@@ -33,12 +33,12 @@ |
||
33 | 33 | /** |
34 | 34 | * @var string Id to identify managed objects |
35 | 35 | */ |
36 | - public $element = 'undefined'; // Will be defined into constructor |
|
36 | + public $element = 'undefined'; // Will be defined into constructor |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var string Name of table without prefix where object is stored |
40 | 40 | */ |
41 | - public $table_element = 'undefined'; // Will be defined into constructor |
|
41 | + public $table_element = 'undefined'; // Will be defined into constructor |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @var CtyperesourceLine[] Lines |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | if ($line->fk_product) { |
649 | 649 | $spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
650 | 650 | $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); |
651 | - $this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n"); |
|
651 | + $this->printer->text($line->ref.$spaces.$line->qty.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
|
652 | 652 | $this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n"); |
653 | 653 | } else { |
654 | 654 | $spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
718 | 718 | break; |
719 | 719 | case 'DOL_PRINT_CURR_DATE': |
720 | - if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
720 | + if (strlen($vals[$tplline]['value']) < 2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
721 | 721 | else $this->printer->text(date($vals[$tplline]['value'])."\n"); |
722 | 722 | break; |
723 | 723 | case 'DOL_LINE_FEED': |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | $this->printer->getPrintConnector() -> write("\x1e"); |
804 | 804 | break; |
805 | 805 | case 'DOL_BEEP_ALTERNATIVE': //if DOL_BEEP not works |
806 | - $this->printer->getPrintConnector() -> write(Printer::ESC . "B" . chr(4) . chr(1)); |
|
806 | + $this->printer->getPrintConnector() -> write(Printer::ESC."B".chr(4).chr(1)); |
|
807 | 807 | break; |
808 | 808 | case 'DOL_PRINT_ORDER_LINES': |
809 | 809 | foreach ($object->lines as $line) { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | // Clean data |
367 | 367 | // $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml'); |
368 | 368 | |
369 | - if ($this->jobposition->create(DolibarrApiAccess::$user)<0) { |
|
369 | + if ($this->jobposition->create(DolibarrApiAccess::$user) < 0) { |
|
370 | 370 | throw new RestException(500, "Error creating jobposition", array_merge(array($this->jobposition->error), $this->jobposition->errors)); |
371 | 371 | } |
372 | 372 | return $this->jobposition->id; |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | // Clean data |
399 | 399 | // $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml'); |
400 | 400 | |
401 | - if ($this->candidature->create(DolibarrApiAccess::$user)<0) { |
|
401 | + if ($this->candidature->create(DolibarrApiAccess::$user) < 0) { |
|
402 | 402 | throw new RestException(500, "Error creating candidature", array_merge(array($this->candidature->error), $this->candidature->errors)); |
403 | 403 | } |
404 | 404 | return $this->candidature->id; |
@@ -507,7 +507,7 @@ |
||
507 | 507 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
508 | 508 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
509 | 509 | } |
510 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
510 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
511 | 511 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
512 | 512 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
513 | 513 | $totalarray['nbfield']++; |
@@ -335,7 +335,7 @@ |
||
335 | 335 | print '<tr class="oddeven" height="24">'; |
336 | 336 | print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>'; |
337 | 337 | print '<td class="right">'.$val['nb'].'</td>'; |
338 | - print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']): "0").'%</td>'; |
|
338 | + print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']) : "0").'%</td>'; |
|
339 | 339 | print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>'; |
340 | 340 | print '<td class="right opacitylow" style="'.((!isset($val['total_diff']) || $val['total_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['total_diff']) ? round($val['total_diff']) : "0").'%</td>'; |
341 | 341 | print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>'; |
@@ -494,7 +494,7 @@ |
||
494 | 494 | if ($key === 'date_prevue_depart' && $object->lead_time_for_warning > 0 && $object->$key > 0) { |
495 | 495 | $date_prevue_depart = $object->$key; |
496 | 496 | $date_prevue_depart_plus_delai = $date_prevue_depart; |
497 | - if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
497 | + if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart).' + '.$object->lead_time_for_warning.' day'); |
|
498 | 498 | if ($date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); |
499 | 499 | } |
500 | 500 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | /** |
95 | 95 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
96 | 96 | */ |
97 | - public $fields=array( |
|
97 | + public $fields = array( |
|
98 | 98 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), |
99 | 99 | 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"Help text for amount",), |
100 | 100 | 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>'1', 'position'=>45, 'notnull'=>0, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp', 'help'=>"Help text for quantity",), |
@@ -449,9 +449,9 @@ discard block |
||
449 | 449 | |
450 | 450 | global $conf, $user, $langs; |
451 | 451 | |
452 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
453 | - include_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; |
|
454 | - include_once DOL_DOCUMENT_ROOT . '/product/stock/stocktransfer/class/stocktransfer.class.php'; |
|
452 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
453 | + include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; |
|
454 | + include_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransfer.class.php'; |
|
455 | 455 | |
456 | 456 | $p = new Product($this->db); |
457 | 457 | $p->fetch($this->fk_product); |
@@ -455,17 +455,17 @@ |
||
455 | 455 | // Rôles |
456 | 456 | $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "internal"'); |
457 | 457 | $res = $this->db->fetch_object($resql); |
458 | - $nextid=$this->getNextId(); |
|
458 | + $nextid = $this->getNextId(); |
|
459 | 459 | if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)'); |
460 | 460 | |
461 | 461 | $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STFROM" AND element = "StockTransfer" AND source = "external"'); |
462 | 462 | $res = $this->db->fetch_object($resql); |
463 | - $nextid=$this->getNextId(); |
|
463 | + $nextid = $this->getNextId(); |
|
464 | 464 | if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)'); |
465 | 465 | |
466 | 466 | $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "external"'); |
467 | 467 | $res = $this->db->fetch_object($resql); |
468 | - $nextid=$this->getNextId(); |
|
468 | + $nextid = $this->getNextId(); |
|
469 | 469 | if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)'); |
470 | 470 | |
471 | 471 | return $this->_init($sql, $options); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * \ingroup stocktransfer |
24 | 24 | * \brief File of class to manage StockTransfer numbering rules standard |
25 | 25 | */ |
26 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
26 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
27 | 27 | |
28 | 28 | |
29 | 29 | /** |