From a2a5f75aa3c1948ee3bd7da586e3dcc4d7adb596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Mar 2023 17:52:34 +0100 Subject: [PATCH] Fix position of column --- htdocs/mrp/mo_production.php | 184 ++++++++++++++++++++++++----------- 1 file changed, 125 insertions(+), 59 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 9e0e76db326..49bafee23c3 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -937,6 +937,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (isModEnabled('productbatch')) { print ''; } + + // Split + print ''; + + // Split All + print ''; + // Action delete line if ($permissiontodelete) { $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id); @@ -947,12 +954,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - // Split - print ''; - - // Split All - print ''; - print ''; // Show detailed of already consumed with js code to collapse @@ -1002,6 +1003,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } + // Split + print ''; + + // Split All + print ''; + // Action delete line if ($permissiontodelete) { $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']).'&fk_movement='.((int) $line2['fk_stock_movement']); @@ -1067,23 +1074,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Lot / Batch if (isModEnabled('productbatch')) { - print ''; + print ''; if ($tmpproduct->status_batch) { $preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : ''); print ''; print $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', ''); - - $type = 'batch'; - print ''; - print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"'); - print ''; - print ''; - if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"'); - print ''; } print ''; } + // Split + $type = 'batch'; + print ''; + print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"'); + print ''; + + // Split All + print ''; + if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) { + print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"'); + } + print ''; + // Action delete line if ($permissiontodelete) { print ''; @@ -1138,8 +1150,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; + // Product print ''; + // Qty print ''; + // Cost price if ($permissiontoupdatecost) { if (empty($bomcostupdated)) { print ''; @@ -1147,16 +1162,59 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } } + // Already produced print ''; + // Warehouse print ''; + + // Lot if (isModEnabled('productbatch')) { print ''; + + // Split + print ''; + + // Split All + print ''; + } + + // Action delete + if ($permissiontodelete) { + print ''; + } + + print ''; + + if ($action == 'addproduceline') { + print ''."\n"; + print ''; + + // Product + print ''; + // Qty + print ''; + // Cost price + if ($permissiontoupdatecost) { + print ''; + } + // Action (cost price + already produced) + print ''; + // Lot - serial + if (isModEnabled('productbatch')) { + print ''; // Split print ''; @@ -1164,33 +1222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Split All print ''; } - print ''; - print ''; - } - print ''; - - if ($action == 'addproduceline') { - print ''."\n"; - print ''; - print ''; - // Qty - print ''; - // Cost price - print ''; - - // Qty already produced - print ''; - // Lot - serial - if (isModEnabled('productbatch')) { - print ''; - } - // Action + // Action delete if ($permissiontodelete) { print ''; } @@ -1228,10 +1260,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; + // Product print ''; + // Qty print ''; + // Cost price if ($permissiontoupdatecost) { // Defined $manufacturingcost $manufacturingcost = 0; @@ -1259,6 +1294,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; } + // Already produced print '
'.$langs->trans("Product").''.$langs->trans("Qty").''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).''.$langs->trans("QtyAlreadyProduced").''; if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { print $langs->trans("Warehouse"); } print ''; if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { print $langs->trans("Batch"); + } + print '
'; + print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300'); + print ''; + print ''; + print ''; + print '
'; - print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300'); - print ''; - // Warehouse - print ''; - print ''; - print '
'.$tmpproduct->getNomUrl(1); print '
'.$tmpproduct->label.''; print '
'.$line->qty.''; if ($alreadyproduced) { print '