From 0e6a3aa2be59ebef17c3298919d618982e09c3d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Mar 2023 15:52:49 +0100 Subject: [PATCH 01/19] Fix param --- htdocs/accountancy/bookkeeping/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9231ae96a95..b57e0a10157 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1460,7 +1460,7 @@ while ($i < min($num, $limit)) { // Creation operation date if (!empty($arrayfields['t.date_creation']['checked'])) { - print ''.dol_print_date($line->date_creation, 'dayhour', 'tzuserel').''; + print ''.dol_print_date($line->date_creation, 'dayhour', 'tzuserrel').''; if (!$i) { $totalarray['nbfield']++; } @@ -1468,7 +1468,7 @@ while ($i < min($num, $limit)) { // Modification operation date if (!empty($arrayfields['t.tms']['checked'])) { - print ''.dol_print_date($line->date_modification, 'dayhour', 'tzuserel').''; + print ''.dol_print_date($line->date_modification, 'dayhour', 'tzuserrel').''; if (!$i) { $totalarray['nbfield']++; } @@ -1476,7 +1476,7 @@ while ($i < min($num, $limit)) { // Exported operation date if (!empty($arrayfields['t.date_export']['checked'])) { - print ''.dol_print_date($line->date_export, 'dayhour', 'tzuserel').''; + print ''.dol_print_date($line->date_export, 'dayhour', 'tzuserrel').''; if (!$i) { $totalarray['nbfield']++; } @@ -1484,7 +1484,7 @@ while ($i < min($num, $limit)) { // Validated operation date if (!empty($arrayfields['t.date_validated']['checked'])) { - print ''.dol_print_date($line->date_validation, 'dayhour', 'tzuserel').''; + print ''.dol_print_date($line->date_validation, 'dayhour', 'tzuserrel').''; if (!$i) { $totalarray['nbfield']++; } From f154e893d904596a0b37e77773d191b7e9b52cc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Mar 2023 21:38:56 +0100 Subject: [PATCH 02/19] Fix escaping --- htdocs/ticket/class/ticket.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 600436125a7..adf104d9ae9 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1872,20 +1872,18 @@ class Ticket extends CommonObject { $contacts = array(); - // Generation requete recherche + // Forge the search SQL $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople"; $sql .= " WHERE entity IN (".getEntity('contact').")"; if (!empty($socid)) { - $sql .= " AND fk_soc='".$this->db->escape($socid)."'"; + $sql .= " AND fk_soc = ".((int) $socid); } - if (!empty($email)) { $sql .= " AND "; - if (!$case) { - $sql .= "email LIKE '".$this->db->escape($email)."'"; + $sql .= "email = '".$this->db->escape($email)."'"; } else { - $sql .= "email LIKE BINARY '".$this->db->escape($email)."'"; + $sql .= "email LIKE BINARY '".$this->db->escape($this->db->escapeforlike($email))."'"; } } From 5505966934602222b639fda5c8258caa3c2a17cb Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:59:39 +0100 Subject: [PATCH 03/19] FIX: expense report accountancy: sql syntax error when performing automatic linking --- htdocs/accountancy/expensereport/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 948130dd98a..bfe5a1f4e63 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -111,7 +111,7 @@ if ($action == 'validatehistory') { $sql1 = "SELECT erd.rowid, accnt.rowid as suggestedid"; $sql1 .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd"; $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as t ON erd.fk_c_type_fees = t.id"; - $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity); + $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity).","; $sql1 .= " ".MAIN_DB_PREFIX."expensereport as er"; $sql1 .= " WHERE erd.fk_expensereport = er.rowid AND er.entity = ".((int) $conf->entity); $sql1 .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0"; From 54e00b800a9c65cc19bb0ce30ab338d03a0bc746 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 21 Mar 2023 12:07:12 +0100 Subject: [PATCH 04/19] FIX : action delete card fac rec --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 27b039d8b4c..853d4eb75f4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1181,7 +1181,7 @@ if ($action == 'create') { } // Confirm delete of repeatable invoice - if ($action == 'ask_deleteinvoice') { + if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); } From 420fdcacedce51bb7376c9931ca9a781ca25fcc9 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 21 Mar 2023 15:08:28 +0100 Subject: [PATCH 05/19] FIX: societe list: regression to redirection to customer card when single result of search filters --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index de58e557d8e..4c5f0251485 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -776,7 +776,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ( $obj = $db->fetch_object($resql); $id = $obj->rowid; if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) { - if ($companystatic->client > 0) { + if ($obj->client > 0) { header("Location: ".DOL_URL_ROOT.'/comm/card.php?socid='.$id); exit; } From 9fa7dcd4330bc60367bcee5bdd4ac40572b22dbf Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 21 Mar 2023 22:35:52 +0100 Subject: [PATCH 06/19] fix sql --- .../mysql/tables/llx_opensurvey_comments-opensurvey.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.sql b/htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.sql index b447431cca5..bbee48ad0cf 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.sql @@ -20,8 +20,8 @@ CREATE TABLE llx_opensurvey_comments ( id_sondage CHAR(16) NOT NULL, comment text NOT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - usercomment text + usercomment text, date_creation datetime NOT NULL, - ip varchar(250), --ip used to create record (for public submission page) + ip varchar(250) --ip used to create record (for public submission page) ) ENGINE=innodb; From 0834a59c1ca3780f8ddd80429ea501b879ff8754 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 21 Mar 2023 22:45:41 +0100 Subject: [PATCH 07/19] same sql error --- .../mysql/tables/llx_opensurvey_user_studs-opensurvey.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.sql index 26de6ff8a21..5d3b132c8dd 100644 --- a/htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.sql +++ b/htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.sql @@ -20,7 +20,7 @@ CREATE TABLE llx_opensurvey_user_studs ( nom VARCHAR(64) NOT NULL, id_sondage VARCHAR(16) NOT NULL, reponses VARCHAR(200) NOT NULL, -- Not used for 'F' surveys - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, date_creation datetime NOT NULL, - ip varchar(250), --ip used to create record (for public submission page) + ip varchar(250) --ip used to create record (for public submission page) ) ENGINE=innodb; From 9d52e5c00cd8719728781a04e02f4a4e82d0b940 Mon Sep 17 00:00:00 2001 From: priojk Date: Wed, 22 Mar 2023 09:14:03 +0100 Subject: [PATCH 08/19] included 'charges' as option for table column --- htdocs/product/fournisseurs.php | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index c1b61913d9f..5875ae855bd 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -11,6 +11,7 @@ * Copyright (C) 2019 Frédéric France * Copyright (C) 2019 Tim Otte * Copyright (C) 2020 Pierre Ardoin + * Copyright (C) 2023 Joachim Kueter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -769,6 +770,15 @@ END; print ''; } + // Option to define a transport cost on supplier price + if (!empty($conf->global->PRODUCT_CHARGES)) { + print ''; + print ''.$langs->trans("Charges").''; + print ''; + print ''; + print ''; + } + // Discount qty min print ''.$langs->trans("DiscountQtyMin").''; print ' %'; @@ -800,17 +810,6 @@ END; print ''; } - // Option to define a transport cost on supplier price - if (!empty($conf->global->PRODUCT_CHARGES)) { - if (isModEnabled('margin')) { - print ''; - print ''.$langs->trans("Charges").''; - print ''; - print ''; - print ''; - } - } - // Product description of the supplier if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { //WYSIWYG Editor @@ -948,6 +947,7 @@ END; 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10), + 'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => !empty($conf->global->PRODUCT_CHARGES), 'checked'=>0, 'position'=>11), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14), 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15), @@ -1035,6 +1035,10 @@ END; print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); $nbfields++; } + if (!empty($arrayfields['pfp.charges']['checked'])) { + print_liste_field_titre("Charges", $_SERVER["PHP_SELF"], "pfp.charges", "", $param, '', $sortfield, $sortorder, 'right '); + $nbfields++; + } print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); $nbfields++; if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) { @@ -1177,6 +1181,13 @@ END; print ''; } + // Charges + if (!empty($arrayfields['pfp.charges']['checked'])) { + print ''; + print price($productfourn->fourn_charges); + print ''; + } + // Discount print ''; print price2num($productfourn->fourn_remise_percent).'%'; From 0324ffcd208a572a93598273a3470bc571c6432b Mon Sep 17 00:00:00 2001 From: priojk Date: Wed, 22 Mar 2023 09:26:19 +0100 Subject: [PATCH 09/19] Stickler: white space --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 5875ae855bd..0604ec6a6d0 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -947,7 +947,7 @@ END; 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10), - 'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => !empty($conf->global->PRODUCT_CHARGES), 'checked'=>0, 'position'=>11), + 'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => !empty($conf->global->PRODUCT_CHARGES), 'checked'=>0, 'position'=>11), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14), 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15), From d3bbb29ed6263083e02d61580d879f2e1a230aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Mar 2023 09:34:21 +0100 Subject: [PATCH 10/19] Fix filter syntax on product card --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 627b7fc5b64..775a05094fd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2078,7 +2078,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$object->isService() && isModEnabled('bom')) { print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).''; - $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".((int) $object->id); + $bomkey = "Bom:bom/class/bom.class.php:0:(t.status:=:1) AND (t.fk_product:=:".((int) $object->id).')'; print $form->selectForForms($bomkey, 'fk_default_bom', (GETPOSTISSET('fk_default_bom') ? GETPOST('fk_default_bom') : $object->fk_default_bom), 1); print ''; } From c6067d34c9b09fc711ec11b3134e475d6be5e1d6 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Tue, 21 Mar 2023 10:09:16 +0100 Subject: [PATCH 11/19] in case of multiselect in a string for the ticket type, we need to explode "$selected" and not just array($selected) --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 15634a761d4..08ccfc10190 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -692,7 +692,7 @@ class FormTicket { global $langs, $user; - $selected = is_array($selected) ? $selected : (!empty($selected) ? array($selected) : array()); + $selected = is_array($selected) ? $selected : (!empty($selected) ? explode(',', $selected) : array()); $ticketstat = new Ticket($this->db); dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG); From 344b165acc0533f8d9ae6c4a0af32605b6390508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Mar 2023 00:13:21 +0100 Subject: [PATCH 12/19] Doc --- htdocs/blockedlog/class/authority.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index b3dd9b45f47..e274ff4175d 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -20,6 +20,11 @@ */ class BlockedLogAuthority { + /** + * DoliDB + * @var DoliDB + */ + public $db; /** * Id of the log @@ -45,6 +50,12 @@ class BlockedLogAuthority */ public $tms = 0; + /** + * Error message + * @var string + */ + public $error; + /** * Constructor * From a2a5f75aa3c1948ee3bd7da586e3dcc4d7adb596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Mar 2023 17:52:34 +0100 Subject: [PATCH 13/19] 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 '