mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix Situation Percent with USE_INVOICE_SITUATION = 2
Lines situation percent on new lines must be 0 (No cumulative)
This commit is contained in:
@@ -2029,7 +2029,7 @@ if (empty($reshook)) {
|
||||
$line->fk_prev_id = $line->id;
|
||||
$line->fetch_optionals();
|
||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
|
||||
$line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note
|
||||
$line->situation_percent = 0; // New situation percent must be 0 (No cumulative)
|
||||
} else {
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
}
|
||||
|
||||
@@ -3955,7 +3955,12 @@ class Facture extends CommonInvoice
|
||||
$fk_prev_id = 'null';
|
||||
}
|
||||
if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) {
|
||||
$situation_percent = 100;
|
||||
// INVOICE_USE_SITUATION = 2 - Lines situation percent on new lines must be 0 (No cumulative)
|
||||
if($this->type == Facture::TYPE_SITUATION && getDolGlobalInt('INVOICE_USE_SITUATION') == 2){
|
||||
$situation_percent = 0;
|
||||
} else {
|
||||
$situation_percent = 100;
|
||||
}
|
||||
}
|
||||
if (empty($ref_ext)) {
|
||||
$ref_ext = '';
|
||||
|
||||
Reference in New Issue
Block a user