@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | $this->libelle = $objp->product_label; // deprecated |
422 | 422 | $this->product_label = $objp->product_label; |
423 | 423 | $this->product_desc = $objp->product_desc; |
424 | - $this->fk_unit = $objp->fk_unit; |
|
424 | + $this->fk_unit = $objp->fk_unit; |
|
425 | 425 | |
426 | - $this->packaging = $objp->packaging; |
|
426 | + $this->packaging = $objp->packaging; |
|
427 | 427 | |
428 | 428 | $this->date_start = $this->db->jdate($objp->date_start); |
429 | 429 | $this->date_end = $this->db->jdate($objp->date_end); |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | // End call triggers |
642 | 642 | |
643 | 643 | if (!$error) { |
644 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "propaldet WHERE rowid = " . ((int) $this->rowid); |
|
644 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid); |
|
645 | 645 | dol_syslog("PropaleLigne::delete", LOG_DEBUG); |
646 | 646 | if ($this->db->query($sql)) { |
647 | 647 | // Remove extrafields |
@@ -650,11 +650,11 @@ discard block |
||
650 | 650 | $result = $this->deleteExtraFields(); |
651 | 651 | if ($result < 0) { |
652 | 652 | $error++; |
653 | - dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR); |
|
653 | + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | } else { |
657 | - $this->error = $this->db->error() . " sql=" . $sql; |
|
657 | + $this->error = $this->db->error()." sql=".$sql; |
|
658 | 658 | $error++; |
659 | 659 | } |
660 | 660 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $objp = $this->db->fetch_object($result); |
185 | 185 | |
186 | 186 | if (!$objp) { |
187 | - $this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql; |
|
187 | + $this->error = 'OrderLine with id '.$rowid.' not found sql='.$sql; |
|
188 | 188 | return 0; |
189 | 189 | } |
190 | 190 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $this->product_desc = $objp->product_desc; |
230 | 230 | $this->product_tobatch = $objp->product_tobatch; |
231 | 231 | $this->fk_unit = $objp->fk_unit; |
232 | - $this->packaging = $objp->packaging; |
|
232 | + $this->packaging = $objp->packaging; |
|
233 | 233 | |
234 | 234 | $this->date_start = $this->db->jdate($objp->date_start); |
235 | 235 | $this->date_end = $this->db->jdate($objp->date_end); |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | // check if order line is not in a shipment line before deleting |
273 | 273 | $sqlCheckShipmentLine = "SELECT"; |
274 | 274 | $sqlCheckShipmentLine .= " ed.rowid"; |
275 | - $sqlCheckShipmentLine .= " FROM " . MAIN_DB_PREFIX . "expeditiondet ed"; |
|
276 | - $sqlCheckShipmentLine .= " WHERE ed.fk_elementdet = " . ((int) $this->id); |
|
275 | + $sqlCheckShipmentLine .= " FROM ".MAIN_DB_PREFIX."expeditiondet ed"; |
|
276 | + $sqlCheckShipmentLine .= " WHERE ed.fk_elementdet = ".((int) $this->id); |
|
277 | 277 | |
278 | 278 | $resqlCheckShipmentLine = $this->db->query($sqlCheckShipmentLine); |
279 | 279 | if (!$resqlCheckShipmentLine) { |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | if ($num > 0) { |
287 | 287 | $error++; |
288 | 288 | $objCheckShipmentLine = $this->db->fetch_object($resqlCheckShipmentLine); |
289 | - $this->error = $langs->trans('ErrorRecordAlreadyExists') . ' : ' . $langs->trans('ShipmentLine') . ' ' . $objCheckShipmentLine->rowid; |
|
289 | + $this->error = $langs->trans('ErrorRecordAlreadyExists').' : '.$langs->trans('ShipmentLine').' '.$objCheckShipmentLine->rowid; |
|
290 | 290 | $this->errors[] = $this->error; |
291 | 291 | } |
292 | 292 | $this->db->free($resqlCheckShipmentLine); |
293 | 293 | } |
294 | 294 | if ($error) { |
295 | - dol_syslog(__METHOD__ . 'Error ; ' . $this->error, LOG_ERR); |
|
295 | + dol_syslog(__METHOD__.'Error ; '.$this->error, LOG_ERR); |
|
296 | 296 | return -1; |
297 | 297 | } |
298 | 298 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | if (!$error) { |
311 | - $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . "commandedet WHERE rowid = " . ((int) $this->id); |
|
311 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid = ".((int) $this->id); |
|
312 | 312 | |
313 | 313 | dol_syslog("OrderLine::delete", LOG_DEBUG); |
314 | 314 | $resql = $this->db->query($sql); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $result = $this->deleteExtraFields(); |
324 | 324 | if ($result < 0) { |
325 | 325 | $error++; |
326 | - dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR); |
|
326 | + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); |
|
327 | 327 | } |
328 | 328 | } |
329 | 329 | |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | } |
334 | 334 | |
335 | 335 | foreach ($this->errors as $errmsg) { |
336 | - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); |
|
337 | - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); |
|
336 | + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); |
|
337 | + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); |
|
338 | 338 | } |
339 | 339 | $this->db->rollback(); |
340 | 340 | return -1 * $error; |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | /** |
382 | 382 | * Shipment on process |
383 | 383 | */ |
384 | - const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
384 | + const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
385 | 385 | |
386 | 386 | /** |
387 | 387 | * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. |
@@ -397,12 +397,12 @@ discard block |
||
397 | 397 | /* |
398 | 398 | * No signature |
399 | 399 | */ |
400 | - const STATUS_NO_SIGNATURE = 0; |
|
400 | + const STATUS_NO_SIGNATURE = 0; |
|
401 | 401 | |
402 | 402 | /* |
403 | 403 | * Signed by sender |
404 | 404 | */ |
405 | - const STATUS_SIGNED_SENDER = 1; |
|
405 | + const STATUS_SIGNED_SENDER = 1; |
|
406 | 406 | |
407 | 407 | /* |
408 | 408 | * Signed by receiver |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | /* |
413 | 413 | * Signed by all |
414 | 414 | */ |
415 | - const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
415 | + const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
416 | 416 | |
417 | 417 | |
418 | 418 | /** |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | if (getDolGlobalString('COMMANDE_ADDON')) { |
446 | 446 | $mybool = false; |
447 | 447 | |
448 | - $file = getDolGlobalString('COMMANDE_ADDON') . ".php"; |
|
448 | + $file = getDolGlobalString('COMMANDE_ADDON').".php"; |
|
449 | 449 | $classname = getDolGlobalString('COMMANDE_ADDON'); |
450 | 450 | |
451 | 451 | // Include file with class |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | // Set new ref and current status |
632 | 632 | if (!$error) { |
633 | 633 | $this->ref = $num; |
634 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
634 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
635 | 635 | $this->status = self::STATUS_VALIDATED; |
636 | 636 | } |
637 | 637 | |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | if ($objsoc->fetch($socid) > 0) { |
1256 | 1256 | $this->socid = $objsoc->id; |
1257 | 1257 | $this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); |
1258 | - $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0); |
|
1258 | + $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0); |
|
1259 | 1259 | $this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); |
1260 | 1260 | $this->fk_project = 0; |
1261 | 1261 | $this->fk_delivery_address = 0; |
@@ -1346,8 +1346,8 @@ discard block |
||
1346 | 1346 | { |
1347 | 1347 | global $conf, $hookmanager; |
1348 | 1348 | |
1349 | - require_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
1350 | - require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
1349 | + require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
1350 | + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
1351 | 1351 | |
1352 | 1352 | $error = 0; |
1353 | 1353 | |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | $line->fk_parent_line = $object->lines[$i]->fk_parent_line; |
1380 | 1380 | $line->fk_unit = $object->lines[$i]->fk_unit; |
1381 | 1381 | |
1382 | - $line->date_start = $object->lines[$i]->date_start; |
|
1382 | + $line->date_start = $object->lines[$i]->date_start; |
|
1383 | 1383 | $line->date_end = $object->lines[$i]->date_end; |
1384 | 1384 | |
1385 | 1385 | $line->fk_fournprice = $object->lines[$i]->fk_fournprice; |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | $this->line->date_end = $date_end; |
1735 | 1735 | |
1736 | 1736 | $this->line->fk_fournprice = $fk_fournprice; |
1737 | - $this->line->pa_ht = $pa_ht; // Can be '' when not defined or 0 if defined to 0 or a price value |
|
1737 | + $this->line->pa_ht = $pa_ht; // Can be '' when not defined or 0 if defined to 0 or a price value |
|
1738 | 1738 | |
1739 | 1739 | // Multicurrency |
1740 | 1740 | $this->line->fk_multicurrency = $this->fk_multicurrency; |
@@ -2205,7 +2205,7 @@ discard block |
||
2205 | 2205 | $line->weight_units = $objp->weight_units; |
2206 | 2206 | $line->volume = $objp->volume; |
2207 | 2207 | $line->volume_units = $objp->volume_units; |
2208 | - $line->packaging = $objp->packaging; |
|
2208 | + $line->packaging = $objp->packaging; |
|
2209 | 2209 | |
2210 | 2210 | $line->date_start = $this->db->jdate($objp->date_start); |
2211 | 2211 | $line->date_end = $this->db->jdate($objp->date_end); |
@@ -3528,15 +3528,15 @@ discard block |
||
3528 | 3528 | //$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0"; |
3529 | 3529 | if ($mode == 'toship') { |
3530 | 3530 | // An order to ship is an open order (validated or in progress) |
3531 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ")"; |
|
3531 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")"; |
|
3532 | 3532 | } |
3533 | 3533 | if ($mode == 'tobill') { |
3534 | 3534 | // An order to bill is an order not already billed |
3535 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ", " . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3535 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.", ".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3536 | 3536 | } |
3537 | 3537 | if ($mode == 'shippedtobill') { |
3538 | 3538 | // An order shipped and to bill is a delivered order not already billed |
3539 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3539 | + $sql .= " AND c.fk_statut IN (".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3540 | 3540 | } |
3541 | 3541 | if ($user->socid) { |
3542 | 3542 | $sql .= " AND c.fk_soc = ".((int) $user->socid); |
@@ -3865,7 +3865,7 @@ discard block |
||
3865 | 3865 | } |
3866 | 3866 | |
3867 | 3867 | global $action; |
3868 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
3868 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
3869 | 3869 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
3870 | 3870 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
3871 | 3871 | if ($reshook > 0) { |
@@ -3973,7 +3973,7 @@ discard block |
||
3973 | 3973 | $this->status = $this::STATUS_DRAFT; |
3974 | 3974 | |
3975 | 3975 | // Lines |
3976 | - $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) |
|
3976 | + $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) |
|
3977 | 3977 | $xnbp = 0; |
3978 | 3978 | |
3979 | 3979 | while ($xnbp < $nbp) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $objp = $this->db->fetch_object($result); |
227 | 227 | |
228 | 228 | if (!$objp) { |
229 | - $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; |
|
229 | + $this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql; |
|
230 | 230 | return 0; |
231 | 231 | } |
232 | 232 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $this->total_localtax1 = $objp->total_localtax1; |
258 | 258 | $this->total_localtax2 = $objp->total_localtax2; |
259 | 259 | $this->total_ttc = $objp->total_ttc; |
260 | - $this->fk_code_ventilation = $objp->fk_code_ventilation; |
|
260 | + $this->fk_code_ventilation = $objp->fk_code_ventilation; |
|
261 | 261 | $this->rang = $objp->rang; |
262 | 262 | $this->fk_fournprice = $objp->fk_fournprice; |
263 | 263 | $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $this->multicurrency_total_tva = $objp->multicurrency_total_tva; |
284 | 284 | $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; |
285 | 285 | |
286 | - $this->packaging = $objp->packaging; |
|
286 | + $this->packaging = $objp->packaging; |
|
287 | 287 | |
288 | 288 | $this->fetch_optionals(); |
289 | 289 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | $sql .= ", date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null"); |
652 | 652 | $sql .= ", product_type=".$this->product_type; |
653 | 653 | $sql .= ", info_bits='".$this->db->escape($this->info_bits)."'"; |
654 | - $sql .= ", special_code=" . (int) $this->special_code; |
|
654 | + $sql .= ", special_code=".(int) $this->special_code; |
|
655 | 655 | if (empty($this->skip_update_total)) { |
656 | 656 | $sql .= ", total_ht=".price2num($this->total_ht); |
657 | 657 | $sql .= ", total_tva=".price2num($this->total_tva); |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | // General $Variables |
93 | -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
93 | +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
94 | 94 | $ref = GETPOST('ref', 'alpha'); |
95 | 95 | $socid = GETPOSTINT('socid'); |
96 | 96 | $action = GETPOST('action', 'aZ09'); |
97 | 97 | $confirm = GETPOST('confirm', 'alpha'); |
98 | 98 | $cancel = GETPOST('cancel', 'alpha'); |
99 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
100 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
99 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
100 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
101 | 101 | $lineid = GETPOSTINT('lineid'); |
102 | 102 | $userid = GETPOSTINT('userid'); |
103 | 103 | $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | setEventMessages('', $warningMsgLineList, 'warnings'); |
267 | 267 | } |
268 | 268 | |
269 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); |
|
269 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); |
|
270 | 270 | exit(); |
271 | 271 | } else { |
272 | 272 | $langs->load("errors"); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | // Validation |
358 | 358 | $object->fetch($id); |
359 | 359 | |
360 | - if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
360 | + if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
361 | 361 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
362 | 362 | ) { |
363 | 363 | $object->date = dol_now(); |
@@ -892,27 +892,27 @@ discard block |
||
892 | 892 | $keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); |
893 | 893 | |
894 | 894 | if (!isset($amount_ht[$keyforvatrate])) { |
895 | - $amount_ht[$keyforvatrate]=0; |
|
895 | + $amount_ht[$keyforvatrate] = 0; |
|
896 | 896 | } |
897 | 897 | $amount_ht[$keyforvatrate] += $line->total_ht; |
898 | 898 | if (!isset($amount_tva[$keyforvatrate])) { |
899 | - $amount_tva[$keyforvatrate]=0; |
|
899 | + $amount_tva[$keyforvatrate] = 0; |
|
900 | 900 | } |
901 | 901 | $amount_tva[$keyforvatrate] += $line->total_tva; |
902 | 902 | if (!isset($amount_ttc[$keyforvatrate])) { |
903 | - $amount_ttc[$keyforvatrate]=0; |
|
903 | + $amount_ttc[$keyforvatrate] = 0; |
|
904 | 904 | } |
905 | 905 | $amount_ttc[$keyforvatrate] += $line->total_ttc; |
906 | 906 | if (!isset($multicurrency_amount_ht[$keyforvatrate])) { |
907 | - $multicurrency_amount_ht[$keyforvatrate]=0; |
|
907 | + $multicurrency_amount_ht[$keyforvatrate] = 0; |
|
908 | 908 | } |
909 | 909 | $multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht; |
910 | 910 | if (!isset($multicurrency_amount_tva[$keyforvatrate])) { |
911 | - $multicurrency_amount_tva[$keyforvatrate]=0; |
|
911 | + $multicurrency_amount_tva[$keyforvatrate] = 0; |
|
912 | 912 | } |
913 | 913 | $multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva; |
914 | 914 | if (!isset($multicurrency_amount_ttc[$keyforvatrate])) { |
915 | - $multicurrency_amount_ttc[$keyforvatrate]=0; |
|
915 | + $multicurrency_amount_ttc[$keyforvatrate] = 0; |
|
916 | 916 | } |
917 | 917 | $multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc; |
918 | 918 | $i++; |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $error++; |
1085 | 1085 | } |
1086 | 1086 | |
1087 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
1087 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
1088 | 1088 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
1089 | 1089 | |
1090 | 1090 | // Replacement invoice |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
1117 | 1117 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
1118 | 1118 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
1119 | - $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
1119 | + $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
1120 | 1120 | $object->fk_project = GETPOSTINT('projectid'); |
1121 | 1121 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
1122 | 1122 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
@@ -1177,9 +1177,9 @@ discard block |
||
1177 | 1177 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
1178 | 1178 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
1179 | 1179 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
1180 | - $object->model_pdf = GETPOST('model'); |
|
1180 | + $object->model_pdf = GETPOST('model'); |
|
1181 | 1181 | $object->fk_project = GETPOSTINT('projectid'); |
1182 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
1182 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
1183 | 1183 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
1184 | 1184 | $object->fk_account = GETPOSTINT('fk_account'); |
1185 | 1185 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1501,7 +1501,7 @@ discard block |
||
1501 | 1501 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
1502 | 1502 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
1503 | 1503 | $object->ref_client = GETPOST('ref_client'); |
1504 | - $object->ref_customer = GETPOST('ref_client'); |
|
1504 | + $object->ref_customer = GETPOST('ref_client'); |
|
1505 | 1505 | $object->model_pdf = GETPOST('model'); |
1506 | 1506 | $object->fk_project = GETPOSTINT('projectid'); |
1507 | 1507 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -1565,7 +1565,7 @@ discard block |
||
1565 | 1565 | $element = $subelement = 'expedition'; |
1566 | 1566 | } |
1567 | 1567 | |
1568 | - $object->origin = $origin; // deprecated |
|
1568 | + $object->origin = $origin; // deprecated |
|
1569 | 1569 | $object->origin_type = $origin; |
1570 | 1570 | $object->origin_id = $originid; |
1571 | 1571 | |
@@ -1600,7 +1600,7 @@ discard block |
||
1600 | 1600 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines"); |
1601 | 1601 | $result = $srcobject->fetch($object->origin_id); |
1602 | 1602 | |
1603 | - $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
1603 | + $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
1604 | 1604 | // If deposit invoice - down payment with 1 line (fixed amount or percent) |
1605 | 1605 | if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) { |
1606 | 1606 | // Define the array $amountdeposit |
@@ -2003,7 +2003,7 @@ discard block |
||
2003 | 2003 | if (!empty($origin) && !empty($originid)) { |
2004 | 2004 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
2005 | 2005 | |
2006 | - $object->origin = $origin; // deprecated |
|
2006 | + $object->origin = $origin; // deprecated |
|
2007 | 2007 | $object->origin_type = $origin; |
2008 | 2008 | $object->origin_id = $originid; |
2009 | 2009 | |
@@ -2029,7 +2029,7 @@ discard block |
||
2029 | 2029 | $line->fk_prev_id = $line->id; |
2030 | 2030 | $line->fetch_optionals(); |
2031 | 2031 | if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { |
2032 | - $line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note |
|
2032 | + $line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note |
|
2033 | 2033 | } else { |
2034 | 2034 | $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note |
2035 | 2035 | } |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | } else { |
2140 | 2140 | $db->rollback(); |
2141 | 2141 | $action = 'create'; |
2142 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
2142 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
2143 | 2143 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
2144 | 2144 | setEventMessages($object->error, $object->errors, 'errors'); |
2145 | 2145 | } |
@@ -2697,7 +2697,7 @@ discard block |
||
2697 | 2697 | // Define special_code for special lines |
2698 | 2698 | $special_code = GETPOSTINT('special_code'); |
2699 | 2699 | if ($special_code == 3) { |
2700 | - $special_code = 0; // Options should not exists on invoices |
|
2700 | + $special_code = 0; // Options should not exists on invoices |
|
2701 | 2701 | } |
2702 | 2702 | |
2703 | 2703 | $line = new FactureLigne($db); |
@@ -3261,7 +3261,7 @@ discard block |
||
3261 | 3261 | $fk_account = GETPOSTINT('fk_account'); |
3262 | 3262 | |
3263 | 3263 | // Load objectsrc |
3264 | - $objectsrc = null; // Initialise |
|
3264 | + $objectsrc = null; // Initialise |
|
3265 | 3265 | //$remise_absolue = 0; |
3266 | 3266 | if (!empty($origin) && !empty($originid)) { |
3267 | 3267 | // Parse element/subelement (ex: project_task) |
@@ -3272,7 +3272,7 @@ discard block |
||
3272 | 3272 | $subelement = $regs[2]; |
3273 | 3273 | } |
3274 | 3274 | |
3275 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
3275 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
3276 | 3276 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
3277 | 3277 | |
3278 | 3278 | if ($element == 'project') { |
@@ -3346,8 +3346,8 @@ discard block |
||
3346 | 3346 | $fk_account = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); |
3347 | 3347 | |
3348 | 3348 | if (isModEnabled('multicurrency')) { |
3349 | - $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
3350 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
3349 | + $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
3350 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
3351 | 3351 | } |
3352 | 3352 | |
3353 | 3353 | //Replicate extrafields |
@@ -3440,7 +3440,7 @@ discard block |
||
3440 | 3440 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
3441 | 3441 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
3442 | 3442 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
3443 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
3443 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
3444 | 3444 | if ($soc->id > 0) { |
3445 | 3445 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
3446 | 3446 | } |
@@ -3961,8 +3961,8 @@ discard block |
||
3961 | 3961 | if ($socid > 0) { |
3962 | 3962 | print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">'; |
3963 | 3963 | |
3964 | - $thirdparty = $soc; // used by object_discounts.tpl.php |
|
3965 | - $discount_type = 0; // used by object_discounts.tpl.php |
|
3964 | + $thirdparty = $soc; // used by object_discounts.tpl.php |
|
3965 | + $discount_type = 0; // used by object_discounts.tpl.php |
|
3966 | 3966 | $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); |
3967 | 3967 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; |
3968 | 3968 | |
@@ -4003,7 +4003,7 @@ discard block |
||
4003 | 4003 | if (empty($retained_warranty)) { |
4004 | 4004 | if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value |
4005 | 4005 | // Facture->retained_warranty (does not exist on Expedition) |
4006 | - $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
4006 | + $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
4007 | 4007 | } |
4008 | 4008 | } |
4009 | 4009 | $retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT'); |
@@ -4482,7 +4482,7 @@ discard block |
||
4482 | 4482 | $nbMandated = 0; |
4483 | 4483 | foreach ($object->lines as $line) { |
4484 | 4484 | $res = $line->fetch_product(); |
4485 | - if ($res > 0) { |
|
4485 | + if ($res > 0) { |
|
4486 | 4486 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
4487 | 4487 | $nbMandated++; |
4488 | 4488 | break; |
@@ -4694,7 +4694,7 @@ discard block |
||
4694 | 4694 | } |
4695 | 4695 | // Ref customer |
4696 | 4696 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1); |
4697 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
4697 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
4698 | 4698 | // Thirdparty |
4699 | 4699 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
4700 | 4700 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -5088,45 +5088,45 @@ discard block |
||
5088 | 5088 | } |
5089 | 5089 | print '<tr>'; |
5090 | 5090 | // Amount HT |
5091 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
5092 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
5091 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
5092 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
5093 | 5093 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
5094 | 5094 | // Multicurrency Amount HT |
5095 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
5095 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
5096 | 5096 | } |
5097 | 5097 | print '</tr>'; |
5098 | 5098 | |
5099 | 5099 | print '<tr>'; |
5100 | 5100 | // Amount VAT |
5101 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
5102 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
5101 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
5102 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
5103 | 5103 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
5104 | 5104 | // Multicurrency Amount VAT |
5105 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
5105 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
5106 | 5106 | } |
5107 | 5107 | print '</tr>'; |
5108 | 5108 | |
5109 | 5109 | // Amount Local Taxes |
5110 | 5110 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
5111 | 5111 | print '<tr>'; |
5112 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
5113 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
5112 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
5113 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
5114 | 5114 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
5115 | 5115 | $object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
5116 | 5116 | |
5117 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
5117 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
5118 | 5118 | } |
5119 | 5119 | print '</tr>'; |
5120 | 5120 | } |
5121 | 5121 | |
5122 | 5122 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
5123 | 5123 | print '<tr>'; |
5124 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
5125 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
5124 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
5125 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
5126 | 5126 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
5127 | 5127 | $object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
5128 | 5128 | |
5129 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
5129 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
5130 | 5130 | } |
5131 | 5131 | print '</tr>'; |
5132 | 5132 | } |
@@ -5186,11 +5186,11 @@ discard block |
||
5186 | 5186 | |
5187 | 5187 | print '<tr>'; |
5188 | 5188 | // Amount TTC |
5189 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
5190 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
5189 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
5190 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
5191 | 5191 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
5192 | 5192 | // Multicurrency Amount TTC |
5193 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
5193 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
5194 | 5194 | } |
5195 | 5195 | print '</tr>'; |
5196 | 5196 | |
@@ -5861,7 +5861,7 @@ discard block |
||
5861 | 5861 | $langs->load("contracts"); |
5862 | 5862 | |
5863 | 5863 | if ($usercancreatecontract) { |
5864 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
5864 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
5865 | 5865 | } |
5866 | 5866 | } |
5867 | 5867 | } |
@@ -6087,7 +6087,7 @@ discard block |
||
6087 | 6087 | if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) |
6088 | 6088 | $enableDelete = false; |
6089 | 6089 | $deleteHref = '#'; |
6090 | - if ($isErasable > 0 && ! $objectidnext) { |
|
6090 | + if ($isErasable > 0 && !$objectidnext) { |
|
6091 | 6091 | $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); |
6092 | 6092 | $enableDelete = true; |
6093 | 6093 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @var string |
152 | 152 | */ |
153 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
153 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
154 | 154 | |
155 | 155 | /** |
156 | 156 | * Selling price with tax |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @var string |
164 | 164 | */ |
165 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
165 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
166 | 166 | |
167 | 167 | /** |
168 | 168 | * Minimum price net |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | /** |
512 | 512 | * @var int|string |
513 | 513 | */ |
514 | - public $weight_units; // scale -3, 0, 3, 6 |
|
514 | + public $weight_units; // scale -3, 0, 3, 6 |
|
515 | 515 | /** |
516 | 516 | * @var float|string |
517 | 517 | */ |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * @var int|string |
521 | 521 | */ |
522 | - public $length_units; // scale -3, 0, 3, 6 |
|
522 | + public $length_units; // scale -3, 0, 3, 6 |
|
523 | 523 | /** |
524 | 524 | * @var float|string |
525 | 525 | */ |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | /** |
528 | 528 | * @var int|string |
529 | 529 | */ |
530 | - public $width_units; // scale -3, 0, 3, 6 |
|
530 | + public $width_units; // scale -3, 0, 3, 6 |
|
531 | 531 | /** |
532 | 532 | * @var float|string|null |
533 | 533 | */ |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | /** |
536 | 536 | * @var int|string|null |
537 | 537 | */ |
538 | - public $height_units; // scale -3, 0, 3, 6 |
|
538 | + public $height_units; // scale -3, 0, 3, 6 |
|
539 | 539 | /** |
540 | 540 | * @var float|string|null |
541 | 541 | */ |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | /** |
544 | 544 | * @var int|string|null |
545 | 545 | */ |
546 | - public $surface_units; // scale -3, 0, 3, 6 |
|
546 | + public $surface_units; // scale -3, 0, 3, 6 |
|
547 | 547 | /** |
548 | 548 | * @var float|string|null |
549 | 549 | */ |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | /** |
552 | 552 | * @var int|string|null |
553 | 553 | */ |
554 | - public $volume_units; // scale -3, 0, 3, 6 |
|
554 | + public $volume_units; // scale -3, 0, 3, 6 |
|
555 | 555 | |
556 | 556 | /** |
557 | 557 | * @var float|string|null |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | /** |
561 | 561 | * @var ?string |
562 | 562 | */ |
563 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
563 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
564 | 564 | |
565 | 565 | /** |
566 | 566 | * @var string |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
876 | 876 | //'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')), |
877 | 877 | //'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')), |
878 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
878 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
879 | 879 | ); |
880 | 880 | |
881 | 881 | /** |
@@ -1179,9 +1179,9 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | // update accountancy for this entity |
1181 | 1181 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1182 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1182 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1183 | 1183 | |
1184 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1184 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1185 | 1185 | $sql .= " fk_product"; |
1186 | 1186 | $sql .= ", entity"; |
1187 | 1187 | $sql .= ", accountancy_code_buy"; |
@@ -1192,13 +1192,13 @@ discard block |
||
1192 | 1192 | $sql .= ", accountancy_code_sell_export"; |
1193 | 1193 | $sql .= ") VALUES ("; |
1194 | 1194 | $sql .= $this->id; |
1195 | - $sql .= ", " . ((int) $conf->entity); |
|
1196 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1197 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1198 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1199 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1200 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1201 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1195 | + $sql .= ", ".((int) $conf->entity); |
|
1196 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1197 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1198 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1199 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1200 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1201 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1202 | 1202 | $sql .= ")"; |
1203 | 1203 | $result = $this->db->query($sql); |
1204 | 1204 | if (!$result) { |
@@ -1582,12 +1582,12 @@ discard block |
||
1582 | 1582 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
1583 | 1583 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
1584 | 1584 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1585 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1586 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1587 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1588 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1589 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1590 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1585 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1586 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1587 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1588 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1589 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1590 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1591 | 1591 | } |
1592 | 1592 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
1593 | 1593 | $sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null'); |
@@ -1620,9 +1620,9 @@ discard block |
||
1620 | 1620 | |
1621 | 1621 | // update accountancy for this entity |
1622 | 1622 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1623 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1623 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1624 | 1624 | |
1625 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1625 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1626 | 1626 | $sql .= " fk_product"; |
1627 | 1627 | $sql .= ", entity"; |
1628 | 1628 | $sql .= ", accountancy_code_buy"; |
@@ -1633,13 +1633,13 @@ discard block |
||
1633 | 1633 | $sql .= ", accountancy_code_sell_export"; |
1634 | 1634 | $sql .= ") VALUES ("; |
1635 | 1635 | $sql .= ((int) $this->id); |
1636 | - $sql .= ", " . ((int) $conf->entity); |
|
1637 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1638 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1639 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1640 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1641 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1642 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1636 | + $sql .= ", ".((int) $conf->entity); |
|
1637 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1638 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1639 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1640 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1641 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1642 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1643 | 1643 | $sql .= ")"; |
1644 | 1644 | $result = $this->db->query($sql); |
1645 | 1645 | if (!$result) { |
@@ -1717,7 +1717,7 @@ discard block |
||
1717 | 1717 | $error++; |
1718 | 1718 | } else { |
1719 | 1719 | // to keep old entries with the new dir |
1720 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
1720 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
1721 | 1721 | $ecmfiles = new EcmFiles($this->db); |
1722 | 1722 | $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); |
1723 | 1723 | } |
@@ -2015,7 +2015,7 @@ discard block |
||
2015 | 2015 | } |
2016 | 2016 | } elseif (isset($this->multilangs[$key])) { |
2017 | 2017 | if (empty($this->multilangs[$key]["label"])) { |
2018 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2018 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2019 | 2019 | return -1; |
2020 | 2020 | } |
2021 | 2021 | |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | */ |
2213 | 2213 | private function getArrayForPriceCompare($level = 0) |
2214 | 2214 | { |
2215 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
2215 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
2216 | 2216 | |
2217 | 2217 | foreach ($testExit as $field) { |
2218 | 2218 | if (!isset($this->$field)) { |
@@ -2902,12 +2902,12 @@ discard block |
||
2902 | 2902 | |
2903 | 2903 | // For MultiCompany |
2904 | 2904 | // PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2905 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2906 | - $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. |
|
2905 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2906 | + $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. |
|
2907 | 2907 | $visibleWarehousesEntities = $conf->entity; |
2908 | 2908 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
2909 | 2909 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
2910 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2910 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2911 | 2911 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
2912 | 2912 | $separatedEntityPMP = true; |
2913 | 2913 | } |
@@ -2915,7 +2915,7 @@ discard block |
||
2915 | 2915 | global $mc; |
2916 | 2916 | $separatedStock = true; |
2917 | 2917 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
2918 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
2918 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
2919 | 2919 | } |
2920 | 2920 | } |
2921 | 2921 | if ($separatedEntityPMP) { |
@@ -2933,10 +2933,10 @@ discard block |
||
2933 | 2933 | } |
2934 | 2934 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2935 | 2935 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
2936 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
2936 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
2937 | 2937 | } |
2938 | 2938 | if ($separatedStock) { |
2939 | - $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)."))"; |
|
2939 | + $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)."))"; |
|
2940 | 2940 | } |
2941 | 2941 | |
2942 | 2942 | if ($id) { |
@@ -3103,15 +3103,15 @@ discard block |
||
3103 | 3103 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
3104 | 3104 | $sql .= " AND price_level=".((int) $i); |
3105 | 3105 | $sql .= " AND fk_product = ".((int) $this->id); |
3106 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3107 | - $sql .= " LIMIT 1"; // Only the first one |
|
3106 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3107 | + $sql .= " LIMIT 1"; // Only the first one |
|
3108 | 3108 | $resql = $this->db->query($sql); |
3109 | 3109 | if ($resql) { |
3110 | 3110 | $result = $this->db->fetch_array($resql); |
3111 | 3111 | |
3112 | 3112 | $this->multiprices[$i] = $result ? $result["price"] : null; |
3113 | 3113 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
3114 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3114 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3115 | 3115 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
3116 | 3116 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
3117 | 3117 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3336,7 +3336,7 @@ discard block |
||
3336 | 3336 | $obj = $this->db->fetch_object($result); |
3337 | 3337 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
3338 | 3338 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
3339 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3339 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3340 | 3340 | } else { |
3341 | 3341 | $this->error = $this->db->error(); |
3342 | 3342 | $error++; |
@@ -4859,7 +4859,7 @@ discard block |
||
4859 | 4859 | //Addition of a product with the highest rank +1 |
4860 | 4860 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4861 | 4861 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")"; |
4862 | - if (! $this->db->query($sql)) { |
|
4862 | + if (!$this->db->query($sql)) { |
|
4863 | 4863 | dol_print_error($this->db); |
4864 | 4864 | return -1; |
4865 | 4865 | } else { |
@@ -4980,7 +4980,7 @@ discard block |
||
4980 | 4980 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
4981 | 4981 | $sql .= " SET rang = ".((int) $cpt); |
4982 | 4982 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
4983 | - if (! $this->db->query($sql)) { |
|
4983 | + if (!$this->db->query($sql)) { |
|
4984 | 4984 | dol_print_error($this->db); |
4985 | 4985 | return -1; |
4986 | 4986 | } |
@@ -5415,7 +5415,7 @@ discard block |
||
5415 | 5415 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
5416 | 5416 | foreach ($this->sousprods as $prod_name => $desc_product) { |
5417 | 5417 | if (is_array($desc_product)) { |
5418 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5418 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5419 | 5419 | } |
5420 | 5420 | } |
5421 | 5421 | } |
@@ -5572,7 +5572,7 @@ discard block |
||
5572 | 5572 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
5573 | 5573 | $sql .= " ORDER BY pa.rang"; |
5574 | 5574 | |
5575 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5575 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5576 | 5576 | |
5577 | 5577 | if ($level == 1) { |
5578 | 5578 | $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 |
@@ -5637,7 +5637,7 @@ discard block |
||
5637 | 5637 | $parent[$this->label][$keyChild] = $valueChild; |
5638 | 5638 | } |
5639 | 5639 | foreach ($parent as $key => $value) { // key=label, value is array of children |
5640 | - $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5640 | + $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5641 | 5641 | } |
5642 | 5642 | } |
5643 | 5643 | |
@@ -5673,7 +5673,7 @@ discard block |
||
5673 | 5673 | if (!empty($this->entity) && $permissiontoreadproduct) { |
5674 | 5674 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1'); |
5675 | 5675 | if ($this->nbphoto > 0) { |
5676 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
5676 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
5677 | 5677 | } |
5678 | 5678 | } |
5679 | 5679 | |
@@ -5683,7 +5683,7 @@ discard block |
||
5683 | 5683 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
5684 | 5684 | } |
5685 | 5685 | if (isset($this->status) && isset($this->status_buy)) { |
5686 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
5686 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
5687 | 5687 | } |
5688 | 5688 | |
5689 | 5689 | if (!empty($this->ref)) { |
@@ -5733,7 +5733,7 @@ discard block |
||
5733 | 5733 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
5734 | 5734 | } |
5735 | 5735 | if ($labelsurfacevolume) { |
5736 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
5736 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
5737 | 5737 | } |
5738 | 5738 | } |
5739 | 5739 | if ($this->isService() && !empty($this->duration_value)) { |
@@ -5775,9 +5775,9 @@ discard block |
||
5775 | 5775 | } |
5776 | 5776 | // show categories for this record only in ajax to not overload lists |
5777 | 5777 | if (isModEnabled('category') && !$nofetch) { |
5778 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5778 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5779 | 5779 | $form = new Form($this->db); |
5780 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5780 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5781 | 5781 | } |
5782 | 5782 | } |
5783 | 5783 | |
@@ -6301,7 +6301,7 @@ discard block |
||
6301 | 6301 | if (isModEnabled("supplier_order")) { |
6302 | 6302 | $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); |
6303 | 6303 | if (isset($includedraftpoforvirtual)) { |
6304 | - $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 |
|
6304 | + $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 |
|
6305 | 6305 | } |
6306 | 6306 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
6307 | 6307 | if ($result < 0) { |
@@ -6342,7 +6342,7 @@ discard block |
||
6342 | 6342 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) { |
6343 | 6343 | if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6344 | 6344 | $tmpnewprod = dol_clone($this, 1); |
6345 | - $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6345 | + $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6346 | 6346 | $this->stock_theorique += $tmpnewprod->stats_commande['qty']; |
6347 | 6347 | } |
6348 | 6348 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') { |
@@ -6359,7 +6359,7 @@ discard block |
||
6359 | 6359 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) { // Warning: stock change "on approval", not on validation ! |
6360 | 6360 | if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6361 | 6361 | $tmpnewprod = dol_clone($this, 1); |
6362 | - $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6362 | + $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6363 | 6363 | $this->stock_theorique += $this->stats_commande_fournisseur['qty']; |
6364 | 6364 | } |
6365 | 6365 | $this->stock_theorique -= $stock_reception_fournisseur; |
@@ -6736,7 +6736,7 @@ discard block |
||
6736 | 6736 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
6737 | 6737 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
6738 | 6738 | foreach ($dirsociete as $dirroot) { |
6739 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6739 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6740 | 6740 | if ($res) { |
6741 | 6741 | break; |
6742 | 6742 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | $result = restrictedArea($user, 'expensereport', $object->id, 'expensereport'); |
165 | 165 | |
166 | -$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
166 | +$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
167 | 167 | |
168 | 168 | |
169 | 169 | /* |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | if ($overlappingExpenseReportID > 0) { |
316 | 316 | $error++; |
317 | - setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'. $langs->trans('ShowTrip').'</a>', null, 'errors'); |
|
317 | + setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'.$langs->trans('ShowTrip').'</a>', null, 'errors'); |
|
318 | 318 | $action = 'create'; |
319 | 319 | } |
320 | 320 | } |
@@ -2387,7 +2387,7 @@ discard block |
||
2387 | 2387 | } |
2388 | 2388 | } |
2389 | 2389 | |
2390 | - $tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
2390 | + $tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
2391 | 2391 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; |
2392 | 2392 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; |
2393 | 2393 | |
@@ -2442,7 +2442,7 @@ discard block |
||
2442 | 2442 | |
2443 | 2443 | // Quantity |
2444 | 2444 | print '<td class="right">'; |
2445 | - print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty |
|
2445 | + print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty |
|
2446 | 2446 | print '</td>'; |
2447 | 2447 | |
2448 | 2448 | //print '<td class="right">'.$langs->trans('AmountHT').'</td>'; |
@@ -2547,7 +2547,7 @@ discard block |
||
2547 | 2547 | print '</script>'."\n"; |
2548 | 2548 | print '</td></tr>'; |
2549 | 2549 | |
2550 | - $tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
2550 | + $tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
2551 | 2551 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; |
2552 | 2552 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; |
2553 | 2553 |