@@ -356,10 +356,10 @@ |
||
356 | 356 | $desc = dol_htmlentitiesbr($objectligne->desc, 1); // Desc (not empty for free lines) |
357 | 357 | $txt = ''; |
358 | 358 | if (empty($conf->global->CONTRACT_HIDE_QTY_ON_PDF)) { |
359 | - $txt .= $outputlangs->transnoentities("Quantity") . ' : <strong>' . $objectligne->qty . '</strong>'; |
|
359 | + $txt .= $outputlangs->transnoentities("Quantity").' : <strong>'.$objectligne->qty.'</strong>'; |
|
360 | 360 | } |
361 | 361 | if (empty($conf->global->CONTRACT_HIDE_PRICE_ON_PDF)) { |
362 | - $txt .= ' - ' . $outputlangs->transnoentities("UnitPrice") . ' : <strong>' . price($objectligne->subprice) . '</strong>'; |
|
362 | + $txt .= ' - '.$outputlangs->transnoentities("UnitPrice").' : <strong>'.price($objectligne->subprice).'</strong>'; |
|
363 | 363 | } |
364 | 364 | if (empty($conf->global->CONTRACT_HIDE_PLANNED_DATE_ON_PDF)) { |
365 | 365 | $txt .= '<br>'; |
@@ -353,7 +353,7 @@ |
||
353 | 353 | 'b.montant'=>'rule-computeAmount', |
354 | 354 | 'b.sens'=>'rule-computeDirection' |
355 | 355 | ); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) |
356 | - $this->import_convertvalue_array[$r]=array( |
|
356 | + $this->import_convertvalue_array[$r] = array( |
|
357 | 357 | 'b.piece_num' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanValue', 'element' => 'Accountancy'), |
358 | 358 | 'b.numero_compte'=>array('rule'=>'accountingaccount'), |
359 | 359 | 'b.subledger_account'=>array('rule'=>'accountingaccount'), |
@@ -101,27 +101,27 @@ |
||
101 | 101 | { |
102 | 102 | global $langs; |
103 | 103 | $legendSkills = '<div style="font-style:italic;"> |
104 | - ' . $langs->trans('legend') . ' |
|
104 | + ' . $langs->trans('legend').' |
|
105 | 105 | <table class="border" width="100%"> |
106 | 106 | <tr> |
107 | 107 | <td><span style="vertical-align:middle" class="toohappy diffnote little"></span> |
108 | - ' . $langs->trans('CompetenceAcquiredByOneOrMore') . '</td> |
|
108 | + ' . $langs->trans('CompetenceAcquiredByOneOrMore').'</td> |
|
109 | 109 | </tr> |
110 | 110 | <tr> |
111 | 111 | <td><span style="vertical-align:middle" class="veryhappy diffnote little"></span> |
112 | - ' . $langs->trans('MaxlevelGreaterThan') . '</td> |
|
112 | + ' . $langs->trans('MaxlevelGreaterThan').'</td> |
|
113 | 113 | </tr> |
114 | 114 | <tr> |
115 | 115 | <td><span style="vertical-align:middle" class="happy diffnote little"></span> |
116 | - ' . $langs->trans('MaxLevelEqualTo') . '</td> |
|
116 | + ' . $langs->trans('MaxLevelEqualTo').'</td> |
|
117 | 117 | </tr> |
118 | 118 | <tr> |
119 | 119 | <td><span style="vertical-align:middle" class="sad diffnote little"></span> |
120 | - ' . $langs->trans('MaxLevelLowerThan') . '</td> |
|
120 | + ' . $langs->trans('MaxLevelLowerThan').'</td> |
|
121 | 121 | </tr> |
122 | 122 | <tr> |
123 | 123 | <td><span style="vertical-align:middle" class="toosad diffnote little"></span> |
124 | - ' . $langs->trans('SkillNotAcquired') . '</td> |
|
124 | + ' . $langs->trans('SkillNotAcquired').'</td> |
|
125 | 125 | </tr> |
126 | 126 | </table> |
127 | 127 | </div>'; |
@@ -144,7 +144,9 @@ |
||
144 | 144 | //$socid = $user->socid; |
145 | 145 | accessforbidden(); |
146 | 146 | } |
147 | -if (!$permissiontoread) accessforbidden(); |
|
147 | +if (!$permissiontoread) { |
|
148 | + accessforbidden(); |
|
149 | +} |
|
148 | 150 | |
149 | 151 | |
150 | 152 | /* |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $hasgroupby = true; |
306 | 306 | $sql .= " GROUP BY "; |
307 | 307 | foreach ($object->fields as $key => $val) { |
308 | - $sql .= "t." . $key . ", "; |
|
308 | + $sql .= "t.".$key.", "; |
|
309 | 309 | } |
310 | 310 | // Add fields from extrafields |
311 | 311 | //if (!empty($extrafields->attributes[$object->table_element]['label'])) { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | //} |
316 | 316 | // Add where from hooks |
317 | 317 | $parameters = array(); |
318 | -$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook |
|
318 | +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook |
|
319 | 319 | $sql .= $hookmanager->resPrint; |
320 | 320 | $sql = preg_replace("/,\s*$/", "", $sql); |
321 | 321 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { |
381 | 381 | $obj = $db->fetch_object($resql); |
382 | 382 | $id = $obj->rowid; |
383 | - header("Location: " . dol_buildpath('/variants/card.php', 2) . '?id=' . $id); |
|
383 | + header("Location: ".dol_buildpath('/variants/card.php', 2).'?id='.$id); |
|
384 | 384 | exit; |
385 | 385 | } |
386 | 386 | |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
608 | 608 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
609 | 609 | } |
610 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
610 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
611 | 611 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
612 | 612 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
613 | 613 | $totalarray['nbfield']++; |
@@ -704,23 +704,23 @@ discard block |
||
704 | 704 | foreach ($object->fields as $key => $val) { |
705 | 705 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
706 | 706 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
707 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
707 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
708 | 708 | } elseif ($key == 'status') { |
709 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
709 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | if (in_array($val['type'], array('timestamp'))) { |
713 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
713 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
714 | 714 | } elseif ($key == 'ref') { |
715 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
715 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { |
719 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
719 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
720 | 720 | } |
721 | 721 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
722 | 722 | |
723 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
723 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
724 | 724 | print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : ''); |
725 | 725 | if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) { |
726 | 726 | print ' title="'.dol_escape_htmltag($object->$key).'"'; |
@@ -739,15 +739,15 @@ discard block |
||
739 | 739 | } |
740 | 740 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
741 | 741 | if (!$i) { |
742 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
742 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
743 | 743 | } |
744 | 744 | if (!isset($totalarray['val'])) { |
745 | 745 | $totalarray['val'] = array(); |
746 | 746 | } |
747 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
748 | - $totalarray['val']['t.' . $key] = 0; |
|
747 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
748 | + $totalarray['val']['t.'.$key] = 0; |
|
749 | 749 | } |
750 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
750 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
751 | 751 | } |
752 | 752 | } |
753 | 753 | } |
@@ -794,14 +794,14 @@ discard block |
||
794 | 794 | // Move |
795 | 795 | print '<td class="center linecolmove tdlineupdown">'; |
796 | 796 | if ($i > 0) { |
797 | - print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=up&rowid=' . $obj->rowid . '">' . img_up('default', 0, 'imgupforline') . '</a>'; |
|
797 | + print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=up&rowid='.$obj->rowid.'">'.img_up('default', 0, 'imgupforline').'</a>'; |
|
798 | 798 | } |
799 | 799 | if ($i < $num - 1) { |
800 | - print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=down&rowid=' . $obj->rowid . '">' . img_down('default', 0, 'imgdownforline') . '</a>'; |
|
800 | + print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=down&rowid='.$obj->rowid.'">'.img_down('default', 0, 'imgdownforline').'</a>'; |
|
801 | 801 | } |
802 | 802 | print '</td>'; |
803 | 803 | |
804 | - print '</tr>' . "\n"; |
|
804 | + print '</tr>'."\n"; |
|
805 | 805 | } |
806 | 806 | |
807 | 807 | $i++; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | $coldisplay++; |
67 | 67 | ?> |
68 | 68 | <td class="nobottom linecolref"> |
69 | - <?php $coldisplay++; if ($nolinesbefore) { echo $langs->trans('Ref') . ': '; } ?> |
|
69 | + <?php $coldisplay++; if ($nolinesbefore) { echo $langs->trans('Ref').': '; } ?> |
|
70 | 70 | <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo (GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : ''); ?>" autofocus> |
71 | 71 | <?php |
72 | 72 | if (is_object($hookmanager)) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
80 | 80 | */ |
81 | - public $fields=array( |
|
81 | + public $fields = array( |
|
82 | 82 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
83 | 83 | 'fk_product_attribute' => array('type'=>'integer:ProductAttribute:variants/class/ProductAttribute.class.php', 'label'=>'ProductAttribute', 'enabled'=>1, 'visible'=>0, 'position'=>10, 'notnull'=>1, 'index'=>1,), |
84 | 84 | 'ref' => array('type'=>'varchar(255)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''), |
@@ -160,32 +160,32 @@ discard block |
||
160 | 160 | $error++; |
161 | 161 | } |
162 | 162 | if ($error) { |
163 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
163 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
164 | 164 | return -1; |
165 | 165 | } |
166 | 166 | |
167 | 167 | $this->db->begin(); |
168 | 168 | |
169 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " ("; |
|
169 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; |
|
170 | 170 | $sql .= " fk_product_attribute, ref, value, entity, position"; |
171 | 171 | $sql .= ")"; |
172 | 172 | $sql .= " VALUES ("; |
173 | - $sql .= " " . ((int) $this->fk_product_attribute); |
|
174 | - $sql .= ", '" . $this->db->escape($this->ref) . "'"; |
|
175 | - $sql .= ", '" . $this->db->escape($this->value) . "'"; |
|
176 | - $sql .= ", " . ((int) $this->entity); |
|
177 | - $sql .= ", " . ((int) $this->position); |
|
173 | + $sql .= " ".((int) $this->fk_product_attribute); |
|
174 | + $sql .= ", '".$this->db->escape($this->ref)."'"; |
|
175 | + $sql .= ", '".$this->db->escape($this->value)."'"; |
|
176 | + $sql .= ", ".((int) $this->entity); |
|
177 | + $sql .= ", ".((int) $this->position); |
|
178 | 178 | $sql .= ")"; |
179 | 179 | |
180 | 180 | dol_syslog(__METHOD__, LOG_DEBUG); |
181 | 181 | $resql = $this->db->query($sql); |
182 | 182 | if (!$resql) { |
183 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
183 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
184 | 184 | $error++; |
185 | 185 | } |
186 | 186 | |
187 | 187 | if (!$error) { |
188 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); |
|
188 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | if (!$error && !$notrigger) { |
@@ -226,20 +226,20 @@ discard block |
||
226 | 226 | $error++; |
227 | 227 | } |
228 | 228 | if ($error) { |
229 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
229 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
230 | 230 | return -1; |
231 | 231 | } |
232 | 232 | |
233 | 233 | $sql = "SELECT rowid, fk_product_attribute, ref, value"; |
234 | - $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
|
235 | - $sql .= " WHERE rowid = " . ((int) $id); |
|
236 | - $sql .= " AND entity IN (" . getEntity('product') . ")"; |
|
234 | + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
|
235 | + $sql .= " WHERE rowid = ".((int) $id); |
|
236 | + $sql .= " AND entity IN (".getEntity('product').")"; |
|
237 | 237 | |
238 | 238 | dol_syslog(__METHOD__, LOG_DEBUG); |
239 | 239 | $resql = $this->db->query($sql); |
240 | 240 | if (!$resql) { |
241 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
242 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
241 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
242 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
243 | 243 | return -1; |
244 | 244 | } |
245 | 245 | |
@@ -274,15 +274,15 @@ discard block |
||
274 | 274 | $sql .= "DISTINCT "; |
275 | 275 | } |
276 | 276 | |
277 | - $sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM " . MAIN_DB_PREFIX . "product_attribute_value v "; |
|
277 | + $sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".MAIN_DB_PREFIX."product_attribute_value v "; |
|
278 | 278 | |
279 | 279 | if ($only_used) { |
280 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid "; |
|
281 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
282 | - $sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = c.fk_product_child "; |
|
280 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid "; |
|
281 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination c ON c.rowid = c2v.fk_prod_combination "; |
|
282 | + $sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = c.fk_product_child "; |
|
283 | 283 | } |
284 | 284 | |
285 | - $sql .= "WHERE v.fk_product_attribute = " . ((int) $prodattr_id); |
|
285 | + $sql .= "WHERE v.fk_product_attribute = ".((int) $prodattr_id); |
|
286 | 286 | |
287 | 287 | if ($only_used) { |
288 | 288 | $sql .= " AND c2v.rowid IS NOT NULL AND p.tosell = 1"; |
@@ -334,25 +334,25 @@ discard block |
||
334 | 334 | $error++; |
335 | 335 | } |
336 | 336 | if ($error) { |
337 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
337 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
338 | 338 | return -1; |
339 | 339 | } |
340 | 340 | |
341 | 341 | $this->db->begin(); |
342 | 342 | |
343 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET"; |
|
343 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; |
|
344 | 344 | |
345 | - $sql .= " fk_product_attribute = " . ((int) $this->fk_product_attribute); |
|
346 | - $sql .= ", ref = '" . $this->db->escape($this->ref) . "'"; |
|
347 | - $sql .= ", value = '" . $this->db->escape($this->value) . "'"; |
|
348 | - $sql .= ", position = " . ((int) $this->position); |
|
345 | + $sql .= " fk_product_attribute = ".((int) $this->fk_product_attribute); |
|
346 | + $sql .= ", ref = '".$this->db->escape($this->ref)."'"; |
|
347 | + $sql .= ", value = '".$this->db->escape($this->value)."'"; |
|
348 | + $sql .= ", position = ".((int) $this->position); |
|
349 | 349 | |
350 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
350 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
351 | 351 | |
352 | 352 | dol_syslog(__METHOD__, LOG_DEBUG); |
353 | 353 | $resql = $this->db->query($sql); |
354 | 354 | if (!$resql) { |
355 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
355 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
356 | 356 | $error++; |
357 | 357 | } |
358 | 358 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $error++; |
396 | 396 | } |
397 | 397 | if ($error) { |
398 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
398 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
399 | 399 | return -1; |
400 | 400 | } |
401 | 401 | |
@@ -419,12 +419,12 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | if (!$error) { |
422 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id); |
|
422 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id); |
|
423 | 423 | |
424 | 424 | dol_syslog(__METHOD__, LOG_DEBUG); |
425 | 425 | $resql = $this->db->query($sql); |
426 | 426 | if (!$resql) { |
427 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
427 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
428 | 428 | $error++; |
429 | 429 | } |
430 | 430 | } |
@@ -457,16 +457,16 @@ discard block |
||
457 | 457 | $error++; |
458 | 458 | } |
459 | 459 | if ($error) { |
460 | - dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR); |
|
460 | + dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR); |
|
461 | 461 | return -1; |
462 | 462 | } |
463 | 463 | |
464 | - $sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr_val = " . ((int) $this->id); |
|
464 | + $sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr_val = ".((int) $this->id); |
|
465 | 465 | |
466 | 466 | dol_syslog(__METHOD__, LOG_DEBUG); |
467 | 467 | $resql = $this->db->query($sql); |
468 | 468 | if (!$resql) { |
469 | - $this->errors[] = "Error " . $this->db->lasterror(); |
|
469 | + $this->errors[] = "Error ".$this->db->lasterror(); |
|
470 | 470 | return -1; |
471 | 471 | } |
472 | 472 |
@@ -57,7 +57,9 @@ |
||
57 | 57 | |
58 | 58 | // Category |
59 | 59 | $selected_cat = (int) GETPOST('search_categ', 'int'); |
60 | -if ($selected_cat == -1) $selected_cat = ''; |
|
60 | +if ($selected_cat == -1) { |
|
61 | + $selected_cat = ''; |
|
62 | +} |
|
61 | 63 | $subcat = false; |
62 | 64 | if (GETPOST('subcat', 'alpha') === 'yes') { |
63 | 65 | $subcat = true; |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | $month_current = dol_print_date(dol_now(), '%m'); |
100 | 100 | $year_start = $year; |
101 | 101 | } |
102 | -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
103 | -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
102 | +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
103 | +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
104 | 104 | // Quarter |
105 | 105 | if (empty($date_start) || empty($date_end)) { // We define date_start and date_end |
106 | 106 | $q = GETPOST("q", "int") ?GETPOST("q", "int") : 0; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $headerparams = array_merge($commonparams, $headerparams); |
180 | 180 | $tableparams = array_merge($commonparams, $tableparams); |
181 | 181 | |
182 | -$paramslink=""; |
|
182 | +$paramslink = ""; |
|
183 | 183 | foreach ($allparams as $key => $value) { |
184 | 184 | $paramslink .= '&'.$key.'='.$value; |
185 | 185 | } |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | $modecompta = "RECETTES-DEPENSES"; |
204 | 204 | } |
205 | 205 | |
206 | -$exportlink=""; |
|
207 | -$namelink=""; |
|
206 | +$exportlink = ""; |
|
207 | +$namelink = ""; |
|
208 | 208 | |
209 | 209 | // Show report header |
210 | 210 | if ($modecompta == "CREANCES-DETTES") { |
@@ -289,7 +289,7 @@ |
||
289 | 289 | // phpcs:enable |
290 | 290 | $this->_Metric = $format['metric']; |
291 | 291 | $this->_Avery_Name = $format['name']; |
292 | - $this->_Avery_Code = empty($format['code'])?'':$format['code']; |
|
292 | + $this->_Avery_Code = empty($format['code']) ? '' : $format['code']; |
|
293 | 293 | $this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc); |
294 | 294 | $this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc); |
295 | 295 | $this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc); |
@@ -813,7 +813,9 @@ |
||
813 | 813 | |
814 | 814 | // Complete vat rate with code |
815 | 815 | $vatrate = $newinvoiceline->tva_tx; |
816 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
816 | + if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) { |
|
817 | + $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
818 | + } |
|
817 | 819 | |
818 | 820 | $newinvoiceline->fk_parent_line = $fk_parent_line; |
819 | 821 |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $this->mode_reglement_id = 0; |
505 | 505 | } |
506 | 506 | $this->status = self::STATUS_DRAFT; |
507 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
507 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
508 | 508 | |
509 | 509 | if (!empty($this->multicurrency_code)) { |
510 | 510 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | |
586 | 586 | // Fields always coming from template |
587 | 587 | $this->remise_absolue = $_facrec->remise_absolue; |
588 | - $this->remise_percent = $_facrec->remise_percent; // TODO deprecated |
|
588 | + $this->remise_percent = $_facrec->remise_percent; // TODO deprecated |
|
589 | 589 | $this->fk_incoterms = $_facrec->fk_incoterms; |
590 | 590 | $this->location_incoterms = $_facrec->location_incoterms; |
591 | 591 | |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $this->mode_reglement_id = 0; |
606 | 606 | } |
607 | 607 | $this->status = self::STATUS_DRAFT; |
608 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
608 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
609 | 609 | |
610 | 610 | $this->linked_objects = $_facrec->linkedObjectsIds; |
611 | 611 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | $sql .= ", fk_soc"; |
688 | 688 | $sql .= ", datec"; |
689 | 689 | $sql .= ", remise_absolue"; |
690 | - $sql .= ", remise_percent"; // TODO deprecated |
|
690 | + $sql .= ", remise_percent"; // TODO deprecated |
|
691 | 691 | $sql .= ", datef"; |
692 | 692 | $sql .= ", date_pointoftax"; |
693 | 693 | $sql .= ", note_private"; |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | $sql .= ", ".((int) $socid); |
714 | 714 | $sql .= ", '".$this->db->idate($now)."'"; |
715 | 715 | $sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL'); |
716 | - $sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); // TODO deprecated |
|
716 | + $sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); // TODO deprecated |
|
717 | 717 | $sql .= ", '".$this->db->idate($this->date)."'"; |
718 | 718 | $sql .= ", ".(empty($this->date_pointoftax) ? "null" : "'".$this->db->idate($this->date_pointoftax)."'"); |
719 | 719 | $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | |
853 | 853 | // Complete vat rate with code |
854 | 854 | $vatrate = $newinvoiceline->tva_tx; |
855 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
855 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
|
856 | 856 | |
857 | 857 | $newinvoiceline->fk_parent_line = $fk_parent_line; |
858 | 858 | |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | $buyprice, |
1075 | 1075 | $_facrec->lines[$i]->label, |
1076 | 1076 | empty($_facrec->lines[$i]->array_options) ?null:$_facrec->lines[$i]->array_options, |
1077 | - 100, // situation percent is undefined on recurring invoice lines |
|
1077 | + 100, // situation percent is undefined on recurring invoice lines |
|
1078 | 1078 | '', |
1079 | 1079 | $_facrec->lines[$i]->fk_unit, |
1080 | 1080 | $_facrec->lines[$i]->multicurrency_subprice, |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | $facture->cond_reglement_id = $this->cond_reglement_id; |
1178 | 1178 | $facture->mode_reglement_id = $this->mode_reglement_id; |
1179 | 1179 | $facture->remise_absolue = $this->remise_absolue; |
1180 | - $facture->remise_percent = $this->remise_percent; // TODO deprecated |
|
1180 | + $facture->remise_percent = $this->remise_percent; // TODO deprecated |
|
1181 | 1181 | |
1182 | 1182 | $facture->origin = $this->origin; |
1183 | 1183 | $facture->origin_id = $this->origin_id; |
@@ -1653,7 +1653,7 @@ discard block |
||
1653 | 1653 | { |
1654 | 1654 | global $conf, $langs, $hookmanager, $action; |
1655 | 1655 | |
1656 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1656 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1657 | 1657 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1658 | 1658 | return null; |
1659 | 1659 | } |
@@ -1663,7 +1663,7 @@ discard block |
||
1663 | 1663 | return null; |
1664 | 1664 | } |
1665 | 1665 | |
1666 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1666 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1667 | 1667 | |
1668 | 1668 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { |
1669 | 1669 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1707,7 +1707,7 @@ discard block |
||
1707 | 1707 | $deposit->pos_source = $origin->pos_source; |
1708 | 1708 | $deposit->model_pdf = 'crabe'; |
1709 | 1709 | |
1710 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
1710 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
1711 | 1711 | |
1712 | 1712 | if (!empty($conf->global->$modelByTypeConfName)) { |
1713 | 1713 | $deposit->model_pdf = $conf->global->$modelByTypeConfName; |
@@ -1762,10 +1762,10 @@ discard block |
||
1762 | 1762 | continue; |
1763 | 1763 | } |
1764 | 1764 | $TTotalByTva[$line->tva_tx] += $line->total_ttc; |
1765 | - $descriptions[$line->tva_tx] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
1766 | - $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
1767 | - $descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
1768 | - $descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
1765 | + $descriptions[$line->tva_tx] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
1766 | + $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
1767 | + $descriptions[$line->tva_tx] .= $langs->trans('Qty').' : '.$line->qty; |
|
1768 | + $descriptions[$line->tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
1769 | 1769 | } |
1770 | 1770 | |
1771 | 1771 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1789,10 +1789,10 @@ discard block |
||
1789 | 1789 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
1790 | 1790 | $tva_tx = $lines[$i]->tva_tx; |
1791 | 1791 | $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100; |
1792 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
1793 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
1794 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
1795 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
1792 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
1793 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
1794 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
1795 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
1796 | 1796 | } |
1797 | 1797 | |
1798 | 1798 | if ($totalamount == 0) { |
@@ -1807,11 +1807,11 @@ discard block |
||
1807 | 1807 | continue; |
1808 | 1808 | } |
1809 | 1809 | |
1810 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
1810 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
1811 | 1811 | |
1812 | 1812 | // Hidden conf |
1813 | 1813 | if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) { |
1814 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
1814 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
1815 | 1815 | } |
1816 | 1816 | |
1817 | 1817 | $addlineResult = $deposit->addline( |
@@ -2073,7 +2073,7 @@ discard block |
||
2073 | 2073 | $label = $langs->trans("Invoice"); |
2074 | 2074 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
2075 | 2075 | } |
2076 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2076 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
2077 | 2077 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
2078 | 2078 | } |
2079 | 2079 | |
@@ -2185,10 +2185,10 @@ discard block |
||
2185 | 2185 | $this->id = $obj->rowid; |
2186 | 2186 | $this->entity = $obj->entity; |
2187 | 2187 | |
2188 | - $this->ref = $obj->ref; |
|
2189 | - $this->ref_client = $obj->ref_client; |
|
2190 | - $this->ref_customer = $obj->ref_client; |
|
2191 | - $this->ref_ext = $obj->ref_ext; |
|
2188 | + $this->ref = $obj->ref; |
|
2189 | + $this->ref_client = $obj->ref_client; |
|
2190 | + $this->ref_customer = $obj->ref_client; |
|
2191 | + $this->ref_ext = $obj->ref_ext; |
|
2192 | 2192 | $this->type = $obj->type; |
2193 | 2193 | $this->date = $this->db->jdate($obj->df); |
2194 | 2194 | $this->date_pointoftax = $this->db->jdate($obj->date_pointoftax); |
@@ -2196,7 +2196,7 @@ discard block |
||
2196 | 2196 | $this->date_validation = $this->db->jdate($obj->datev); |
2197 | 2197 | $this->date_modification = $this->db->jdate($obj->datem); |
2198 | 2198 | $this->datem = $this->db->jdate($obj->datem); |
2199 | - $this->remise_percent = $obj->remise_percent; // TODO deprecated |
|
2199 | + $this->remise_percent = $obj->remise_percent; // TODO deprecated |
|
2200 | 2200 | $this->remise_absolue = $obj->remise_absolue; |
2201 | 2201 | $this->total_ht = $obj->total_ht; |
2202 | 2202 | $this->total_tva = $obj->total_tva; |
@@ -2214,7 +2214,7 @@ discard block |
||
2214 | 2214 | $this->fk_project = $obj->fk_project; |
2215 | 2215 | $this->project = null; // Clear if another value was already set by fetch_projet |
2216 | 2216 | |
2217 | - $this->statut = $obj->status; // deprecated |
|
2217 | + $this->statut = $obj->status; // deprecated |
|
2218 | 2218 | $this->status = $obj->status; |
2219 | 2219 | |
2220 | 2220 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2347,7 +2347,7 @@ discard block |
||
2347 | 2347 | $line->ref = $objp->product_ref; // Ref product |
2348 | 2348 | $line->product_ref = $objp->product_ref; // Ref product |
2349 | 2349 | $line->libelle = $objp->product_label; // deprecated |
2350 | - $line->product_label = $objp->product_label; // Label product |
|
2350 | + $line->product_label = $objp->product_label; // Label product |
|
2351 | 2351 | $line->product_desc = $objp->product_desc; // Description product |
2352 | 2352 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
2353 | 2353 | $line->qty = $objp->qty; |
@@ -2526,7 +2526,7 @@ discard block |
||
2526 | 2526 | $sql .= " date_pointoftax=".(strval($this->date_pointoftax) != '' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null').","; |
2527 | 2527 | $sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; |
2528 | 2528 | $sql .= " paye=".(isset($this->paye) ? $this->db->escape($this->paye) : 0).","; |
2529 | - $sql .= " remise_percent=".(isset($this->remise_percent) ? $this->db->escape($this->remise_percent) : "null").","; // TODO deprecated |
|
2529 | + $sql .= " remise_percent=".(isset($this->remise_percent) ? $this->db->escape($this->remise_percent) : "null").","; // TODO deprecated |
|
2530 | 2530 | $sql .= " remise_absolue=".(isset($this->remise_absolue) ? $this->db->escape($this->remise_absolue) : "null").","; |
2531 | 2531 | $sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").","; |
2532 | 2532 | $sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").","; |
@@ -2640,7 +2640,7 @@ discard block |
||
2640 | 2640 | $facligne->rang = 1; |
2641 | 2641 | $linecount = count($this->lines); |
2642 | 2642 | for ($ii = 1; $ii <= $linecount; $ii++) { |
2643 | - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1); |
|
2643 | + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); |
|
2644 | 2644 | } |
2645 | 2645 | } |
2646 | 2646 | |
@@ -3555,7 +3555,7 @@ discard block |
||
3555 | 3555 | // Set new ref and define current status |
3556 | 3556 | if (!$error) { |
3557 | 3557 | $this->ref = $num; |
3558 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3558 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3559 | 3559 | $this->status = self::STATUS_VALIDATED; |
3560 | 3560 | $this->date_validation = $now; |
3561 | 3561 | $i = 0; |
@@ -3700,7 +3700,7 @@ discard block |
||
3700 | 3700 | |
3701 | 3701 | if ($error == 0) { |
3702 | 3702 | $old_statut = $this->status; |
3703 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
3703 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
3704 | 3704 | $this->status = self::STATUS_DRAFT; |
3705 | 3705 | |
3706 | 3706 | // Call trigger |
@@ -4031,7 +4031,7 @@ discard block |
||
4031 | 4031 | return -2; |
4032 | 4032 | } |
4033 | 4033 | } else { |
4034 | - $this->errors[]='status of invoice must be Draft to allow use of ->addline()'; |
|
4034 | + $this->errors[] = 'status of invoice must be Draft to allow use of ->addline()'; |
|
4035 | 4035 | dol_syslog(get_class($this)."::addline status of invoice must be Draft to allow use of ->addline()", LOG_ERR); |
4036 | 4036 | return -3; |
4037 | 4037 | } |
@@ -5678,14 +5678,14 @@ discard block |
||
5678 | 5678 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5679 | 5679 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
5680 | 5680 | } |
5681 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5682 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5681 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5682 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
5683 | 5683 | if ($datetouse == 'invoicedate') { |
5684 | 5684 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5685 | 5685 | } else { |
5686 | 5686 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
5687 | 5687 | } |
5688 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5688 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
5689 | 5689 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5690 | 5690 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
5691 | 5691 | } |
@@ -5893,7 +5893,7 @@ discard block |
||
5893 | 5893 | $actioncomm->create($user); |
5894 | 5894 | } |
5895 | 5895 | |
5896 | - $this->db->commit(); // We always commit |
|
5896 | + $this->db->commit(); // We always commit |
|
5897 | 5897 | } |
5898 | 5898 | |
5899 | 5899 | if ($errormesg) { |
@@ -5929,7 +5929,7 @@ discard block |
||
5929 | 5929 | // get date of last validated invoices of same type |
5930 | 5930 | $sql = "SELECT datef"; |
5931 | 5931 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
5932 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
5932 | + $sql .= " WHERE type = ".(int) $this->type; |
|
5933 | 5933 | $sql .= " AND date_valid IS NOT NULL"; |
5934 | 5934 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
5935 | 5935 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -6110,7 +6110,7 @@ discard block |
||
6110 | 6110 | $objp = $this->db->fetch_object($result); |
6111 | 6111 | |
6112 | 6112 | if (!$objp) { |
6113 | - $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; |
|
6113 | + $this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql; |
|
6114 | 6114 | return 0; |
6115 | 6115 | } |
6116 | 6116 |