@@ -569,7 +569,7 @@ |
||
569 | 569 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
570 | 570 | $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
571 | 571 | } |
572 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
572 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
573 | 573 | if (!empty($arrayfields['t.' . $key]['checked'])) { |
574 | 574 | print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; |
575 | 575 | $totalarray['nbfield']++; |
@@ -40,8 +40,8 @@ |
||
40 | 40 | |
41 | 41 | $id = GETPOSTINT('id'); |
42 | 42 | $ref = GETPOST('ref', 'alpha'); |
43 | -$batch = GETPOST('batch', 'alpha'); |
|
44 | -$objectid = GETPOSTINT('productid'); |
|
43 | +$batch = GETPOST('batch', 'alpha'); |
|
44 | +$objectid = GETPOSTINT('productid'); |
|
45 | 45 | |
46 | 46 | // Security check |
47 | 47 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |
@@ -40,8 +40,8 @@ |
||
40 | 40 | |
41 | 41 | $id = GETPOSTINT('id'); |
42 | 42 | $ref = GETPOST('ref', 'alpha'); |
43 | -$batch = GETPOST('batch', 'alpha'); |
|
44 | -$objectid = GETPOSTINT('productid'); |
|
43 | +$batch = GETPOST('batch', 'alpha'); |
|
44 | +$objectid = GETPOSTINT('productid'); |
|
45 | 45 | |
46 | 46 | // Security check |
47 | 47 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |
@@ -40,8 +40,8 @@ |
||
40 | 40 | |
41 | 41 | $id = GETPOSTINT('id'); |
42 | 42 | $ref = GETPOST('ref', 'alpha'); |
43 | -$batch = GETPOST('batch', 'alpha'); |
|
44 | -$objectid = GETPOSTINT('productid'); |
|
43 | +$batch = GETPOST('batch', 'alpha'); |
|
44 | +$objectid = GETPOSTINT('productid'); |
|
45 | 45 | |
46 | 46 | // Security check |
47 | 47 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), |
453 | 453 | ); |
454 | 454 | //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
455 | -if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
|
455 | +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { |
|
456 | 456 | $arrayofmassactions = array(); |
457 | 457 | } |
458 | 458 | if (isModEnabled('category') && $user->hasRight('stock', 'creer')) { |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | } |
531 | 531 | |
532 | 532 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
533 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
533 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
534 | 534 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
535 | 535 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
536 | 536 | |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | } 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'])) { |
648 | 648 | $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
649 | 649 | } |
650 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
650 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
651 | 651 | if (!empty($arrayfields['t.' . $key]['checked'])) { |
652 | 652 | 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"; |
653 | 653 | $totalarray['nbfield']++; |
@@ -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'); |
@@ -166,7 +166,7 @@ |
||
166 | 166 | /** |
167 | 167 | * Warehouse open and any operations are allowed, but warehouse is not included into calculation of stock. |
168 | 168 | */ |
169 | - const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
169 | + const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
170 | 170 | |
171 | 171 | |
172 | 172 |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | 'skip_batch' => &$skip_batch, |
220 | 220 | 'id_product_batch' => &$id_product_batch |
221 | 221 | ); |
222 | - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
222 | + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
223 | 223 | |
224 | 224 | if ($reshook < 0) { |
225 | 225 | if (!empty($hookmanager->resPrint)) { |
@@ -708,8 +708,8 @@ discard block |
||
708 | 708 | $this->price = $obj->price; |
709 | 709 | $this->fk_user_author = $obj->fk_user_author; |
710 | 710 | $this->label = $obj->label; |
711 | - $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
712 | - $this->origintype = $obj->origin_type; // For backward compatibility |
|
711 | + $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
712 | + $this->origintype = $obj->origin_type; // For backward compatibility |
|
713 | 713 | $this->origin_id = $obj->origin_id; |
714 | 714 | $this->origin_type = $obj->origin_type; |
715 | 715 | $this->inventorycode = $obj->inventorycode; |
@@ -944,8 +944,8 @@ discard block |
||
944 | 944 | } else { // product_batch record not found |
945 | 945 | $pdluo->fk_product_stock = $vfk_product_stock; |
946 | 946 | $pdluo->qty = $qty; |
947 | - $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
948 | - $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
947 | + $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
948 | + $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
949 | 949 | $pdluo->batch = $vbatchnumber; |
950 | 950 | |
951 | 951 | $result = $pdluo->create($user, 1); |