Skip to content

Commit

Permalink
Solucionado bug al cambiar la columna predeterminada subtotal/neto.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoRazorX committed Oct 6, 2022
1 parent 14b328d commit 5bf1289
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/Base/AjaxForms/CommonLineHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
trait CommonLineHTML
{
/** @var string */
protected static $columnView = 'subtotal';
protected static $columnView;

/** @var int */
protected static $num = 0;
Expand Down
5 changes: 2 additions & 3 deletions Core/Base/AjaxForms/CommonSalesPurchases.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

trait CommonSalesPurchases
{
protected static $columnView = 'subtotal';
protected static $columnView;

protected static function cifnif(Translator $i18n, BusinessDocument $model): string
{
Expand Down Expand Up @@ -522,8 +522,7 @@ protected static function subtotalNetoBtn(Translator $i18n): string
. $i18n->trans('subtotal') . '</button>';
}

$html .= '</div>'
. '</div>';
$html .= '</div></div>';
return $html;
}

Expand Down
6 changes: 5 additions & 1 deletion Core/Base/AjaxForms/PurchasesFooterHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
namespace FacturaScripts\Core\Base\AjaxForms;

use FacturaScripts\Core\App\AppSettings;
use FacturaScripts\Core\Base\Contract\PurchasesModInterface;
use FacturaScripts\Core\Base\Translator;
use FacturaScripts\Core\Model\Base\PurchaseDocument;
use FacturaScripts\Core\Model\User;
use FacturaScripts\Core\Base\Contract\PurchasesModInterface;

/**
* Description of PurchasesFooterHTML
Expand Down Expand Up @@ -72,6 +72,10 @@ public static function assets()

public static function render(PurchaseDocument $model): string
{
if (empty(self::$columnView)) {
self::$columnView = AppSettings::get('default', 'columnetosubtotal', 'subtotal');
}

if (empty($model->codproveedor)) {
return '';
}
Expand Down
4 changes: 4 additions & 0 deletions Core/Base/AjaxForms/PurchasesLineHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ public static function map(array $lines, PurchaseDocument $model): array
*/
public static function render(array $lines, PurchaseDocument $model): string
{
if (empty(self::$columnView)) {
self::$columnView = AppSettings::get('default', 'columnetosubtotal', 'subtotal');
}

self::$numlines = count($lines);
$i18n = new Translator();
$html = '';
Expand Down
4 changes: 4 additions & 0 deletions Core/Base/AjaxForms/SalesFooterHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public static function assets()

public static function render(SalesDocument $model): string
{
if (empty(self::$columnView)) {
self::$columnView = AppSettings::get('default', 'columnetosubtotal', 'subtotal');
}

if (empty($model->codcliente)) {
return '';
}
Expand Down
4 changes: 4 additions & 0 deletions Core/Base/AjaxForms/SalesLineHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public static function map(array $lines, SalesDocument $model): array
*/
public static function render(array $lines, SalesDocument $model): string
{
if (empty(self::$columnView)) {
self::$columnView = AppSettings::get('default', 'columnetosubtotal', 'subtotal');
}

self::$numlines = count($lines);
$i18n = new Translator();
$html = '';
Expand Down

0 comments on commit 5bf1289

Please sign in to comment.