Merge pull request #36541 from rycks/18_fix_deposit_backport_43f551e270a00165dcb7274c0904b66b9eaf30b8
backport of PR36378 : Problem with deposit line on Type of operation
This commit is contained in:
commit
3c2e85bdb1
2 changed files with 26 additions and 0 deletions
|
|
@ -419,6 +419,19 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$this->atleastonediscount++;
|
||||
}
|
||||
|
||||
// determine category of operation
|
||||
$is_deposit = false;
|
||||
if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$is_deposit = true;
|
||||
}
|
||||
}
|
||||
// If DEPOSIT, this line is completely ignored for calculations.
|
||||
if ($is_deposit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// determine category of operation
|
||||
if ($categoryOfOperation < 2) {
|
||||
$lineProductType = $object->lines[$i]->product_type;
|
||||
|
|
|
|||
|
|
@ -446,6 +446,19 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$this->atleastonediscount++;
|
||||
}
|
||||
|
||||
// Do not take into account lines of the type “deposit.”
|
||||
$is_deposit = false;
|
||||
if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$is_deposit = true;
|
||||
}
|
||||
}
|
||||
// If DEPOSIT, this line is completely ignored for calculations.
|
||||
if ($is_deposit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// determine category of operation
|
||||
if ($categoryOfOperation < 2) {
|
||||
$lineProductType = $object->lines[$i]->product_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue