Merge branch 'NEW/addline_with_position_choice' of github.com:atm-gauthier/dolibarr into NEW/addline_with_position_choice_develop

This commit is contained in:
Gauthier PC portable 024 2021-11-16 16:05:17 +01:00
commit f664a977c6
2 changed files with 16 additions and 2 deletions

View File

@ -2057,7 +2057,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';
@ -2087,6 +2087,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) {
$srcinvoice = new Facture($this->db);

View File

@ -1111,7 +1111,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';
@ -1142,6 +1142,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) {
$srcinvoice = new FactureFournisseur($this->db);