Fix #20533 Dispatch Tab Quantity

Fix #20533
Dispatch Tab Total Quantity now considers services (and the configuration option to manage stocks on services)
This commit is contained in:
antonin_tdj 2022-11-26 00:23:29 +01:00 committed by GitHub
parent b84a7def1f
commit 9852d470ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,7 +178,10 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
$sumQtyAllreadyDispatched = $sumQtyAllreadyDispatched + $dispachedLines[$line]['qty'];
}
for ($line = 0 ; $line < $nbLinesOrdered; $line++) {
$sumQtyOrdered = $sumQtyOrdered + $object->lines[$line]->qty;
//If line is a product of conf to manage stocks for services
if($object->lines[$line]->product_type == 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)){
$sumQtyOrdered = $sumQtyOrdered + $object->lines[$line]->qty;
}
}
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.price2num($sumQtyAllreadyDispatched, 'MS').' / '.price2num($sumQtyOrdered, 'MS').'</span>';
}