@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
624 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
625 | 625 | /** |
626 | 626 | * Delete targets emailing |
627 | 627 | * |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | */ |
630 | 630 | public function delete_targets() |
631 | 631 | { |
632 | - // phpcs:enable |
|
632 | + // phpcs:enable |
|
633 | 633 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "mailing_cibles"; |
634 | 634 | $sql .= " WHERE fk_mailing = " . ((int) $this->id); |
635 | 635 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | } |
647 | 647 | |
648 | 648 | |
649 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
649 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
650 | 650 | /** |
651 | 651 | * Change status of each recipient |
652 | 652 | * |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | */ |
656 | 656 | public function reset_targets_status($user) |
657 | 657 | { |
658 | - // phpcs:enable |
|
658 | + // phpcs:enable |
|
659 | 659 | $sql = "UPDATE " . MAIN_DB_PREFIX . "mailing_cibles"; |
660 | 660 | $sql .= " SET statut = 0"; |
661 | 661 | $sql .= " WHERE fk_mailing = " . ((int) $this->id); |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | return $this->LibStatut($this->status, $mode); |
871 | 871 | } |
872 | 872 | |
873 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
873 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
874 | 874 | /** |
875 | 875 | * Return the label of a given status |
876 | 876 | * |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | */ |
881 | 881 | public function LibStatut($status, $mode = 0) |
882 | 882 | { |
883 | - // phpcs:enable |
|
883 | + // phpcs:enable |
|
884 | 884 | global $langs; |
885 | 885 | $langs->load("mailing"); |
886 | 886 |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $this->title = $obj->title; |
385 | 385 | $this->messtype = $obj->messtype; |
386 | 386 | |
387 | - $this->statut = $obj->status; // deprecated |
|
387 | + $this->statut = $obj->status; // deprecated |
|
388 | 388 | $this->status = $obj->status; |
389 | 389 | |
390 | 390 | $this->nbemail = $obj->nbemail; |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | $sql .= ' WHERE rowid = ' . ((int) $this->id); |
728 | 728 | |
729 | 729 | $resqlupdate = $this->db->query($sql); |
730 | - if (! $resqlupdate) { |
|
730 | + if (!$resqlupdate) { |
|
731 | 731 | $this->error = $this->db->lasterror(); |
732 | 732 | return -1; |
733 | 733 | } else { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | return $event; |
340 | 340 | } |
341 | 341 | |
342 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
342 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
343 | 343 | /** |
344 | 344 | * Clean sensible object datas |
345 | 345 | * |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function _cleanObjectDatas($object) |
350 | 350 | { |
351 | - // phpcs:enable |
|
351 | + // phpcs:enable |
|
352 | 352 | $object = parent::_cleanObjectDatas($object); |
353 | 353 | |
354 | 354 | unset($object->note); // alreaydy into note_private |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | } |
665 | 665 | |
666 | 666 | |
667 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
667 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
668 | 668 | /** |
669 | 669 | * Clean sensible object datas |
670 | 670 | * |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | */ |
674 | 674 | protected function _cleanObjectDatas($object) |
675 | 675 | { |
676 | - // phpcs:enable |
|
676 | + // phpcs:enable |
|
677 | 677 | $object = parent::_cleanObjectDatas($object); |
678 | 678 | |
679 | 679 | // Remove fields not relevant to categories |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $error = 0; |
88 | 88 | $this->db->begin(); |
89 | 89 | |
90 | - if (! $error) { |
|
91 | - if (! $notrigger) { |
|
90 | + if (!$error) { |
|
91 | + if (!$notrigger) { |
|
92 | 92 | // Call triggers |
93 | 93 | $result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user); |
94 | 94 | if ($result < 0) { |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - if (! $error) { |
|
101 | + if (!$error) { |
|
102 | 102 | $result = $this->deleteExtraFields(); |
103 | 103 | if ($result < 0) { |
104 | 104 | $error++; |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - if (! $error) { |
|
108 | + if (!$error) { |
|
109 | 109 | $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id; |
110 | 110 | |
111 | 111 | $res = $this->db->query($sql); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $this->reputations = array('-1' => '', 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
229 | 229 | } |
230 | 230 | |
231 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
231 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
232 | 232 | /** |
233 | 233 | * Remove all prices for this couple supplier-product |
234 | 234 | * |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function remove_fournisseur($id_fourn) |
239 | 239 | { |
240 | - // phpcs:enable |
|
240 | + // phpcs:enable |
|
241 | 241 | $ok = 1; |
242 | 242 | |
243 | 243 | $this->db->begin(); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | |
264 | 264 | |
265 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
265 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
266 | 266 | /** |
267 | 267 | * Remove a price for a couple supplier-product |
268 | 268 | * |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function remove_product_fournisseur_price($rowid) |
273 | 273 | { |
274 | - // phpcs:enable |
|
274 | + // phpcs:enable |
|
275 | 275 | global $conf, $user; |
276 | 276 | |
277 | 277 | $error = 0; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | |
310 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
310 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
311 | 311 | /** |
312 | 312 | * Modify the purchase price for a supplier |
313 | 313 | * |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $fk_barcode_type = 0, |
364 | 364 | $options = array() |
365 | 365 | ) { |
366 | - // phpcs:enable |
|
366 | + // phpcs:enable |
|
367 | 367 | global $conf, $langs; |
368 | 368 | //global $mysoc; |
369 | 369 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | } |
668 | 668 | } |
669 | 669 | |
670 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
670 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
671 | 671 | /** |
672 | 672 | * Loads the price information of a provider |
673 | 673 | * |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | */ |
678 | 678 | public function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) |
679 | 679 | { |
680 | - // phpcs:enable |
|
680 | + // phpcs:enable |
|
681 | 681 | global $conf; |
682 | 682 | |
683 | 683 | $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | } |
763 | 763 | |
764 | 764 | |
765 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
765 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
766 | 766 | /** |
767 | 767 | * List all supplier prices of a product |
768 | 768 | * |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public function list_product_fournisseur_price($prodid, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0, $socid = 0) |
779 | 779 | { |
780 | - // phpcs:enable |
|
780 | + // phpcs:enable |
|
781 | 781 | global $conf; |
782 | 782 | |
783 | 783 | $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id, p.ref as product_ref, p.tosell as status, p.tobuy as status_buy, "; |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | } |
878 | 878 | } |
879 | 879 | |
880 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
880 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
881 | 881 | /** |
882 | 882 | * Load properties for minimum price |
883 | 883 | * |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | */ |
890 | 890 | public function find_min_price_product_fournisseur($prodid, $qty = 0, $socid = 0) |
891 | 891 | { |
892 | - // phpcs:enable |
|
892 | + // phpcs:enable |
|
893 | 893 | global $conf; |
894 | 894 | |
895 | 895 | if (empty($prodid)) { |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | return $thirdparty->getNomUrl($withpicto, $option, $maxlen, $notooltip); |
1063 | 1063 | } |
1064 | 1064 | |
1065 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1065 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1066 | 1066 | /** |
1067 | 1067 | * Display price of product |
1068 | 1068 | * |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | */ |
1077 | 1077 | public function display_price_product_fournisseur($showunitprice = 1, $showsuptitle = 1, $maxlen = 0, $notooltip = 0, $productFournList = array()) |
1078 | 1078 | { |
1079 | - // phpcs:enable |
|
1079 | + // phpcs:enable |
|
1080 | 1080 | global $conf, $langs; |
1081 | 1081 | |
1082 | 1082 | $out = ''; |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | return $this->LibStatut($this->status, $mode); |
1415 | 1415 | } |
1416 | 1416 | |
1417 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1417 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1418 | 1418 | /** |
1419 | 1419 | * Return the status |
1420 | 1420 | * |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | */ |
1426 | 1426 | public function LibStatut($status, $mode = 0, $type = 0) |
1427 | 1427 | { |
1428 | - // phpcs:enable |
|
1428 | + // phpcs:enable |
|
1429 | 1429 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
1430 | 1430 | global $langs; |
1431 | 1431 | //$langs->load("mymodule@mymodule"); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public $fourn_remise; |
139 | 139 | |
140 | - public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set |
|
140 | + public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * @var int product-supplier id |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public $fk_availability; |
158 | 158 | |
159 | 159 | public $fourn_unitprice; |
160 | - public $fourn_unitprice_with_discount; // not saved into database |
|
160 | + public $fourn_unitprice_with_discount; // not saved into database |
|
161 | 161 | public $fourn_tva_tx; |
162 | 162 | public $fourn_tva_npr; |
163 | 163 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | } |
476 | 476 | $sql = "UPDATE " . MAIN_DB_PREFIX . "product_fournisseur_price"; |
477 | 477 | $sql .= " SET fk_user = " . ((int) $user->id) . " ,"; |
478 | - $sql .= " datec = '" . $this->db->idate($now) . "' ,"; // Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log. |
|
478 | + $sql .= " datec = '" . $this->db->idate($now) . "' ,"; // Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log. |
|
479 | 479 | $sql .= " ref_fourn = '" . $this->db->escape($ref_fourn) . "',"; |
480 | 480 | $sql .= " desc_fourn = '" . $this->db->escape($desc_fourn) . "',"; |
481 | 481 | $sql .= " price = " . ((float) $buyprice) . ","; |
@@ -825,10 +825,10 @@ discard block |
||
825 | 825 | $prodfourn->fourn_tva_tx = $record["tva_tx"]; |
826 | 826 | $prodfourn->fourn_id = $record["fourn_id"]; |
827 | 827 | $prodfourn->fourn_name = $record["supplier_name"]; |
828 | - $prodfourn->fk_availability = $record["fk_availability"]; |
|
828 | + $prodfourn->fk_availability = $record["fk_availability"]; |
|
829 | 829 | $prodfourn->delivery_time_days = $record["delivery_time_days"]; |
830 | 830 | $prodfourn->id = $prodid; |
831 | - $prodfourn->fourn_tva_npr = $record["info_bits"]; |
|
831 | + $prodfourn->fourn_tva_npr = $record["info_bits"]; |
|
832 | 832 | $prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; |
833 | 833 | $prodfourn->supplier_reputation = $record["supplier_reputation"]; |
834 | 834 | $prodfourn->fourn_date_creation = $this->db->jdate($record['datec']); |
@@ -188,10 +188,10 @@ |
||
188 | 188 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
189 | 189 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
190 | 190 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
191 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
192 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
191 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
192 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
193 | 193 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $objp->socid); |
194 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
194 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
195 | 195 | $sqlsearchpackage .= " LIMIT 1"; |
196 | 196 | |
197 | 197 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | } |
777 | 777 | } |
778 | 778 | |
779 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
779 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
780 | 780 | /** |
781 | 781 | * Mise a jour de l'objet ligne de commande en base |
782 | 782 | * |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | */ |
785 | 785 | public function update_total() |
786 | 786 | { |
787 | - // phpcs:enable |
|
787 | + // phpcs:enable |
|
788 | 788 | $this->db->begin(); |
789 | 789 | |
790 | 790 | // Mise a jour ligne en base |
@@ -694,8 +694,7 @@ |
||
694 | 694 | $sql .= " " . ($this->fk_parent_line > 0 ? "'" . $this->db->escape($this->fk_parent_line) . "'" : "null") . ","; |
695 | 695 | $product_label |
696 | 696 | = !empty($this->product_label) |
697 | - ? $this->product_label : |
|
698 | - (!empty($this->label) ? $this->label : null); |
|
697 | + ? $this->product_label : (!empty($this->label) ? $this->label : null); |
|
699 | 698 | $sql .= " " . (!empty($product_label) ? "'" . $this->db->escape($product_label) . "'" : "null") . ","; |
700 | 699 | $sql .= " '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "',"; |
701 | 700 | $sql .= " '" . $this->db->escape($this->ref_supplier) . "',"; |
@@ -143,7 +143,7 @@ |
||
143 | 143 | $this->note_private = $obj->note; |
144 | 144 | $this->type_code = $obj->payment_code; |
145 | 145 | $this->type_label = $obj->payment_type; |
146 | - $this->fk_paiement = $obj->fk_paiement; |
|
146 | + $this->fk_paiement = $obj->fk_paiement; |
|
147 | 147 | $this->statut = $obj->statut; |
148 | 148 | |
149 | 149 | $error = 1; |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | return $this->LibStatut($this->statut, $mode); |
598 | 598 | } |
599 | 599 | |
600 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
600 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
601 | 601 | /** |
602 | 602 | * Return the label of a given status |
603 | 603 | * |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | */ |
608 | 608 | public function LibStatut($status, $mode = 0) |
609 | 609 | { |
610 | - // phpcs:enable |
|
610 | + // phpcs:enable |
|
611 | 611 | global $langs; |
612 | 612 | |
613 | 613 | $langs->load('compta'); |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | } |
895 | 895 | |
896 | 896 | |
897 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
897 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
898 | 898 | /** |
899 | 899 | * Load the third party of object, from id into this->thirdparty |
900 | 900 | * |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | */ |
904 | 904 | public function fetch_thirdparty($force_thirdparty_id = 0) |
905 | 905 | { |
906 | - // phpcs:enable |
|
906 | + // phpcs:enable |
|
907 | 907 | |
908 | 908 | if (empty($force_thirdparty_id)) { |
909 | 909 | $billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first supplier invoice to get him |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
164 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
165 | 165 | /** |
166 | 166 | * Create a supplier category |
167 | 167 | * |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function CreateCategory($user, $name) |
173 | 173 | { |
174 | - // phpcs:enable |
|
174 | + // phpcs:enable |
|
175 | 175 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie (label,visible,type)"; |
176 | 176 | $sql .= " VALUES "; |
177 | 177 | $sql .= " ('" . $this->db->escape($name) . "',1,1)"; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
191 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
192 | 192 | /** |
193 | 193 | * Return the suppliers list |
194 | 194 | * |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function ListArray() |
198 | 198 | { |
199 | - // phpcs:enable |
|
199 | + // phpcs:enable |
|
200 | 200 | global $conf; |
201 | 201 | global $user; |
202 | 202 |