Skip to content

Commit

Permalink
Solucionado bug al generar facturas rectificativas parciales. No esta…
Browse files Browse the repository at this point in the history
…ba teniendo en cuenta las líneas de la rectifica al calcular, sino las de la original.
  • Loading branch information
NeoRazorX committed May 9, 2022
1 parent baf5e81 commit ec88bc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions Core/Controller/EditFacturaCliente.php
Expand Up @@ -5,11 +5,11 @@

namespace FacturaScripts\Core\Controller;

use FacturaScripts\Core\Base\AjaxForms\SalesController;
use FacturaScripts\Core\Base\Calculator;
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
use FacturaScripts\Core\Lib\ExtendedController\BaseView;
use FacturaScripts\Dinamic\Lib\Accounting\InvoiceToAccounting;
use FacturaScripts\Core\Base\AjaxForms\SalesController;
use FacturaScripts\Dinamic\Lib\ReceiptGenerator;
use FacturaScripts\Dinamic\Model\FacturaCliente;

Expand All @@ -24,10 +24,7 @@ class EditFacturaCliente extends SalesController
private const VIEW_ACCOUNTS = 'ListAsiento';
private const VIEW_RECEIPTS = 'ListReciboCliente';

/**
* @return string
*/
public function getModelClassName()
public function getModelClassName(): string
{
return 'FacturaCliente';
}
Expand Down Expand Up @@ -303,7 +300,8 @@ protected function newRefundAction(): bool
}
}

Calculator::calculate($newRefund, $lines, false);
$newLines = $newRefund->getLines();
Calculator::calculate($newRefund, $newLines, false);
$newRefund->idestado = $invoice->idestado;
if (false === $newRefund->save()) {
$this->toolBox()->i18nLog()->error('record-save-error');
Expand Down
10 changes: 4 additions & 6 deletions Core/Controller/EditFacturaProveedor.php
Expand Up @@ -5,11 +5,11 @@

namespace FacturaScripts\Core\Controller;

use FacturaScripts\Core\Base\AjaxForms\PurchasesController;
use FacturaScripts\Core\Base\Calculator;
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
use FacturaScripts\Core\Lib\ExtendedController\BaseView;
use FacturaScripts\Dinamic\Lib\Accounting\InvoiceToAccounting;
use FacturaScripts\Core\Base\AjaxForms\PurchasesController;
use FacturaScripts\Dinamic\Lib\ReceiptGenerator;
use FacturaScripts\Dinamic\Model\FacturaProveedor;

Expand All @@ -25,10 +25,7 @@ class EditFacturaProveedor extends PurchasesController
private const VIEW_ACCOUNTS = 'ListAsiento';
private const VIEW_RECEIPTS = 'ListReciboProveedor';

/**
* @return string
*/
public function getModelClassName()
public function getModelClassName(): string
{
return 'FacturaProveedor';
}
Expand Down Expand Up @@ -305,7 +302,8 @@ protected function newRefundAction(): bool
}
}

Calculator::calculate($newRefund, $lines, false);
$newLines = $newRefund->getLines();
Calculator::calculate($newRefund, $newLines, false);
$newRefund->idestado = $invoice->idestado;
if (false === $newRefund->save()) {
$this->toolBox()->i18nLog()->error('record-save-error');
Expand Down

0 comments on commit ec88bc7

Please sign in to comment.