@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $search_date_endday = GETPOSTINT('search_date_endday'); |
85 | 85 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
86 | 86 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
87 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
87 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
88 | 88 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
89 | 89 | $search_date_when_startday = GETPOSTINT('search_date_when_startday'); |
90 | 90 | $search_date_when_startmonth = GETPOSTINT('search_date_when_startmonth'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $search_date_when_endday = GETPOSTINT('search_date_when_endday'); |
93 | 93 | $search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth'); |
94 | 94 | $search_date_when_endyear = GETPOSTINT('search_date_when_endyear'); |
95 | -$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver |
|
95 | +$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver |
|
96 | 96 | $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); |
97 | 97 | $search_recurring = GETPOST('search_recurring', 'intcomma'); |
98 | 98 | $search_frequency = GETPOST('search_frequency', 'alpha'); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | $object->fields = dol_sort_array($object->fields, 'position'); |
165 | 165 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
166 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
166 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
167 | 167 | |
168 | 168 | if ($socid > 0) { |
169 | 169 | $tmpthirdparty = new Societe($db); |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend' => $langs->trans("SendByMail"), 'builddoc' => $langs->trans("PDFMerge"))); |
539 | 539 | |
540 | 540 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
541 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
541 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
542 | 542 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
543 | 543 | //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); |
544 | 544 |
@@ -312,14 +312,14 @@ discard block |
||
312 | 312 | |
313 | 313 | // Creation of payment line |
314 | 314 | $paiement = new PaiementFourn($db); |
315 | - $paiement->datepaye = $datepaye; |
|
315 | + $paiement->datepaye = $datepaye; |
|
316 | 316 | |
317 | 317 | $correctedAmounts = []; |
318 | 318 | foreach ($amounts as $key => $value) { |
319 | 319 | $correctedAmounts[$key] = (float) $value; |
320 | 320 | } |
321 | 321 | |
322 | - $paiement->amounts = $correctedAmounts; // Array of amounts |
|
322 | + $paiement->amounts = $correctedAmounts; // Array of amounts |
|
323 | 323 | $paiement->multicurrency_amounts = $multicurrency_amounts; |
324 | 324 | $paiement->multicurrency_code = $multicurrency_code; // Array with all currency of payments dispatching |
325 | 325 | $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching |
@@ -610,8 +610,8 @@ discard block |
||
610 | 610 | $total = 0; |
611 | 611 | $total_ttc = 0; |
612 | 612 | $totalrecu = 0; |
613 | - $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote |
|
614 | - $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits |
|
613 | + $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote |
|
614 | + $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits |
|
615 | 615 | while ($i < $num) { |
616 | 616 | $objp = $db->fetch_object($resql); |
617 | 617 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha'); |
87 | 87 | $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); |
88 | 88 | $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); |
89 | -$search_status = GETPOST('search_status', 'intcomma'); // Can be '' or a numeric |
|
89 | +$search_status = GETPOST('search_status', 'intcomma'); // Can be '' or a numeric |
|
90 | 90 | $search_paymentmode = GETPOST('search_paymentmode', 'intcomma'); |
91 | 91 | $search_paymentcond = GETPOST('search_paymentcond', 'intcomma'); |
92 | 92 | $search_town = GETPOST('search_town', 'alpha'); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | $object->fields = dol_sort_array($object->fields, 'position'); |
220 | 220 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
221 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
221 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
222 | 222 | |
223 | 223 | if (!isModEnabled('supplier_invoice')) { |
224 | 224 | accessforbidden(); |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1078 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1078 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1079 | 1079 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1080 | 1080 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1081 | 1081 | |
@@ -1929,7 +1929,7 @@ discard block |
||
1929 | 1929 | $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; |
1930 | 1930 | } |
1931 | 1931 | if (empty($totalarray['val']['totalam'])) { |
1932 | - $totalarray['val']['totalam'] = 0; // avoid PHP Warning: Undefined array key "totalam" on line 1891 |
|
1932 | + $totalarray['val']['totalam'] = 0; // avoid PHP Warning: Undefined array key "totalam" on line 1891 |
|
1933 | 1933 | } |
1934 | 1934 | $totalarray['val']['totalam'] += $totalpay; |
1935 | 1935 | } |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | $page = 0; |
88 | 88 | } // If $page is not defined, or '' or -1 |
89 | 89 | $offset = $limit * $page; |
90 | -if (! $sortorder) { |
|
90 | +if (!$sortorder) { |
|
91 | 91 | $sortorder = 'DESC'; |
92 | 92 | } |
93 | -if (! $sortfield) { |
|
93 | +if (!$sortfield) { |
|
94 | 94 | $sortfield = 'f.titre'; |
95 | 95 | } |
96 | 96 | $pageprev = $page - 1; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $object = new FactureFournisseurRec($db); |
100 | 100 | if (($id > 0 || $title) && $action != 'create' && $action != 'add') { |
101 | 101 | $ret = $object->fetch($id, $title); |
102 | - if (! $ret) { |
|
102 | + if (!$ret) { |
|
103 | 103 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
104 | 104 | } |
105 | 105 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $action = 'list'; |
144 | 144 | $massaction = ''; |
145 | 145 | } |
146 | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
146 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
147 | 147 | $massaction = ''; |
148 | 148 | } |
149 | 149 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // Create predefined invoice |
172 | 172 | if ($action == 'add') { |
173 | - if (! GETPOST('title', 'alphanohtml')) { |
|
173 | + if (!GETPOST('title', 'alphanohtml')) { |
|
174 | 174 | setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); |
175 | 175 | $action = "create"; |
176 | 176 | $error++; |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
196 | - if (! $error) { |
|
196 | + if (!$error) { |
|
197 | 197 | $object->subtype = GETPOSTINT('subtype'); |
198 | 198 | $object->title = GETPOST('title', 'alphanohtml'); |
199 | - $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
199 | + $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
200 | 200 | $object->label = GETPOST('libelle', 'alpha'); |
201 | 201 | $object->fk_project = GETPOSTINT('projectid'); |
202 | 202 | $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $action = "create"; |
243 | 243 | } |
244 | 244 | |
245 | - if (! $error) { |
|
245 | + if (!$error) { |
|
246 | 246 | $db->commit(); |
247 | 247 | |
248 | 248 | header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user); |
293 | 293 | |
294 | 294 | if ($result > 0) { |
295 | - $object->titre = $title; // deprecated |
|
295 | + $object->titre = $title; // deprecated |
|
296 | 296 | $object->title = $title; |
297 | 297 | $object->ref = $object->title; |
298 | 298 | } else { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $error++; |
340 | 340 | } |
341 | 341 | |
342 | - if (! $error) { |
|
342 | + if (!$error) { |
|
343 | 343 | $db->commit(); |
344 | 344 | } else { |
345 | 345 | $db->rollback(); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $error++; |
357 | 357 | } |
358 | 358 | |
359 | - if (! $error) { |
|
359 | + if (!$error) { |
|
360 | 360 | $db->commit(); |
361 | 361 | } else { |
362 | 362 | $db->rollback(); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $error++; |
416 | 416 | } |
417 | 417 | |
418 | - if (! $error) { |
|
418 | + if (!$error) { |
|
419 | 419 | $result = $object->insertExtraFields('BILLREC_MODIFY'); |
420 | 420 | if ($result < 0) { |
421 | 421 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); |
467 | 467 | $error++; |
468 | 468 | } |
469 | - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
469 | + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
470 | 470 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); |
471 | 471 | $error++; |
472 | 472 | } |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | } |
516 | 516 | } |
517 | 517 | |
518 | - if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
518 | + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
519 | 519 | $ret = $object->fetch($id); |
520 | 520 | if ($ret < 0) { |
521 | 521 | dol_print_error($db, $object->error); |
@@ -731,8 +731,8 @@ discard block |
||
731 | 731 | $action = ''; |
732 | 732 | } |
733 | 733 | } |
734 | - } elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) { |
|
735 | - if (! $object->fetch($id) > 0) { |
|
734 | + } elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { |
|
735 | + if (!$object->fetch($id) > 0) { |
|
736 | 736 | dol_print_error($db); |
737 | 737 | } |
738 | 738 | $object->fetch_thirdparty(); |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | |
784 | 784 | // Define special_code for special lines |
785 | 785 | $special_code = GETPOSTINT('special_code'); |
786 | - if (! GETPOST('qty', 'alpha')) { |
|
786 | + if (!GETPOST('qty', 'alpha')) { |
|
787 | 787 | $special_code = 3; |
788 | 788 | } |
789 | 789 | |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $date_end_fill = !empty(GETPOSTINT('date_end_fill')) ? GETPOSTINT('date_end_fill') : 'NULL'; |
830 | 830 | |
831 | 831 | // Update line |
832 | - if (! $error) { |
|
832 | + if (!$error) { |
|
833 | 833 | $result = $object->updateline(GETPOSTINT('lineid'), GETPOSTINT('productid'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); |
834 | 834 | if ($result >= 0) { |
835 | 835 | $object->fetch($object->id); // Reload lines |
@@ -1488,8 +1488,8 @@ discard block |
||
1488 | 1488 | print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); |
1489 | 1489 | } |
1490 | 1490 | //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); |
1491 | - if (! $object->isMaxNbGenReached()) { |
|
1492 | - if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1491 | + if (!$object->isMaxNbGenReached()) { |
|
1492 | + if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1493 | 1493 | print img_warning($langs->trans("Late")); |
1494 | 1494 | } |
1495 | 1495 | } else { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // Load object |
56 | 56 | include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
57 | 57 | |
58 | -$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice |
|
58 | +$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice |
|
59 | 59 | |
60 | 60 | // Security check |
61 | 61 | if ($user->socid) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $search_date_endday = GETPOSTINT('search_date_endday'); |
63 | 63 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
64 | 64 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
65 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
65 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
66 | 66 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
67 | 67 | $search_company = GETPOST('search_company', 'alpha'); |
68 | 68 | $search_payment_type = GETPOST('search_payment_type', 'alpha'); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'p.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70), |
111 | 111 | ); |
112 | 112 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
113 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
113 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
114 | 114 | |
115 | 115 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
116 | 116 | $hookmanager->initHooks(array('paymentsupplierlist')); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture_fourn AS f ON f.rowid = pf.fk_facturefourn'; |
208 | 208 | $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON s.rowid = f.fk_soc'; |
209 | 209 | |
210 | -$sql .= ' WHERE f.entity IN (' . getEntity('supplier_invoice') . ')'; // TODO We should use p.entity that does not exists yet in this table |
|
210 | +$sql .= ' WHERE f.entity IN (' . getEntity('supplier_invoice') . ')'; // TODO We should use p.entity that does not exists yet in this table |
|
211 | 211 | if ($socid > 0) { |
212 | 212 | $sql .= " AND EXISTS (SELECT f.fk_soc FROM " . MAIN_DB_PREFIX . "facture_fourn as f, " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as pf"; |
213 | 213 | $sql .= " WHERE p.rowid = pf.fk_paiementfourn AND pf.fk_facturefourn = f.rowid AND f.fk_soc = " . ((int) $socid) . ")"; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | return $this->fetch_lines(); |
700 | 700 | } |
701 | 701 | |
702 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
702 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
703 | 703 | /** |
704 | 704 | * Get lines of template invoices into this->lines |
705 | 705 | * |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | public function fetch_lines() |
709 | 709 | { |
710 | - // phpcs:enable |
|
710 | + // phpcs:enable |
|
711 | 711 | $this->lines = array(); |
712 | 712 | |
713 | 713 | // Retrieve all extrafield for line |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | return $this->LibStatut($this->frequency ? 1 : 0, $this->suspended, $mode, $alreadypaid, empty($this->type) ? 0 : $this->type); |
1513 | 1513 | } |
1514 | 1514 | |
1515 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1515 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1516 | 1516 | /** |
1517 | 1517 | * Return label of a status |
1518 | 1518 | * |
@@ -1525,7 +1525,7 @@ discard block |
||
1525 | 1525 | */ |
1526 | 1526 | public function LibStatut($recur, $status, $mode = 0, $alreadypaid = -1, $type = 0) |
1527 | 1527 | { |
1528 | - // phpcs:enable |
|
1528 | + // phpcs:enable |
|
1529 | 1529 | global $langs; |
1530 | 1530 | $langs->load('bills'); |
1531 | 1531 |
@@ -351,13 +351,13 @@ discard block |
||
351 | 351 | $sql .= ", '" . $this->db->idate($now) . "'"; |
352 | 352 | $sql .= ", " . ((int) $this->suspended); |
353 | 353 | $sql .= ", '" . $this->db->escape($this->libelle) . "'"; |
354 | - $sql .= ", " . (!empty($facfourn_src->total_ttc) ? (float) $facfourn_src->total_ttc : '0'); // amount |
|
354 | + $sql .= ", " . (!empty($facfourn_src->total_ttc) ? (float) $facfourn_src->total_ttc : '0'); // amount |
|
355 | 355 | $sql .= ", " . ((int) $user->id); |
356 | 356 | $sql .= ", " . (!empty($this->fk_project) ? ((int) $this->fk_project) : 'NULL'); |
357 | 357 | $sql .= ", " . (!empty($facfourn_src->fk_account) ? ((int) $facfourn_src->fk_account) : 'NULL'); |
358 | 358 | $sql .= ", " . ($this->cond_reglement_id > 0 ? (int) $this->cond_reglement_id : 'NULL'); |
359 | 359 | $sql .= ", " . ($this->mode_reglement_id > 0 ? (int) $this->mode_reglement_id : 'NULL'); |
360 | - $sql .= ", " . ($facfourn_src->date_echeance > 0 ? "'" . $this->db->idate($facfourn_src->date_echeance) . "'" : 'NULL'); // date_lim_reglement |
|
360 | + $sql .= ", " . ($facfourn_src->date_echeance > 0 ? "'" . $this->db->idate($facfourn_src->date_echeance) . "'" : 'NULL'); // date_lim_reglement |
|
361 | 361 | $sql .= ", " . (!empty($this->note_private) ? "'" . $this->db->escape($this->note_private) . "'" : 'NULL'); |
362 | 362 | $sql .= ", " . (!empty($this->note_public) ? "'" . $this->db->escape($this->note_public) . "'" : 'NULL'); |
363 | 363 | $sql .= ", " . (!empty($this->model_pdf) ? "'" . $this->db->escape($this->model_pdf) . "'" : 'NULL'); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | $error = 0; |
513 | 513 | |
514 | 514 | $sql = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_rec SET"; |
515 | - $sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "") . "'," ; |
|
515 | + $sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "") . "',"; |
|
516 | 516 | $sql .= " subtype=" . (isset($this->subtype) ? $this->db->escape($this->subtype) : "null") . ","; |
517 | 517 | $sql .= " ref_supplier = '" . (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "") . "',"; |
518 | 518 | $sql .= " entity = " . (!empty($this->entity) ? ((int) $this->entity) : 1) . ','; |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $this->id = $obj->rowid; |
631 | 631 | $this->titre = $obj->title; |
632 | 632 | $this->title = $obj->title; |
633 | - $this->subtype = $obj->subtype; |
|
633 | + $this->subtype = $obj->subtype; |
|
634 | 634 | $this->ref = $obj->title; |
635 | 635 | $this->ref_supplier = $obj->ref_supplier; |
636 | 636 | $this->entity = $obj->entity; |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | $line->product_type = $objp->product_type; |
789 | 789 | $line->date_start = $objp->date_start; |
790 | 790 | $line->date_end = $objp->date_end; |
791 | - $line->info_bits = $objp->info_bits ; |
|
791 | + $line->info_bits = $objp->info_bits; |
|
792 | 792 | $line->special_code = $objp->special_code; |
793 | 793 | $line->rang = $objp->rang; |
794 | 794 | $line->fk_unit = $objp->fk_unit; |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | } |
872 | 872 | // End call triggers |
873 | 873 | } |
874 | - if (! $error) { |
|
874 | + if (!$error) { |
|
875 | 875 | $this->db->commit(); |
876 | 876 | return 1; |
877 | 877 | } else { |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | $sql .= ', fk_user_author'; |
1016 | 1016 | $sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; |
1017 | 1017 | $sql .= ') VALUES ('; |
1018 | - $sql .= ' ' . (int) $facid; // source supplier invoice id |
|
1018 | + $sql .= ' ' . (int) $facid; // source supplier invoice id |
|
1019 | 1019 | $sql .= ', ' . (!empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); |
1020 | 1020 | $sql .= ', ' . (!empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); |
1021 | 1021 | $sql .= ', ' . (!empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); |
@@ -1356,7 +1356,7 @@ discard block |
||
1356 | 1356 | |
1357 | 1357 | $new_fac_fourn->type = self::TYPE_STANDARD; |
1358 | 1358 | $new_fac_fourn->subtype = $facturerec->subtype; |
1359 | - $new_fac_fourn->statut = self::STATUS_DRAFT; // deprecated |
|
1359 | + $new_fac_fourn->statut = self::STATUS_DRAFT; // deprecated |
|
1360 | 1360 | $new_fac_fourn->status = self::STATUS_DRAFT; |
1361 | 1361 | $new_fac_fourn->date = empty($facturerec->date_when) ? $now : $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. |
1362 | 1362 | $new_fac_fourn->socid = $facturerec->socid; |
@@ -1365,7 +1365,7 @@ discard block |
||
1365 | 1365 | $new_fac_fourn->model_pdf = $facturerec->model_pdf; |
1366 | 1366 | $new_fac_fourn->fk_project = $facturerec->fk_project; |
1367 | 1367 | $new_fac_fourn->label = $facturerec->label; |
1368 | - $new_fac_fourn->libelle = $facturerec->label; // deprecated |
|
1368 | + $new_fac_fourn->libelle = $facturerec->label; // deprecated |
|
1369 | 1369 | |
1370 | 1370 | $invoiceidgenerated = $new_fac_fourn->create($user); |
1371 | 1371 | $laststep = "Create invoiceidgenerated $invoiceidgenerated"; |
@@ -2072,8 +2072,8 @@ discard block |
||
2072 | 2072 | $error = 0; |
2073 | 2073 | $this->db->begin(); |
2074 | 2074 | |
2075 | - if (! $error) { |
|
2076 | - if (! $notrigger) { |
|
2075 | + if (!$error) { |
|
2076 | + if (!$notrigger) { |
|
2077 | 2077 | // Call triggers |
2078 | 2078 | $result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user); |
2079 | 2079 | if ($result < 0) { |
@@ -2083,14 +2083,14 @@ discard block |
||
2083 | 2083 | } |
2084 | 2084 | } |
2085 | 2085 | |
2086 | - if (! $error) { |
|
2086 | + if (!$error) { |
|
2087 | 2087 | $result = $this->deleteExtraFields(); |
2088 | 2088 | if ($result < 0) { |
2089 | 2089 | $error++; |
2090 | 2090 | } |
2091 | 2091 | } |
2092 | 2092 | |
2093 | - if (! $error) { |
|
2093 | + if (!$error) { |
|
2094 | 2094 | $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id; |
2095 | 2095 | |
2096 | 2096 | $res = $this->db->query($sql); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | } |
608 | 608 | |
609 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
609 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
610 | 610 | /** |
611 | 611 | * Load array lines |
612 | 612 | * |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | */ |
616 | 616 | public function fetch_lines($only_product = 0) |
617 | 617 | { |
618 | - // phpcs:enable |
|
618 | + // phpcs:enable |
|
619 | 619 | |
620 | 620 | $this->lines = array(); |
621 | 621 | |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | return $this->LibStatut($this->statut, $mode, $this->billed); |
881 | 881 | } |
882 | 882 | |
883 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
883 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
884 | 884 | /** |
885 | 885 | * Return label of a status |
886 | 886 | * |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | */ |
892 | 892 | public function LibStatut($status, $mode = 0, $billed = 0) |
893 | 893 | { |
894 | - // phpcs:enable |
|
894 | + // phpcs:enable |
|
895 | 895 | global $langs, $hookmanager; |
896 | 896 | |
897 | 897 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | return $result; |
1390 | 1390 | } |
1391 | 1391 | |
1392 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1392 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1393 | 1393 | /** |
1394 | 1394 | * Cancel an approved order. |
1395 | 1395 | * The cancellation is done after approval |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | */ |
1401 | 1401 | public function Cancel($user, $idwarehouse = -1) |
1402 | 1402 | { |
1403 | - // phpcs:enable |
|
1403 | + // phpcs:enable |
|
1404 | 1404 | global $langs, $conf; |
1405 | 1405 | |
1406 | 1406 | $error = 0; |
@@ -2537,7 +2537,7 @@ discard block |
||
2537 | 2537 | return $ret; |
2538 | 2538 | } |
2539 | 2539 | |
2540 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2540 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2541 | 2541 | /** |
2542 | 2542 | * Set a delivery in database for this supplier order |
2543 | 2543 | * |
@@ -2549,7 +2549,7 @@ discard block |
||
2549 | 2549 | */ |
2550 | 2550 | public function Livraison($user, $date, $type, $comment) |
2551 | 2551 | { |
2552 | - // phpcs:enable |
|
2552 | + // phpcs:enable |
|
2553 | 2553 | global $conf, $langs; |
2554 | 2554 | |
2555 | 2555 | $result = 0; |
@@ -2651,7 +2651,7 @@ discard block |
||
2651 | 2651 | return $result; |
2652 | 2652 | } |
2653 | 2653 | |
2654 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2654 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2655 | 2655 | /** |
2656 | 2656 | * Set delivery date |
2657 | 2657 | * |
@@ -2663,7 +2663,7 @@ discard block |
||
2663 | 2663 | */ |
2664 | 2664 | public function set_date_livraison($user, $delivery_date, $notrigger = 0) |
2665 | 2665 | { |
2666 | - // phpcs:enable |
|
2666 | + // phpcs:enable |
|
2667 | 2667 | return $this->setDeliveryDate($user, $delivery_date, $notrigger); |
2668 | 2668 | } |
2669 | 2669 | |
@@ -2723,7 +2723,7 @@ discard block |
||
2723 | 2723 | } |
2724 | 2724 | } |
2725 | 2725 | |
2726 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2726 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2727 | 2727 | /** |
2728 | 2728 | * Set the id projet |
2729 | 2729 | * |
@@ -2734,7 +2734,7 @@ discard block |
||
2734 | 2734 | */ |
2735 | 2735 | public function set_id_projet($user, $id_projet, $notrigger = 0) |
2736 | 2736 | { |
2737 | - // phpcs:enable |
|
2737 | + // phpcs:enable |
|
2738 | 2738 | if ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")) { |
2739 | 2739 | $error = 0; |
2740 | 2740 | |
@@ -3242,7 +3242,7 @@ discard block |
||
3242 | 3242 | } |
3243 | 3243 | } |
3244 | 3244 | |
3245 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
3245 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
3246 | 3246 | /** |
3247 | 3247 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
3248 | 3248 | * |
@@ -3252,7 +3252,7 @@ discard block |
||
3252 | 3252 | */ |
3253 | 3253 | public function load_board($user, $mode = 'opened') |
3254 | 3254 | { |
3255 | - // phpcs:enable |
|
3255 | + // phpcs:enable |
|
3256 | 3256 | global $conf, $langs; |
3257 | 3257 | |
3258 | 3258 | $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.fk_statut, c.date_livraison as delivery_date, c.total_ht"; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | $this->ref_supplier = $obj->ref_supplier; |
521 | 521 | $this->socid = $obj->fk_soc; |
522 | 522 | $this->fourn_id = $obj->fk_soc; |
523 | - $this->statut = $obj->status; // deprecated |
|
523 | + $this->statut = $obj->status; // deprecated |
|
524 | 524 | $this->status = $obj->status; |
525 | 525 | $this->billed = $obj->billed; |
526 | 526 | $this->user_author_id = $obj->user_author_id; |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $this->fk_project = $obj->fk_project; |
552 | 552 | $this->cond_reglement_id = $obj->fk_cond_reglement; |
553 | 553 | $this->cond_reglement_code = $obj->cond_reglement_code; |
554 | - $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
554 | + $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
555 | 555 | $this->cond_reglement_label = $obj->cond_reglement_label; |
556 | 556 | $this->cond_reglement_doc = $obj->cond_reglement_doc; |
557 | 557 | $this->fk_account = $obj->fk_account; |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
685 | 685 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
686 | 686 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
687 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
688 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
687 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
688 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
689 | 689 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $this->socid); |
690 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
690 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
691 | 691 | $sqlsearchpackage .= " LIMIT 1"; |
692 | 692 | |
693 | 693 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -1623,10 +1623,10 @@ discard block |
||
1623 | 1623 | $line->date_end, |
1624 | 1624 | $line->array_options, |
1625 | 1625 | $line->fk_unit, |
1626 | - $line->multicurrency_subprice, // pu_ht_devise |
|
1627 | - $line->origin, // origin |
|
1628 | - $line->origin_id, // origin_id |
|
1629 | - $line->rang, // rang |
|
1626 | + $line->multicurrency_subprice, // pu_ht_devise |
|
1627 | + $line->origin, // origin |
|
1628 | + $line->origin_id, // origin_id |
|
1629 | + $line->rang, // rang |
|
1630 | 1630 | $line->special_code |
1631 | 1631 | ); |
1632 | 1632 | if ($result < 0) { |
@@ -2000,7 +2000,7 @@ discard block |
||
2000 | 2000 | $this->db->begin(); |
2001 | 2001 | |
2002 | 2002 | $product_type = $type; |
2003 | - $label = ''; // deprecated |
|
2003 | + $label = ''; // deprecated |
|
2004 | 2004 | |
2005 | 2005 | if ($fk_product > 0) { |
2006 | 2006 | if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) { // Not the common case |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | $this->line->total_localtax2 = $total_localtax2; |
2144 | 2144 | $this->line->total_ttc = $total_ttc; |
2145 | 2145 | $this->line->product_type = $type; |
2146 | - $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
2146 | + $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
2147 | 2147 | $this->line->origin = $origin; |
2148 | 2148 | $this->line->origin_id = $origin_id; |
2149 | 2149 | $this->line->fk_unit = $fk_unit; |
@@ -3350,7 +3350,7 @@ discard block |
||
3350 | 3350 | global $conf, $langs; |
3351 | 3351 | |
3352 | 3352 | if (!dol_strlen($modele)) { |
3353 | - $modele = ''; // No doc template/generation by default |
|
3353 | + $modele = ''; // No doc template/generation by default |
|
3354 | 3354 | |
3355 | 3355 | if (!empty($this->model_pdf)) { |
3356 | 3356 | $modele = $this->model_pdf; |
@@ -3892,10 +3892,10 @@ discard block |
||
3892 | 3892 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
3893 | 3893 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
3894 | 3894 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
3895 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
3896 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
3895 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
3896 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
3897 | 3897 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $objp->socid); |
3898 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
3898 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
3899 | 3899 | $sqlsearchpackage .= " LIMIT 1"; |
3900 | 3900 | |
3901 | 3901 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | } |
1013 | 1013 | |
1014 | 1014 | |
1015 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1015 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1016 | 1016 | /** |
1017 | 1017 | * Load this->lines |
1018 | 1018 | * |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | */ |
1021 | 1021 | public function fetch_lines() |
1022 | 1022 | { |
1023 | - // phpcs:enable |
|
1023 | + // phpcs:enable |
|
1024 | 1024 | $this->lines = array(); |
1025 | 1025 | |
1026 | 1026 | $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description as line_desc, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | } |
1308 | 1308 | } |
1309 | 1309 | |
1310 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1310 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1311 | 1311 | /** |
1312 | 1312 | * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) |
1313 | 1313 | * |
@@ -1316,7 +1316,7 @@ discard block |
||
1316 | 1316 | */ |
1317 | 1317 | public function insert_discount($idremise) |
1318 | 1318 | { |
1319 | - // phpcs:enable |
|
1319 | + // phpcs:enable |
|
1320 | 1320 | global $conf, $langs; |
1321 | 1321 | |
1322 | 1322 | include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; |
@@ -1542,7 +1542,7 @@ discard block |
||
1542 | 1542 | } |
1543 | 1543 | |
1544 | 1544 | |
1545 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1545 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1546 | 1546 | /** |
1547 | 1547 | * Tag invoice as a paid invoice |
1548 | 1548 | * |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | */ |
1556 | 1556 | public function set_paid($user, $close_code = '', $close_note = '') |
1557 | 1557 | { |
1558 | - // phpcs:enable |
|
1558 | + // phpcs:enable |
|
1559 | 1559 | dol_syslog(get_class($this) . "::set_paid is deprecated, use setPaid instead", LOG_NOTICE); |
1560 | 1560 | return $this->setPaid($user, $close_code, $close_note); |
1561 | 1561 | } |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | } |
1621 | 1621 | } |
1622 | 1622 | |
1623 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1623 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1624 | 1624 | /** |
1625 | 1625 | * Tag the invoice as not fully paid + trigger call BILL_UNPAYED |
1626 | 1626 | * Function used when a direct debit payment is refused, |
@@ -1633,7 +1633,7 @@ discard block |
||
1633 | 1633 | */ |
1634 | 1634 | public function set_unpaid($user) |
1635 | 1635 | { |
1636 | - // phpcs:enable |
|
1636 | + // phpcs:enable |
|
1637 | 1637 | dol_syslog(get_class($this) . "::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE); |
1638 | 1638 | return $this->setUnpaid($user); |
1639 | 1639 | } |
@@ -2568,7 +2568,7 @@ discard block |
||
2568 | 2568 | } |
2569 | 2569 | } |
2570 | 2570 | |
2571 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2571 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2572 | 2572 | /** |
2573 | 2573 | * Return list of replaceable invoices |
2574 | 2574 | * Status valid or abandoned for other reason + not paid + no payment + not already replaced |
@@ -2579,7 +2579,7 @@ discard block |
||
2579 | 2579 | */ |
2580 | 2580 | public function list_replacable_supplier_invoices($socid = 0) |
2581 | 2581 | { |
2582 | - // phpcs:enable |
|
2582 | + // phpcs:enable |
|
2583 | 2583 | global $conf; |
2584 | 2584 | |
2585 | 2585 | $return = array(); |
@@ -2617,7 +2617,7 @@ discard block |
||
2617 | 2617 | } |
2618 | 2618 | } |
2619 | 2619 | |
2620 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2620 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2621 | 2621 | /** |
2622 | 2622 | * Return list of qualifying invoices for correction by credit note |
2623 | 2623 | * Invoices that respect the following rules are returned: |
@@ -2629,7 +2629,7 @@ discard block |
||
2629 | 2629 | */ |
2630 | 2630 | public function list_qualified_avoir_supplier_invoices($socid = 0) |
2631 | 2631 | { |
2632 | - // phpcs:enable |
|
2632 | + // phpcs:enable |
|
2633 | 2633 | global $conf; |
2634 | 2634 | |
2635 | 2635 | $return = array(); |
@@ -2671,7 +2671,7 @@ discard block |
||
2671 | 2671 | } |
2672 | 2672 | } |
2673 | 2673 | |
2674 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2674 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2675 | 2675 | /** |
2676 | 2676 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
2677 | 2677 | * |
@@ -2680,7 +2680,7 @@ discard block |
||
2680 | 2680 | */ |
2681 | 2681 | public function load_board($user) |
2682 | 2682 | { |
2683 | - // phpcs:enable |
|
2683 | + // phpcs:enable |
|
2684 | 2684 | global $conf, $langs; |
2685 | 2685 | |
2686 | 2686 | $sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut as status, ff.total_ht, ff.total_ttc'; |
@@ -4431,7 +4431,7 @@ discard block |
||
4431 | 4431 | } |
4432 | 4432 | } |
4433 | 4433 | |
4434 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4434 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4435 | 4435 | /** |
4436 | 4436 | * Mise a jour de l'objet ligne de commande en base |
4437 | 4437 | * |
@@ -4439,7 +4439,7 @@ discard block |
||
4439 | 4439 | */ |
4440 | 4440 | public function update_total() |
4441 | 4441 | { |
4442 | - // phpcs:enable |
|
4442 | + // phpcs:enable |
|
4443 | 4443 | $this->db->begin(); |
4444 | 4444 | |
4445 | 4445 | // Mise a jour ligne en base |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | /** |
228 | 228 | * @var int ID |
229 | 229 | */ |
230 | - public $fk_account; // default bank account |
|
230 | + public $fk_account; // default bank account |
|
231 | 231 | |
232 | 232 | /** |
233 | 233 | * @var int Transport mode id |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $this->location_incoterms = $_facrec->location_incoterms; |
464 | 464 | |
465 | 465 | // Clean parameters |
466 | - if (! $this->type) { |
|
466 | + if (!$this->type) { |
|
467 | 467 | $this->type = self::TYPE_STANDARD; |
468 | 468 | } |
469 | 469 | if (!empty(GETPOST('ref_supplier'))) { |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | $this->array_options = $_facrec->array_options; |
479 | 479 | |
480 | - if (! $this->mode_reglement_id) { |
|
480 | + if (!$this->mode_reglement_id) { |
|
481 | 481 | $this->mode_reglement_id = 0; |
482 | 482 | } |
483 | 483 | $this->status = self::STATUS_DRAFT; |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | /* |
727 | 727 | * Insert lines of template invoices |
728 | 728 | */ |
729 | - if (! $error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) { |
|
729 | + if (!$error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) { |
|
730 | 730 | foreach ($_facrec->lines as $i => $val) { |
731 | 731 | if ($_facrec->lines[$i]->fk_product) { |
732 | 732 | $prod = new Product($this->db); |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | $buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice; |
754 | 754 | |
755 | 755 | // If buyprice not defined from template invoice, we try to guess the best value |
756 | - if (! $buyprice && $_facrec->lines[$i]->fk_product > 0) { |
|
756 | + if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) { |
|
757 | 757 | require_once constant('DOL_DOCUMENT_ROOT') . '/fourn/class/fournisseur.product.class.php'; |
758 | 758 | $producttmp = new ProductFournisseur($this->db); |
759 | 759 | $producttmp->fetch($_facrec->lines[$i]->fk_product); |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | |
1005 | 1005 | $this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array(); |
1006 | 1006 | |
1007 | - $this->socid = $obj->socid; |
|
1007 | + $this->socid = $obj->socid; |
|
1008 | 1008 | |
1009 | 1009 | // Retrieve all extrafield |
1010 | 1010 | // fetch optionals attributes and labels |
@@ -2278,7 +2278,7 @@ discard block |
||
2278 | 2278 | // Multicurrency |
2279 | 2279 | $supplierinvoiceline->fk_multicurrency = $this->fk_multicurrency; |
2280 | 2280 | $supplierinvoiceline->multicurrency_code = $this->multicurrency_code; |
2281 | - $supplierinvoiceline->multicurrency_subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise |
|
2281 | + $supplierinvoiceline->multicurrency_subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise |
|
2282 | 2282 | |
2283 | 2283 | $supplierinvoiceline->multicurrency_total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ht) : $multicurrency_total_ht); // For credit note and if qty is negative, total is negative |
2284 | 2284 | $supplierinvoiceline->multicurrency_total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_tva) : $multicurrency_total_tva); // For credit note and if qty is negative, total is negative |
@@ -2444,7 +2444,7 @@ discard block |
||
2444 | 2444 | |
2445 | 2445 | $line->qty = ($this->type == self::TYPE_CREDIT_NOTE ? abs((float) $qty) : $qty); // For credit note, quantity is always positive and unit price negative |
2446 | 2446 | $line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise |
2447 | - $line->pu_ht = $line->subprice; // deprecated |
|
2447 | + $line->pu_ht = $line->subprice; // deprecated |
|
2448 | 2448 | $line->pu_ttc = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ttc) : $pu_ttc); // For credit note, unit price always negative, always positive otherwise |
2449 | 2449 | |
2450 | 2450 | $line->remise_percent = $remise_percent; |
@@ -2729,7 +2729,7 @@ discard block |
||
2729 | 2729 | |
2730 | 2730 | while ($obj = $this->db->fetch_object($resql)) { |
2731 | 2731 | $facturestatic->date_echeance = $this->db->jdate($obj->datefin); |
2732 | - $facturestatic->statut = $obj->status; // For backward compatibility |
|
2732 | + $facturestatic->statut = $obj->status; // For backward compatibility |
|
2733 | 2733 | $facturestatic->status = $obj->status; |
2734 | 2734 | |
2735 | 2735 | $response->nbtodo++; |
@@ -3164,15 +3164,15 @@ discard block |
||
3164 | 3164 | // Load source object |
3165 | 3165 | $object->fetch($fromid); |
3166 | 3166 | $object->id = 0; |
3167 | - $object->statut = self::STATUS_DRAFT; // For backward compatibility |
|
3167 | + $object->statut = self::STATUS_DRAFT; // For backward compatibility |
|
3168 | 3168 | $object->status = self::STATUS_DRAFT; |
3169 | 3169 | |
3170 | 3170 | $object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor |
3171 | 3171 | |
3172 | 3172 | // Clear fields |
3173 | 3173 | $object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf") . ' ' . $object->ref_supplier : $this->ref_supplier); |
3174 | - $object->author = $user->id; // FIXME? user_validation_id is replacement for author |
|
3175 | - $object->user_validation_id = 0; // FIXME? user_validation_id is replacement for author |
|
3174 | + $object->author = $user->id; // FIXME? user_validation_id is replacement for author |
|
3175 | + $object->user_validation_id = 0; // FIXME? user_validation_id is replacement for author |
|
3176 | 3176 | $object->fk_facture_source = 0; |
3177 | 3177 | $object->date_creation = ''; |
3178 | 3178 | $object->date_validation = ''; |
@@ -3475,14 +3475,14 @@ discard block |
||
3475 | 3475 | if (!empty($paymentmode) && $paymentmode != 'all') { |
3476 | 3476 | $sql .= ", " . MAIN_DB_PREFIX . "c_paiement as cp"; |
3477 | 3477 | } |
3478 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
3479 | - $sql .= " AND f.fk_statut = " . self::STATUS_VALIDATED; // Only validated status |
|
3478 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
3479 | + $sql .= " AND f.fk_statut = " . self::STATUS_VALIDATED; // Only validated status |
|
3480 | 3480 | if ($datetouse == 'invoicedate') { |
3481 | 3481 | $sql .= " AND f.datef = '" . $this->db->idate($tmpidate, 'gmt') . "'"; |
3482 | 3482 | } else { |
3483 | 3483 | $sql .= " AND f.date_lim_reglement = '" . $this->db->idate($tmpidate, 'gmt') . "'"; |
3484 | 3484 | } |
3485 | - $sql .= " AND f.entity IN (" . getEntity('supplier_invoice', 0) . ")"; // One batch process only one company (no sharing) |
|
3485 | + $sql .= " AND f.entity IN (" . getEntity('supplier_invoice', 0) . ")"; // One batch process only one company (no sharing) |
|
3486 | 3486 | if (!empty($paymentmode) && $paymentmode != 'all') { |
3487 | 3487 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '" . $this->db->escape($paymentmode) . "'"; |
3488 | 3488 | } |
@@ -3702,7 +3702,7 @@ discard block |
||
3702 | 3702 | $actioncomm->create($user); |
3703 | 3703 | } |
3704 | 3704 | |
3705 | - $this->db->commit(); // We always commit |
|
3705 | + $this->db->commit(); // We always commit |
|
3706 | 3706 | } |
3707 | 3707 | |
3708 | 3708 | if ($errormesg) { |
@@ -4377,8 +4377,7 @@ discard block |
||
4377 | 4377 | $sql .= " " . ($this->fk_parent_line > 0 ? "'" . $this->db->escape($this->fk_parent_line) . "'" : "null") . ","; |
4378 | 4378 | $product_label |
4379 | 4379 | = !empty($this->product_label) |
4380 | - ? $this->product_label : |
|
4381 | - (!empty($this->label) ? $this->label : null); |
|
4380 | + ? $this->product_label : (!empty($this->label) ? $this->label : null); |
|
4382 | 4381 | $sql .= " " . (!empty($product_label) ? "'" . $this->db->escape($product_label) . "'" : "null") . ","; |
4383 | 4382 | $sql .= " '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "',"; |
4384 | 4383 | $sql .= " '" . $this->db->escape($this->ref_supplier) . "',"; |