Passed
Push — main ( 324b47...7af4bb )
by Rafael
43:55
created
htdocs/product/reassortlot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 
95 95
 // Default sort order (if not yet defined by previous GETPOST)
96 96
 if (!$sortfield) {
97
-    reset($object->fields);                 // Reset is required to avoid key() to return null.
97
+    reset($object->fields); // Reset is required to avoid key() to return null.
98 98
     $sortfield = "p." . key($object->fields); // Set here default search field. By default 1st field in definition.
99 99
 }
100 100
 if (!$sortorder) {
Please login to merge, or discard this patch.
htdocs/product/admin/product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
 $action = GETPOST('action', 'aZ09');
51 51
 $value = GETPOST('value', 'alpha');
52
-$modulepart = GETPOST('modulepart', 'aZ09');    // Used by actions_setmoduleoptions.inc.php
52
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
53 53
 
54 54
 $label = GETPOST('label', 'alpha');
55 55
 $scandir = GETPOST('scan_dir', 'alpha');
Please login to merge, or discard this patch.
htdocs/product/inventory/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 // Default sort order (if not yet defined by previous GETPOST)
74 74
 if (!$sortfield) {
75
-    reset($object->fields);                 // Reset is required to avoid key() to return null.
75
+    reset($object->fields); // Reset is required to avoid key() to return null.
76 76
     $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition.
77 77
 }
78 78
 if (!$sortorder) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 // Output page
376 376
 // --------------------------------------------------------------------
377 377
 
378
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');   // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
378
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
379 379
 
380 380
 $arrayofselected = is_array($toselect) ? $toselect : array();
381 381
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
     } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
602 602
         $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
603 603
     }
604
-    $cssforfield = preg_replace('/small\s*/', '', $cssforfield);    // the 'small' css must not be used for the title label
604
+    $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
605 605
     if (!empty($arrayfields['t.' . $key]['checked'])) {
606 606
         print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n";
607 607
         $totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/product/inventory/inventory.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 $line = $db->fetch_object($resql);
165 165
 
166 166
                 $qty_stock = $line->qty_stock;
167
-                $qty_view = $line->qty_view;        // The quantity viewed by inventorier, the qty we target
167
+                $qty_view = $line->qty_view; // The quantity viewed by inventorier, the qty we target
168 168
 
169 169
 
170 170
                 // Load real stock we have now.
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                         }
222 222
                         $sqlupdate .= " WHERE rowid = " . ((int) $line->rowid);
223 223
                         $resqlupdate = $db->query($sqlupdate);
224
-                        if (! $resqlupdate) {
224
+                        if (!$resqlupdate) {
225 225
                             $error++;
226 226
                             setEventMessages($db->lasterror(), null, 'errors');
227 227
                             break;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                     if (!empty($line->pmp_real) && getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
232 232
                         $sqlpmp = 'UPDATE ' . MAIN_DB_PREFIX . 'product SET pmp = ' . ((float) $line->pmp_real) . ' WHERE rowid = ' . ((int) $line->fk_product);
233 233
                         $resqlpmp = $db->query($sqlpmp);
234
-                        if (! $resqlpmp) {
234
+                        if (!$resqlpmp) {
235 235
                             $error++;
236 236
                             setEventMessages($db->lasterror(), null, 'errors');
237 237
                             break;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                         if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
240 240
                             $sqlpmp = 'UPDATE ' . MAIN_DB_PREFIX . 'product_perentity SET pmp = ' . ((float) $line->pmp_real) . ' WHERE fk_product = ' . ((int) $line->fk_product) . ' AND entity=' . $conf->entity;
241 241
                             $resqlpmp = $db->query($sqlpmp);
242
-                            if (! $resqlpmp) {
242
+                            if (!$resqlpmp) {
243 243
                                 $error++;
244 244
                                 setEventMessages($db->lasterror(), null, 'errors');
245 245
                                 break;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
             $error++;
259 259
         }
260 260
 
261
-        if (! $error) {
261
+        if (!$error) {
262 262
             $db->commit();
263 263
         } else {
264 264
             $db->rollback();
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
                         setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors');
299 299
                     }
300 300
                     if ($result > 0) {
301
-                        $inventoryline->qty_stock = price2num(GETPOST('stock_qty_' . $lineid, 'alpha'), 'MS');    // The new value that was set in as hidden field
302
-                        $inventoryline->qty_view = $qtytoupdate;    // The new value we want
301
+                        $inventoryline->qty_stock = price2num(GETPOST('stock_qty_' . $lineid, 'alpha'), 'MS'); // The new value that was set in as hidden field
302
+                        $inventoryline->qty_view = $qtytoupdate; // The new value we want
303 303
                         $inventoryline->pmp_real = price2num(GETPOST('realpmp_' . $lineid, 'alpha'), 'MS');
304 304
                         $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_' . $lineid, 'alpha'), 'MS');
305 305
                         $resultupdate = $inventoryline->update($user);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                     // Delete record
309 309
                     $result = $inventoryline->fetch($lineid);
310 310
                     if ($result > 0) {
311
-                        $inventoryline->qty_view = null;            // The new value we want
311
+                        $inventoryline->qty_view = null; // The new value we want
312 312
                         $inventoryline->pmp_real = price2num(GETPOST('realpmp_' . $lineid, 'alpha'), 'MS');
313 313
                         $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_' . $lineid, 'alpha'), 'MS');
314 314
                         $resultupdate = $inventoryline->update($user);
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
         }
325 325
 
326 326
         // Update line with id of stock movement (and the start quantity if it has changed this last recording)
327
-        if (! $error) {
327
+        if (!$error) {
328 328
             $sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "inventory";
329 329
             $sqlupdate .= " SET fk_user_modif = " . ((int) $user->id);
330 330
             $sqlupdate .= " WHERE rowid = " . ((int) $object->id);
331 331
             $resqlupdate = $db->query($sqlupdate);
332
-            if (! $resqlupdate) {
332
+            if (!$resqlupdate) {
333 333
                 $error++;
334 334
                 setEventMessages($db->lasterror(), null, 'errors');
335 335
             }
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
                 print '</td>';
1170 1170
 
1171 1171
                 print '<td class="right nowraponall">';
1172
-                print $obj->qty_view;   // qty found
1172
+                print $obj->qty_view; // qty found
1173 1173
                 print '</td>';
1174 1174
 
1175 1175
                 //PMP Real
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
                 $totalRealValuation += $pmp_valuation_real;
1192 1192
             } else {
1193 1193
                 print '<td class="right nowraponall">';
1194
-                print $obj->qty_view;   // qty found
1194
+                print $obj->qty_view; // qty found
1195 1195
                 print '</td>';
1196 1196
             }
1197 1197
             print '<td>';
Please login to merge, or discard this patch.
htdocs/product/inventory/ajax/searchfrombarcode.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -92,22 +92,22 @@  discard block
 block discarded – undo
92 92
                     $fk_product = $object->fk_product;
93 93
                     $reelqty = $object->reel;
94 94
 
95
-                    $objectreturn = array('fk_warehouse' => $warehouseid,'fk_product' => $fk_product,'reelqty' => $reelqty);
95
+                    $objectreturn = array('fk_warehouse' => $warehouseid, 'fk_product' => $fk_product, 'reelqty' => $reelqty);
96 96
                 }
97 97
             }
98 98
         }
99 99
         if ($warehousefound < 1) {
100
-            $response = array('status' => 'error','errorcode' => 'NotFound','message' => 'No warehouse found for barcode' . $barcode);
100
+            $response = array('status' => 'error', 'errorcode' => 'NotFound', 'message' => 'No warehouse found for barcode' . $barcode);
101 101
         } elseif ($warehousefound > 1) {
102
-            $response = array('status' => 'error','errorcode' => 'TooManyWarehouse','message' => 'Too many warehouse found');
102
+            $response = array('status' => 'error', 'errorcode' => 'TooManyWarehouse', 'message' => 'Too many warehouse found');
103 103
         } else {
104
-            $response = array('status' => 'success','message' => 'Warehouse found','object' => $objectreturn);
104
+            $response = array('status' => 'success', 'message' => 'Warehouse found', 'object' => $objectreturn);
105 105
         }
106 106
     } else {
107
-        $response = array('status' => 'error','errorcode' => 'NotFound','message' => "No results found for barcode");
107
+        $response = array('status' => 'error', 'errorcode' => 'NotFound', 'message' => "No results found for barcode");
108 108
     }
109 109
 } else {
110
-    $response = array('status' => 'error','errorcode' => 'ActionError','message' => "Error on action");
110
+    $response = array('status' => 'error', 'errorcode' => 'ActionError', 'message' => "Error on action");
111 111
 }
112 112
 
113 113
 if ($action == "addnewlineproduct") {
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 
127 127
         $result = $inventoryline->create($user);
128 128
         if ($result > 0) {
129
-            $response = array('status' => 'success','message' => 'Success on creating line','id_line' => $result);
129
+            $response = array('status' => 'success', 'message' => 'Success on creating line', 'id_line' => $result);
130 130
         } else {
131
-            $response = array('status' => 'error','errorcode' => 'ErrorCreation','message' => "Error on line creation");
131
+            $response = array('status' => 'error', 'errorcode' => 'ErrorCreation', 'message' => "Error on line creation");
132 132
         }
133 133
     } else {
134
-        $response = array('status' => 'error','errorcode' => 'NoIdForInventory','message' => "No id for inventory");
134
+        $response = array('status' => 'error', 'errorcode' => 'NoIdForInventory', 'message' => "No id for inventory");
135 135
     }
136 136
 }
137 137
 
Please login to merge, or discard this patch.
htdocs/product/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $refalreadyexists = 0;
99 99
 
100 100
 // Get parameters
101
-$id  = GETPOSTINT('id');
101
+$id = GETPOSTINT('id');
102 102
 if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
103 103
     $ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
104 104
 } else {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
                 $object->status_batch = GETPOST('status_batch', 'aZ09');
772 772
                 $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory');
773 773
                 $object->batch_mask = GETPOST('batch_mask', 'alpha');
774
-                $object->fk_default_warehouse   = GETPOSTINT('fk_default_warehouse');
774
+                $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse');
775 775
                 $object->fk_default_workstation   = GETPOSTINT('fk_default_workstation');
776 776
                 // removed from update view so GETPOST always empty
777 777
                 /*
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
                     $object->accountancy_code_buy_export = $accountancy_code_buy_export;
872 872
                 }
873 873
                 if ($object->isService()) {
874
-                    $object->mandatory_period =  (!empty($checkmandatory)) ? 1 : 0 ;
874
+                    $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0;
875 875
                 }
876 876
 
877 877
 
Please login to merge, or discard this patch.
htdocs/product/ajax/products.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 $socid = GETPOSTINT('socid');
48 48
 $type = GETPOSTINT('type');
49 49
 $mode = GETPOSTINT('mode');
50
-$status = ((GETPOSTINT('status') >= 0) ? GETPOSTINT('status') : - 1);   // status buy when mode = customer , status purchase when mode = supplier
51
-$status_purchase = ((GETPOSTINT('status_purchase') >= 0) ? GETPOSTINT('status_purchase') : - 1);    // status purchase when mode = customer
50
+$status = ((GETPOSTINT('status') >= 0) ? GETPOSTINT('status') : - 1); // status buy when mode = customer , status purchase when mode = supplier
51
+$status_purchase = ((GETPOSTINT('status_purchase') >= 0) ? GETPOSTINT('status_purchase') : - 1); // status purchase when mode = customer
52 52
 $outjson = (GETPOSTINT('outjson') ? GETPOSTINT('outjson') : 0);
53 53
 $price_level = GETPOSTINT('price_level');
54 54
 $action = GETPOST('action', 'aZ09');
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         // Multiprice (1 price per level)
163 163
         if (!$found && isset($price_level) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { // If we need a particular price level (from 1 to 6)
164 164
             $sql = "SELECT price, price_ttc, price_base_type,";
165
-            $sql .= " tva_tx, default_vat_code";    // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on.
165
+            $sql .= " tva_tx, default_vat_code"; // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on.
166 166
             $sql .= " FROM " . MAIN_DB_PREFIX . "product_price ";
167 167
             $sql .= " WHERE fk_product = " . ((int) $id);
168 168
             $sql .= " AND entity IN (" . getEntity('productprice') . ")";
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
                 $objp = $db->fetch_object($result);
176 176
                 if ($objp) {
177 177
                     $found = true;
178
-                    $outprice_ht = price($objp->price);         // formatted for language user because is inserted into input field
179
-                    $outprice_ttc = price($objp->price_ttc);    // formatted for language user because is inserted into input field
178
+                    $outprice_ht = price($objp->price); // formatted for language user because is inserted into input field
179
+                    $outprice_ttc = price($objp->price_ttc); // formatted for language user because is inserted into input field
180 180
                     $outpricebasetype = $objp->price_base_type;
181 181
                     if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
182 182
                         $outtva_tx_formated = price($objp->tva_tx); // formatted for language user because is inserted into input field
183
-                        $outtva_tx = price2num($objp->tva_tx);      // international numeric
183
+                        $outtva_tx = price2num($objp->tva_tx); // international numeric
184 184
                         $outdefault_vat_code = $objp->default_vat_code;
185 185
                     } else {
186 186
                         // The common and default behaviour.
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
         }
225 225
 
226 226
         // VAT to use and default VAT for product are set to same value by default
227
-        $product_outtva_tx_formated =  $outtva_tx_formated;
228
-        $product_outtva_tx =  $outtva_tx;
227
+        $product_outtva_tx_formated = $outtva_tx_formated;
228
+        $product_outtva_tx = $outtva_tx;
229 229
         $product_outdefault_vat_code = $outdefault_vat_code;
230 230
 
231 231
         // If we ask the price according to buyer, we change it.
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     $match = preg_grep('/(' . preg_quote($htmlname, '/') . '[0-9]+)/', array_keys($_GET));
294 294
     sort($match);
295 295
 
296
-    $idprod = (empty($match[0]) ? '' : $match[0]);      // Take first key found into GET array with matching $htmlname123
296
+    $idprod = (empty($match[0]) ? '' : $match[0]); // Take first key found into GET array with matching $htmlname123
297 297
 
298 298
     if (GETPOST($htmlname, 'alpha') == '' && (!$idprod || !GETPOST($idprod, 'alpha'))) {
299 299
         print json_encode(array());
Please login to merge, or discard this patch.
htdocs/product/composition/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -444,7 +444,7 @@
 block discarded – undo
444 444
 
445 445
                     $unitline = price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MU');
446 446
                     $totalline = price2num($value['nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MT');
447
-                    $total +=  $totalline;
447
+                    $total += $totalline;
448 448
 
449 449
                     print '<td class="right nowraponall">';
450 450
                     print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'] . 'x ' : '') . '<span class="amount">' . price($unitline, 0, '', 0, 0, -1, $conf->currency)) . '</span>';
Please login to merge, or discard this patch.
htdocs/product/stock/list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
449 449
 );
450 450
 //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
451
-if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
451
+if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
452 452
     $arrayofmassactions = array();
453 453
 }
454 454
 if (isModEnabled('category') && $user->hasRight('stock', 'creer')) {
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
     } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
642 642
         $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
643 643
     }
644
-    $cssforfield = preg_replace('/small\s*/', '', $cssforfield);    // the 'small' css must not be used for the title label
644
+    $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
645 645
     if (!empty($arrayfields['t.' . $key]['checked'])) {
646 646
         print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n";
647 647
         $totalarray['nbfield']++;
Please login to merge, or discard this patch.