@@ -80,20 +80,20 @@ |
||
80 | 80 | } |
81 | 81 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
82 | 82 | // Qty frozen |
83 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
83 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
84 | 84 | |
85 | 85 | // Disable stock change |
86 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
86 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
87 | 87 | |
88 | 88 | // Efficiency |
89 | - print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
89 | + print '<td class="linecolefficiency right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | // Service and workstations are active |
93 | 93 | if ($filtertype == 1 && isModEnabled('workstation')) { |
94 | 94 | // Workstation |
95 | 95 | if (isModEnabled('workstation')) { |
96 | - print '<td class="linecolworkstation">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
96 | + print '<td class="linecolworkstation">'.$form->textwithpicto($langs->trans('DefaultWorkstation'), '').'</td>'; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 |
@@ -146,18 +146,18 @@ |
||
146 | 146 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
147 | 147 | // Qty frozen |
148 | 148 | $coldisplay++; |
149 | - print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOSTINT('qty_frozen') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>'; |
|
149 | + print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOSTISSET("qty_frozen") ? (GETPOSTINT('qty_frozen') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')).'>'; |
|
150 | 150 | print '</td>'; |
151 | 151 | |
152 | 152 | // Disable stock change |
153 | 153 | $coldisplay++; |
154 | - print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOSTINT("disable_stock_change") ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">'; |
|
154 | + print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOSTISSET('disablestockchange') ? (GETPOSTINT("disable_stock_change") ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')).'">'; |
|
155 | 155 | print '</td>'; |
156 | 156 | |
157 | 157 | // Efficiency |
158 | 158 | $coldisplay++; |
159 | 159 | print '<td class="nobottom nowrap linecollost right">'; |
160 | - print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>'; |
|
160 | + print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>'; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | // Service and workstations are active |
@@ -85,27 +85,27 @@ discard block |
||
85 | 85 | print '</span></td>'; |
86 | 86 | } |
87 | 87 | } else { // Service |
88 | - print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
88 | + print '<td class="linecolunit right">'.$form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
89 | 89 | } |
90 | 90 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
91 | 91 | // Qty frozen |
92 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
92 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
93 | 93 | |
94 | 94 | // Disable stock change |
95 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
95 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
96 | 96 | |
97 | 97 | // Efficiency |
98 | - print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
98 | + print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // Service and workstations are active |
102 | 102 | if ($filtertype == 1 && isModEnabled('workstation')) { |
103 | - print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>'; |
|
103 | + print '<td class="linecolworkstation right">'.$form->textwithpicto($langs->trans('Workstation'), '').'</td>'; |
|
104 | 104 | } |
105 | 105 | // Cost |
106 | - print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>'; |
|
106 | + print '<td class="linecoltotalcost right">'.$form->textwithpicto($langs->trans('TotalCost'), '').'</td>'; |
|
107 | 107 | |
108 | - print '<td class="linecoledit" colspan="' . $colspan . '"> </td>'; |
|
108 | + print '<td class="linecoledit" colspan="'.$colspan.'"> </td>'; |
|
109 | 109 | print '</tr>'; |
110 | 110 | } |
111 | 111 | print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create').'">'; |
@@ -180,18 +180,18 @@ discard block |
||
180 | 180 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
181 | 181 | // Qty frozen |
182 | 182 | $coldisplay++; |
183 | - print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '') . '>'; |
|
183 | + print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '').'>'; |
|
184 | 184 | print '</td>'; |
185 | 185 | |
186 | 186 | // Disable stock change |
187 | 187 | $coldisplay++; |
188 | - print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '') . '">'; |
|
188 | + print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '').'">'; |
|
189 | 189 | print '</td>'; |
190 | 190 | |
191 | 191 | // Efficiency |
192 | 192 | $coldisplay++; |
193 | 193 | print '<td class="bordertop nobottom nowrap linecollost right">'; |
194 | - print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . ((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1) . '">'; |
|
194 | + print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1).'">'; |
|
195 | 195 | print '</td>'; |
196 | 196 | } |
197 | 197 | // Service and workstations are active |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | |
211 | 211 | |
212 | 212 | $coldisplay += $colspan; |
213 | -print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">'; |
|
214 | -print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">'; |
|
213 | +print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="'.$colspan.'">'; |
|
214 | +print '<input type="submit" class="button button-add small" name="addline" id="addline" value="'.$langs->trans('Add').'">'; |
|
215 | 215 | print '</td>'; |
216 | 216 | print '</tr>'; |
217 | 217 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public $price; |
145 | 145 | |
146 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
146 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
147 | 147 | |
148 | 148 | /** |
149 | 149 | * Selling price with tax |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public $price_ttc; |
154 | 154 | |
155 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
155 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
156 | 156 | |
157 | 157 | /** |
158 | 158 | * Minimum price net |
@@ -405,20 +405,20 @@ discard block |
||
405 | 405 | |
406 | 406 | //! Metric of products |
407 | 407 | public $weight; |
408 | - public $weight_units; // scale -3, 0, 3, 6 |
|
408 | + public $weight_units; // scale -3, 0, 3, 6 |
|
409 | 409 | public $length; |
410 | - public $length_units; // scale -3, 0, 3, 6 |
|
410 | + public $length_units; // scale -3, 0, 3, 6 |
|
411 | 411 | public $width; |
412 | - public $width_units; // scale -3, 0, 3, 6 |
|
412 | + public $width_units; // scale -3, 0, 3, 6 |
|
413 | 413 | public $height; |
414 | - public $height_units; // scale -3, 0, 3, 6 |
|
414 | + public $height_units; // scale -3, 0, 3, 6 |
|
415 | 415 | public $surface; |
416 | - public $surface_units; // scale -3, 0, 3, 6 |
|
416 | + public $surface_units; // scale -3, 0, 3, 6 |
|
417 | 417 | public $volume; |
418 | - public $volume_units; // scale -3, 0, 3, 6 |
|
418 | + public $volume_units; // scale -3, 0, 3, 6 |
|
419 | 419 | |
420 | 420 | public $net_measure; |
421 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
421 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
422 | 422 | |
423 | 423 | public $accountancy_code_sell; |
424 | 424 | public $accountancy_code_sell_intra; |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
621 | 621 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
622 | 622 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
623 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
623 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
624 | 624 | ); |
625 | 625 | |
626 | 626 | /** |
@@ -924,9 +924,9 @@ discard block |
||
924 | 924 | |
925 | 925 | // update accountancy for this entity |
926 | 926 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
927 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
927 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
928 | 928 | |
929 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
929 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
930 | 930 | $sql .= " fk_product"; |
931 | 931 | $sql .= ", entity"; |
932 | 932 | $sql .= ", accountancy_code_buy"; |
@@ -937,13 +937,13 @@ discard block |
||
937 | 937 | $sql .= ", accountancy_code_sell_export"; |
938 | 938 | $sql .= ") VALUES ("; |
939 | 939 | $sql .= $this->id; |
940 | - $sql .= ", " . $conf->entity; |
|
941 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
942 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
943 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
944 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
945 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
946 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
940 | + $sql .= ", ".$conf->entity; |
|
941 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
942 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
943 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
944 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
945 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
946 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
947 | 947 | $sql .= ")"; |
948 | 948 | $result = $this->db->query($sql); |
949 | 949 | if (!$result) { |
@@ -1323,12 +1323,12 @@ discard block |
||
1323 | 1323 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
1324 | 1324 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
1325 | 1325 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1326 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1327 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1328 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1329 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1330 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1331 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1326 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1327 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1328 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1329 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1330 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1331 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1332 | 1332 | } |
1333 | 1333 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
1334 | 1334 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1359,9 +1359,9 @@ discard block |
||
1359 | 1359 | |
1360 | 1360 | // update accountancy for this entity |
1361 | 1361 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1362 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1362 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1363 | 1363 | |
1364 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1364 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1365 | 1365 | $sql .= " fk_product"; |
1366 | 1366 | $sql .= ", entity"; |
1367 | 1367 | $sql .= ", accountancy_code_buy"; |
@@ -1372,13 +1372,13 @@ discard block |
||
1372 | 1372 | $sql .= ", accountancy_code_sell_export"; |
1373 | 1373 | $sql .= ") VALUES ("; |
1374 | 1374 | $sql .= $this->id; |
1375 | - $sql .= ", " . $conf->entity; |
|
1376 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1377 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1378 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1379 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1380 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1381 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1375 | + $sql .= ", ".$conf->entity; |
|
1376 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1377 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1378 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1379 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1380 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1381 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1382 | 1382 | $sql .= ")"; |
1383 | 1383 | $result = $this->db->query($sql); |
1384 | 1384 | if (!$result) { |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | $error++; |
1457 | 1457 | } else { |
1458 | 1458 | // to keep old entries with the new dir |
1459 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
1459 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
1460 | 1460 | $ecmfiles = new EcmFiles($this->db); |
1461 | 1461 | $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); |
1462 | 1462 | } |
@@ -1754,7 +1754,7 @@ discard block |
||
1754 | 1754 | } |
1755 | 1755 | } elseif (isset($this->multilangs[$key])) { |
1756 | 1756 | if (empty($this->multilangs["$key"]["label"])) { |
1757 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
1757 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
1758 | 1758 | return -1; |
1759 | 1759 | } |
1760 | 1760 | |
@@ -1949,7 +1949,7 @@ discard block |
||
1949 | 1949 | */ |
1950 | 1950 | private function getArrayForPriceCompare($level = 0) |
1951 | 1951 | { |
1952 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
1952 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
1953 | 1953 | |
1954 | 1954 | foreach ($testExit as $field) { |
1955 | 1955 | if (!isset($this->$field)) { |
@@ -2593,12 +2593,12 @@ discard block |
||
2593 | 2593 | |
2594 | 2594 | //For MultiCompany |
2595 | 2595 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2596 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2597 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2596 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2597 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2598 | 2598 | $visibleWarehousesEntities = $conf->entity; |
2599 | 2599 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
2600 | 2600 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
2601 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2601 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2602 | 2602 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
2603 | 2603 | $separatedEntityPMP = true; |
2604 | 2604 | } |
@@ -2606,7 +2606,7 @@ discard block |
||
2606 | 2606 | global $mc; |
2607 | 2607 | $separatedStock = true; |
2608 | 2608 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
2609 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
2609 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
2610 | 2610 | } |
2611 | 2611 | } |
2612 | 2612 | if ($separatedEntityPMP) { |
@@ -2624,10 +2624,10 @@ discard block |
||
2624 | 2624 | } |
2625 | 2625 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2626 | 2626 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
2627 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
2627 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
2628 | 2628 | } |
2629 | 2629 | if ($separatedStock) { |
2630 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2630 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2631 | 2631 | } |
2632 | 2632 | |
2633 | 2633 | if ($id) { |
@@ -2787,15 +2787,15 @@ discard block |
||
2787 | 2787 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
2788 | 2788 | $sql .= " AND price_level=".((int) $i); |
2789 | 2789 | $sql .= " AND fk_product = ".((int) $this->id); |
2790 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2791 | - $sql .= " LIMIT 1"; // Only the first one |
|
2790 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2791 | + $sql .= " LIMIT 1"; // Only the first one |
|
2792 | 2792 | $resql = $this->db->query($sql); |
2793 | 2793 | if ($resql) { |
2794 | 2794 | $result = $this->db->fetch_array($resql); |
2795 | 2795 | |
2796 | 2796 | $this->multiprices[$i] = $result ? $result["price"] : null; |
2797 | 2797 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
2798 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2798 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2799 | 2799 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
2800 | 2800 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
2801 | 2801 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3020,7 +3020,7 @@ discard block |
||
3020 | 3020 | $obj = $this->db->fetch_object($result); |
3021 | 3021 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
3022 | 3022 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
3023 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3023 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3024 | 3024 | } else { |
3025 | 3025 | $this->error = $this->db->error(); |
3026 | 3026 | $error++; |
@@ -4526,7 +4526,7 @@ discard block |
||
4526 | 4526 | //Addition of a product with the highest rank +1 |
4527 | 4527 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4528 | 4528 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")"; |
4529 | - if (! $this->db->query($sql)) { |
|
4529 | + if (!$this->db->query($sql)) { |
|
4530 | 4530 | dol_print_error($this->db); |
4531 | 4531 | return -1; |
4532 | 4532 | } else { |
@@ -4647,7 +4647,7 @@ discard block |
||
4647 | 4647 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
4648 | 4648 | $sql .= " SET rang = ".((int) $cpt); |
4649 | 4649 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
4650 | - if (! $this->db->query($sql)) { |
|
4650 | + if (!$this->db->query($sql)) { |
|
4651 | 4651 | dol_print_error($this->db); |
4652 | 4652 | return -1; |
4653 | 4653 | } |
@@ -5083,7 +5083,7 @@ discard block |
||
5083 | 5083 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
5084 | 5084 | foreach ($this->sousprods as $prod_name => $desc_product) { |
5085 | 5085 | if (is_array($desc_product)) { |
5086 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5086 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5087 | 5087 | } |
5088 | 5088 | } |
5089 | 5089 | } |
@@ -5240,7 +5240,7 @@ discard block |
||
5240 | 5240 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
5241 | 5241 | $sql .= " ORDER BY pa.rang"; |
5242 | 5242 | |
5243 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5243 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5244 | 5244 | |
5245 | 5245 | if ($level == 1) { |
5246 | 5246 | $alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately |
@@ -5331,7 +5331,7 @@ discard block |
||
5331 | 5331 | if (!empty($this->entity)) { |
5332 | 5332 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); |
5333 | 5333 | if ($this->nbphoto > 0) { |
5334 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
5334 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
5335 | 5335 | } |
5336 | 5336 | } |
5337 | 5337 | |
@@ -5341,7 +5341,7 @@ discard block |
||
5341 | 5341 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
5342 | 5342 | } |
5343 | 5343 | if (isset($this->status) && isset($this->status_buy)) { |
5344 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
5344 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
5345 | 5345 | } |
5346 | 5346 | |
5347 | 5347 | if (!empty($this->ref)) { |
@@ -5389,7 +5389,7 @@ discard block |
||
5389 | 5389 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
5390 | 5390 | } |
5391 | 5391 | if ($labelsurfacevolume) { |
5392 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
5392 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
5393 | 5393 | } |
5394 | 5394 | } |
5395 | 5395 | if ($this->isService() && !empty($this->duration_value)) { |
@@ -5431,9 +5431,9 @@ discard block |
||
5431 | 5431 | } |
5432 | 5432 | // show categories for this record only in ajax to not overload lists |
5433 | 5433 | if (isModEnabled('category') && !$nofetch) { |
5434 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5434 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5435 | 5435 | $form = new Form($this->db); |
5436 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5436 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5437 | 5437 | } |
5438 | 5438 | |
5439 | 5439 | return $datas; |
@@ -5954,7 +5954,7 @@ discard block |
||
5954 | 5954 | if (isModEnabled("supplier_order")) { |
5955 | 5955 | $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); |
5956 | 5956 | if (isset($includedraftpoforvirtual)) { |
5957 | - $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
5957 | + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
5958 | 5958 | } |
5959 | 5959 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
5960 | 5960 | if ($result < 0) { |
@@ -6386,7 +6386,7 @@ discard block |
||
6386 | 6386 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
6387 | 6387 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
6388 | 6388 | foreach ($dirsociete as $dirroot) { |
6389 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6389 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6390 | 6390 | if ($res) { |
6391 | 6391 | break; |
6392 | 6392 | } |
@@ -6714,7 +6714,7 @@ discard block |
||
6714 | 6714 | */ |
6715 | 6715 | public function getKanbanView($option = '', $arraydata = null) |
6716 | 6716 | { |
6717 | - global $langs,$conf; |
|
6717 | + global $langs, $conf; |
|
6718 | 6718 | |
6719 | 6719 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
6720 | 6720 |