From ed4610b36bde8878574d0ab4922627f37f443717 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 28 Apr 2022 11:45:55 +0200 Subject: [PATCH] FIX : Move column "Real Qty" just before "Real PMP" column --- htdocs/product/inventory/inventory.php | 48 +++++++++++++++++--------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 204c6539c29..f7691193e24 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -910,15 +910,17 @@ if ($object->id > 0) { print ''; } print ''.$langs->trans("ExpectedQty").''; - print ''; - print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); - print ''; if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''.$langs->trans('PMPExpected').''; print ''.$langs->trans('ExpectedValuation').''; + print ''.$form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")).''; print ''.$langs->trans('PMPReal').''; print ''.$langs->trans('RealValuation').''; - } + } else { + print ''; + print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); + print ''; + } if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { // Actions or link to stock movement print ''; @@ -1041,7 +1043,6 @@ if ($object->id > 0) { // 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) { @@ -1049,11 +1050,6 @@ if ($object->id > 0) { $hasinput = true; } - print ''; - print img_picto('', 'eraser', 'class="opacitymedium"'); - print ''; - print ''; - print ''; if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; @@ -1066,6 +1062,14 @@ if ($object->id > 0) { print ''; print price($pmp_valuation); print ''; + + print ''; + print ''; + print img_picto('', 'eraser', 'class="opacitymedium"'); + print ''; + print ''; + print ''; + //PMP Real print ''; @@ -1081,18 +1085,22 @@ if ($object->id > 0) { $totalExpectedValuation += $pmp_valuation; $totalRealValuation += $pmp_valuation_real; - } + } else { + print ''; + print ''; + print img_picto('', 'eraser', 'class="opacitymedium"'); + print ''; + print ''; + print ''; + } // Picto delete line print ''; print ''.img_delete().''; $qty_tmp = price2num(GETPOST("id_".$obj->rowid."_input_tmp", 'MS')) >= 0 ? GETPOST("id_".$obj->rowid."_input_tmp") : $qty_view; - print ''; + print ''; print ''; } else { - print ''; - print $obj->qty_view; // qty found - print ''; if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; @@ -1105,6 +1113,10 @@ if ($object->id > 0) { print price($pmp_valuation); print ''; + print ''; + print $obj->qty_view; // qty found + print ''; + //PMP Real print ''; if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; @@ -1119,7 +1131,11 @@ if ($object->id > 0) { $totalExpectedValuation += $pmp_valuation; $totalRealValuation += $pmp_valuation_real; - } + } else { + print ''; + print $obj->qty_view; // qty found + print ''; + } if ($obj->fk_movement > 0) { $stockmovment = new MouvementStock($db); $stockmovment->fetch($obj->fk_movement);