Passed
Push — GENERAL_BUG_REVIEW_240911 ( 6dbc7d...fb375d )
by Rafael
53:50
created
Dolibarr/Code/Product/Classes/ProductCustomerPrice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@
 block discarded – undo
256 256
         $sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->db->escape($this->localtax2_type) . "'") . ",";
257 257
         $sql .= " " . (!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)) . ",";
258 258
         $sql .= " " . ((int) $user->id) . ",";
259
-        $sql .=  " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ",";
259
+        $sql .= " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ",";
260 260
         $sql .= " " . (!isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'");
261 261
         $sql .= ")";
262 262
 
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Classes/MouvementStock.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                 'skip_batch'       => &$skip_batch,
220 220
                 'id_product_batch' => &$id_product_batch
221 221
             );
222
-            $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action);    // Note that $action and $object may have been modified by some hooks
222
+            $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
223 223
 
224 224
             if ($reshook < 0) {
225 225
                 if (!empty($hookmanager->resPrint)) {
@@ -708,8 +708,8 @@  discard block
 block discarded – undo
708 708
                 $this->price = $obj->price;
709 709
                 $this->fk_user_author = $obj->fk_user_author;
710 710
                 $this->label = $obj->label;
711
-                $this->fk_origin = $obj->origin_id;     // For backward compatibility
712
-                $this->origintype = $obj->origin_type;  // For backward compatibility
711
+                $this->fk_origin = $obj->origin_id; // For backward compatibility
712
+                $this->origintype = $obj->origin_type; // For backward compatibility
713 713
                 $this->origin_id = $obj->origin_id;
714 714
                 $this->origin_type = $obj->origin_type;
715 715
                 $this->inventorycode = $obj->inventorycode;
@@ -944,8 +944,8 @@  discard block
 block discarded – undo
944 944
             } else {                    // product_batch record not found
945 945
                 $pdluo->fk_product_stock = $vfk_product_stock;
946 946
                 $pdluo->qty = $qty;
947
-                $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby'];        // No more used. Now eatby date is store in table of lot, no more into prouct_batch table.
948
-                $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby'];     // No more used. Now sellby date is store in table of lot, no more into prouct_batch table.
947
+                $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table.
948
+                $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table.
949 949
                 $pdluo->batch = $vbatchnumber;
950 950
 
951 951
                 $result = $pdluo->create($user, 1);
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $this->db = $db;
167 167
     }
168 168
 
169
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
169
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
170 170
     /**
171 171
      *  Add a movement of stock (in one direction only).
172 172
      *  This is the lowest level method to record a stock change. There is no control if warehouse is open or not.
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0, $donotcleanemptylines = 0, $force_update_batch = false)
198 198
     {
199
-		// phpcs:enable
199
+        // phpcs:enable
200 200
         global $conf, $langs;
201 201
 
202 202
 
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
         return $result;
966 966
     }
967 967
 
968
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
968
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
969 969
     /**
970 970
      * Return Url link of origin object
971 971
      *
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
      */
976 976
     public function get_origin($origin_id, $origin_type)
977 977
     {
978
-		// phpcs:enable
978
+        // phpcs:enable
979 979
         $origin = '';
980 980
 
981 981
         switch ($origin_type) {
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
         return $this->LibStatut($mode);
1189 1189
     }
1190 1190
 
1191
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1191
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1192 1192
     /**
1193 1193
      *  Return the label of the status
1194 1194
      *
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
      */
1198 1198
     public function LibStatut($mode = 0)
1199 1199
     {
1200
-		// phpcs:enable
1200
+        // phpcs:enable
1201 1201
         global $langs;
1202 1202
 
1203 1203
         if ($mode == 0 || $mode == 1) {
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Classes/Inventory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         return $this->LibStatut($this->status, $mode);
649 649
     }
650 650
 
651
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
651
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
652 652
     /**
653 653
      *  Return the status
654 654
      *
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
      */
659 659
     public static function LibStatut($status, $mode = 0)
660 660
     {
661
-		// phpcs:enable
661
+        // phpcs:enable
662 662
         global $langs;
663 663
 
664 664
         $labelStatus = array();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public $picto = 'inventory';
66 66
 
67
-    const STATUS_DRAFT     = 0;     // Draft
68
-    const STATUS_VALIDATED = 1;     // Inventory is in process
69
-    const STATUS_RECORDED  = 2;     // Inventory is finisged. Stock movement has been recorded.
70
-    const STATUS_CANCELED  = 9;     // Canceled
67
+    const STATUS_DRAFT     = 0; // Draft
68
+    const STATUS_VALIDATED = 1; // Inventory is in process
69
+    const STATUS_RECORDED  = 2; // Inventory is finisged. Stock movement has been recorded.
70
+    const STATUS_CANCELED  = 9; // Canceled
71 71
 
72 72
     /**
73 73
      *  'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         'fk_warehouse'       => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'InventoryForASpecificWarehouse', 'picto' => 'stock', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
108 108
         'fk_product'         => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'InventoryForASpecificProduct', 'picto' => 'product', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
109 109
         'categories_product' => array('type' => 'chkbxlst:categorie:label:rowid::type=0:0:', 'label' => 'OrProductsWithCategories', 'visible' => 3, 'enabled' => 1, 'position' => 33, 'help' => '', 'picto' => 'category', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx'),
110
-        'date_inventory'     => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'),  // This date is not used so disabled by default.
110
+        'date_inventory'     => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'), // This date is not used so disabled by default.
111 111
         'date_creation'      => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500, 'csslist' => 'nowraponall'),
112 112
         'tms'                => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501, 'csslist' => 'nowraponall'),
113 113
         'date_validation'    => array('type' => 'datetime', 'label' => 'DateValidation', 'visible' => -2, 'enabled' => 1, 'position' => 502, 'csslist' => 'nowraponall'),
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Classes/PriceGlobalVariableUpdater.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
         return 1;
559 559
     }
560 560
 
561
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
561
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
562 562
     /**
563 563
      *  Update next_update into database
564 564
      *
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
      */
570 570
     public function update_next_update($next_update, $user = null, $notrigger = 0)
571 571
     {
572
-		// phpcs:enable
572
+        // phpcs:enable
573 573
         $error = 0;
574 574
 
575 575
         $this->next_update = $next_update;
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
         }
604 604
     }
605 605
 
606
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
606
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
607 607
     /**
608 608
      *  Update last_status into database
609 609
      *
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
      */
615 615
     public function update_status($last_status, $user = null, $notrigger = 0)
616 616
     {
617
-		// phpcs:enable
617
+        // phpcs:enable
618 618
         $error = 0;
619 619
 
620 620
         $this->last_status = $last_status;
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Classes/Product.php 2 patches
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
         return $result;
1056 1056
     }
1057 1057
 
1058
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1058
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1059 1059
     /**
1060 1060
      *  Check barcode
1061 1061
      *
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
      */
1069 1069
     public function check_barcode($valuetotest, $typefortest)
1070 1070
     {
1071
-		// phpcs:enable
1071
+        // phpcs:enable
1072 1072
         global $conf;
1073 1073
         if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
1074 1074
             $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM'));
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
     }
1985 1985
 
1986 1986
 
1987
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1987
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1988 1988
     /**
1989 1989
      *  Insert a track that we changed a customer price
1990 1990
      *
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
      */
1995 1995
     private function _log_price($user, $level = 0)
1996 1996
     {
1997
-		// phpcs:enable
1997
+        // phpcs:enable
1998 1998
         global $conf;
1999 1999
 
2000 2000
         $now = dol_now();
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
     }
2024 2024
 
2025 2025
 
2026
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2026
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2027 2027
     /**
2028 2028
      *  Delete a price line
2029 2029
      *
@@ -2033,7 +2033,7 @@  discard block
 block discarded – undo
2033 2033
      */
2034 2034
     public function log_price_delete($user, $rowid)
2035 2035
     {
2036
-		// phpcs:enable
2036
+        // phpcs:enable
2037 2037
         $sql = "DELETE FROM " . $this->db->prefix() . "product_price_by_qty";
2038 2038
         $sql .= " WHERE fk_product_price = " . ((int) $rowid);
2039 2039
         $resql = $this->db->query($sql);
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
         return array('pu_ht' => $pu_ht, 'pu_ttc' => $pu_ttc, 'price_min' => $price_min, 'price_base_type' => $price_base_type, 'tva_tx' => $tva_tx, 'tva_npr' => $tva_npr);
2169 2169
     }
2170 2170
 
2171
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2171
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2172 2172
     /**
2173 2173
      * Read price used by a provider.
2174 2174
      * We enter as input couple prodfournprice/qty or triplet qty/product_id/fourn_ref.
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
      */
2185 2185
     public function get_buyprice($prodfournprice, $qty, $product_id = 0, $fourn_ref = '', $fk_soc = 0)
2186 2186
     {
2187
-		// phpcs:enable
2187
+        // phpcs:enable
2188 2188
         global $action, $hookmanager;
2189 2189
 
2190 2190
         // Call hook if any
@@ -2988,7 +2988,7 @@  discard block
 block discarded – undo
2988 2988
         }
2989 2989
     }
2990 2990
 
2991
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2991
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2992 2992
     /**
2993 2993
      *  Charge tableau des stats OF pour le produit/service
2994 2994
      *
@@ -2997,7 +2997,7 @@  discard block
 block discarded – undo
2997 2997
      */
2998 2998
     public function load_stats_mo($socid = 0)
2999 2999
     {
3000
-		// phpcs:enable
3000
+        // phpcs:enable
3001 3001
         global $user, $hookmanager, $action;
3002 3002
 
3003 3003
         $error = 0;
@@ -3048,7 +3048,7 @@  discard block
 block discarded – undo
3048 3048
         return 1;
3049 3049
     }
3050 3050
 
3051
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3051
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3052 3052
     /**
3053 3053
      *  Charge tableau des stats OF pour le produit/service
3054 3054
      *
@@ -3057,7 +3057,7 @@  discard block
 block discarded – undo
3057 3057
      */
3058 3058
     public function load_stats_bom($socid = 0)
3059 3059
     {
3060
-		// phpcs:enable
3060
+        // phpcs:enable
3061 3061
         global $user, $hookmanager, $action;
3062 3062
 
3063 3063
         $error = 0;
@@ -3117,7 +3117,7 @@  discard block
 block discarded – undo
3117 3117
         return 1;
3118 3118
     }
3119 3119
 
3120
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3120
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3121 3121
     /**
3122 3122
      *  Charge tableau des stats propale pour le produit/service
3123 3123
      *
@@ -3126,7 +3126,7 @@  discard block
 block discarded – undo
3126 3126
      */
3127 3127
     public function load_stats_propale($socid = 0)
3128 3128
     {
3129
-		// phpcs:enable
3129
+        // phpcs:enable
3130 3130
         global $conf, $user, $hookmanager, $action;
3131 3131
 
3132 3132
         $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_customers, COUNT(DISTINCT p.rowid) as nb,";
@@ -3192,7 +3192,7 @@  discard block
 block discarded – undo
3192 3192
     }
3193 3193
 
3194 3194
 
3195
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3195
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3196 3196
     /**
3197 3197
      *  Charge tableau des stats propale pour le produit/service
3198 3198
      *
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
      */
3202 3202
     public function load_stats_proposal_supplier($socid = 0)
3203 3203
     {
3204
-		// phpcs:enable
3204
+        // phpcs:enable
3205 3205
         global $conf, $user, $hookmanager, $action;
3206 3206
 
3207 3207
         $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_suppliers, COUNT(DISTINCT p.rowid) as nb,";
@@ -3246,7 +3246,7 @@  discard block
 block discarded – undo
3246 3246
     }
3247 3247
 
3248 3248
 
3249
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3249
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3250 3250
     /**
3251 3251
      *  Charge tableau des stats commande client pour le produit/service
3252 3252
      *
@@ -3257,7 +3257,7 @@  discard block
 block discarded – undo
3257 3257
      */
3258 3258
     public function load_stats_commande($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
3259 3259
     {
3260
-		// phpcs:enable
3260
+        // phpcs:enable
3261 3261
         global $conf, $user, $hookmanager, $action;
3262 3262
 
3263 3263
         $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,";
@@ -3373,7 +3373,7 @@  discard block
 block discarded – undo
3373 3373
         }
3374 3374
     }
3375 3375
 
3376
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3376
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3377 3377
     /**
3378 3378
      *  Charge tableau des stats commande fournisseur pour le produit/service
3379 3379
      *
@@ -3385,7 +3385,7 @@  discard block
 block discarded – undo
3385 3385
      */
3386 3386
     public function load_stats_commande_fournisseur($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null)
3387 3387
     {
3388
-		// phpcs:enable
3388
+        // phpcs:enable
3389 3389
         global $conf, $user, $hookmanager, $action;
3390 3390
 
3391 3391
         $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_suppliers, COUNT(DISTINCT c.rowid) as nb,";
@@ -3434,7 +3434,7 @@  discard block
 block discarded – undo
3434 3434
         }
3435 3435
     }
3436 3436
 
3437
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3437
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3438 3438
     /**
3439 3439
      *  Charge tableau des stats expedition client pour le produit/service
3440 3440
      *
@@ -3446,7 +3446,7 @@  discard block
 block discarded – undo
3446 3446
      */
3447 3447
     public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '')
3448 3448
     {
3449
-		// phpcs:enable
3449
+        // phpcs:enable
3450 3450
         global $conf, $user, $hookmanager, $action;
3451 3451
 
3452 3452
         $sql = "SELECT COUNT(DISTINCT e.fk_soc) as nb_customers, COUNT(DISTINCT e.rowid) as nb,";
@@ -3520,7 +3520,7 @@  discard block
 block discarded – undo
3520 3520
         }
3521 3521
     }
3522 3522
 
3523
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3523
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3524 3524
     /**
3525 3525
      *  Charge tableau des stats réception fournisseur pour le produit/service
3526 3526
      *
@@ -3532,7 +3532,7 @@  discard block
 block discarded – undo
3532 3532
      */
3533 3533
     public function load_stats_reception($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null)
3534 3534
     {
3535
-		// phpcs:enable
3535
+        // phpcs:enable
3536 3536
         global $conf, $user, $hookmanager, $action;
3537 3537
 
3538 3538
         $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_suppliers, COUNT(DISTINCT cf.rowid) as nb,";
@@ -3581,7 +3581,7 @@  discard block
 block discarded – undo
3581 3581
         }
3582 3582
     }
3583 3583
 
3584
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3584
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3585 3585
     /**
3586 3586
      *  Charge tableau des stats production pour le produit/service
3587 3587
      *
@@ -3594,7 +3594,7 @@  discard block
 block discarded – undo
3594 3594
      */
3595 3595
     public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $dateofvirtualstock = null, $warehouseid = 0)
3596 3596
     {
3597
-		// phpcs:enable
3597
+        // phpcs:enable
3598 3598
         global $user, $hookmanager, $action;
3599 3599
 
3600 3600
         $serviceStockIsEnabled = isModEnabled("service") && getDolGlobalString('STOCK_SUPPORTS_SERVICES');
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
         }
3709 3709
     }
3710 3710
 
3711
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3711
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3712 3712
     /**
3713 3713
      *  Charge tableau des stats contrat pour le produit/service
3714 3714
      *
@@ -3717,7 +3717,7 @@  discard block
 block discarded – undo
3717 3717
      */
3718 3718
     public function load_stats_contrat($socid = 0)
3719 3719
     {
3720
-		// phpcs:enable
3720
+        // phpcs:enable
3721 3721
         global $conf, $user, $hookmanager, $action;
3722 3722
 
3723 3723
         $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,";
@@ -3782,7 +3782,7 @@  discard block
 block discarded – undo
3782 3782
         }
3783 3783
     }
3784 3784
 
3785
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3785
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3786 3786
     /**
3787 3787
      *  Charge tableau des stats facture pour le produit/service
3788 3788
      *
@@ -3791,7 +3791,7 @@  discard block
 block discarded – undo
3791 3791
      */
3792 3792
     public function load_stats_facture($socid = 0)
3793 3793
     {
3794
-		// phpcs:enable
3794
+        // phpcs:enable
3795 3795
         global $conf, $user, $hookmanager, $action;
3796 3796
 
3797 3797
         $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,";
@@ -3857,7 +3857,7 @@  discard block
 block discarded – undo
3857 3857
     }
3858 3858
 
3859 3859
 
3860
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3860
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3861 3861
     /**
3862 3862
      *  Charge tableau des stats facture recurrentes pour le produit/service
3863 3863
      *
@@ -3866,7 +3866,7 @@  discard block
 block discarded – undo
3866 3866
      */
3867 3867
     public function load_stats_facturerec($socid = 0)
3868 3868
     {
3869
-		// phpcs:enable
3869
+        // phpcs:enable
3870 3870
         global $conf, $user, $hookmanager, $action;
3871 3871
 
3872 3872
         $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,";
@@ -3931,7 +3931,7 @@  discard block
 block discarded – undo
3931 3931
         }
3932 3932
     }
3933 3933
 
3934
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3934
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3935 3935
     /**
3936 3936
      *  Charge tableau des stats facture pour le produit/service
3937 3937
      *
@@ -3940,7 +3940,7 @@  discard block
 block discarded – undo
3940 3940
      */
3941 3941
     public function load_stats_facture_fournisseur($socid = 0)
3942 3942
     {
3943
-		// phpcs:enable
3943
+        // phpcs:enable
3944 3944
         global $conf, $user, $hookmanager, $action;
3945 3945
 
3946 3946
         $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_suppliers, COUNT(DISTINCT f.rowid) as nb,";
@@ -3984,7 +3984,7 @@  discard block
 block discarded – undo
3984 3984
         }
3985 3985
     }
3986 3986
 
3987
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3987
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
3988 3988
     /**
3989 3989
      *  Return an array formatted for showing graphs
3990 3990
      *
@@ -3995,7 +3995,7 @@  discard block
 block discarded – undo
3995 3995
      */
3996 3996
     private function _get_stats($sql, $mode, $year = 0)
3997 3997
     {
3998
-		// phpcs:enable
3998
+        // phpcs:enable
3999 3999
         $tab = array();
4000 4000
 
4001 4001
         $resql = $this->db->query($sql);
@@ -4062,7 +4062,7 @@  discard block
 block discarded – undo
4062 4062
     }
4063 4063
 
4064 4064
 
4065
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4065
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4066 4066
     /**
4067 4067
      *  Return nb of units or customers invoices in which product is included
4068 4068
      *
@@ -4075,7 +4075,7 @@  discard block
 block discarded – undo
4075 4075
      */
4076 4076
     public function get_nb_vente($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4077 4077
     {
4078
-		// phpcs:enable
4078
+        // phpcs:enable
4079 4079
         global $conf;
4080 4080
         global $user;
4081 4081
 
@@ -4116,7 +4116,7 @@  discard block
 block discarded – undo
4116 4116
     }
4117 4117
 
4118 4118
 
4119
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4119
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4120 4120
     /**
4121 4121
      *  Return nb of units or supplier invoices in which product is included
4122 4122
      *
@@ -4129,7 +4129,7 @@  discard block
 block discarded – undo
4129 4129
      */
4130 4130
     public function get_nb_achat($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4131 4131
     {
4132
-		// phpcs:enable
4132
+        // phpcs:enable
4133 4133
         global $conf;
4134 4134
         global $user;
4135 4135
 
@@ -4169,7 +4169,7 @@  discard block
 block discarded – undo
4169 4169
         return $this->_get_stats($sql, $mode, $year);
4170 4170
     }
4171 4171
 
4172
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4172
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4173 4173
     /**
4174 4174
      * Return nb of units in proposals in which product is included
4175 4175
      *
@@ -4182,7 +4182,7 @@  discard block
 block discarded – undo
4182 4182
      */
4183 4183
     public function get_nb_propal($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4184 4184
     {
4185
-		// phpcs:enable
4185
+        // phpcs:enable
4186 4186
         global $conf, $user;
4187 4187
 
4188 4188
         $sql = "SELECT sum(d.qty) as qty, date_format(p.datep, '%Y%m')";
@@ -4221,7 +4221,7 @@  discard block
 block discarded – undo
4221 4221
         return $this->_get_stats($sql, $mode, $year);
4222 4222
     }
4223 4223
 
4224
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4224
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4225 4225
     /**
4226 4226
      *  Return nb of units in proposals in which product is included
4227 4227
      *
@@ -4234,7 +4234,7 @@  discard block
 block discarded – undo
4234 4234
      */
4235 4235
     public function get_nb_propalsupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4236 4236
     {
4237
-		// phpcs:enable
4237
+        // phpcs:enable
4238 4238
         global $conf;
4239 4239
         global $user;
4240 4240
 
@@ -4274,7 +4274,7 @@  discard block
 block discarded – undo
4274 4274
         return $this->_get_stats($sql, $mode, $year);
4275 4275
     }
4276 4276
 
4277
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4277
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4278 4278
     /**
4279 4279
      *  Return nb of units in orders in which product is included
4280 4280
      *
@@ -4287,7 +4287,7 @@  discard block
 block discarded – undo
4287 4287
      */
4288 4288
     public function get_nb_order($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4289 4289
     {
4290
-		// phpcs:enable
4290
+        // phpcs:enable
4291 4291
         global $conf, $user;
4292 4292
 
4293 4293
         $sql = "SELECT sum(d.qty) as qty, date_format(c.date_commande, '%Y%m')";
@@ -4326,7 +4326,7 @@  discard block
 block discarded – undo
4326 4326
         return $this->_get_stats($sql, $mode, $year);
4327 4327
     }
4328 4328
 
4329
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4329
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4330 4330
     /**
4331 4331
      *  Return nb of units in orders in which product is included
4332 4332
      *
@@ -4339,7 +4339,7 @@  discard block
 block discarded – undo
4339 4339
      */
4340 4340
     public function get_nb_ordersupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4341 4341
     {
4342
-		// phpcs:enable
4342
+        // phpcs:enable
4343 4343
         global $conf, $user;
4344 4344
 
4345 4345
         $sql = "SELECT sum(d.qty) as qty, date_format(c.date_commande, '%Y%m')";
@@ -4378,7 +4378,7 @@  discard block
 block discarded – undo
4378 4378
         return $this->_get_stats($sql, $mode, $year);
4379 4379
     }
4380 4380
 
4381
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4381
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4382 4382
     /**
4383 4383
      *  Return nb of units in orders in which product is included
4384 4384
      *
@@ -4391,7 +4391,7 @@  discard block
 block discarded – undo
4391 4391
      */
4392 4392
     public function get_nb_contract($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4393 4393
     {
4394
-		// phpcs:enable
4394
+        // phpcs:enable
4395 4395
         global $conf, $user;
4396 4396
 
4397 4397
         $sql = "SELECT sum(d.qty) as qty, date_format(c.date_contrat, '%Y%m')";
@@ -4432,7 +4432,7 @@  discard block
 block discarded – undo
4432 4432
         return $this->_get_stats($sql, $mode, $year);
4433 4433
     }
4434 4434
 
4435
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4435
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4436 4436
     /**
4437 4437
      *  Return nb of units in orders in which product is included
4438 4438
      *
@@ -4445,7 +4445,7 @@  discard block
 block discarded – undo
4445 4445
      */
4446 4446
     public function get_nb_mos($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
4447 4447
     {
4448
-		// phpcs:enable
4448
+        // phpcs:enable
4449 4449
         global $conf, $user;
4450 4450
 
4451 4451
         $sql = "SELECT sum(d.qty), date_format(d.date_valid, '%Y%m')";
@@ -4485,7 +4485,7 @@  discard block
 block discarded – undo
4485 4485
         return $this->_get_stats($sql, $mode, $year);
4486 4486
     }
4487 4487
 
4488
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4488
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4489 4489
     /**
4490 4490
      *  Link a product/service to a parent product/service
4491 4491
      *
@@ -4500,7 +4500,7 @@  discard block
 block discarded – undo
4500 4500
     {
4501 4501
         global $user;
4502 4502
 
4503
-		// phpcs:enable
4503
+        // phpcs:enable
4504 4504
         // Clean parameters
4505 4505
         if (!is_numeric($id_pere)) {
4506 4506
             $id_pere = 0;
@@ -4558,7 +4558,7 @@  discard block
 block discarded – undo
4558 4558
         }
4559 4559
     }
4560 4560
 
4561
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4561
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4562 4562
     /**
4563 4563
      *  Modify composed product
4564 4564
      *
@@ -4573,7 +4573,7 @@  discard block
 block discarded – undo
4573 4573
     {
4574 4574
         global $user;
4575 4575
 
4576
-		// phpcs:enable
4576
+        // phpcs:enable
4577 4577
         // Clean parameters
4578 4578
         if (!is_numeric($id_pere)) {
4579 4579
             $id_pere = 0;
@@ -4612,7 +4612,7 @@  discard block
 block discarded – undo
4612 4612
         }
4613 4613
     }
4614 4614
 
4615
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4615
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4616 4616
     /**
4617 4617
      *  Remove a link between a subproduct and a parent product/service
4618 4618
      *
@@ -4625,7 +4625,7 @@  discard block
 block discarded – undo
4625 4625
     {
4626 4626
         global $user;
4627 4627
 
4628
-		// phpcs:enable
4628
+        // phpcs:enable
4629 4629
         if (!is_numeric($fk_parent)) {
4630 4630
             $fk_parent = 0;
4631 4631
         }
@@ -4676,7 +4676,7 @@  discard block
 block discarded – undo
4676 4676
         return 1;
4677 4677
     }
4678 4678
 
4679
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4679
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4680 4680
     /**
4681 4681
      *  Check if it is a sub-product into a kit
4682 4682
      *
@@ -4686,7 +4686,7 @@  discard block
 block discarded – undo
4686 4686
      */
4687 4687
     public function is_sousproduit($fk_parent, $fk_child)
4688 4688
     {
4689
-		// phpcs:enable
4689
+        // phpcs:enable
4690 4690
         $sql = "SELECT fk_product_pere, qty, incdec";
4691 4691
         $sql .= " FROM " . $this->db->prefix() . "product_association";
4692 4692
         $sql .= " WHERE fk_product_pere  = " . ((int) $fk_parent);
@@ -4713,7 +4713,7 @@  discard block
 block discarded – undo
4713 4713
     }
4714 4714
 
4715 4715
 
4716
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4716
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4717 4717
     /**
4718 4718
      *  Add a supplier price for the product.
4719 4719
      *  Note: Duplicate ref is accepted for different quantity only, or for different companies.
@@ -4726,7 +4726,7 @@  discard block
 block discarded – undo
4726 4726
      */
4727 4727
     public function add_fournisseur($user, $id_fourn, $ref_fourn, $quantity)
4728 4728
     {
4729
-		// phpcs:enable
4729
+        // phpcs:enable
4730 4730
         global $conf;
4731 4731
 
4732 4732
         $now = dol_now();
@@ -4814,7 +4814,7 @@  discard block
 block discarded – undo
4814 4814
     }
4815 4815
 
4816 4816
 
4817
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4817
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4818 4818
     /**
4819 4819
      * Return list of suppliers providing the product or service
4820 4820
      *
@@ -4822,7 +4822,7 @@  discard block
 block discarded – undo
4822 4822
      */
4823 4823
     public function list_suppliers()
4824 4824
     {
4825
-		// phpcs:enable
4825
+        // phpcs:enable
4826 4826
         global $conf;
4827 4827
 
4828 4828
         $list = array();
@@ -4846,7 +4846,7 @@  discard block
 block discarded – undo
4846 4846
         return $list;
4847 4847
     }
4848 4848
 
4849
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4849
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4850 4850
     /**
4851 4851
      *  Recopie les prix d'un produit/service sur un autre
4852 4852
      *
@@ -4934,7 +4934,7 @@  discard block
 block discarded – undo
4934 4934
         return 1;
4935 4935
     }
4936 4936
 
4937
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4937
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4938 4938
     /**
4939 4939
      * Clone links between products
4940 4940
      *
@@ -4944,7 +4944,7 @@  discard block
 block discarded – undo
4944 4944
      */
4945 4945
     public function clone_associations($fromId, $toId)
4946 4946
     {
4947
-		// phpcs:enable
4947
+        // phpcs:enable
4948 4948
         $this->db->begin();
4949 4949
 
4950 4950
         $sql = 'INSERT INTO ' . $this->db->prefix() . 'product_association (fk_product_pere, fk_product_fils, qty, incdec)';
@@ -4961,7 +4961,7 @@  discard block
 block discarded – undo
4961 4961
         return 1;
4962 4962
     }
4963 4963
 
4964
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4964
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
4965 4965
     /**
4966 4966
      *  Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre
4967 4967
      *
@@ -4971,7 +4971,7 @@  discard block
 block discarded – undo
4971 4971
      */
4972 4972
     public function clone_fournisseurs($fromId, $toId)
4973 4973
     {
4974
-		// phpcs:enable
4974
+        // phpcs:enable
4975 4975
         $this->db->begin();
4976 4976
 
4977 4977
         $now = dol_now();
@@ -5007,7 +5007,7 @@  discard block
 block discarded – undo
5007 5007
         }
5008 5008
     }
5009 5009
 
5010
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5010
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5011 5011
     /**
5012 5012
      *  Function recursive, used only by get_arbo_each_prod(), to build tree of subproducts into ->res
5013 5013
      *  Define value of this->res
@@ -5022,7 +5022,7 @@  discard block
 block discarded – undo
5022 5022
      */
5023 5023
     public function fetch_prod_arbo($prod, $compl_path = '', $multiply = 1, $level = 1, $id_parent = 0, $ignore_stock_load = 0)
5024 5024
     {
5025
-		// phpcs:enable
5025
+        // phpcs:enable
5026 5026
         global $conf, $langs;
5027 5027
 
5028 5028
         $tmpproduct = null;
@@ -5075,7 +5075,7 @@  discard block
 block discarded – undo
5075 5075
         }
5076 5076
     }
5077 5077
 
5078
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5078
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5079 5079
     /**
5080 5080
      *  Build the tree of subproducts and return it.
5081 5081
      *  this->sousprods must have been loaded by this->get_sousproduits_arbo()
@@ -5086,7 +5086,7 @@  discard block
 block discarded – undo
5086 5086
      */
5087 5087
     public function get_arbo_each_prod($multiply = 1, $ignore_stock_load = 0)
5088 5088
     {
5089
-		// phpcs:enable
5089
+        // phpcs:enable
5090 5090
         $this->res = array();
5091 5091
         if (isset($this->sousprods) && is_array($this->sousprods)) {
5092 5092
             foreach ($this->sousprods as $prod_name => $desc_product) {
@@ -5297,7 +5297,7 @@  discard block
 block discarded – undo
5297 5297
         }
5298 5298
     }
5299 5299
 
5300
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5300
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5301 5301
     /**
5302 5302
      *     Return tree of all subproducts for product. Tree contains array of array(0=prodid, 1=>qty, 2=>product type, 3=>label, 4=>incdec, 5=>product ref)
5303 5303
      *     Set this->sousprods
@@ -5306,7 +5306,7 @@  discard block
 block discarded – undo
5306 5306
      */
5307 5307
     public function get_sousproduits_arbo()
5308 5308
     {
5309
-		// phpcs:enable
5309
+        // phpcs:enable
5310 5310
         $parent = array();
5311 5311
 
5312 5312
         foreach ($this->getChildsArbo($this->id) as $keyChild => $valueChild) {    // Warning. getChildsArbo can call getChildsArbo recursively. Starting point is $value[0]=id of product
@@ -5602,7 +5602,7 @@  discard block
 block discarded – undo
5602 5602
         }
5603 5603
     }
5604 5604
 
5605
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5605
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5606 5606
     /**
5607 5607
      *    Return label of a given status
5608 5608
      *
@@ -5613,7 +5613,7 @@  discard block
 block discarded – undo
5613 5613
      */
5614 5614
     public function LibStatut($status, $mode = 0, $type = 0)
5615 5615
     {
5616
-		// phpcs:enable
5616
+        // phpcs:enable
5617 5617
         global $conf, $langs;
5618 5618
 
5619 5619
         $labelStatus = $labelStatusShort = '';
@@ -5711,7 +5711,7 @@  discard block
 block discarded – undo
5711 5711
     }
5712 5712
 
5713 5713
 
5714
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5714
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5715 5715
     /**
5716 5716
      *  Adjust stock in a warehouse for product
5717 5717
      *
@@ -5730,7 +5730,7 @@  discard block
 block discarded – undo
5730 5730
      */
5731 5731
     public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null)
5732 5732
     {
5733
-		// phpcs:enable
5733
+        // phpcs:enable
5734 5734
         if ($id_entrepot) {
5735 5735
             $this->db->begin();
5736 5736
 
@@ -5770,7 +5770,7 @@  discard block
 block discarded – undo
5770 5770
         return -1;
5771 5771
     }
5772 5772
 
5773
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5773
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5774 5774
     /**
5775 5775
      *  Adjust stock in a warehouse for product with batch number
5776 5776
      *
@@ -5793,7 +5793,7 @@  discard block
 block discarded – undo
5793 5793
      */
5794 5794
     public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
5795 5795
     {
5796
-		// phpcs:enable
5796
+        // phpcs:enable
5797 5797
         if ($id_entrepot) {
5798 5798
             $this->db->begin();
5799 5799
 
@@ -5833,7 +5833,7 @@  discard block
 block discarded – undo
5833 5833
         return -1;
5834 5834
     }
5835 5835
 
5836
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5836
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5837 5837
     /**
5838 5838
      * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products)
5839 5839
      * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id.
@@ -5848,7 +5848,7 @@  discard block
 block discarded – undo
5848 5848
      */
5849 5849
     public function load_stock($option = '', $includedraftpoforvirtual = null, $dateofvirtualstock = null)
5850 5850
     {
5851
-		// phpcs:enable
5851
+        // phpcs:enable
5852 5852
         global $conf;
5853 5853
 
5854 5854
         $this->stock_reel = 0;
@@ -5915,7 +5915,7 @@  discard block
 block discarded – undo
5915 5915
     }
5916 5916
 
5917 5917
 
5918
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5918
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
5919 5919
     /**
5920 5920
      *  Load value ->stock_theorique of a product. Property this->id must be defined.
5921 5921
      *  This function need a lot of load. If you use it on list, use a cache to execute it one for each product id.
@@ -5927,7 +5927,7 @@  discard block
 block discarded – undo
5927 5927
      */
5928 5928
     public function load_virtual_stock($includedraftpoforvirtual = null, $dateofvirtualstock = null)
5929 5929
     {
5930
-		// phpcs:enable
5930
+        // phpcs:enable
5931 5931
         global $conf, $hookmanager, $action;
5932 5932
 
5933 5933
         $stock_commande_client = 0;
@@ -6086,7 +6086,7 @@  discard block
 block discarded – undo
6086 6086
         }
6087 6087
     }
6088 6088
 
6089
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6089
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6090 6090
     /**
6091 6091
      *  Move an uploaded file described into $file array into target directory $sdir.
6092 6092
      *
@@ -6096,7 +6096,7 @@  discard block
 block discarded – undo
6096 6096
      */
6097 6097
     public function add_photo($sdir, $file)
6098 6098
     {
6099
-		// phpcs:enable
6099
+        // phpcs:enable
6100 6100
         global $conf;
6101 6101
 
6102 6102
         include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
@@ -6133,7 +6133,7 @@  discard block
 block discarded – undo
6133 6133
         }
6134 6134
     }
6135 6135
 
6136
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6136
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6137 6137
     /**
6138 6138
      *  Return if at least one photo is available
6139 6139
      *
@@ -6142,7 +6142,7 @@  discard block
 block discarded – undo
6142 6142
      */
6143 6143
     public function is_photo_available($sdir)
6144 6144
     {
6145
-		// phpcs:enable
6145
+        // phpcs:enable
6146 6146
         include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
6147 6147
         include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
6148 6148
 
@@ -6174,7 +6174,7 @@  discard block
 block discarded – undo
6174 6174
         return false;
6175 6175
     }
6176 6176
 
6177
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6177
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6178 6178
     /**
6179 6179
      * Return an array with all photos of product found on disk. There is no sorting criteria.
6180 6180
      *
@@ -6184,7 +6184,7 @@  discard block
 block discarded – undo
6184 6184
      */
6185 6185
     public function liste_photos($dir, $nbmax = 0)
6186 6186
     {
6187
-		// phpcs:enable
6187
+        // phpcs:enable
6188 6188
         include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
6189 6189
         include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
6190 6190
 
@@ -6235,7 +6235,7 @@  discard block
 block discarded – undo
6235 6235
         return $tabobj;
6236 6236
     }
6237 6237
 
6238
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6238
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6239 6239
     /**
6240 6240
      *  Delete a photo and its thumbs
6241 6241
      *
@@ -6244,7 +6244,7 @@  discard block
 block discarded – undo
6244 6244
      */
6245 6245
     public function delete_photo($file)
6246 6246
     {
6247
-		// phpcs:enable
6247
+        // phpcs:enable
6248 6248
         include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
6249 6249
         include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
6250 6250
 
@@ -6269,7 +6269,7 @@  discard block
 block discarded – undo
6269 6269
         }
6270 6270
     }
6271 6271
 
6272
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6272
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6273 6273
     /**
6274 6274
      *  Load size of image file
6275 6275
      *
@@ -6278,7 +6278,7 @@  discard block
 block discarded – undo
6278 6278
      */
6279 6279
     public function get_image_size($file)
6280 6280
     {
6281
-		// phpcs:enable
6281
+        // phpcs:enable
6282 6282
         $file_osencoded = dol_osencode($file);
6283 6283
         $infoImg = getimagesize($file_osencoded); // Get information on image
6284 6284
         $this->imgWidth = $infoImg[0]; // Largeur de l'image
@@ -6376,7 +6376,7 @@  discard block
 block discarded – undo
6376 6376
     }
6377 6377
 
6378 6378
 
6379
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6379
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6380 6380
     /**
6381 6381
      *  Get a barcode from the module to generate barcode values.
6382 6382
      *  Return value is stored into this->barcode
@@ -6387,7 +6387,7 @@  discard block
 block discarded – undo
6387 6387
      */
6388 6388
     public function get_barcode($object, $type = '')
6389 6389
     {
6390
-		// phpcs:enable
6390
+        // phpcs:enable
6391 6391
         global $conf;
6392 6392
 
6393 6393
         $result = '';
@@ -6494,7 +6494,7 @@  discard block
 block discarded – undo
6494 6494
         return $label;
6495 6495
     }
6496 6496
 
6497
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6497
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
6498 6498
     /**
6499 6499
      * Return minimum product recommended price
6500 6500
      *
@@ -6502,7 +6502,7 @@  discard block
 block discarded – undo
6502 6502
      */
6503 6503
     public function min_recommended_price()
6504 6504
     {
6505
-		// phpcs:enable
6505
+        // phpcs:enable
6506 6506
         global $conf;
6507 6507
 
6508 6508
         $maxpricesupplier = 0;
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public $price;
148 148
 
149
-    public $price_formated;         // used by takepos/ajax/ajax.php
149
+    public $price_formated; // used by takepos/ajax/ajax.php
150 150
 
151 151
     /**
152 152
      * Selling price with tax
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public $price_ttc;
157 157
 
158
-    public $price_ttc_formated;     // used by takepos/ajax/ajax.php
158
+    public $price_ttc_formated; // used by takepos/ajax/ajax.php
159 159
 
160 160
     /**
161 161
      * Minimum price net
@@ -408,20 +408,20 @@  discard block
 block discarded – undo
408 408
 
409 409
     //! Metric of products
410 410
     public $weight;
411
-    public $weight_units;   // scale -3, 0, 3, 6
411
+    public $weight_units; // scale -3, 0, 3, 6
412 412
     public $length;
413
-    public $length_units;   // scale -3, 0, 3, 6
413
+    public $length_units; // scale -3, 0, 3, 6
414 414
     public $width;
415
-    public $width_units;    // scale -3, 0, 3, 6
415
+    public $width_units; // scale -3, 0, 3, 6
416 416
     public $height;
417
-    public $height_units;   // scale -3, 0, 3, 6
417
+    public $height_units; // scale -3, 0, 3, 6
418 418
     public $surface;
419
-    public $surface_units;  // scale -3, 0, 3, 6
419
+    public $surface_units; // scale -3, 0, 3, 6
420 420
     public $volume;
421
-    public $volume_units;   // scale -3, 0, 3, 6
421
+    public $volume_units; // scale -3, 0, 3, 6
422 422
 
423 423
     public $net_measure;
424
-    public $net_measure_units;  // scale -3, 0, 3, 6
424
+    public $net_measure_units; // scale -3, 0, 3, 6
425 425
 
426 426
     public $accountancy_code_sell;
427 427
     public $accountancy_code_sell_intra;
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
         'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
634 634
         //'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
635 635
         //'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
636
-        'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
636
+        'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
637 637
     );
638 638
 
639 639
     /**
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
      */
1958 1958
     private function getArrayForPriceCompare($level = 0)
1959 1959
     {
1960
-        $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
1960
+        $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
1961 1961
 
1962 1962
         foreach ($testExit as $field) {
1963 1963
             if (!isset($this->$field)) {
@@ -2601,8 +2601,8 @@  discard block
 block discarded – undo
2601 2601
 
2602 2602
         //For MultiCompany
2603 2603
         //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2604
-        $separatedEntityPMP = false;    // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2605
-        $separatedStock = false;        // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2604
+        $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2605
+        $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2606 2606
         $visibleWarehousesEntities = $conf->entity;
2607 2607
         if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2608 2608
             if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
@@ -2795,15 +2795,15 @@  discard block
 block discarded – undo
2795 2795
                         $sql .= " WHERE entity IN (" . getEntity('productprice') . ")";
2796 2796
                         $sql .= " AND price_level=" . ((int) $i);
2797 2797
                         $sql .= " AND fk_product = " . ((int) $this->id);
2798
-                        $sql .= " ORDER BY date_price DESC, rowid DESC";    // Get the most recent line
2799
-                        $sql .= " LIMIT 1";                                 // Only the first one
2798
+                        $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
2799
+                        $sql .= " LIMIT 1"; // Only the first one
2800 2800
                         $resql = $this->db->query($sql);
2801 2801
                         if ($resql) {
2802 2802
                             $result = $this->db->fetch_array($resql);
2803 2803
 
2804 2804
                             $this->multiprices[$i] = $result ? $result["price"] : null;
2805 2805
                             $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
2806
-                            $this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
2806
+                            $this->multiprices_min[$i] = $result ? $result["price_min"] : null;
2807 2807
                             $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
2808 2808
                             $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
2809 2809
                             // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
                 $obj = $this->db->fetch_object($result);
3029 3029
                 $this->stats_mo['customers_' . $role] = $obj->nb_customers ? $obj->nb_customers : 0;
3030 3030
                 $this->stats_mo['nb_' . $role] = $obj->nb ? $obj->nb : 0;
3031
-                $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;     // qty may be a float due to the SUM()
3031
+                $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
3032 3032
             } else {
3033 3033
                 $this->error = $this->db->error();
3034 3034
                 $error++;
@@ -4534,7 +4534,7 @@  discard block
 block discarded – undo
4534 4534
                 //Addition of a product with the highest rank +1
4535 4535
                 $sql = "INSERT INTO " . $this->db->prefix() . "product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4536 4536
                 $sql .= " VALUES (" . ((int) $id_pere) . ", " . ((int) $id_fils) . ", " . price2num($qty, 'MS') . ", " . ((int) $incdec) . ", " . ((int) $rank) . ")";
4537
-                if (! $this->db->query($sql)) {
4537
+                if (!$this->db->query($sql)) {
4538 4538
                     dol_print_error($this->db);
4539 4539
                     return -1;
4540 4540
                 } else {
@@ -4655,7 +4655,7 @@  discard block
 block discarded – undo
4655 4655
                 $sql = "UPDATE " . $this->db->prefix() . "product_association";
4656 4656
                 $sql .= " SET rang = " . ((int) $cpt);
4657 4657
                 $sql .= " WHERE rowid = " . ((int) $objrank->rowid);
4658
-                if (! $this->db->query($sql)) {
4658
+                if (!$this->db->query($sql)) {
4659 4659
                     dol_print_error($this->db);
4660 4660
                     return -1;
4661 4661
                 }
@@ -6722,7 +6722,7 @@  discard block
 block discarded – undo
6722 6722
      */
6723 6723
     public function getKanbanView($option = '', $arraydata = null)
6724 6724
     {
6725
-        global $langs,$conf;
6725
+        global $langs, $conf;
6726 6726
 
6727 6727
         $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
6728 6728
 
Please login to merge, or discard this patch.
Dolibarr/Code/Product/Api/Products.php 2 patches
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -467,13 +467,23 @@
 block discarded – undo
467 467
                 if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) {
468 468
                     $pricemodified = true;
469 469
                 } else {
470
-                    if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) $pricemodified = true;
470
+                    if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) {
471
+                        $pricemodified = true;
472
+                    }
471 473
                     if ($this->product->multiprices_base_type[$key] == 'TTC') {
472
-                        if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) $pricemodified = true;
473
-                        if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) $pricemodified = true;
474
+                        if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) {
475
+                            $pricemodified = true;
476
+                        }
477
+                        if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) {
478
+                            $pricemodified = true;
479
+                        }
474 480
                     } else {
475
-                        if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) $pricemodified = true;
476
-                        if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) $pricemodified = true;
481
+                        if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) {
482
+                            $pricemodified = true;
483
+                        }
484
+                        if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) {
485
+                            $pricemodified = true;
486
+                        }
477 487
                     }
478 488
                 }
479 489
                 if ($pricemodified && $result > 0) {
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
         // Select products of given category
341 341
         if ($category > 0) {
342
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
342
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
343 343
             $sql .= " AND c.fk_product = t.rowid";
344 344
         }
345 345
         if ($mode == 1) {
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
 
419 419
             $obj_ret['data'] = $tmp;
420 420
             $obj_ret['pagination'] = array(
421
-                'total' => (int)$total,
421
+                'total' => (int) $total,
422 422
                 'page' => $page, //count starts from 0
423
-                'page_count' => ceil((int)$total / $limit),
423
+                'page_count' => ceil((int) $total / $limit),
424 424
                 'limit' => $limit
425 425
             );
426 426
         }
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
         if ($result <= 0) {
1000 1000
             throw new RestException(500, "Error updating buy price : " . $this->db->lasterror());
1001 1001
         }
1002
-        return (int)$this->productsupplier->product_fourn_price_id;
1002
+        return (int) $this->productsupplier->product_fourn_price_id;
1003 1003
     }
1004 1004
 
1005 1005
     /**
@@ -1082,15 +1082,15 @@  discard block
 block discarded – undo
1082 1082
         $sql .= ' WHERE t.entity IN (' . getEntity('product') . ')';
1083 1083
 
1084 1084
         if ($supplier > 0) {
1085
-            $sql .= " AND s.fk_soc = " . ((int)$supplier);
1085
+            $sql .= " AND s.fk_soc = " . ((int) $supplier);
1086 1086
         }
1087 1087
         if ($socid > 0) {   // if external user
1088
-            $sql .= " AND s.fk_soc = " . ((int)$socid);
1088
+            $sql .= " AND s.fk_soc = " . ((int) $socid);
1089 1089
         }
1090 1090
         $sql .= " AND s.fk_product = t.rowid";
1091 1091
         // Select products of given category
1092 1092
         if ($category > 0) {
1093
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
1093
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
1094 1094
             $sql .= " AND c.fk_product = t.rowid";
1095 1095
         }
1096 1096
         if ($mode == 1) {
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
         }
1286 1286
 
1287 1287
         $prodattr = new ProductAttribute($this->db);
1288
-        $result = $prodattr->fetch((int)$id);
1288
+        $result = $prodattr->fetch((int) $id);
1289 1289
 
1290 1290
         if ($result < 0) {
1291 1291
             throw new RestException(404, "Product attribute not found");
@@ -1301,11 +1301,11 @@  discard block
 block discarded – undo
1301 1301
 
1302 1302
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1303 1303
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1304
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$prodattr->id) . " AND pac.entity IN (" . getEntity('product') . ")";
1304
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $prodattr->id) . " AND pac.entity IN (" . getEntity('product') . ")";
1305 1305
 
1306 1306
         $resql = $this->db->query($sql);
1307 1307
         $obj = $this->db->fetch_object($resql);
1308
-        $prodattr->is_used_by_products = (int)$obj->nb;
1308
+        $prodattr->is_used_by_products = (int) $obj->nb;
1309 1309
 
1310 1310
         return $this->_cleanObjectDatas($prodattr);
1311 1311
     }
@@ -1350,12 +1350,12 @@  discard block
 block discarded – undo
1350 1350
 
1351 1351
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1352 1352
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1353
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1353
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1354 1354
 
1355 1355
         $resql = $this->db->query($sql);
1356 1356
         $obj = $this->db->fetch_object($resql);
1357 1357
 
1358
-        $attr["is_used_by_products"] = (int)$obj->nb;
1358
+        $attr["is_used_by_products"] = (int) $obj->nb;
1359 1359
 
1360 1360
         return $attr;
1361 1361
     }
@@ -1400,12 +1400,12 @@  discard block
 block discarded – undo
1400 1400
 
1401 1401
         $sql = "SELECT COUNT(*) as nb FROM " . $this->db->prefix() . "product_attribute_combination2val as pac2v";
1402 1402
         $sql .= " JOIN " . $this->db->prefix() . "product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
1403
-        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int)$result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1403
+        $sql .= " WHERE pac2v.fk_prod_attr = " . ((int) $result->rowid) . " AND pac.entity IN (" . getEntity('product') . ")";
1404 1404
 
1405 1405
         $resql = $this->db->query($sql);
1406 1406
         $obj = $this->db->fetch_object($resql);
1407 1407
 
1408
-        $attr["is_used_by_products"] = (int)$obj->nb;
1408
+        $attr["is_used_by_products"] = (int) $obj->nb;
1409 1409
 
1410 1410
         return $attr;
1411 1411
     }
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 
1464 1464
         $prodattr = new ProductAttribute($this->db);
1465 1465
 
1466
-        $result = $prodattr->fetch((int)$id);
1466
+        $result = $prodattr->fetch((int) $id);
1467 1467
         if ($result == 0) {
1468 1468
             throw new RestException(404, 'Attribute not found');
1469 1469
         } elseif ($result < 0) {
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
         }
1485 1485
 
1486 1486
         if ($prodattr->update(DolibarrApiAccess::$user) > 0) {
1487
-            $result = $prodattr->fetch((int)$id);
1487
+            $result = $prodattr->fetch((int) $id);
1488 1488
             if ($result == 0) {
1489 1489
                 throw new RestException(404, 'Attribute not found');
1490 1490
             } elseif ($result < 0) {
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
         }
1515 1515
 
1516 1516
         $prodattr = new ProductAttribute($this->db);
1517
-        $prodattr->id = (int)$id;
1517
+        $prodattr->id = (int) $id;
1518 1518
         $result = $prodattr->delete(DolibarrApiAccess::$user);
1519 1519
 
1520 1520
         if ($result <= 0) {
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
             throw new RestException(403);
1581 1581
         }
1582 1582
 
1583
-        $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value WHERE rowid = " . (int)$id . " AND entity IN (" . getEntity('product') . ")";
1583
+        $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value WHERE rowid = " . (int) $id . " AND entity IN (" . getEntity('product') . ")";
1584 1584
 
1585 1585
         $query = $this->db->query($sql);
1586 1586
 
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
         $ref = trim($ref);
1625 1625
 
1626 1626
         $sql = "SELECT rowid, fk_product_attribute, ref, value FROM " . $this->db->prefix() . "product_attribute_value";
1627
-        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int)$id) . " AND entity IN (" . getEntity('product') . ")";
1627
+        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int) $id) . " AND entity IN (" . getEntity('product') . ")";
1628 1628
 
1629 1629
         $query = $this->db->query($sql);
1630 1630
 
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
         $ref = trim($ref);
1668 1668
 
1669 1669
         $sql = "SELECT rowid FROM " . $this->db->prefix() . "product_attribute_value";
1670
-        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int)$id) . " AND entity IN (" . getEntity('product') . ")";
1670
+        $sql .= " WHERE ref LIKE '" . $this->db->escape($ref) . "' AND fk_product_attribute = " . ((int) $id) . " AND entity IN (" . getEntity('product') . ")";
1671 1671
         $query = $this->db->query($sql);
1672 1672
 
1673 1673
         if (!$query) {
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
         $objectval = new ProductAttributeValue($this->db);
1711 1711
 
1712
-        $return = $objectval->fetchAllByProductAttribute((int)$id);
1712
+        $return = $objectval->fetchAllByProductAttribute((int) $id);
1713 1713
 
1714 1714
         if (count($return) == 0) {
1715 1715
             throw new RestException(404, 'Attribute values not found');
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
         }
1786 1786
 
1787 1787
         $objectval = new ProductAttributeValue($this->db);
1788
-        $objectval->fk_product_attribute = ((int)$id);
1788
+        $objectval->fk_product_attribute = ((int) $id);
1789 1789
         $objectval->ref = $ref;
1790 1790
         $objectval->value = $value;
1791 1791
 
@@ -1814,7 +1814,7 @@  discard block
 block discarded – undo
1814 1814
         }
1815 1815
 
1816 1816
         $objectval = new ProductAttributeValue($this->db);
1817
-        $result = $objectval->fetch((int)$id);
1817
+        $result = $objectval->fetch((int) $id);
1818 1818
 
1819 1819
         if ($result == 0) {
1820 1820
             throw new RestException(404, 'Attribute value not found');
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
         }
1837 1837
 
1838 1838
         if ($objectval->update(DolibarrApiAccess::$user) > 0) {
1839
-            $result = $objectval->fetch((int)$id);
1839
+            $result = $objectval->fetch((int) $id);
1840 1840
             if ($result == 0) {
1841 1841
                 throw new RestException(404, 'Attribute not found');
1842 1842
             } elseif ($result < 0) {
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
         }
1867 1867
 
1868 1868
         $objectval = new ProductAttributeValue($this->db);
1869
-        $objectval->id = (int)$id;
1869
+        $objectval->id = (int) $id;
1870 1870
 
1871 1871
         if ($objectval->delete(DolibarrApiAccess::$user) > 0) {
1872 1872
             return 1;
@@ -1893,16 +1893,16 @@  discard block
 block discarded – undo
1893 1893
         }
1894 1894
 
1895 1895
         $prodcomb = new ProductCombination($this->db);
1896
-        $combinations = $prodcomb->fetchAllByFkProductParent((int)$id);
1896
+        $combinations = $prodcomb->fetchAllByFkProductParent((int) $id);
1897 1897
 
1898 1898
         foreach ($combinations as $key => $combination) {
1899 1899
             $prodc2vp = new ProductCombination2ValuePair($this->db);
1900
-            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int)$combination->id);
1900
+            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
1901 1901
             $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
1902 1902
 
1903 1903
             if (!empty($includestock) && DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
1904 1904
                 $productModel = new Product($this->db);
1905
-                $productModel->fetch((int)$combination->fk_product_child);
1905
+                $productModel->fetch((int) $combination->fk_product_child);
1906 1906
                 $productModel->load_stock($includestock);
1907 1907
                 $combinations[$key]->stock_warehouse = $this->_cleanObjectDatas($productModel)->stock_warehouse;
1908 1908
             }
@@ -1934,11 +1934,11 @@  discard block
 block discarded – undo
1934 1934
         }
1935 1935
 
1936 1936
         $prodcomb = new ProductCombination($this->db);
1937
-        $combinations = $prodcomb->fetchAllByFkProductParent((int)$this->product->id);
1937
+        $combinations = $prodcomb->fetchAllByFkProductParent((int) $this->product->id);
1938 1938
 
1939 1939
         foreach ($combinations as $key => $combination) {
1940 1940
             $prodc2vp = new ProductCombination2ValuePair($this->db);
1941
-            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int)$combination->id);
1941
+            $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
1942 1942
             $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
1943 1943
         }
1944 1944
 
@@ -1985,15 +1985,15 @@  discard block
 block discarded – undo
1985 1985
         $prodattr = new ProductAttribute($this->db);
1986 1986
         $prodattr_val = new ProductAttributeValue($this->db);
1987 1987
         foreach ($features as $id_attr => $id_value) {
1988
-            if ($prodattr->fetch((int)$id_attr) < 0) {
1988
+            if ($prodattr->fetch((int) $id_attr) < 0) {
1989 1989
                 throw new RestException(400, 'Invalid attribute ID: ' . $id_attr);
1990 1990
             }
1991
-            if ($prodattr_val->fetch((int)$id_value) < 0) {
1991
+            if ($prodattr_val->fetch((int) $id_value) < 0) {
1992 1992
                 throw new RestException(400, 'Invalid attribute value ID: ' . $id_value);
1993 1993
             }
1994 1994
         }
1995 1995
 
1996
-        $result = $this->product->fetch((int)$id);
1996
+        $result = $this->product->fetch((int) $id);
1997 1997
         if (!$result) {
1998 1998
             throw new RestException(404, 'Product not found');
1999 1999
         }
@@ -2042,10 +2042,10 @@  discard block
 block discarded – undo
2042 2042
         $prodattr = new ProductAttribute($this->db);
2043 2043
         $prodattr_val = new ProductAttributeValue($this->db);
2044 2044
         foreach ($features as $id_attr => $id_value) {
2045
-            if ($prodattr->fetch((int)$id_attr) < 0) {
2045
+            if ($prodattr->fetch((int) $id_attr) < 0) {
2046 2046
                 throw new RestException(404);
2047 2047
             }
2048
-            if ($prodattr_val->fetch((int)$id_value) < 0) {
2048
+            if ($prodattr_val->fetch((int) $id_value) < 0) {
2049 2049
                 throw new RestException(404);
2050 2050
             }
2051 2051
         }
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
         }
2090 2090
 
2091 2091
         $prodcomb = new ProductCombination($this->db);
2092
-        $prodcomb->fetch((int)$id);
2092
+        $prodcomb->fetch((int) $id);
2093 2093
 
2094 2094
         foreach ($request_data as $field => $value) {
2095 2095
             if ($field == 'rowid') {
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
         }
2130 2130
 
2131 2131
         $prodcomb = new ProductCombination($this->db);
2132
-        $prodcomb->id = (int)$id;
2132
+        $prodcomb->id = (int) $id;
2133 2133
         $result = $prodcomb->delete(DolibarrApiAccess::$user);
2134 2134
         if ($result <= 0) {
2135 2135
             throw new RestException(500, "Error deleting variant");
Please login to merge, or discard this patch.
Dolibarr/Code/Partnerships/Classes/Partnership.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
         return $this->LibStatut($this->status, $mode);
1101 1101
     }
1102 1102
 
1103
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1103
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1104 1104
     /**
1105 1105
      *  Return the status
1106 1106
      *
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
      */
1111 1111
     public function LibStatut($status, $mode = 0)
1112 1112
     {
1113
-		// phpcs:enable
1113
+        // phpcs:enable
1114 1114
         if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
1115 1115
             global $langs;
1116 1116
             //$langs->load("partnership");
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@
 block discarded – undo
70 70
 
71 71
 
72 72
     const STATUS_DRAFT = 0;
73
-    const STATUS_VALIDATED = 1;     // Validate (no more draft)
74
-    const STATUS_APPROVED = 2;      // Approved
75
-    const STATUS_REFUSED = 3;       // Refused
73
+    const STATUS_VALIDATED = 1; // Validate (no more draft)
74
+    const STATUS_APPROVED = 2; // Approved
75
+    const STATUS_REFUSED = 3; // Refused
76 76
     const STATUS_CANCELED = 9;
77 77
 
78 78
 
Please login to merge, or discard this patch.
Dolibarr/Code/Partnerships/Classes/PartnershipUtils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                                     $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
216 216
                                     ; // Short text ($langs->transnoentities('MailSentByTo')...);
217 217
                                     if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
218
-                                        $object->actionmsg2     = $subject; // Short text
218
+                                        $object->actionmsg2 = $subject; // Short text
219 219
                                     }
220 220
 
221 221
                                     $object->trackid = $trackid;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                                             $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
439 439
                                             ; // Short text ($langs->transnoentities('MailSentByTo')...);
440 440
                                             if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
441
-                                                $object->actionmsg2     = $subject; // Short text
441
+                                                $object->actionmsg2 = $subject; // Short text
442 442
                                             }
443 443
 
444 444
                                             $object->trackid = $trackid;
Please login to merge, or discard this patch.
Dolibarr/Code/Partnerships/Api/Partnerships.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     }
342 342
 
343 343
 
344
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
344
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
345 345
     /**
346 346
      * Clean sensible object datas
347 347
      *
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      */
351 351
     protected function _cleanObjectDatas($object)
352 352
     {
353
-		// phpcs:enable
353
+        // phpcs:enable
354 354
         $object = parent::_cleanObjectDatas($object);
355 355
 
356 356
         unset($object->rowid);
Please login to merge, or discard this patch.