NEW : insert_discount() functions handle

This commit is contained in:
Gauthier PC portable 024 2021-11-16 16:02:55 +01:00
parent 1e0d7d92a9
commit c55008e8af
2 changed files with 16 additions and 2 deletions

View File

@ -1954,7 +1954,7 @@ class Facture extends CommonInvoice
public function insert_discount($idremise)
{
// phpcs:enable
global $langs;
global $conf, $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
@ -1986,6 +1986,13 @@ class Facture extends CommonInvoice
$facligne->rang = -1;
$facligne->info_bits = 2;
if(!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$facligne->rang = 1;
for ($ii = 1; $ii <= count($this->lines); $ii++) {
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1);
}
}
// Get buy/cost price of invoice that is source of discount
if ($remise->fk_facture_source > 0)
{

View File

@ -1025,7 +1025,7 @@ class FactureFournisseur extends CommonInvoice
public function insert_discount($idremise)
{
// phpcs:enable
global $langs;
global $conf, $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
@ -1058,6 +1058,13 @@ class FactureFournisseur extends CommonInvoice
$facligne->rang = -1;
$facligne->info_bits = 2;
if(!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$facligne->rang = 1;
for ($ii = 1; $ii <= count($this->lines); $ii++) {
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1);
}
}
// Get buy/cost price of invoice that is source of discount
if ($remise->fk_invoice_supplier_source > 0)
{