From a01a870aa9e707d16a5bd9b3e0bd8ee8829da284 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, 22 insertions(+), 2 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 6026e4316e4..4b57ef547cf 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -879,6 +879,11 @@ if ($object->id > 0) { print ''; print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); print ''; + + print ''; + print $langs->trans("Delta"); + print ''; + if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { // Actions or link to stock movement print ''; @@ -910,6 +915,7 @@ if ($object->id > 0) { print ''; print ''; // Actions + print ''; print ''; print ''; print ''; @@ -989,9 +995,7 @@ if ($object->id > 0) { print ''; print ''; - // Real quantity if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { - print ''; $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; //if (!$hasinput && $qty_view !== null && $obj->qty_stock != $qty_view) { @@ -999,12 +1003,20 @@ if ($object->id > 0) { $hasinput = true; } + // Real quantity + print ''; print ''; print img_picto('', 'eraser', 'class="opacitymedium"'); print ''; print ''; print ''; + // Delta quantity + $dt = $obj->qty_view - $obj->qty_stock; + print ''; + if($dt != 0) print $dt; + print ''; + // Picto delete line print ''; print ''.img_delete().''; @@ -1012,9 +1024,17 @@ if ($object->id > 0) { print ''; print ''; } else { + // Real quantity print ''; print $obj->qty_view; // qty found print ''; + + // Delta quantity + $dt = $obj->qty_view - $obj->qty_stock; + print ''; + if($dt != 0) print $dt; + print ''; + print ''; if ($obj->fk_movement > 0) { $stockmovment = new MouvementStock($db);