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:
lvessiller-opendsi 2025-12-11 10:18:58 +01:00 committed by GitHub
commit 3c2e85bdb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View file

@ -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;

View file

@ -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;