Passed
Push — FUNCTIONS_LIB_REVIEW_240920 ( 00d68f )
by Rafael
49:46
created
public/htdocs/imports/emptyexample.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@
 block discarded – undo
99 99
 }
100 100
 
101 101
 // List of targets fields
102
-$headerlinefields = array();    // Array of fields (label to show)
103
-$contentlinevalues = array();   // Array of example values
102
+$headerlinefields = array(); // Array of fields (label to show)
103
+$contentlinevalues = array(); // Array of example values
104 104
 $i = 0;
105 105
 foreach ($fieldstarget as $code => $label) {
106 106
     $withoutstar = preg_replace('/\*/', '', $fieldstarget[$code]);
Please login to merge, or discard this patch.
public/htdocs/imports/import.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
149 149
 $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
150 150
 $separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml', 3) : '');
151
-$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"');  // We must use 'nohtml' and not 'alphanohtml' because we must accept "
151
+$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
152 152
 $charset = GETPOST('charset', 'aZ09');
153 153
 $separator_used = str_replace('\t', "\t", $separator);
154 154
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
     $maxfilesizearray = getMaxFileSizeArray();
616 616
     $maxmin = $maxfilesizearray['maxmin'];
617 617
     if ($maxmin > 0) {
618
-        print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
618
+        print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file
619 619
     }
620 620
     print '<input type="file" name="userfile" size="20" maxlength="80"> &nbsp; &nbsp; ';
621 621
     $out = (!getDolGlobalString('MAIN_UPLOAD_DOC') ? ' disabled' : '');
@@ -625,29 +625,29 @@  discard block
 block discarded – undo
625 625
         $max = getDolGlobalString('MAIN_UPLOAD_DOC'); // In Kb
626 626
         $maxphp = @ini_get('upload_max_filesize'); // In unknown
627 627
         if (preg_match('/k$/i', $maxphp)) {
628
-            $maxphp = (int)substr($maxphp, 0, -1);
628
+            $maxphp = (int) substr($maxphp, 0, -1);
629 629
         }
630 630
         if (preg_match('/m$/i', $maxphp)) {
631
-            $maxphp = (int)substr($maxphp, 0, -1) * 1024;
631
+            $maxphp = (int) substr($maxphp, 0, -1) * 1024;
632 632
         }
633 633
         if (preg_match('/g$/i', $maxphp)) {
634
-            $maxphp = (int)substr($maxphp, 0, -1) * 1024 * 1024;
634
+            $maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024;
635 635
         }
636 636
         if (preg_match('/t$/i', $maxphp)) {
637
-            $maxphp = (int)substr($maxphp, 0, -1) * 1024 * 1024 * 1024;
637
+            $maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024 * 1024;
638 638
         }
639 639
         $maxphp2 = @ini_get('post_max_size'); // In unknown
640 640
         if (preg_match('/k$/i', $maxphp2)) {
641
-            $maxphp2 = (int)substr($maxphp2, 0, -1);
641
+            $maxphp2 = (int) substr($maxphp2, 0, -1);
642 642
         }
643 643
         if (preg_match('/m$/i', $maxphp2)) {
644
-            $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024;
644
+            $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024;
645 645
         }
646 646
         if (preg_match('/g$/i', $maxphp2)) {
647
-            $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024 * 1024;
647
+            $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024;
648 648
         }
649 649
         if (preg_match('/t$/i', $maxphp2)) {
650
-            $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024 * 1024 * 1024;
650
+            $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024 * 1024;
651 651
         }
652 652
         // Now $max and $maxphp and $maxphp2 are in Kb
653 653
         $maxmin = $max;
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     //var_dump($_SESSION["dol_array_match_file_to_database_select"]);
735 735
     $serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : '';
736 736
     $fieldsarray = explode(',', $serialized_array_match_file_to_database);
737
-    $array_match_file_to_database = array();        // Same than $fieldsarray but with mapped value only  (col1 => 's.fielda', col2 => 's.fieldb'...)
737
+    $array_match_file_to_database = array(); // Same than $fieldsarray but with mapped value only  (col1 => 's.fielda', col2 => 's.fieldb'...)
738 738
     foreach ($fieldsarray as $elem) {
739 739
         $tabelem = explode('=', $elem, 2);
740 740
         $key = $tabelem[0];
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
     foreach ($fieldstarget as $code => $line) {
1089 1089
         //var_dump($line);
1090 1090
 
1091
-        $tmparray = explode('|', $line["label"]);   // If label of field is several translation keys separated with |
1091
+        $tmparray = explode('|', $line["label"]); // If label of field is several translation keys separated with |
1092 1092
         $labeltoshow = '';
1093 1093
         foreach ($tmparray as $tmpkey => $tmpval) {
1094 1094
             $labeltoshow .= ($labeltoshow ? ' ' . $langs->trans('or') . ' ' : '') . $langs->transnoentities($tmpval);
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
     //var_dump($fieldssource);
1119 1119
     //var_dump($fieldstarget);
1120 1120
 
1121
-    $modetoautofillmapping = 'session';     // Use setup in session
1121
+    $modetoautofillmapping = 'session'; // Use setup in session
1122 1122
     if ($initialloadofstep4) {
1123 1123
         $modetoautofillmapping = 'guess';
1124 1124
     }
@@ -1250,10 +1250,10 @@  discard block
 block discarded – undo
1250 1250
             } elseif ($modetoautofillmapping == 'session' && !empty($_SESSION['dol_array_match_file_to_database_select'])) {
1251 1251
                 $tmpselectioninsession = dolExplodeIntoArray($_SESSION['dol_array_match_file_to_database_select'], ',', '=');
1252 1252
                 //var_dump($code);
1253
-                if (!empty($tmpselectioninsession[(string)($i + 1)]) && $tmpselectioninsession[(string)($i + 1)] == $tmpcode) {
1253
+                if (!empty($tmpselectioninsession[(string) ($i + 1)]) && $tmpselectioninsession[(string) ($i + 1)] == $tmpcode) {
1254 1254
                     $selectforline .= ' selected';
1255 1255
                 }
1256
-                $selectforline .= ' data-debug="' . $tmpcode . '-' . $code . '-' . $j . '-' . (!empty($tmpselectioninsession[(string)($i + 1)]) ? $tmpselectioninsession[(string)($i + 1)] : "") . '"';
1256
+                $selectforline .= ' data-debug="' . $tmpcode . '-' . $code . '-' . $j . '-' . (!empty($tmpselectioninsession[(string) ($i + 1)]) ? $tmpselectioninsession[(string) ($i + 1)] : "") . '"';
1257 1257
             }
1258 1258
             $selectforline .= ' data-html="' . dol_escape_htmltag($labelhtml) . '"';
1259 1259
             $selectforline .= '>';
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
         // - Then we set to disabled all fields that are selected
1331 1331
         print 'function setOptionsToDisabled() {' . "\n";
1332 1332
         print '		console.log("Remove the disabled flag everywhere");' . "\n";
1333
-        print '		$("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);' . "\n";  // Enable all options
1333
+        print '		$("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);' . "\n"; // Enable all options
1334 1334
         print '		arrayofselectedvalues = [];' . "\n";
1335 1335
 
1336 1336
         print '		$("select.targetselectchange").each(function(){' . "\n";
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
         print '     $.each(arrayofselectedvalues, function(key, value) {' . "\n"; // Loop on each selected value
1348 1348
         print '         if (value != -1) {' . "\n";
1349 1349
         print '     		console.log("Process key="+key+" value="+value+" to disable.");' . "\n";
1350
-        print '				$("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);' . "\n";  // Set to disabled except if currently selected
1350
+        print '				$("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);' . "\n"; // Set to disabled except if currently selected
1351 1351
         print '         }' . "\n";
1352 1352
         print '     });' . "\n";
1353 1353
         print '}' . "\n";
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
         $sql .= " FROM " . MAIN_DB_PREFIX . "import_model";
1491 1491
         $sql .= " WHERE type = '" . $db->escape($datatoimport) . "'";
1492 1492
         if (!getDolGlobalString('EXPORTS_SHARE_MODELS')) {  // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
1493
-            $sql .= " AND fk_user IN (0, " . ((int)$user->id) . ")";
1493
+            $sql .= " AND fk_user IN (0, " . ((int) $user->id) . ")";
1494 1494
         }
1495 1495
         $sql .= " ORDER BY rowid";
1496 1496
 
Please login to merge, or discard this patch.
public/htdocs/fichinter/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                                                     $mult = 3600 * 24 * 7;
388 388
                                                     break;
389 389
                                                 case 'm':
390
-                                                    $mult = (int)3600 * 24 * (365 / 12); // Average month duration
390
+                                                    $mult = (int) 3600 * 24 * (365 / 12); // Average month duration
391 391
                                                     break;
392 392
                                                 case 'y':
393 393
                                                     $mult = 3600 * 24 * 365;
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
     } else {
1077 1077
         print '<form name="fichinter" action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
1078 1078
         print '<input type="hidden" name="token" value="' . newToken() . '">';
1079
-        print '<input type="hidden" name="action" value="create">';     // We go back to create action
1079
+        print '<input type="hidden" name="action" value="create">'; // We go back to create action
1080 1080
         print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
1081 1081
 
1082 1082
         print dol_get_fiche_head('');
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
         $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
1366 1366
         $sql .= ' ft.date as date_intervention';
1367 1367
         $sql .= ' FROM ' . MAIN_DB_PREFIX . 'fichinterdet as ft';
1368
-        $sql .= ' WHERE ft.fk_fichinter = ' . ((int)$object->id);
1368
+        $sql .= ' WHERE ft.fk_fichinter = ' . ((int) $object->id);
1369 1369
         if (getDolGlobalString('FICHINTER_HIDE_EMPTY_DURATION')) {
1370 1370
             $sql .= ' AND ft.duree <> 0';
1371 1371
         }
Please login to merge, or discard this patch.
public/htdocs/mrp/mo_card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $objectbomchildline = new BOMLine($db);
163 163
 
164 164
         foreach ($TBomLineId as $id_bom_line) {
165
-            $object = new Mo($db);  // modified by the actions_addupdatedelete.inc.php
165
+            $object = new Mo($db); // modified by the actions_addupdatedelete.inc.php
166 166
 
167 167
             $objectbomchildline->fetch($id_bom_line);
168 168
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $res = $object->add_object_linked('mo', $mo_parent->id);
181 181
         }
182 182
 
183
-        header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . ((int)$mo_parent->id), 1));
183
+        header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . ((int) $mo_parent->id), 1));
184 184
         exit;
185 185
     } elseif ($action == 'confirm_cancel' && $confirm == 'yes' && !empty($permissiontoadd)) {
186 186
         $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
Please login to merge, or discard this patch.
public/htdocs/core/lib/loan.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,8 +114,8 @@
 block discarded – undo
114 114
     $mens = price2num($mens);
115 115
     $capital = price2num($capital);
116 116
     $rate = price2num($rate);
117
-    $numactualloadterm = ((int)$numactualloadterm);
118
-    $nbterm = ((int)$nbterm);
117
+    $numactualloadterm = ((int) $numactualloadterm);
118
+    $nbterm = ((int) $nbterm);
119 119
 
120 120
     // If mensuality is 0 we don't pay interests and remaining capital not modified
121 121
     if ($mens == 0) {
Please login to merge, or discard this patch.
public/htdocs/fourn/facture/card.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     // Action clone object
198 198
     if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
199 199
         $objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
200
-        '@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
200
+        '@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
201 201
 
202 202
         if (GETPOST('newsupplierref', 'alphanohtml')) {
203 203
             $objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
                 $sql = 'SELECT SUM(pf.amount) as total_paiements';
673 673
                 $sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn as pf, ' . MAIN_DB_PREFIX . 'paiementfourn as p';
674 674
                 $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement') . ')';
675
-                $sql .= ' WHERE pf.fk_facturefourn = ' . ((int)$object->id);
675
+                $sql .= ' WHERE pf.fk_facturefourn = ' . ((int) $object->id);
676 676
                 $sql .= ' AND pf.fk_paiementfourn = p.rowid';
677 677
                 $sql .= ' AND p.entity IN (' . getEntity('invoice') . ')';
678 678
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
                 $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
690 690
                 $sql .= " re.description, re.fk_invoice_supplier_source";
691 691
                 $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
692
-                $sql .= " WHERE fk_invoice_supplier = " . ((int)$object->id);
692
+                $sql .= " WHERE fk_invoice_supplier = " . ((int) $object->id);
693 693
                 $resql = $db->query($sql);
694 694
                 if (!empty($resql)) {
695 695
                     while ($obj = $db->fetch_object($resql)) {
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
             }
712 712
             if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) {
713 713
                 foreach ($amount_ht as $tva_tx => $xxx) {
714
-                    $discount->amount_ht = abs((float)$amount_ht[$tva_tx]);
715
-                    $discount->amount_tva = abs((float)$amount_tva[$tva_tx]);
716
-                    $discount->amount_ttc = abs((float)$amount_ttc[$tva_tx]);
717
-                    $discount->multicurrency_amount_ht = abs((float)$multicurrency_amount_ht[$tva_tx]);
718
-                    $discount->multicurrency_amount_tva = abs((float)$multicurrency_amount_tva[$tva_tx]);
719
-                    $discount->multicurrency_amount_ttc = abs((float)$multicurrency_amount_ttc[$tva_tx]);
714
+                    $discount->amount_ht = abs((float) $amount_ht[$tva_tx]);
715
+                    $discount->amount_tva = abs((float) $amount_tva[$tva_tx]);
716
+                    $discount->amount_ttc = abs((float) $amount_ttc[$tva_tx]);
717
+                    $discount->multicurrency_amount_ht = abs((float) $multicurrency_amount_ht[$tva_tx]);
718
+                    $discount->multicurrency_amount_tva = abs((float) $multicurrency_amount_tva[$tva_tx]);
719
+                    $discount->multicurrency_amount_ttc = abs((float) $multicurrency_amount_ttc[$tva_tx]);
720 720
 
721 721
                     // Clean vat code
722 722
                     $reg = array();
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
                         $tva_tx = preg_replace('/\s*\(.*\)/', '', $tva_tx); // Remove code into vatrate.
727 727
                     }
728 728
 
729
-                    $discount->tva_tx = abs((float)$tva_tx);
729
+                    $discount->tva_tx = abs((float) $tva_tx);
730 730
                     $discount->vat_src_code = $vat_src_code;
731 731
 
732 732
                     $result = $discount->create($user);
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         $db->begin();
783 783
 
784 784
         $error = 0;
785
-        $tmpproject = 0;  // Ensure a value
785
+        $tmpproject = 0; // Ensure a value
786 786
 
787 787
         // Fill array 'array_options' with data from add form
788 788
         $ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             $error++;
791 791
         }
792 792
 
793
-        $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');   // If we enter the 02 january, we need to save the 02 january for server
793
+        $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
794 794
         $datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
795 795
         //var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
796 796
         //var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
                 $object->ref_supplier = GETPOST('ref_supplier', 'alpha');
830 830
                 $object->socid = GETPOSTINT('socid');
831 831
                 $object->label = GETPOST('label', 'alphanohtml');
832
-                $object->libelle = $object->label;  // deprecated
832
+                $object->libelle = $object->label; // deprecated
833 833
                 $object->date = $dateinvoice;
834 834
                 $object->date_echeance = $datedue;
835 835
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
                 $object->subtype = GETPOST('subtype', 'alphanohtml');
904 904
                 $object->socid = GETPOSTINT('socid');
905 905
                 $object->label = GETPOST('label', 'alphanohtml');
906
-                $object->libelle = $object->label;  // Deprecated
906
+                $object->libelle = $object->label; // Deprecated
907 907
                 $object->date = $dateinvoice;
908 908
                 $object->date_echeance = $datedue;
909 909
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
                 $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
1014 1014
                 $object->mode_reglement_id = GETPOSTINT('mode_reglement_id');
1015 1015
                 $object->fk_account = GETPOSTINT('fk_account');
1016
-                $object->amount = (float)price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1016
+                $object->amount = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1017 1017
                 //$object->remise_absolue       = price2num(GETPOST('remise_absolue'), 'MU');
1018 1018
                 //$object->remise_percent       = price2num(GETPOST('remise_percent'), '', 2);
1019 1019
                 $object->fk_incoterms = GETPOSTINT('incoterm_id');
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
                 $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1074 1074
                 $object->socid = GETPOSTINT('socid');
1075 1075
                 $object->label = GETPOST('label', 'alphanohtml');
1076
-                $object->libelle = $object->label;   // deprecated
1076
+                $object->libelle = $object->label; // deprecated
1077 1077
                 $object->date = $dateinvoice;
1078 1078
                 $object->date_echeance = $datedue;
1079 1079
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
                                 if ($typeamount == 'amount') {
1177 1177
                                     $amount = $valuedeposit;
1178 1178
                                 } else {
1179
-                                    $amount = $srcobject->total_ttc * ((float)$valuedeposit / 100);
1179
+                                    $amount = $srcobject->total_ttc * ((float) $valuedeposit / 100);
1180 1180
                                 }
1181 1181
 
1182 1182
                                 $TTotalByTva = array();
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
                                             if ($qualified) {
1215 1215
                                                 $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1216 1216
                                                 $tva_tx = $lines[$i]->tva_tx;
1217
-                                                $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * (float)$valuedeposit) / 100;
1217
+                                                $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * (float) $valuedeposit) / 100;
1218 1218
                                             }
1219 1219
                                         }
1220 1220
 
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
                                     0,
1300 1300
                                     $object->lines[0]->date_start,
1301 1301
                                     $object->lines[0]->date_end,
1302
-                                    array(),  // array_options
1302
+                                    array(), // array_options
1303 1303
                                     0,
1304 1304
                                     0,
1305 1305
                                     '',
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
             $idprod = GETPOSTINT('idprod');
1585 1585
         }
1586 1586
 
1587
-        $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);      // Can be '1.2' or '1.2 (CODE)'
1587
+        $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1588 1588
 
1589 1589
         $price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
1590 1590
         $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
                 $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings
1809 1809
             } else {
1810 1810
                 $pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
1811
-                $pu_ht = price2num((float)$pu_ttc / (1 + ((float)$tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
1811
+                $pu_ht = price2num((float) $pu_ttc / (1 + ((float) $tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
1812 1812
             }
1813 1813
             $price_base_type = 'HT';
1814 1814
             $pu_devise = price2num($price_ht_devise, 'CU');
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
 // Mode creation
2083 2083
 if ($action == 'create') {
2084 2084
     $facturestatic = new FactureFournisseur($db);
2085
-    $selectedLines = array();  // Ensure initialised
2085
+    $selectedLines = array(); // Ensure initialised
2086 2086
 
2087 2087
     print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2088 2088
 
@@ -2277,7 +2277,7 @@  discard block
 block discarded – undo
2277 2277
     print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
2278 2278
     print '<input type="hidden" name="token" value="' . newToken() . '">';
2279 2279
     print '<input type="hidden" name="action" value="add">';
2280
-    print '<input type="hidden" name="changecompany" value="0">';   // will be set to 1 by javascript so we know post is done after a company change
2280
+    print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2281 2281
 
2282 2282
     if (!empty($societe->id) && $societe->id > 0) {
2283 2283
         print '<input type="hidden" name="socid" value="' . $societe->id . '">' . "\n";
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 
2362 2362
             $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2363 2363
             $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_fourn_rec as r';
2364
-            $sql .= ' WHERE r.fk_soc = ' . (int)$invoice_predefined->socid;
2364
+            $sql .= ' WHERE r.fk_soc = ' . (int) $invoice_predefined->socid;
2365 2365
 
2366 2366
             $resql = $db->query($sql);
2367 2367
             if ($resql) {
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
             // TODO We should not need this. Also data comes from not reliable value of $object->multicurrency_total_ttc that may be wrong if it was
2942 2942
             // calculated by summing lines that were in a currency for some of them and into another for others (lines from discount/down payment into another currency for example)
2943 2943
             if ($resteapayer == 0 && $multicurrency_resteapayer != 0 && $object->multicurrency_code != $conf->currency) {
2944
-                $resteapayer = price2num((float)$multicurrency_resteapayer / $object->multicurrency_tx, 'MT');
2944
+                $resteapayer = price2num((float) $multicurrency_resteapayer / $object->multicurrency_tx, 'MT');
2945 2945
             }
2946 2946
         }
2947 2947
 
@@ -3229,7 +3229,7 @@  discard block
 block discarded – undo
3229 3229
         // Thirdparty
3230 3230
         $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'supplier');
3231 3231
         if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
3232
-            $morehtmlref .= ' <div class="inline-block valignmiddle">(<a class="valignmiddle" href="' . constant('BASE_URL') . '/fourn/facture/list.php?socid=' . ((int)$object->thirdparty->id) . '&search_company=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherBills") . '</a>)</div>';
3232
+            $morehtmlref .= ' <div class="inline-block valignmiddle">(<a class="valignmiddle" href="' . constant('BASE_URL') . '/fourn/facture/list.php?socid=' . ((int) $object->thirdparty->id) . '&search_company=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherBills") . '</a>)</div>';
3233 3233
         }
3234 3234
         // Project
3235 3235
         if (isModEnabled('project')) {
@@ -3238,7 +3238,7 @@  discard block
 block discarded – undo
3238 3238
             if ($permissiontoadd) {
3239 3239
                 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3240 3240
                 if ($action != 'classify') {
3241
-                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int)$object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3241
+                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int) $object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3242 3242
                 }
3243 3243
                 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3244 3244
             } else {
@@ -3672,7 +3672,7 @@  discard block
 block discarded – undo
3672 3672
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
3673 3673
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_paiement as c ON p.fk_paiement = c.id';
3674 3674
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
3675
-            $sql .= ' WHERE pf.fk_facturefourn = ' . ((int)$object->id);
3675
+            $sql .= ' WHERE pf.fk_facturefourn = ' . ((int) $object->id);
3676 3676
             $sql .= ' ORDER BY p.datep, p.tms';
3677 3677
 
3678 3678
             $result = $db->query($sql);
@@ -3793,7 +3793,7 @@  discard block
 block discarded – undo
3793 3793
                 $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
3794 3794
                 $sql .= " re.description, re.fk_invoice_supplier_source";
3795 3795
                 $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
3796
-                $sql .= " WHERE fk_invoice_supplier = " . ((int)$object->id);
3796
+                $sql .= " WHERE fk_invoice_supplier = " . ((int) $object->id);
3797 3797
                 $resql = $db->query($sql);
3798 3798
                 if ($resql) {
3799 3799
                     $num = $db->num_rows($resql);
Please login to merge, or discard this patch.
Dolibarr/Code/Core/Classes/FormOther.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
         $sql .= " FROM " . $this->db->prefix() . "export_model";
415 415
         $sql .= " WHERE type = '" . $this->db->escape($type) . "'";
416 416
         if (!getDolGlobalString('EXPORTS_SHARE_MODELS')) {  // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
417
-            $sql .= " AND fk_user IN (0, " . ((int)$fk_user) . ")";
417
+            $sql .= " AND fk_user IN (0, " . ((int) $fk_user) . ")";
418 418
         }
419 419
         $sql .= " ORDER BY label";
420 420
         $result = $this->db->query($sql);
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $sql .= " FROM " . $this->db->prefix() . "import_model";
478 478
         $sql .= " WHERE type = '" . $this->db->escape($type) . "'";
479 479
         if (!getDolGlobalString('EXPORTS_SHARE_MODELS')) {  // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
480
-            $sql .= " AND fk_user IN (0, " . ((int)$fk_user) . ")";
480
+            $sql .= " AND fk_user IN (0, " . ((int) $fk_user) . ")";
481 481
         }
482 482
         $sql .= " ORDER BY label";
483 483
         $result = $this->db->query($sql);
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
         }
644 644
 
645 645
         for ($i = $start; $i <= $end; $i += $increment) {
646
-            if ($selected != '' && (int)$selected == $i) {
646
+            if ($selected != '' && (int) $selected == $i) {
647 647
                 $return .= '<option value="' . $i . '" selected>';
648 648
             } else {
649 649
                 $return .= '<option value="' . $i . '">';
@@ -779,10 +779,10 @@  discard block
 block discarded – undo
779 779
         }
780 780
 
781 781
         if (!$user->hasRight('user', 'user', 'lire')) {
782
-            $sql_usr .= " AND u.rowid = " . ((int)$user->id);
782
+            $sql_usr .= " AND u.rowid = " . ((int) $user->id);
783 783
         }
784 784
         if (!empty($user->socid)) {
785
-            $sql_usr .= " AND u.fk_soc = " . ((int)$user->socid);
785
+            $sql_usr .= " AND u.fk_soc = " . ((int) $user->socid);
786 786
         }
787 787
         if (getDolGlobalString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX')) {
788 788
             $sql_usr .= " AND u.employee <> 0";
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
                 $sql_usr .= " WHERE u2.entity IN (" . getEntity('user') . ")";
816 816
             }
817 817
 
818
-            $sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc = " . ((int)$user->socid);
818
+            $sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc = " . ((int) $user->socid);
819 819
 
820 820
             //Add hook to filter on user (for example on usergroup define in custom modules)
821 821
             if (!empty($reshook)) {
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 
1255 1255
         $color = substr($color, 1, 6);
1256 1256
 
1257
-        $red = hexdec(substr($color, 0, 2));    // Red channel conversion
1257
+        $red = hexdec(substr($color, 0, 2)); // Red channel conversion
1258 1258
         $green = hexdec(substr($color, 2, 2)); // Green channel conversion
1259
-        $blue = hexdec(substr($color, 4, 2));  // Blue channel conversion
1259
+        $blue = hexdec(substr($color, 4, 2)); // Blue channel conversion
1260 1260
 
1261 1261
         $couleur = imagecolorallocate($image, $red, $green, $blue);
1262 1262
         //print $red.$green.$blue;
Please login to merge, or discard this patch.
public/htdocs/contact/consumption.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle as type_contact_label, ';
220 220
     $tables_from = MAIN_DB_PREFIX . 'fichinterdet d';
221 221
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'fichinter as f ON d.fk_fichinter=f.rowid';
222
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
222
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
223 223
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='fichinter' and tc.source='external' and tc.active=1)";
224 224
     $where = ' WHERE f.entity IN (' . getEntity('intervention') . ')';
225 225
     $dateprint = 'f.datec';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     $tables_from = MAIN_DB_PREFIX . 'facturedet d';
231 231
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture as f ON d.fk_facture=f.rowid';
232 232
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
233
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
233
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
234 234
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='facture' and tc.source='external' and tc.active=1)";
235 235
     $where = " WHERE f.entity IN (" . getEntity('invoice') . ")";
236 236
     $dateprint = 'f.datef';
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     $tables_from = MAIN_DB_PREFIX . 'propaldet d';
243 243
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'propal as c ON d.fk_propal=c.rowid';
244 244
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
245
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
245
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
246 246
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)";
247 247
     $where = ' WHERE c.entity IN (' . getEntity('propal') . ')';
248 248
     $dateprint = 'c.datep';
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     $tables_from = MAIN_DB_PREFIX . 'commandedet d';
255 255
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'commande as c ON d.fk_commande=c.rowid';
256 256
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
257
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
257
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
258 258
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='commande' and tc.source='external' and tc.active=1)";
259 259
     $where = ' WHERE c.entity IN (' . getEntity('order') . ')';
260 260
     $dateprint = 'c.date_commande';
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     $tables_from = MAIN_DB_PREFIX . 'facture_fourn_det d';
267 267
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture_fourn as f ON d.fk_facture_fourn=f.rowid';
268 268
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
269
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
269
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
270 270
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='invoice_supplier' and tc.source='external' and tc.active=1)";
271 271
     $where = ' WHERE f.entity IN (' . getEntity($documentstatic->element) . ')';
272 272
     $dateprint = 'f.datef';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     $tables_from = MAIN_DB_PREFIX . 'commande_fournisseurdet d';
291 291
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'commande_fournisseur as c ON d.fk_commande=c.rowid';
292 292
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
293
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
293
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
294 294
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='order_supplier' and tc.source='external' and tc.active=1)";
295 295
     $where = ' WHERE c.entity IN (' . getEntity($documentstatic->element) . ')';
296 296
     $dateprint = 'c.date_valid';
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     $tables_from = MAIN_DB_PREFIX . 'contratdet d';
304 304
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'contrat as c ON d.fk_contrat=c.rowid';
305 305
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
306
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
306
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
307 307
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='contrat' and tc.source='external' and tc.active=1)";
308 308
     $where = ' WHERE c.entity IN (' . getEntity('contrat') . ')';
309 309
     $dateprint = 'c.date_valid';
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 $param .= "&year=" . urlencode($year);
375 375
 $param .= "&sprod_fulldescr=" . urlencode($sprod_fulldescr);
376 376
 if (!empty($socid)) {
377
-    $param .= "&socid=" . urlencode((string)($socid));
377
+    $param .= "&socid=" . urlencode((string) ($socid));
378 378
 }
379 379
 $param .= "&type_element=" . urlencode($type_element);
380 380
 
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 
389 389
     $num = $db->num_rows($resql);
390 390
 
391
-    $param = (!empty($socid) ? "&socid=" . urlencode((string)($socid)) : "") . "&type_element=" . urlencode((string)($type_element)) . "&id=" . urlencode((string)($id));
391
+    $param = (!empty($socid) ? "&socid=" . urlencode((string) ($socid)) : "") . "&type_element=" . urlencode((string) ($type_element)) . "&id=" . urlencode((string) ($id));
392 392
     if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
393 393
         $param .= '&contextpage=' . urlencode($contextpage);
394 394
     }
395 395
     if ($limit > 0 && $limit != $conf->liste_limit) {
396
-        $param .= '&limit=' . ((int)$limit);
396
+        $param .= '&limit=' . ((int) $limit);
397 397
     }
398 398
     if ($sprod_fulldescr) {
399 399
         $param .= "&sprod_fulldescr=" . urlencode($sprod_fulldescr);
@@ -402,10 +402,10 @@  discard block
 block discarded – undo
402 402
         $param .= "&sref=" . urlencode($sref);
403 403
     }
404 404
     if ($month) {
405
-        $param .= "&month=" . urlencode((string)($month));
405
+        $param .= "&month=" . urlencode((string) ($month));
406 406
     }
407 407
     if ($year) {
408
-        $param .= "&year=" . urlencode((string)($year));
408
+        $param .= "&year=" . urlencode((string) ($year));
409 409
     }
410 410
     if ($optioncss != '') {
411 411
         $param .= '&optioncss=' . urlencode($optioncss);
Please login to merge, or discard this patch.
public/htdocs/contact/canvas/actions_contactcard_common.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             // Town
165 165
             $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
166 166
 
167
-            if (dol_strlen(trim((string)$this->object->country_id)) == 0) {
167
+            if (dol_strlen(trim((string) $this->object->country_id)) == 0) {
168 168
                 $this->object->country_id = $objsoc->country_id;
169 169
             }
170 170
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         // We set country_id, and country_code label of the chosen country
317 317
         if ($this->object->country_id) {
318
-            $sql = "SELECT code, label FROM " . MAIN_DB_PREFIX . "c_country WHERE rowid = " . ((int)$this->object->country_id);
318
+            $sql = "SELECT code, label FROM " . MAIN_DB_PREFIX . "c_country WHERE rowid = " . ((int) $this->object->country_id);
319 319
             $resql = $this->db->query($sql);
320 320
             if ($resql) {
321 321
                 $obj = $this->db->fetch_object($resql);
Please login to merge, or discard this patch.