@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | print '<tr class="oddeven nohover" id="tr-aaa-'.$rowid.'">'; |
| 1161 | 1161 | print '<td colspan="'.$colspan.'" class="" style="padding-left: 20px; padding-right: 20px;">'; |
| 1162 | 1162 | |
| 1163 | - $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); |
|
| 1163 | + $fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content'); |
|
| 1164 | 1164 | if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { |
| 1165 | 1165 | $fieldsforcontent[] = 'content_lines'; |
| 1166 | 1166 | } |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) |
| 1240 | 1240 | } |
| 1241 | 1241 | // Test on 'enabled' |
| 1242 | - if (! (int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1242 | + if (!(int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1243 | 1243 | $i++; |
| 1244 | 1244 | continue; // Email template not qualified |
| 1245 | 1245 | } |
@@ -1537,7 +1537,7 @@ discard block |
||
| 1537 | 1537 | print $form->selectyesno($value, (isset($obj->$value) ? $obj->$value : ''), 1, false, 0, 1); |
| 1538 | 1538 | } |
| 1539 | 1539 | } else { |
| 1540 | - print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'. $value .'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1540 | + print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'.$value.'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1541 | 1541 | } |
| 1542 | 1542 | print '</td>'; |
| 1543 | 1543 | $nboffieldsprinted++; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | print '<td class="right" width="100">'.$langs->trans("Status").'</td>'; |
| 141 | 141 | print '</tr>'; |
| 142 | 142 | |
| 143 | -print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Login</td><td class="right" width="100">'; |
|
| 143 | +print '<tr class="oddeven"><td>'.$langs->trans("UseCaptchaCode").' - Login</td><td class="right" width="100">'; |
|
| 144 | 144 | if (!empty($conf->use_javascript_ajax)) { |
| 145 | 145 | print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA', array(), null, 0, 0, 1); |
| 146 | 146 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | print '</td></tr>'; |
| 154 | 154 | |
| 155 | 155 | if (isModEnabled('societe')) { |
| 156 | - print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Thirdparty public contact form</td><td class="right" width="100">'; |
|
| 156 | + print '<tr class="oddeven"><td>'.$langs->trans("UseCaptchaCode").' - Thirdparty public contact form</td><td class="right" width="100">'; |
|
| 157 | 157 | if (!empty($conf->use_javascript_ajax)) { |
| 158 | 158 | print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY', array(), null, 0, 0, 1); |
| 159 | 159 | } else { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | print '</td></tr>'; |
| 168 | 168 | |
| 169 | 169 | if (isModEnabled('ticket')) { |
| 170 | - print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Public ticket creation</td><td class="right" width="100">'; |
|
| 170 | + print '<tr class="oddeven"><td>'.$langs->trans("UseCaptchaCode").' - Public ticket creation</td><td class="right" width="100">'; |
|
| 171 | 171 | if (!empty($conf->use_javascript_ajax)) { |
| 172 | 172 | print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET', array(), null, 0, 0, 1); |
| 173 | 173 | } else { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | print '</td></tr>'; |
| 182 | 182 | |
| 183 | 183 | if (isModEnabled('member')) { |
| 184 | - print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Membership public subscription</td><td class="right" width="100">'; |
|
| 184 | + print '<tr class="oddeven"><td>'.$langs->trans("UseCaptchaCode").' - Membership public subscription</td><td class="right" width="100">'; |
|
| 185 | 185 | if (!empty($conf->use_javascript_ajax)) { |
| 186 | 186 | print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_MEMBER', array(), null, 0, 0, 1); |
| 187 | 187 | } else { |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | print '</td></tr>'; |
| 196 | 196 | |
| 197 | 197 | if (isModEnabled('don')) { |
| 198 | - print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Donation public form</td><td class="right" width="100">'; |
|
| 198 | + print '<tr class="oddeven"><td>'.$langs->trans("UseCaptchaCode").' - Donation public form</td><td class="right" width="100">'; |
|
| 199 | 199 | if (!empty($conf->use_javascript_ajax)) { |
| 200 | 200 | print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_DONATION', array(), null, 0, 0, 1); |
| 201 | 201 | } else { |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $form = new Form($db); |
| 144 | 144 | |
| 145 | -$title = $object->ref . ' - ' . $langs->trans("Documents"); |
|
| 145 | +$title = $object->ref.' - '.$langs->trans("Documents"); |
|
| 146 | 146 | if (!empty($withproject)) { |
| 147 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
| 147 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 148 | 148 | } |
| 149 | 149 | $help_url = ''; |
| 150 | 150 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $cols = 2; |
| 258 | 258 | $savobject = $object; |
| 259 | 259 | $object = $projectstatic; |
| 260 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 260 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 261 | 261 | $object = $savobject; |
| 262 | 262 | |
| 263 | 263 | print '</table>'; |
@@ -1276,7 +1276,7 @@ |
||
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | /** |
| 1279 | - * Add a simple expedition line. |
|
| 1279 | + * Add a simple expedition line. |
|
| 1280 | 1280 | * |
| 1281 | 1281 | * @param float $qty Quantity |
| 1282 | 1282 | * @param string $element_type Element type |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | if (getDolGlobalString('EXPEDITION_ADDON_NUMBER')) { |
| 371 | 371 | $mybool = false; |
| 372 | 372 | |
| 373 | - $file = getDolGlobalString('EXPEDITION_ADDON_NUMBER') . ".php"; |
|
| 373 | + $file = getDolGlobalString('EXPEDITION_ADDON_NUMBER').".php"; |
|
| 374 | 374 | $classname = getDolGlobalString('EXPEDITION_ADDON_NUMBER'); |
| 375 | 375 | |
| 376 | 376 | // Include file with class |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $line_id = $this->create_line($warehouse_id, 0, $product_child_qty, $line->rang, $line->array_options, $parent_line_id, $product_child_id); |
| 641 | 641 | if ($line_id <= 0) { |
| 642 | 642 | $error++; |
| 643 | - dol_syslog(__METHOD__ . ' : ' . $this->errorsToString(), LOG_ERR); |
|
| 643 | + dol_syslog(__METHOD__.' : '.$this->errorsToString(), LOG_ERR); |
|
| 644 | 644 | break; |
| 645 | 645 | } |
| 646 | 646 | |
@@ -867,20 +867,20 @@ discard block |
||
| 867 | 867 | if ($this->db->num_rows($result)) { |
| 868 | 868 | $obj = $this->db->fetch_object($result); |
| 869 | 869 | |
| 870 | - $this->id = (int) $obj->rowid; |
|
| 871 | - $this->entity = $obj->entity; |
|
| 872 | - $this->ref = $obj->ref; |
|
| 873 | - $this->socid = $obj->socid; |
|
| 874 | - $this->ref_customer = $obj->ref_customer; |
|
| 875 | - $this->ref_ext = $obj->ref_ext; |
|
| 870 | + $this->id = (int) $obj->rowid; |
|
| 871 | + $this->entity = $obj->entity; |
|
| 872 | + $this->ref = $obj->ref; |
|
| 873 | + $this->socid = $obj->socid; |
|
| 874 | + $this->ref_customer = $obj->ref_customer; |
|
| 875 | + $this->ref_ext = $obj->ref_ext; |
|
| 876 | 876 | $this->status = $obj->fk_statut; |
| 877 | 877 | $this->statut = $this->status; // Deprecated |
| 878 | - $this->signed_status = $obj->signed_status; |
|
| 878 | + $this->signed_status = $obj->signed_status; |
|
| 879 | 879 | $this->user_author_id = $obj->fk_user_author; |
| 880 | 880 | $this->fk_user_author = $obj->fk_user_author; |
| 881 | - $this->user_creation_id = $obj->fk_user_author; |
|
| 881 | + $this->user_creation_id = $obj->fk_user_author; |
|
| 882 | 882 | $this->date_creation = $this->db->jdate($obj->date_creation); |
| 883 | - $this->date_valid = $this->db->jdate($obj->date_valid); |
|
| 883 | + $this->date_valid = $this->db->jdate($obj->date_valid); |
|
| 884 | 884 | $this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated |
| 885 | 885 | $this->date_expedition = $this->db->jdate($obj->date_expedition); // TODO deprecated |
| 886 | 886 | $this->date_shipping = $this->db->jdate($obj->date_expedition); // Date real |
@@ -888,13 +888,13 @@ discard block |
||
| 888 | 888 | $this->fk_delivery_address = $obj->fk_address; |
| 889 | 889 | $this->model_pdf = $obj->model_pdf; |
| 890 | 890 | $this->shipping_method_id = $obj->fk_shipping_method; |
| 891 | - $this->shipping_method = $obj->shipping_method; |
|
| 891 | + $this->shipping_method = $obj->shipping_method; |
|
| 892 | 892 | $this->tracking_number = $obj->tracking_number; |
| 893 | 893 | $this->origin = ($obj->origin_type ? $obj->origin_type : 'commande'); // For compatibility |
| 894 | 894 | $this->origin_type = ($obj->origin_type ? $obj->origin_type : 'commande'); |
| 895 | 895 | $this->origin_id = $obj->origin_id; |
| 896 | 896 | $this->billed = $obj->billed; |
| 897 | - $this->fk_project = $obj->fk_project; |
|
| 897 | + $this->fk_project = $obj->fk_project; |
|
| 898 | 898 | $this->signed_status = $obj->signed_status; |
| 899 | 899 | $this->trueWeight = $obj->weight; |
| 900 | 900 | $this->weight_units = $obj->weight_units; |
@@ -1045,9 +1045,9 @@ discard block |
||
| 1045 | 1045 | // Change status of order to "shipment in process" |
| 1046 | 1046 | $triggerKey = 'SHIPPING_'; // Because when the trigger is fired the object is a shipping and not the real target object, so I add a prefix like SHIPPING_ to avoid confusion |
| 1047 | 1047 | if ($this->origin == 'commande') { |
| 1048 | - $triggerKey.= 'ORDER_SHIPMENTONPROCESS'; |
|
| 1048 | + $triggerKey .= 'ORDER_SHIPMENTONPROCESS'; |
|
| 1049 | 1049 | } else { |
| 1050 | - $triggerKey.= strtoupper($this->origin).'_SHIPMENTONPROCESS'; |
|
| 1050 | + $triggerKey .= strtoupper($this->origin).'_SHIPMENTONPROCESS'; |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | // TODO : load the origin object to trigger the right setStatus according to origin object |
@@ -1261,7 +1261,7 @@ discard block |
||
| 1261 | 1261 | // If product need a batch number, we should not have called this function but addline_batch instead. |
| 1262 | 1262 | // If this happen, we may have a bug in card.php page |
| 1263 | 1263 | if (isModEnabled('productbatch') && !empty($line->fk_product) && !empty($orderline->product_tobatch)) { |
| 1264 | - $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$line->fk_product; // |
|
| 1264 | + $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$line->fk_product; // |
|
| 1265 | 1265 | return -4; |
| 1266 | 1266 | } |
| 1267 | 1267 | |
@@ -2046,14 +2046,14 @@ discard block |
||
| 2046 | 2046 | $this->db->commit(); |
| 2047 | 2047 | |
| 2048 | 2048 | // Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive |
| 2049 | - $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
| 2050 | - $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
| 2049 | + $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
| 2050 | + $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive |
|
| 2051 | 2051 | |
| 2052 | 2052 | // We delete PDFs |
| 2053 | 2053 | $ref = dol_sanitizeFileName($this->ref); |
| 2054 | 2054 | if (!empty($conf->expedition->dir_output)) { |
| 2055 | - $dir = $conf->expedition->dir_output . '/sending/' . $ref; |
|
| 2056 | - $file = $dir . '/' . $ref . '.pdf'; |
|
| 2055 | + $dir = $conf->expedition->dir_output.'/sending/'.$ref; |
|
| 2056 | + $file = $dir.'/'.$ref.'.pdf'; |
|
| 2057 | 2057 | if (file_exists($file)) { |
| 2058 | 2058 | if (!dol_delete_file($file)) { |
| 2059 | 2059 | return 0; |
@@ -2113,7 +2113,7 @@ discard block |
||
| 2113 | 2113 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product"; |
| 2114 | 2114 | $sql .= " WHERE ed.fk_expedition = ".((int) $this->id); |
| 2115 | 2115 | $sql .= " AND ed.fk_elementdet = cd.rowid"; |
| 2116 | - $sql .= " ORDER BY cd.rang, ed.fk_elementdet"; // We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria. |
|
| 2116 | + $sql .= " ORDER BY cd.rang, ed.fk_elementdet"; // We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria. |
|
| 2117 | 2117 | |
| 2118 | 2118 | dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); |
| 2119 | 2119 | $resql = $this->db->query($sql); |
@@ -2147,9 +2147,9 @@ discard block |
||
| 2147 | 2147 | $line->entrepot_id = 0; // entrepod_id in details_entrepot |
| 2148 | 2148 | $line->qty_shipped += $obj->qty_shipped; |
| 2149 | 2149 | } else { |
| 2150 | - $line = new ExpeditionLigne($this->db); // new group to start |
|
| 2151 | - $line->entrepot_id = $obj->fk_entrepot; // this is a property of a shipment line |
|
| 2152 | - $line->qty_shipped = $obj->qty_shipped; // this is a property of a shipment line |
|
| 2150 | + $line = new ExpeditionLigne($this->db); // new group to start |
|
| 2151 | + $line->entrepot_id = $obj->fk_entrepot; // this is a property of a shipment line |
|
| 2152 | + $line->qty_shipped = $obj->qty_shipped; // this is a property of a shipment line |
|
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | $detail_entrepot = new stdClass(); |
@@ -2162,13 +2162,13 @@ discard block |
||
| 2162 | 2162 | $line->rowid = $obj->line_id; // TODO deprecated |
| 2163 | 2163 | $line->id = $obj->line_id; |
| 2164 | 2164 | |
| 2165 | - $line->fk_origin = 'orderline'; // TODO deprecated, we already have element_type that can be use to guess type of line |
|
| 2165 | + $line->fk_origin = 'orderline'; // TODO deprecated, we already have element_type that can be use to guess type of line |
|
| 2166 | 2166 | |
| 2167 | - $line->fk_element = $obj->fk_element; |
|
| 2168 | - $line->origin_id = $obj->fk_element; |
|
| 2169 | - $line->fk_elementdet = $obj->fk_elementdet; |
|
| 2170 | - $line->origin_line_id = $obj->fk_elementdet; |
|
| 2171 | - $line->element_type = $obj->element_type; |
|
| 2167 | + $line->fk_element = $obj->fk_element; |
|
| 2168 | + $line->origin_id = $obj->fk_element; |
|
| 2169 | + $line->fk_elementdet = $obj->fk_elementdet; |
|
| 2170 | + $line->origin_line_id = $obj->fk_elementdet; |
|
| 2171 | + $line->element_type = $obj->element_type; |
|
| 2172 | 2172 | |
| 2173 | 2173 | $line->fk_expedition = $this->id; // id of parent |
| 2174 | 2174 | |
@@ -2355,16 +2355,16 @@ discard block |
||
| 2355 | 2355 | $line = new ExpeditionLigne($this->db); |
| 2356 | 2356 | |
| 2357 | 2357 | $line->rowid = $objp->rowid; |
| 2358 | - $line->id = $objp->rowid; |
|
| 2359 | - $line->fk_expedition = $this->id; |
|
| 2358 | + $line->id = $objp->rowid; |
|
| 2359 | + $line->fk_expedition = $this->id; |
|
| 2360 | 2360 | $line->description = $objp->description; |
| 2361 | 2361 | $line->qty = $objp->qty; |
| 2362 | 2362 | $line->fk_entrepot = $objp->fk_entrepot; |
| 2363 | 2363 | $line->fk_product = $objp->fk_product; |
| 2364 | 2364 | $line->rang = $objp->rang; |
| 2365 | - $line->fk_element = $objp->fk_element; |
|
| 2365 | + $line->fk_element = $objp->fk_element; |
|
| 2366 | 2366 | $line->fk_unit = $objp->fk_unit; |
| 2367 | - $line->fk_elementdet = $objp->fk_elementdet; |
|
| 2367 | + $line->fk_elementdet = $objp->fk_elementdet; |
|
| 2368 | 2368 | $line->fk_element_type = $objp->element_type; |
| 2369 | 2369 | $line->fetch_optionals(); |
| 2370 | 2370 | |
@@ -2531,7 +2531,7 @@ discard block |
||
| 2531 | 2531 | } |
| 2532 | 2532 | $result .= $linkend; |
| 2533 | 2533 | global $action; |
| 2534 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 2534 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 2535 | 2535 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 2536 | 2536 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 2537 | 2537 | if ($reshook > 0) { |
@@ -2580,9 +2580,9 @@ discard block |
||
| 2580 | 2580 | $statusType = 'status9'; |
| 2581 | 2581 | } |
| 2582 | 2582 | |
| 2583 | - $signed_label = ' (' . $this->getLibSignedStatus() . ')'; |
|
| 2584 | - $status_label = $this->signed_status ? $labelStatus . $signed_label : $labelStatus; |
|
| 2585 | - $status_label_short = $this->signed_status ? $labelStatusShort . $signed_label : $labelStatusShort; |
|
| 2583 | + $signed_label = ' ('.$this->getLibSignedStatus().')'; |
|
| 2584 | + $status_label = $this->signed_status ? $labelStatus.$signed_label : $labelStatus; |
|
| 2585 | + $status_label_short = $this->signed_status ? $labelStatusShort.$signed_label : $labelStatusShort; |
|
| 2586 | 2586 | |
| 2587 | 2587 | return dolGetStatus($status_label, $status_label_short, '', $statusType, $mode); |
| 2588 | 2588 | } |
@@ -2606,7 +2606,7 @@ discard block |
||
| 2606 | 2606 | $return .= img_picto('', 'order'); |
| 2607 | 2607 | $return .= '</div>'; |
| 2608 | 2608 | $return .= '<div class="info-box-content">'; |
| 2609 | - $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>'; |
|
| 2609 | + $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>'; |
|
| 2610 | 2610 | if ($selected >= 0) { |
| 2611 | 2611 | $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
| 2612 | 2612 | } |
@@ -2663,7 +2663,7 @@ discard block |
||
| 2663 | 2663 | $this->note_private = 'Private note'; |
| 2664 | 2664 | $this->note_public = 'Public note'; |
| 2665 | 2665 | |
| 2666 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
| 2666 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
| 2667 | 2667 | $xnbp = 0; |
| 2668 | 2668 | while ($xnbp < $nbp) { |
| 2669 | 2669 | $line = new ExpeditionLigne($this->db); |
@@ -2675,7 +2675,7 @@ discard block |
||
| 2675 | 2675 | $line->fk_product = $this->commande->lines[$xnbp]->fk_product; |
| 2676 | 2676 | |
| 2677 | 2677 | $line->weight = 1.123456; |
| 2678 | - $line->weight_units = 0; // kg |
|
| 2678 | + $line->weight_units = 0; // kg |
|
| 2679 | 2679 | |
| 2680 | 2680 | $line->volume = 2.34567; |
| 2681 | 2681 | $line->volume_unit = 0; |
@@ -2809,7 +2809,7 @@ discard block |
||
| 2809 | 2809 | if ($resql) { |
| 2810 | 2810 | while ($obj = $this->db->fetch_object($resql)) { |
| 2811 | 2811 | $label = $langs->trans('SendingMethod'.$obj->code); |
| 2812 | - $this->listmeths[$i]= [ |
|
| 2812 | + $this->listmeths[$i] = [ |
|
| 2813 | 2813 | 'rowid' => (int) $obj->rowid, |
| 2814 | 2814 | 'code' => $obj->code, |
| 2815 | 2815 | 'libelle' => ($label != 'SendingMethod'.$obj->code ? $label : $obj->label), |
@@ -2899,12 +2899,12 @@ discard block |
||
| 2899 | 2899 | if ($shipments_match_order) { |
| 2900 | 2900 | dol_syslog("Qty for the ".count($order->lines)." lines of the origin order is same than qty for lines in the shipment we close (shipments_match_order is true), with new status Expedition::STATUS_CLOSED=".self::STATUS_CLOSED.', so we close order'); |
| 2901 | 2901 | // We close the order |
| 2902 | - $order->cloture($user); // Note this may also create an invoice if module workflow ask it |
|
| 2902 | + $order->cloture($user); // Note this may also create an invoice if module workflow ask it |
|
| 2903 | 2903 | } |
| 2904 | 2904 | } |
| 2905 | 2905 | |
| 2906 | - $this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
| 2907 | - $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
| 2906 | + $this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
| 2907 | + $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback |
|
| 2908 | 2908 | |
| 2909 | 2909 | // If stock increment is done on closing |
| 2910 | 2910 | if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { |
@@ -2952,7 +2952,7 @@ discard block |
||
| 2952 | 2952 | |
| 2953 | 2953 | $error = 0; |
| 2954 | 2954 | |
| 2955 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; |
|
| 2955 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; |
|
| 2956 | 2956 | |
| 2957 | 2957 | $langs->load("agenda"); |
| 2958 | 2958 | |
@@ -2963,14 +2963,14 @@ discard block |
||
| 2963 | 2963 | $sql .= ", cd.subprice"; |
| 2964 | 2964 | $sql .= ", edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock"; |
| 2965 | 2965 | $sql .= ", e.ref"; |
| 2966 | - $sql .= " FROM " . $this->db->prefix() . "expeditiondet as ed"; |
|
| 2967 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "commandedet as cd ON cd.rowid = ed.fk_elementdet"; |
|
| 2968 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid"; |
|
| 2969 | - $sql .= " INNER JOIN " . $this->db->prefix() . "expedition as e ON ed.fk_expedition = e.rowid"; |
|
| 2970 | - $sql .= " WHERE ed.fk_expedition = " . ((int) $this->id); |
|
| 2966 | + $sql .= " FROM ".$this->db->prefix()."expeditiondet as ed"; |
|
| 2967 | + $sql .= " LEFT JOIN ".$this->db->prefix()."commandedet as cd ON cd.rowid = ed.fk_elementdet"; |
|
| 2968 | + $sql .= " LEFT JOIN ".$this->db->prefix()."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid"; |
|
| 2969 | + $sql .= " INNER JOIN ".$this->db->prefix()."expedition as e ON ed.fk_expedition = e.rowid"; |
|
| 2970 | + $sql .= " WHERE ed.fk_expedition = ".((int) $this->id); |
|
| 2971 | 2971 | //$sql .= " AND cd.rowid = ed.fk_elementdet"; |
| 2972 | 2972 | |
| 2973 | - dol_syslog(get_class($this) . "::valid select details", LOG_DEBUG); |
|
| 2973 | + dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); |
|
| 2974 | 2974 | $resql = $this->db->query($sql); |
| 2975 | 2975 | if ($resql) { |
| 2976 | 2976 | $cpt = $this->db->num_rows($resql); |
@@ -2984,7 +2984,7 @@ discard block |
||
| 2984 | 2984 | if ($qty <= 0 || ($qty < 0 && !getDolGlobalInt('SHIPMENT_ALLOW_NEGATIVE_QTY'))) { |
| 2985 | 2985 | continue; |
| 2986 | 2986 | } |
| 2987 | - dol_syslog(get_class($this) . "::valid movement index " . $i . " ed.rowid=" . $obj->edid . " edb.rowid=" . $obj->edbrowid); |
|
| 2987 | + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->edid." edb.rowid=".$obj->edbrowid); |
|
| 2988 | 2988 | |
| 2989 | 2989 | $mouvS = new MouvementStock($this->db); |
| 2990 | 2990 | $mouvS->origin = &$this; |
@@ -150,8 +150,8 @@ |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | $coldisplay += $colspan; |
| 153 | -print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">'; |
|
| 154 | -print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">'; |
|
| 153 | +print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="'.$colspan.'">'; |
|
| 154 | +print '<input type="submit" class="button button-add small" name="addline" id="addline" value="'.$langs->trans('Add').'">'; |
|
| 155 | 155 | print '</td>'; |
| 156 | 156 | print '</tr>'; |
| 157 | 157 | |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // Load Dolibarr environment |
| 33 | 33 | require '../../main.inc.php'; |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
|
| 39 | 39 | require_once './lib/replenishment.lib.php'; |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $fk_entrepot = GETPOSTINT('fk_entrepot'); |
| 79 | 79 | |
| 80 | 80 | // List all visible warehouses |
| 81 | -$resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) . ")"); |
|
| 81 | +$resWar = $db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$db->sanitize(getEntity('stock')).")"); |
|
| 82 | 82 | $listofqualifiedwarehousesid = ""; |
| 83 | 83 | $lastWarehouseID = 0; |
| 84 | 84 | $count = 0; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $db->begin(); |
| 177 | 177 | |
| 178 | 178 | $suppliers = array(); |
| 179 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
| 179 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
| 180 | 180 | $productsupplier = new ProductFournisseur($db); |
| 181 | 181 | for ($i = 0; $i < $linecount; $i++) { |
| 182 | 182 | if (GETPOST('choose'.$i) === 'on' && GETPOSTINT('fourn'.$i) > 0) { |
@@ -216,10 +216,10 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | // If we use multicurrency |
| 218 | 218 | if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) { |
| 219 | - $line->multicurrency_code = $productsupplier->fourn_multicurrency_code; |
|
| 220 | - $line->fk_multicurrency = (int) $productsupplier->fourn_multicurrency_id; |
|
| 219 | + $line->multicurrency_code = $productsupplier->fourn_multicurrency_code; |
|
| 220 | + $line->fk_multicurrency = (int) $productsupplier->fourn_multicurrency_id; |
|
| 221 | 221 | $line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice; |
| 222 | - $line->multicurrency_total_ht = $line->multicurrency_subprice * $qty; |
|
| 222 | + $line->multicurrency_total_ht = $line->multicurrency_subprice * $qty; |
|
| 223 | 223 | $line->multicurrency_total_tva = $line->multicurrency_total_ht * $tva; |
| 224 | 224 | $line->multicurrency_total_ttc = $line->multicurrency_total_ht + $line->multicurrency_total_tva; |
| 225 | 225 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $line->total_tva = $line->total_ht * $tva; |
| 229 | 229 | $line->total_ttc = $line->total_ht + $line->total_tva; |
| 230 | 230 | $line->remise_percent = (float) $productsupplier->remise_percent; |
| 231 | - $line->ref_fourn = $productsupplier->ref_supplier; // deprecated |
|
| 231 | + $line->ref_fourn = $productsupplier->ref_supplier; // deprecated |
|
| 232 | 232 | $line->ref_supplier = $productsupplier->ref_supplier; |
| 233 | 233 | $line->type = $productsupplier->type; |
| 234 | 234 | $line->fk_unit = $productsupplier->fk_unit; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | dol_print_error($db); |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - unset($_POST['fourn' . $i]); |
|
| 245 | + unset($_POST['fourn'.$i]); |
|
| 246 | 246 | } |
| 247 | 247 | unset($_POST[$i]); |
| 248 | 248 | } |
@@ -251,15 +251,15 @@ discard block |
||
| 251 | 251 | $i = 0; |
| 252 | 252 | $fail = 0; |
| 253 | 253 | $orders = array(); |
| 254 | - $suppliersid = array_keys($suppliers); // array of ids of suppliers |
|
| 254 | + $suppliersid = array_keys($suppliers); // array of ids of suppliers |
|
| 255 | 255 | foreach ($suppliers as $supplier) { |
| 256 | 256 | $order = new CommandeFournisseur($db); |
| 257 | 257 | |
| 258 | 258 | // Check if an order for the supplier exists |
| 259 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "commande_fournisseur"; |
|
| 260 | - $sql .= " WHERE fk_soc = " . ((int) $suppliersid[$i]); |
|
| 261 | - $sql .= " AND source = " . ((int) $order::SOURCE_ID_REPLENISHMENT) . " AND fk_statut = " . ((int) $order::STATUS_DRAFT); |
|
| 262 | - $sql .= " AND entity IN (" . getEntity('commande_fournisseur') . ")"; |
|
| 259 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur"; |
|
| 260 | + $sql .= " WHERE fk_soc = ".((int) $suppliersid[$i]); |
|
| 261 | + $sql .= " AND source = ".((int) $order::SOURCE_ID_REPLENISHMENT)." AND fk_statut = ".((int) $order::STATUS_DRAFT); |
|
| 262 | + $sql .= " AND entity IN (".getEntity('commande_fournisseur').")"; |
|
| 263 | 263 | $sql .= " ORDER BY date_creation DESC"; |
| 264 | 264 | $resql = $db->query($sql); |
| 265 | 265 | if ($resql && $db->num_rows($resql) > 0) { |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | if ($result < 0) { |
| 299 | 299 | $fail++; |
| 300 | - $msg = $langs->trans('OrderFail') . " : "; |
|
| 300 | + $msg = $langs->trans('OrderFail')." : "; |
|
| 301 | 301 | $msg .= $order->error; |
| 302 | 302 | setEventMessages($msg, null, 'errors'); |
| 303 | 303 | } else { |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $id = $order->create($user); |
| 325 | 325 | if ($id < 0) { |
| 326 | 326 | $fail++; |
| 327 | - $msg = $langs->trans('OrderFail') . " : "; |
|
| 327 | + $msg = $langs->trans('OrderFail')." : "; |
|
| 328 | 328 | $msg .= $order->error; |
| 329 | 329 | setEventMessages($msg, null, 'errors'); |
| 330 | 330 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
| 378 | 378 | $sql .= ' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,'; |
| 379 | 379 | } |
| 380 | -$sql .= " " . $sqldesiredtock . " as desiredstockcombined, " . $sqlalertstock . " as seuil_stock_alertecombined,"; |
|
| 380 | +$sql .= " ".$sqldesiredtock." as desiredstockcombined, ".$sqlalertstock." as seuil_stock_alertecombined,"; |
|
| 381 | 381 | $sql .= ' s.fk_product,'; |
| 382 | 382 | $sql .= " SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique'; |
| 383 | 383 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | |
| 392 | 392 | $list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid); |
| 393 | 393 | |
| 394 | -$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; |
|
| 395 | -$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s ON p.rowid = s.fk_product'; |
|
| 396 | -$sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse) . ')'; |
|
| 394 | +$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; |
|
| 395 | +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product'; |
|
| 396 | +$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse).')'; |
|
| 397 | 397 | |
| 398 | 398 | $list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? $list_warehouse : $fk_entrepot; |
| 399 | -$sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse_selected) . ')'; |
|
| 399 | +$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse_selected).')'; |
|
| 400 | 400 | |
| 401 | 401 | |
| 402 | 402 | //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | $reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook |
| 409 | 409 | $sql .= $hookmanager->resPrint; |
| 410 | 410 | |
| 411 | -$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 411 | +$sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 412 | 412 | if ($sall) { |
| 413 | 413 | $sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); |
| 414 | 414 | } |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | $sql .= ' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM '.MAIN_DB_PREFIX.'product_attribute_combination as pac WHERE pac.entity IN ('.getEntity('product').'))'; |
| 432 | 432 | } |
| 433 | 433 | if ($fk_supplier > 0) { |
| 434 | - $sql .= ' AND EXISTS (SELECT pfp.rowid FROM ' . MAIN_DB_PREFIX . 'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = ' . ((int) $fk_supplier) . ' AND pfp.entity IN (' . getEntity('product_fournisseur_price') . '))'; |
|
| 434 | + $sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))'; |
|
| 435 | 435 | } |
| 436 | 436 | // Add where from hooks |
| 437 | 437 | $parameters = array(); |
@@ -476,9 +476,9 @@ discard block |
||
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | if (isModEnabled("supplier_order")) { |
| 479 | - $sqlCommandesFourn = "(SELECT " . $db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)") . " as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL |
|
| 480 | - $sqlCommandesFourn .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as cd3,"; |
|
| 481 | - $sqlCommandesFourn .= " " . MAIN_DB_PREFIX . "commande_fournisseur as c3"; |
|
| 479 | + $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL |
|
| 480 | + $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; |
|
| 481 | + $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; |
|
| 482 | 482 | $sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande"; |
| 483 | 483 | $sqlCommandesFourn .= " AND c3.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")"; |
| 484 | 484 | $sqlCommandesFourn .= " AND cd3.fk_product = p.rowid"; |
@@ -517,15 +517,15 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | $sql .= ' HAVING ('; |
| 520 | - $sql .= " (" . $sqldesiredtock . " >= 0 AND (" . $sqldesiredtock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')'; |
|
| 521 | - $sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ") + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . ")))"; |
|
| 520 | + $sql .= " (".$sqldesiredtock." >= 0 AND (".$sqldesiredtock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; |
|
| 521 | + $sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.") + (".$sqlProductionToProduce." - ".$sqlProductionToConsume.")))"; |
|
| 522 | 522 | $sql .= ' OR'; |
| 523 | 523 | if ($includeproductswithoutdesiredqty == 'on') { |
| 524 | - $sql .= " ((" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")"; |
|
| 524 | + $sql .= " ((".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")"; |
|
| 525 | 525 | } else { |
| 526 | - $sql .= " (" . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')'; |
|
| 526 | + $sql .= " (".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; |
|
| 527 | 527 | } |
| 528 | - $sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ") + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . ")))"; |
|
| 528 | + $sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.") + (".$sqlProductionToProduce." - ".$sqlProductionToConsume.")))"; |
|
| 529 | 529 | $sql .= ")"; |
| 530 | 530 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
| 531 | 531 | $sql .= " AND ("; |
@@ -535,22 +535,22 @@ discard block |
||
| 535 | 535 | if ($salert == 'on') { // Option to see when stock is lower than alert |
| 536 | 536 | $sql .= ' AND ('; |
| 537 | 537 | if ($includeproductswithoutdesiredqty == 'on') { |
| 538 | - $sql .= "(" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")"; |
|
| 538 | + $sql .= "(".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")"; |
|
| 539 | 539 | } else { |
| 540 | - $sql .= $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")"; |
|
| 540 | + $sql .= $sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")"; |
|
| 541 | 541 | } |
| 542 | - $sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ") + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . "))"; |
|
| 542 | + $sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.") + (".$sqlProductionToProduce." - ".$sqlProductionToConsume."))"; |
|
| 543 | 543 | $sql .= ")"; |
| 544 | 544 | $alertchecked = 'checked'; |
| 545 | 545 | } |
| 546 | 546 | } else { |
| 547 | 547 | $sql .= ' HAVING ('; |
| 548 | - $sql .= "(" . $sqldesiredtock . " >= 0 AND (" . $sqldesiredtock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")))"; |
|
| 548 | + $sql .= "(".$sqldesiredtock." >= 0 AND (".$sqldesiredtock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")))"; |
|
| 549 | 549 | $sql .= ' OR'; |
| 550 | 550 | if ($includeproductswithoutdesiredqty == 'on') { |
| 551 | - $sql .= " ((" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')))'; |
|
| 551 | + $sql .= " ((".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; |
|
| 552 | 552 | } else { |
| 553 | - $sql .= " (" . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')))'; |
|
| 553 | + $sql .= " (".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; |
|
| 554 | 554 | } |
| 555 | 555 | $sql .= ')'; |
| 556 | 556 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
@@ -561,9 +561,9 @@ discard block |
||
| 561 | 561 | if ($salert == 'on') { // Option to see when stock is lower than alert |
| 562 | 562 | $sql .= " AND ("; |
| 563 | 563 | if ($includeproductswithoutdesiredqty == 'on') { |
| 564 | - $sql .= " (" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . "))"; |
|
| 564 | + $sql .= " (".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel")."))"; |
|
| 565 | 565 | } else { |
| 566 | - $sql .= " " . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . '))'; |
|
| 566 | + $sql .= " ".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").'))'; |
|
| 567 | 567 | } |
| 568 | 568 | $sql .= ')'; |
| 569 | 569 | $alertchecked = 'checked'; |
@@ -605,11 +605,11 @@ discard block |
||
| 605 | 605 | |
| 606 | 606 | $head = array(); |
| 607 | 607 | |
| 608 | -$head[0][0] = DOL_URL_ROOT . '/product/stock/replenish.php'; |
|
| 608 | +$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php'; |
|
| 609 | 609 | $head[0][1] = $title; |
| 610 | 610 | $head[0][2] = 'replenish'; |
| 611 | 611 | |
| 612 | -$head[1][0] = DOL_URL_ROOT . '/product/stock/replenishorders.php'; |
|
| 612 | +$head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; |
|
| 613 | 613 | $head[1][1] = $langs->trans("ReplenishmentOrders"); |
| 614 | 614 | $head[1][2] = 'replenishorders'; |
| 615 | 615 | |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | |
| 619 | 619 | print dol_get_fiche_head($head, 'replenish', '', -1, ''); |
| 620 | 620 | |
| 621 | -print '<span class="opacitymedium">' . $langs->trans("ReplenishmentStatusDesc") . '</span>' . "\n"; |
|
| 621 | +print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'</span>'."\n"; |
|
| 622 | 622 | |
| 623 | 623 | //$link = '<a title=' .$langs->trans("MenuNewWarehouse"). ' href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("MenuNewWarehouse").'</a>'; |
| 624 | 624 | |
@@ -627,39 +627,39 @@ discard block |
||
| 627 | 627 | } |
| 628 | 628 | print '<br><br>'; |
| 629 | 629 | if ($usevirtualstock == 1) { |
| 630 | - print $langs->trans("CurentSelectionMode") . ': '; |
|
| 631 | - print '<span class="a-mesure">' . $langs->trans("UseVirtualStock") . '</span>'; |
|
| 632 | - print ' <a class="a-mesure-disabled" href="' . $_SERVER["PHP_SELF"] . '?mode=physical' . ($fk_supplier > 0 ? '&fk_supplier=' . $fk_supplier : '') . ($fk_entrepot > 0 ? '&fk_entrepot=' . $fk_entrepot : '') . '">' . $langs->trans("UsePhysicalStock") . '</a>'; |
|
| 630 | + print $langs->trans("CurentSelectionMode").': '; |
|
| 631 | + print '<span class="a-mesure">'.$langs->trans("UseVirtualStock").'</span>'; |
|
| 632 | + print ' <a class="a-mesure-disabled" href="'.$_SERVER["PHP_SELF"].'?mode=physical'.($fk_supplier > 0 ? '&fk_supplier='.$fk_supplier : '').($fk_entrepot > 0 ? '&fk_entrepot='.$fk_entrepot : '').'">'.$langs->trans("UsePhysicalStock").'</a>'; |
|
| 633 | 633 | print '<br>'; |
| 634 | 634 | } |
| 635 | 635 | if ($usevirtualstock == 0) { |
| 636 | - print $langs->trans("CurentSelectionMode") . ': '; |
|
| 637 | - print '<a class="a-mesure-disabled" href="' . $_SERVER["PHP_SELF"] . '?mode=virtual' . ($fk_supplier > 0 ? '&fk_supplier=' . $fk_supplier : '') . ($fk_entrepot > 0 ? '&fk_entrepot=' . $fk_entrepot : '') . '">' . $langs->trans("UseVirtualStock") . '</a>'; |
|
| 638 | - print ' <span class="a-mesure">' . $langs->trans("UsePhysicalStock") . '</span>'; |
|
| 636 | + print $langs->trans("CurentSelectionMode").': '; |
|
| 637 | + print '<a class="a-mesure-disabled" href="'.$_SERVER["PHP_SELF"].'?mode=virtual'.($fk_supplier > 0 ? '&fk_supplier='.$fk_supplier : '').($fk_entrepot > 0 ? '&fk_entrepot='.$fk_entrepot : '').'">'.$langs->trans("UseVirtualStock").'</a>'; |
|
| 638 | + print ' <span class="a-mesure">'.$langs->trans("UsePhysicalStock").'</span>'; |
|
| 639 | 639 | print '<br>'; |
| 640 | 640 | } |
| 641 | -print '<br>' . "\n"; |
|
| 641 | +print '<br>'."\n"; |
|
| 642 | 642 | |
| 643 | -print '<form name="formFilterWarehouse" method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 644 | -print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 643 | +print '<form name="formFilterWarehouse" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 644 | +print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 645 | 645 | print '<input type="hidden" name="action" value="filter">'; |
| 646 | -print '<input type="hidden" name="search_ref" value="' . $search_ref . '">'; |
|
| 647 | -print '<input type="hidden" name="search_label" value="' . $search_label . '">'; |
|
| 648 | -print '<input type="hidden" name="salert" value="' . $salert . '">'; |
|
| 649 | -print '<input type="hidden" name="includeproductswithoutdesiredqty" value="' . $includeproductswithoutdesiredqty . '">'; |
|
| 650 | -print '<input type="hidden" name="draftorder" value="' . $draftorder . '">'; |
|
| 651 | -print '<input type="hidden" name="mode" value="' . $mode . '">'; |
|
| 646 | +print '<input type="hidden" name="search_ref" value="'.$search_ref.'">'; |
|
| 647 | +print '<input type="hidden" name="search_label" value="'.$search_label.'">'; |
|
| 648 | +print '<input type="hidden" name="salert" value="'.$salert.'">'; |
|
| 649 | +print '<input type="hidden" name="includeproductswithoutdesiredqty" value="'.$includeproductswithoutdesiredqty.'">'; |
|
| 650 | +print '<input type="hidden" name="draftorder" value="'.$draftorder.'">'; |
|
| 651 | +print '<input type="hidden" name="mode" value="'.$mode.'">'; |
|
| 652 | 652 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 653 | - print '<input type="hidden" name="limit" value="' . $limit . '">'; |
|
| 653 | + print '<input type="hidden" name="limit" value="'.$limit.'">'; |
|
| 654 | 654 | } |
| 655 | 655 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) { |
| 656 | 656 | print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; |
| 657 | - print $langs->trans('Warehouse') . ' ' . $formproduct->selectWarehouses((int) $fk_entrepot, 'fk_entrepot', '', 1); |
|
| 657 | + print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses((int) $fk_entrepot, 'fk_entrepot', '', 1); |
|
| 658 | 658 | print '</div>'; |
| 659 | 659 | } |
| 660 | 660 | print '<div class="inline-block valignmiddle" style="padding-right: 20px;">'; |
| 661 | 661 | $filter = '(fournisseur:=:1)'; |
| 662 | -print $langs->trans('Supplier') . ' ' . $form->select_company($fk_supplier, 'fk_supplier', $filter, 1); |
|
| 662 | +print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', $filter, 1); |
|
| 663 | 663 | print '</div>'; |
| 664 | 664 | |
| 665 | 665 | $parameters = array(); |
@@ -669,29 +669,29 @@ discard block |
||
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | print '<div class="inline-block valignmiddle">'; |
| 672 | -print '<input type="submit" class="button smallpaddingimp" name="valid" value="' . $langs->trans('ToFilter') . '">'; |
|
| 672 | +print '<input type="submit" class="button smallpaddingimp" name="valid" value="'.$langs->trans('ToFilter').'">'; |
|
| 673 | 673 | print '</div>'; |
| 674 | 674 | |
| 675 | 675 | print '</form>'; |
| 676 | 676 | |
| 677 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formulaire">'; |
|
| 678 | -print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 679 | -print '<input type="hidden" name="fk_supplier" value="' . $fk_supplier . '">'; |
|
| 680 | -print '<input type="hidden" name="fk_entrepot" value="' . $fk_entrepot . '">'; |
|
| 681 | -print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 682 | -print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 683 | -print '<input type="hidden" name="type" value="' . $type . '">'; |
|
| 684 | -print '<input type="hidden" name="linecount" value="' . $num . '">'; |
|
| 677 | +print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">'; |
|
| 678 | +print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 679 | +print '<input type="hidden" name="fk_supplier" value="'.$fk_supplier.'">'; |
|
| 680 | +print '<input type="hidden" name="fk_entrepot" value="'.$fk_entrepot.'">'; |
|
| 681 | +print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 682 | +print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 683 | +print '<input type="hidden" name="type" value="'.$type.'">'; |
|
| 684 | +print '<input type="hidden" name="linecount" value="'.$num.'">'; |
|
| 685 | 685 | print '<input type="hidden" name="action" value="order">'; |
| 686 | -print '<input type="hidden" name="mode" value="' . $mode . '">'; |
|
| 686 | +print '<input type="hidden" name="mode" value="'.$mode.'">'; |
|
| 687 | 687 | |
| 688 | 688 | |
| 689 | 689 | if ($search_ref || $search_label || $sall || $salert || $draftorder || GETPOST('search', 'alpha')) { |
| 690 | - $filters = '&search_ref=' . urlencode($search_ref) . '&search_label=' . urlencode($search_label); |
|
| 691 | - $filters .= '&sall=' . urlencode($sall); |
|
| 692 | - $filters .= '&salert=' . urlencode($salert); |
|
| 693 | - $filters .= '&draftorder=' . urlencode($draftorder); |
|
| 694 | - $filters .= '&mode=' . urlencode($mode); |
|
| 690 | + $filters = '&search_ref='.urlencode($search_ref).'&search_label='.urlencode($search_label); |
|
| 691 | + $filters .= '&sall='.urlencode($sall); |
|
| 692 | + $filters .= '&salert='.urlencode($salert); |
|
| 693 | + $filters .= '&draftorder='.urlencode($draftorder); |
|
| 694 | + $filters .= '&mode='.urlencode($mode); |
|
| 695 | 695 | if ($fk_supplier > 0) { |
| 696 | 696 | $filters .= '&fk_supplier='.urlencode((string) ($fk_supplier)); |
| 697 | 697 | } |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | } |
| 714 | 714 | } |
| 715 | 715 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 716 | - $filters .= '&limit=' . ((int) $limit); |
|
| 716 | + $filters .= '&limit='.((int) $limit); |
|
| 717 | 717 | } |
| 718 | 718 | if (!empty($includeproductswithoutdesiredqty)) { |
| 719 | 719 | $filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty); |
@@ -793,12 +793,12 @@ discard block |
||
| 793 | 793 | // Fields title search |
| 794 | 794 | print '<tr class="liste_titre_filter">'; |
| 795 | 795 | print '<td class="liste_titre"> </td>'; |
| 796 | -print '<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="' . dol_escape_htmltag($search_ref) . '"></td>'; |
|
| 797 | -print '<td class="liste_titre"><input class="flat" type="text" name="search_label" size="8" value="' . dol_escape_htmltag($search_label) . '"></td>'; |
|
| 796 | +print '<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).'"></td>'; |
|
| 797 | +print '<td class="liste_titre"><input class="flat" type="text" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).'"></td>'; |
|
| 798 | 798 | if (isModEnabled("service") && $type == 1) { |
| 799 | 799 | print '<td class="liste_titre"> </td>'; |
| 800 | 800 | } |
| 801 | -print '<td class="liste_titre right">' . $form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')) . ' <input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" ' . (!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked : '') . '></td>'; |
|
| 801 | +print '<td class="liste_titre right">'.$form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')).' <input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" '.(!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked : '').'></td>'; |
|
| 802 | 802 | print '<td class="liste_titre right"></td>'; |
| 803 | 803 | print '<td class="liste_titre right">'.$langs->trans('AlertOnly').' <input type="checkbox" id="salert" name="salert" '.(!empty($alertchecked) ? $alertchecked : '').'></td>'; |
| 804 | 804 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
@@ -861,9 +861,9 @@ discard block |
||
| 861 | 861 | // Multilangs |
| 862 | 862 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 863 | 863 | $sql = 'SELECT label,description'; |
| 864 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product_lang'; |
|
| 865 | - $sql .= ' WHERE fk_product = ' . ((int) $objp->rowid); |
|
| 866 | - $sql .= " AND lang = '" . $db->escape($langs->getDefaultLang()) . "'"; |
|
| 864 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang'; |
|
| 865 | + $sql .= ' WHERE fk_product = '.((int) $objp->rowid); |
|
| 866 | + $sql .= " AND lang = '".$db->escape($langs->getDefaultLang())."'"; |
|
| 867 | 867 | $sql .= ' LIMIT 1'; |
| 868 | 868 | |
| 869 | 869 | $resqlm = $db->query($sql); |
@@ -915,11 +915,11 @@ discard block |
||
| 915 | 915 | |
| 916 | 916 | $warning = ''; |
| 917 | 917 | if ($alertstock && ($stock < $alertstock)) { |
| 918 | - $warning = img_warning($langs->trans('StockTooLow')) . ' '; |
|
| 918 | + $warning = img_warning($langs->trans('StockTooLow')).' '; |
|
| 919 | 919 | } |
| 920 | 920 | $warningwarehouse = ''; |
| 921 | 921 | if ($alertstockwarehouse && ($stockwarehouse < $alertstockwarehouse)) { |
| 922 | - $warningwarehouse = img_warning($langs->trans('StockTooLow')) . ' '; |
|
| 922 | + $warningwarehouse = img_warning($langs->trans('StockTooLow')).' '; |
|
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | //depending on conf, use either physical stock or |
@@ -952,38 +952,38 @@ discard block |
||
| 952 | 952 | print '<tr class="oddeven">'; |
| 953 | 953 | |
| 954 | 954 | // Select field |
| 955 | - print '<td><input type="checkbox" class="check" name="choose' . $i . '"></td>'; |
|
| 955 | + print '<td><input type="checkbox" class="check" name="choose'.$i.'"></td>'; |
|
| 956 | 956 | |
| 957 | - print '<td class="nowrap">' . $prod->getNomUrl(1, 'stock') . '</td>'; |
|
| 957 | + print '<td class="nowrap">'.$prod->getNomUrl(1, 'stock').'</td>'; |
|
| 958 | 958 | |
| 959 | - print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($objp->label) . '">'; |
|
| 959 | + print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">'; |
|
| 960 | 960 | print dol_escape_htmltag($objp->label); |
| 961 | - print '<input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp->description) . '">'; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST |
|
| 961 | + print '<input type="hidden" name="desc'.$i.'" value="'.dol_escape_htmltag($objp->description).'">'; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST |
|
| 962 | 962 | print '</td>'; |
| 963 | 963 | |
| 964 | 964 | if (isModEnabled("service") && $type == 1) { |
| 965 | 965 | $regs = array(); |
| 966 | 966 | if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) { |
| 967 | - $duration = $regs[1] . ' ' . $langs->trans('DurationYear'); |
|
| 967 | + $duration = $regs[1].' '.$langs->trans('DurationYear'); |
|
| 968 | 968 | } elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) { |
| 969 | - $duration = $regs[1] . ' ' . $langs->trans('DurationMonth'); |
|
| 969 | + $duration = $regs[1].' '.$langs->trans('DurationMonth'); |
|
| 970 | 970 | } elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) { |
| 971 | - $duration = $regs[1] . ' ' . $langs->trans('DurationDay'); |
|
| 971 | + $duration = $regs[1].' '.$langs->trans('DurationDay'); |
|
| 972 | 972 | } else { |
| 973 | 973 | $duration = $objp->duration; |
| 974 | 974 | } |
| 975 | - print '<td class="center">' . $duration . '</td>'; |
|
| 975 | + print '<td class="center">'.$duration.'</td>'; |
|
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | // Desired stock |
| 979 | - print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->desiredstockpse ? $desiredstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')) . '0') : $desiredstock).'</td>'; |
|
| 979 | + print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->desiredstockpse ? $desiredstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')).'0') : $desiredstock).'</td>'; |
|
| 980 | 980 | |
| 981 | 981 | // Limit stock for alert |
| 982 | - print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->seuil_stock_alertepse ? $alertstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')) . '0') : $alertstock).'</td>'; |
|
| 982 | + print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->seuil_stock_alertepse ? $alertstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')).'0') : $alertstock).'</td>'; |
|
| 983 | 983 | |
| 984 | 984 | // Current stock (all warehouses) |
| 985 | - print '<td class="right">' . $warning . $stock; |
|
| 986 | - print '<!-- stock returned by main sql is ' . $objp->stock_physique . ' -->'; |
|
| 985 | + print '<td class="right">'.$warning.$stock; |
|
| 986 | + print '<!-- stock returned by main sql is '.$objp->stock_physique.' -->'; |
|
| 987 | 987 | print '</td>'; |
| 988 | 988 | |
| 989 | 989 | // Current stock (warehouse selected only) |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | // Already ordered |
| 995 | - print '<td class="right"><a href="replenishorders.php?search_product=' . $prod->id . '">' . $ordered . '</a> ' . $picto . '</td>'; |
|
| 995 | + print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>'; |
|
| 996 | 996 | |
| 997 | 997 | // To order |
| 998 | 998 | $tobuy = ((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy); |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | |
| 1001 | 1001 | // Supplier |
| 1002 | 1002 | print '<td class="right">'; |
| 1003 | - print $form->select_product_fourn_price($prod->id, 'fourn' . $i, $fk_supplier); |
|
| 1003 | + print $form->select_product_fourn_price($prod->id, 'fourn'.$i, $fk_supplier); |
|
| 1004 | 1004 | print '</td>'; |
| 1005 | 1005 | |
| 1006 | 1006 | // Fields from hook |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { |
| 1022 | 1022 | $colspan++; |
| 1023 | 1023 | } |
| 1024 | - print '<tr><td colspan="' . $colspan . '">'; |
|
| 1024 | + print '<tr><td colspan="'.$colspan.'">'; |
|
| 1025 | 1025 | print '<span class="opacitymedium">'; |
| 1026 | 1026 | print $langs->trans("None"); |
| 1027 | 1027 | print '</span>'; |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | |
| 1042 | 1042 | |
| 1043 | 1043 | $value = $langs->trans("CreateOrders"); |
| 1044 | -print '<div class="center"><input type="submit" class="button" name="valid" value="' . $value . '"></div>'; |
|
| 1044 | +print '<div class="center"><input type="submit" class="button" name="valid" value="'.$value.'"></div>'; |
|
| 1045 | 1045 | |
| 1046 | 1046 | |
| 1047 | 1047 | print '</form>'; |
@@ -50,27 +50,27 @@ discard block |
||
| 50 | 50 | class Categorie extends CommonObject |
| 51 | 51 | { |
| 52 | 52 | // Categories types (we use string because we want to accept any modules/types in a future) |
| 53 | - const TYPE_PRODUCT = 'product'; |
|
| 53 | + const TYPE_PRODUCT = 'product'; |
|
| 54 | 54 | const TYPE_SUPPLIER = 'supplier'; |
| 55 | 55 | const TYPE_CUSTOMER = 'customer'; |
| 56 | - const TYPE_MEMBER = 'member'; |
|
| 56 | + const TYPE_MEMBER = 'member'; |
|
| 57 | 57 | const TYPE_CONTACT = 'contact'; |
| 58 | - const TYPE_USER = 'user'; |
|
| 58 | + const TYPE_USER = 'user'; |
|
| 59 | 59 | const TYPE_PROJECT = 'project'; |
| 60 | 60 | const TYPE_ACCOUNT = 'bank_account'; |
| 61 | 61 | const TYPE_BANK_LINE = 'bank_line'; |
| 62 | 62 | const TYPE_WAREHOUSE = 'warehouse'; |
| 63 | - const TYPE_ACTIONCOMM = 'actioncomm'; |
|
| 64 | - const TYPE_WEBSITE_PAGE = 'website_page'; |
|
| 65 | - const TYPE_TICKET = 'ticket'; |
|
| 66 | - const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement'; |
|
| 67 | - const TYPE_FICHINTER = 'fichinter'; |
|
| 68 | - const TYPE_ORDER = 'order'; |
|
| 69 | - const TYPE_INVOICE = 'invoice'; |
|
| 70 | - const TYPE_SUPPLIER_ORDER = 'supplier_order'; |
|
| 63 | + const TYPE_ACTIONCOMM = 'actioncomm'; |
|
| 64 | + const TYPE_WEBSITE_PAGE = 'website_page'; |
|
| 65 | + const TYPE_TICKET = 'ticket'; |
|
| 66 | + const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement'; |
|
| 67 | + const TYPE_FICHINTER = 'fichinter'; |
|
| 68 | + const TYPE_ORDER = 'order'; |
|
| 69 | + const TYPE_INVOICE = 'invoice'; |
|
| 70 | + const TYPE_SUPPLIER_ORDER = 'supplier_order'; |
|
| 71 | 71 | const TYPE_SUPPLIER_INVOICE = 'supplier_invoice'; |
| 72 | 72 | const TYPE_SUPPLIER_PROPOSAL = 'supplier_proposal'; |
| 73 | - const TYPE_PROPOSAL = 'propal'; |
|
| 73 | + const TYPE_PROPOSAL = 'propal'; |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | 'categorie_contact' => 'fk_categorie', |
| 758 | 758 | 'categorie_fournisseur' => 'fk_categorie', |
| 759 | 759 | 'categorie_knowledgemanagement' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('knowledgemanagement')), |
| 760 | - 'categorie_fichinter' => array('field' => 'fk_categorie', 'enabled' => false ), // not yet fully implemented (wait 22) isModEnabled('intervention')), |
|
| 760 | + 'categorie_fichinter' => array('field' => 'fk_categorie', 'enabled' => false), // not yet fully implemented (wait 22) isModEnabled('intervention')), |
|
| 761 | 761 | 'categorie_member' => 'fk_categorie', |
| 762 | 762 | 'categorie_user' => 'fk_categorie', |
| 763 | 763 | 'categorie_product' => 'fk_categorie', |
@@ -1365,14 +1365,14 @@ discard block |
||
| 1365 | 1365 | || preg_match('/'.$keyfilter3.'/', $fullpath) || preg_match('/'.$keyfilter4.'/', $fullpath)); |
| 1366 | 1366 | |
| 1367 | 1367 | if (($test && !$include) || (!$test && $include)) { |
| 1368 | - unset($this->cats[$key]); // @phpstan-ignore-line |
|
| 1368 | + unset($this->cats[$key]); // @phpstan-ignore-line |
|
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG); |
| 1374 | 1374 | |
| 1375 | - $this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel" |
|
| 1375 | + $this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel" |
|
| 1376 | 1376 | |
| 1377 | 1377 | return $this->cats; |
| 1378 | 1378 | } |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | $parents = $this->get_meres(); |
| 1631 | 1631 | if (is_array($parents)) { |
| 1632 | 1632 | foreach ($parents as $parent) { |
| 1633 | - $all_ways = $parent->get_all_ways(); // recursivity. TODO Add a protection for infinite loop |
|
| 1633 | + $all_ways = $parent->get_all_ways(); // recursivity. TODO Add a protection for infinite loop |
|
| 1634 | 1634 | foreach ($all_ways as $way) { |
| 1635 | 1635 | $w = $way; |
| 1636 | 1636 | $w[] = $this; |
@@ -1790,10 +1790,10 @@ discard block |
||
| 1790 | 1790 | */ |
| 1791 | 1791 | public function isAnyPhotoAvailable($sdir) |
| 1792 | 1792 | { |
| 1793 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 1794 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
|
| 1793 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 1794 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
| 1795 | 1795 | |
| 1796 | - $sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/"; |
|
| 1796 | + $sdir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/photos/"; |
|
| 1797 | 1797 | |
| 1798 | 1798 | $dir_osencoded = dol_osencode($sdir); |
| 1799 | 1799 | if (file_exists($dir_osencoded)) { |
@@ -1803,7 +1803,7 @@ discard block |
||
| 1803 | 1803 | if (!utf8_check($file)) { |
| 1804 | 1804 | $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
| 1805 | 1805 | } |
| 1806 | - if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) { |
|
| 1806 | + if (dol_is_file($sdir.$file) && image_format_supported($file) >= 0) { |
|
| 1807 | 1807 | return true; |
| 1808 | 1808 | } |
| 1809 | 1809 | } |
@@ -1926,7 +1926,7 @@ discard block |
||
| 1926 | 1926 | $result .= $linkend; |
| 1927 | 1927 | |
| 1928 | 1928 | global $action; |
| 1929 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1929 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1930 | 1930 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1931 | 1931 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1932 | 1932 | if ($reshook > 0) { |