From 02ad8b88587744a95b7ad5ed098fee528c7d77df Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Wed, 2 Mar 2022 16:39:03 +0400 Subject: [PATCH] Display delta quantity in inventories. --- htdocs/product/inventory/inventory.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 85cd0932f46..95000d37055 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -564,6 +564,11 @@ if ($object->id > 0) { print ''; print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); print ''; + + print ''; + print $form->textwithpicto($langs->trans("Delta"), $langs->trans("InventoryRealQtyHelp")); + print ''; + if ($object->status == $object::STATUS_VALIDATED) { // Actions print ''; @@ -590,6 +595,7 @@ if ($object->id > 0) { print ''; print ''; // Actions + print ''; print ''; print ''; print ''; @@ -657,13 +663,20 @@ if ($object->id > 0) { print $obj->qty_stock; print ''; - // Real quantity + // Delta quantity print ''; if ($object->status == $object::STATUS_VALIDATED) { $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; + + // Delta quantity + $dt = $obj->qty_view - $obj->qty_stock; + print ''; + if($dt != 0) print $dt; + print ''; + print ''; print ''.img_delete().''; print ''; @@ -671,7 +684,16 @@ if ($object->id > 0) { print $obj->qty_view; $totalfound += $obj->qty_view; print ''; + + // Delta quantity + $dt = $obj->qty_view - $obj->qty_stock; + print ''; + if($dt != 0) print $dt; + print ''; + } + + print ''; $i++;