Update commande.class.php (#37301)

the empty qty logic → special_code = 3 ("Option" line) is not respected, unlike Propal which works correctly.
This commit is contained in:
Sylvain Legrand
2026-02-21 14:09:17 +03:00
committed by GitHub
parent deeb710d2b
commit b34fb98b52

View File

@@ -1789,6 +1789,9 @@ class Commande extends CommonOrder
$this->line->total_localtax2 = (float) $total_localtax2;
$this->line->total_ttc = (float) $total_ttc;
$this->line->special_code = $special_code;
if (empty($qty) && empty($special_code)) {
$this->line->special_code = 3;
}
$this->line->origin = $origin;
$this->line->origin_id = $origin_id;
$this->line->fk_parent_line = $fk_parent_line;
@@ -3150,8 +3153,11 @@ class Commande extends CommonOrder
if (empty($remise_percent)) {
$remise_percent = 0;
}
if (empty($special_code) || $special_code == 3) {
$special_code = 0;
if (empty($qty) && empty($special_code)) {
$special_code = 3; // Set option tag
}
if (!empty($qty) && $special_code == 3) {
$special_code = 0; // Remove option tag
}
if (empty($ref_ext)) {
$ref_ext = '';