@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if ($productid > 0) { |
158 | 158 | $sql .= " AND ps.fk_product = " . ((int) $productid); |
159 | 159 | } |
160 | - if (! empty($search_fk_warehouse)) { |
|
160 | + if (!empty($search_fk_warehouse)) { |
|
161 | 161 | $sql .= " AND ps.fk_entrepot IN (" . $db->sanitize(implode(",", $search_fk_warehouse)) . ")"; |
162 | 162 | } |
163 | 163 | if ($search_ref) { |
@@ -373,8 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | // Lines of title |
375 | 375 | print implode(";", ($mode == 'future') ? |
376 | - array('"Product Reference"', '"Label"', '"Current Stock"', '"' . $stocklabel . '"', '"Virtual Stock"') : |
|
377 | - array('"Product Reference"', '"Label"', '"' . $stocklabel . '"', '"Estimated Stock Value"', '"Estimate Sell Value"', '"Movements"', '"Current Stock"')) . "\r\n"; |
|
376 | + array('"Product Reference"', '"Label"', '"Current Stock"', '"' . $stocklabel . '"', '"Virtual Stock"') : array('"Product Reference"', '"Label"', '"' . $stocklabel . '"', '"Estimated Stock Value"', '"Estimate Sell Value"', '"Movements"', '"Current Stock"')) . "\r\n"; |
|
378 | 377 | } else { |
379 | 378 | llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-stock_stockatdate'); |
380 | 379 | |
@@ -604,7 +603,7 @@ discard block |
||
604 | 603 | |
605 | 604 | if ($mode == 'future') { |
606 | 605 | $prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0, $dateendofday); |
607 | - $stock = $prod->stock_theorique; // virtual stock at a date |
|
606 | + $stock = $prod->stock_theorique; // virtual stock at a date |
|
608 | 607 | $prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0); |
609 | 608 | $virtualstock = $prod->stock_theorique; // virtual stock in infinite future |
610 | 609 | } else { |
@@ -712,7 +711,7 @@ discard block |
||
712 | 711 | $url .= '&search_date_startyear=' . GETPOSTINT('dateyear'); |
713 | 712 | } |
714 | 713 | if (count($search_fk_warehouse) > 1) { |
715 | - $url = ''; // Do not show link, multi warehouse as filter not managed yet by target page |
|
714 | + $url = ''; // Do not show link, multi warehouse as filter not managed yet by target page |
|
716 | 715 | } else { |
717 | 716 | foreach ($search_fk_warehouse as $val) { |
718 | 717 | $url .= ($val > 0 ? '&search_warehouse=' . ((int) $val) : ''); |
@@ -767,8 +766,7 @@ discard block |
||
767 | 766 | '', |
768 | 767 | $productid > 0 ? price2num($totalcurrentstock, 'MS') : '', |
769 | 768 | '', |
770 | - price(price2num($totalvirtualstock, 'MS'))) : |
|
771 | - array( |
|
769 | + price(price2num($totalvirtualstock, 'MS'))) : array( |
|
772 | 770 | '"' . $langs->trans("Totalforthispage") . '"', |
773 | 771 | '', |
774 | 772 | '', |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | $backurlforlist = dol_buildpath('/product/stock/productlot_list.php', 1); |
155 | 155 | |
156 | - if ($action == 'seteatby' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
156 | + if ($action == 'seteatby' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
157 | 157 | $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear')); |
158 | 158 | |
159 | 159 | // check parameters |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | - if ($action == 'setsellby' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
181 | + if ($action == 'setsellby' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
182 | 182 | $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear')); |
183 | 183 | |
184 | 184 | // check parameters |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
206 | - if ($action == 'seteol_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
206 | + if ($action == 'seteol_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
207 | 207 | $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('eol_datemonth'), GETPOSTINT('eol_dateday'), GETPOSTINT('eol_dateyear')); |
208 | 208 | $result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); |
209 | 209 | if ($result < 0) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | - if ($action == 'setmanufacturing_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
217 | + if ($action == 'setmanufacturing_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
218 | 218 | $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('manufacturing_datemonth'), GETPOSTINT('manufacturing_dateday'), GETPOSTINT('manufacturing_dateyear')); |
219 | 219 | $result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); |
220 | 220 | if ($result < 0) { |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | - if ($action == 'setscrapping_date' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
228 | + if ($action == 'setscrapping_date' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
229 | 229 | $newvalue = dol_mktime(12, 0, 0, GETPOSTINT('scrapping_datemonth'), GETPOSTINT('scrapping_dateday'), GETPOSTINT('scrapping_dateyear')); |
230 | 230 | $result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); |
231 | 231 | if ($result < 0) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | } */ |
249 | 249 | |
250 | - if ($action == 'setqc_frequency' && $user->hasRight('stock', 'creer') && ! GETPOST('cancel', 'alpha')) { |
|
250 | + if ($action == 'setqc_frequency' && $user->hasRight('stock', 'creer') && !GETPOST('cancel', 'alpha')) { |
|
251 | 251 | $result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY'); |
252 | 252 | if ($result < 0) { // Prévoir un test de format de durée |
253 | 253 | setEventMessages($object->error, null, 'errors'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $confirm = GETPOST('confirm', 'alpha'); |
53 | 53 | $cancel = GETPOST('cancel', 'aZ09'); |
54 | 54 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)) . basename(__FILE__, '.php')); // To manage different context of search |
55 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
55 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
56 | 56 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
57 | 57 | $qty = GETPOSTINT('qty'); |
58 | 58 | $fk_product = GETPOSTINT('fk_product'); |
@@ -556,28 +556,28 @@ discard block |
||
556 | 556 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
557 | 557 | } elseif ($action == 'destock') { // Destock confirmation |
558 | 558 | // Create an array for form |
559 | - $formquestion = array( 'text' => '', |
|
559 | + $formquestion = array('text' => '', |
|
560 | 560 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size' => 40), |
561 | 561 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
562 | 562 | ); |
563 | 563 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1); |
564 | 564 | } elseif ($action == 'destockcancel') { // Destock confirmation cancel |
565 | 565 | // Create an array for form |
566 | - $formquestion = array( 'text' => '', |
|
566 | + $formquestion = array('text' => '', |
|
567 | 567 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size' => 40), |
568 | 568 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
569 | 569 | ); |
570 | 570 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1); |
571 | 571 | } elseif ($action == 'addstock') { // Addstock confirmation |
572 | 572 | // Create an array for form |
573 | - $formquestion = array( 'text' => '', |
|
573 | + $formquestion = array('text' => '', |
|
574 | 574 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label") . ' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size' => 40), |
575 | 575 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
576 | 576 | ); |
577 | 577 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1); |
578 | 578 | } elseif ($action == 'addstockcancel') { // Addstock confirmation cancel |
579 | 579 | // Create an array for form |
580 | - $formquestion = array( 'text' => '', |
|
580 | + $formquestion = array('text' => '', |
|
581 | 581 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label") . ' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size' => 40), |
582 | 582 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
583 | 583 | ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // Default sort order (if not yet defined by previous GETPOST) |
79 | 79 | if (!$sortfield) { |
80 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
80 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
81 | 81 | $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition. |
82 | 82 | } |
83 | 83 | if (!$sortorder) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | // Output page |
348 | 348 | // -------------------------------------------------------------------- |
349 | 349 | |
350 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-product page-stock-stocktransfer_stocktransfer_list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
350 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-product page-stock-stocktransfer_stocktransfer_list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
351 | 351 | |
352 | 352 | // Example : Adding jquery code |
353 | 353 | // print '<script type="text/javascript"> |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | } |
476 | 476 | |
477 | 477 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
478 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
478 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
479 | 479 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
480 | 480 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
481 | 481 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
567 | 567 | $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
568 | 568 | } |
569 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
569 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
570 | 570 | if (!empty($arrayfields['t.' . $key]['checked'])) { |
571 | 571 | print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n"; |
572 | 572 | $totalarray['nbfield']++; |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | return $this->LibStatut($this->status, $mode); |
856 | 856 | } |
857 | 857 | |
858 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
858 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
859 | 859 | /** |
860 | 860 | * Return the status |
861 | 861 | * |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | */ |
866 | 866 | public function LibStatut($status, $mode = 0) |
867 | 867 | { |
868 | - // phpcs:enable |
|
868 | + // phpcs:enable |
|
869 | 869 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
870 | 870 | global $langs; |
871 | 871 | //$langs->load("stocktransfer@stocktransfer"); |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | return $this->LibStatut($this->status, $mode); |
856 | 856 | } |
857 | 857 | |
858 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
858 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
859 | 859 | /** |
860 | 860 | * Return the status |
861 | 861 | * |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | */ |
866 | 866 | public function LibStatut($status, $mode = 0) |
867 | 867 | { |
868 | - // phpcs:enable |
|
868 | + // phpcs:enable |
|
869 | 869 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
870 | 870 | global $langs; |
871 | 871 | //$langs->load("stocktransfer@stocktransfer"); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $object = new MouvementStock($db); |
121 | 121 | $extrafields = new ExtraFields($db); |
122 | 122 | $diroutputmassaction = $conf->stock->dir_output . '/temp/massgeneration/' . $user->id; |
123 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
123 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
124 | 124 | |
125 | 125 | $formfile = new FormFile($db); |
126 | 126 | |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1154 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1154 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1155 | 1155 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1156 | 1156 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1157 | 1157 |
@@ -115,7 +115,7 @@ |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort") . ': ' . price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort") . ': ' . price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() |
|
118 | + $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort") . ': ' . price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort") . ': ' . price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // Add price for costprice (at end) |
@@ -309,7 +309,7 @@ |
||
309 | 309 | include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; |
310 | 310 | |
311 | 311 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
312 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
312 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
313 | 313 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
314 | 314 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
315 | 315 |