Passed
Push — dev ( 162356...096618 )
by Rafael
70:47 queued 05:12
created
public/htdocs/theme/md/badges.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -245,22 +245,22 @@  discard block
 block discarded – undo
245 245
             $thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
246 246
         }
247 247
 
248
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
248
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
249 249
             $thisBadgeTextColor = '#212529';
250 250
             $thisBadgeBackgroundColor = "#fff";
251 251
         }
252 252
 
253
-        if (in_array((string)$statusName, array('0', '5', '9'))) {
253
+        if (in_array((string) $statusName, array('0', '5', '9'))) {
254 254
             $thisBadgeTextColor = '#999999';
255 255
         }
256
-        if (in_array((string)$statusName, array('6'))) {
256
+        if (in_array((string) $statusName, array('6'))) {
257 257
             $thisBadgeTextColor = '#777777';
258 258
         }
259 259
 
260 260
         // badge-statusX
261 261
         print $cssPrefix . ".badge-status" . $statusName . " {\n";
262 262
         print "        color: " . $thisBadgeTextColor . " !important;\n";
263
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
263
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
264 264
             print "        border-color: " . $thisBadgeBorderColor . " !important;\n";
265 265
         }
266 266
         if ($thisBadgeBackgroundColor != '') {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         print $cssPrefix . ".badge-status" . $statusName . ":focus, " . $cssPrefix . ".badge-status" . $statusName . ":hover {\n";
284 284
         print "    color: " . $thisBadgeTextColor . " !important;\n";
285 285
         //print "    background-color: ".colorDarker($thisBadgeBackgroundColor, 10).";\n";
286
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
286
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
287 287
             print "        border-color: " . colorDarker($thisBadgeBorderColor, 10) . " !important;\n";
288 288
         }
289 289
         print "}\n";
Please login to merge, or discard this patch.
public/htdocs/theme/md/btn.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     if (getDolGlobalString('THEME_DARKMODEENABLED')) {
22 22
         print "/* For dark mode */\n";
23 23
         if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
24
-            print "@media (prefers-color-scheme: dark) {";  // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
24
+            print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
25 25
         } else {
26 26
             print "@media not print {";
27 27
         }
Please login to merge, or discard this patch.
public/htdocs/theme/eldy/badges.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -243,22 +243,22 @@  discard block
 block discarded – undo
243 243
             $thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
244 244
         }
245 245
 
246
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
246
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
247 247
             $thisBadgeTextColor = '#212529';
248 248
             $thisBadgeBackgroundColor = "";
249 249
         }
250 250
 
251
-        if (in_array((string)$statusName, array('0', '5', '9'))) {
251
+        if (in_array((string) $statusName, array('0', '5', '9'))) {
252 252
             $thisBadgeTextColor = '#999999';
253 253
         }
254
-        if (in_array((string)$statusName, array('6'))) {
254
+        if (in_array((string) $statusName, array('6'))) {
255 255
             $thisBadgeTextColor = '#777777';
256 256
         }
257 257
 
258 258
         // badge-statusX
259 259
         print $cssPrefix . ".badge-status" . $statusName . " {\n";
260 260
         print "        color: " . $thisBadgeTextColor . " !important;\n";
261
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
261
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
262 262
             print "        border-color: " . $thisBadgeBorderColor . " !important;\n";
263 263
         }
264 264
         if ($thisBadgeBackgroundColor != '') {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         print $cssPrefix . ".badge-status" . $statusName . ":focus, " . $cssPrefix . ".badge-status" . $statusName . ":hover {\n";
282 282
         print "    color: " . $thisBadgeTextColor . " !important;\n";
283 283
         //print "    background-color: " . colorDarker($thisBadgeBackgroundColor, 10) . ";\n";
284
-        if (in_array((string)$statusName, $TBadgeBorderOnly)) {
284
+        if (in_array((string) $statusName, $TBadgeBorderOnly)) {
285 285
             print "        border-color: " . colorDarker($thisBadgeBorderColor, 10) . " !important;\n";
286 286
         }
287 287
         print "}\n";
Please login to merge, or discard this patch.
public/htdocs/societe/ajax/ajaxcompanies.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,13 +118,13 @@
 block discarded – undo
118 118
         $sql .= " OR s.code_fournisseur LIKE '%" . $db->escape($db->escapeforlike($socid)) . "%'";
119 119
     }
120 120
     if (getDolGlobalString('SOCIETE_ALLOW_SEARCH_ON_ROWID')) {
121
-        $sql .= " OR s.rowid = " . ((int)$socid);
121
+        $sql .= " OR s.rowid = " . ((int) $socid);
122 122
     }
123 123
     $sql .= ")";
124 124
 }
125 125
 // Protection for external user access
126 126
 if ($user->socid > 0) {
127
-    $sql .= " AND s.rowid = " . ((int)$user->socid);
127
+    $sql .= " AND s.rowid = " . ((int) $user->socid);
128 128
 }
129 129
 //if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters
130 130
 $sql .= " ORDER BY s.nom ASC";
Please login to merge, or discard this patch.
public/htdocs/societe/paymentmodes.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
             'use_companybankid' => GETPOST('companybankid'),
530 530
             'force_dir_output' => $conf->societe->multidir_output[$object->entity] . '/' . dol_sanitizeFileName($object->id)
531 531
         );
532
-        $_POST['lang_id'] = GETPOST('lang_idrib' . GETPOSTINT('companybankid'), 'alphanohtml');   // This is required by core/action_builddoc.inc.php
533
-        $_POST['model'] = GETPOST('modelrib' . GETPOSTINT('companybankid'), 'alphanohtml');       // This is required by core/action_builddoc.inc.php
532
+        $_POST['lang_id'] = GETPOST('lang_idrib' . GETPOSTINT('companybankid'), 'alphanohtml'); // This is required by core/action_builddoc.inc.php
533
+        $_POST['model'] = GETPOST('modelrib' . GETPOSTINT('companybankid'), 'alphanohtml'); // This is required by core/action_builddoc.inc.php
534 534
     }
535 535
 
536 536
     $id = $socid;
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
         }
601 601
         if ($action == 'syncsepatostripe') {
602 602
             // Create the bank account on current Stripe env
603
-            $companypaymentmode = new CompanyPaymentMode($db);  // Get record in llx_societe_rib
603
+            $companypaymentmode = new CompanyPaymentMode($db); // Get record in llx_societe_rib
604 604
             $companypaymentmode->fetch($id);
605 605
 
606 606
             if ($companypaymentmode->type != 'ban') {
@@ -653,10 +653,10 @@  discard block
 block discarded – undo
653 653
             $db->begin();
654 654
 
655 655
             if (empty($newcu)) {
656
-                $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . $object->id . " AND status = " . ((int)$tmpservicestatus) . " AND entity = " . $conf->entity;
656
+                $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . $object->id . " AND status = " . ((int) $tmpservicestatus) . " AND entity = " . $conf->entity;
657 657
             } else {
658 658
                 $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . "societe_account";
659
-                $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int)$object->id) . " AND status = " . ((int)$tmpservicestatus) . " AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
659
+                $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int) $object->id) . " AND status = " . ((int) $tmpservicestatus) . " AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
660 660
             }
661 661
 
662 662
             $resql = $db->query($sql);
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                 } else {
679 679
                     $sql = 'UPDATE ' . MAIN_DB_PREFIX . "societe_account";
680 680
                     $sql .= " SET key_account = '" . $db->escape($newcu) . "', site_account = '" . $db->escape($tmpsite_account) . "'";
681
-                    $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int)$object->id) . " AND status = " . ((int)$tmpservicestatus) . " AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
681
+                    $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int) $object->id) . " AND status = " . ((int) $tmpservicestatus) . " AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
682 682
                     $resql = $db->query($sql);
683 683
                 }
684 684
             }
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
                     $tokenstring['type'] = $stripesup->type;
732 732
                     $sql = "UPDATE " . MAIN_DB_PREFIX . "oauth_token";
733 733
                     $sql .= " SET tokenstring = '" . $db->escape(json_encode($tokenstring)) . "'";
734
-                    $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int)$object->id) . " AND service = '" . $db->escape($tmpservice) . "' AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
734
+                    $sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '" . $db->escape($tmpsite_account) . "') AND fk_soc = " . ((int) $object->id) . " AND service = '" . $db->escape($tmpservice) . "' AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
735 735
                     // TODO Add site and site_account on oauth_token table
736 736
                     $sql .= " WHERE fk_soc = " . $object->id . " AND service = '" . $db->escape($tmpservice) . "' AND entity = " . $conf->entity; // Keep = here for entity. Only 1 record must be modified !
737 737
                 } catch (Exception $e) {
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
                     $tokenstring['stripe_user_id'] = $stripesup->id;
749 749
                     $tokenstring['type'] = $stripesup->type;
750 750
                     $sql = "INSERT INTO " . MAIN_DB_PREFIX . "oauth_token (service, fk_soc, entity, tokenstring)";
751
-                    $sql .= " VALUES ('" . $db->escape($tmpservice) . "', " . ((int)$object->id) . ", " . ((int)$conf->entity) . ", '" . $db->escape(json_encode($tokenstring)) . "')";
751
+                    $sql .= " VALUES ('" . $db->escape($tmpservice) . "', " . ((int) $object->id) . ", " . ((int) $conf->entity) . ", '" . $db->escape(json_encode($tokenstring)) . "')";
752 752
                     // TODO Add site and site_account on oauth_token table
753 753
                 } catch (Exception $e) {
754 754
                     $error++;
@@ -782,9 +782,9 @@  discard block
 block discarded – undo
782 782
             try {
783 783
                 $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus);
784 784
                 if (preg_match('/pm_|src_/', $source)) {
785
-                    $cu->invoice_settings->default_payment_method = (string)$source; // New
785
+                    $cu->invoice_settings->default_payment_method = (string) $source; // New
786 786
                 } else {
787
-                    $cu->default_source = (string)$source; // Old
787
+                    $cu->default_source = (string) $source; // Old
788 788
                 }
789 789
                 // @phan-suppress-next-line PhanDeprecatedFunction
790 790
                 $result = $cu->save();
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
             print ' <span class="error">(' . $langs->trans("WrongCustomerCode") . ')</span>';
972 972
         }
973 973
         print '</td></tr>';
974
-        $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int)$socid);
974
+        $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int) $socid);
975 975
         $resql = $db->query($sql);
976 976
         if (!$resql) {
977 977
             dol_print_error($db);
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
             print ' <span class="error">(' . $langs->trans("WrongSupplierCode") . ')</span>';
1071 1071
         }
1072 1072
         print '</td></tr>';
1073
-        $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int)$socid);
1073
+        $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int) $socid);
1074 1074
         $resql = $db->query($sql);
1075 1075
         if (!$resql) {
1076 1076
             dol_print_error($db);
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
                         }
1168 1168
 
1169 1169
                         if ($paymentmethodobjsA->data != null && $paymentmethodobjsB->data != null) {
1170
-                            $listofsources = array_merge((array)$paymentmethodobjsA->data, (array)$paymentmethodobjsB->data);
1170
+                            $listofsources = array_merge((array) $paymentmethodobjsA->data, (array) $paymentmethodobjsB->data);
1171 1171
                         } elseif ($paymentmethodobjsB->data != null) {
1172 1172
                             $listofsources = $paymentmethodobjsB->data;
1173 1173
                         } else {
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
         print '<table class="liste centpercent">' . "\n";
1200 1200
         print '<tr class="liste_titre">';
1201 1201
         print '<td>' . $langs->trans('Label') . '</td>';
1202
-        print '<td>' . $form->textwithpicto($langs->trans('ExternalSystemID'), $langs->trans("IDOfPaymentInAnExternalSystem")) . '</td>';   // external system ID
1202
+        print '<td>' . $form->textwithpicto($langs->trans('ExternalSystemID'), $langs->trans("IDOfPaymentInAnExternalSystem")) . '</td>'; // external system ID
1203 1203
         print '<td>' . $langs->trans('Type') . '</td>';
1204 1204
         print '<td>' . $langs->trans('Informations') . '</td>';
1205 1205
         print '<td></td>';
@@ -1225,8 +1225,8 @@  discard block
 block discarded – undo
1225 1225
 
1226 1226
             $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . "societe_rib";
1227 1227
             $sql .= " WHERE type in ('card')";
1228
-            $sql .= " AND fk_soc = " . ((int)$object->id);
1229
-            $sql .= " AND status = " . ((int)$servicestatus);
1228
+            $sql .= " AND fk_soc = " . ((int) $object->id);
1229
+            $sql .= " AND status = " . ((int) $servicestatus);
1230 1230
 
1231 1231
             $resql = $db->query($sql);
1232 1232
             if ($resql) {
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 
1243 1243
                             $arrayofremotecard[$companypaymentmodetemp->stripe_card_ref] = $companypaymentmodetemp->stripe_card_ref;
1244 1244
 
1245
-                            print '<tr class="oddeven" data-rowid="' . ((int)$companypaymentmodetemp->id) . '">';
1245
+                            print '<tr class="oddeven" data-rowid="' . ((int) $companypaymentmodetemp->id) . '">';
1246 1246
                             // Label
1247 1247
                             print '<td class="tdoverflowmax150" title="' . dol_escape_htmltag($companypaymentmodetemp->label) . '">';
1248 1248
                             print dol_escape_htmltag($companypaymentmodetemp->label);
@@ -1558,7 +1558,7 @@  discard block
 block discarded – undo
1558 1558
 
1559 1559
         print '<tr class="liste_titre">';
1560 1560
         print_liste_field_titre("Label");
1561
-        print_liste_field_titre($form->textwithpicto($langs->trans('ExternalSystemID'), $langs->trans("IDOfPaymentInAnExternalSystem")));       // external system ID
1561
+        print_liste_field_titre($form->textwithpicto($langs->trans('ExternalSystemID'), $langs->trans("IDOfPaymentInAnExternalSystem"))); // external system ID
1562 1562
         print_liste_field_titre("Bank");
1563 1563
         print_liste_field_titre("RIB");
1564 1564
         print_liste_field_titre("IBAN");
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
             // Default
1673 1673
             print '<td class="center" width="70">';
1674 1674
             if (!$rib->default_rib) {
1675
-                print '<a href="' . $_SERVER["PHP_SELF"] . '?socid=' . ((int)$object->id) . '&ribid=' . ((int)$rib->id) . '&action=setasbankdefault&token=' . newToken() . '">';
1675
+                print '<a href="' . $_SERVER["PHP_SELF"] . '?socid=' . ((int) $object->id) . '&ribid=' . ((int) $rib->id) . '&action=setasbankdefault&token=' . newToken() . '">';
1676 1676
                 print img_picto($langs->trans("Disabled"), 'off');
1677 1677
                 print '</a>';
1678 1678
             } else {
Please login to merge, or discard this patch.
public/htdocs/societe/contact.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -142,9 +142,9 @@
 block discarded – undo
142 142
 
143 143
         $sql = "DELETE t, et FROM " . MAIN_DB_PREFIX . "socpeople AS t";
144 144
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields AS et ON t.rowid = et.fk_object";
145
-        $sql .= " WHERE t.fk_soc = " . ((int)$socid);
146
-        $sql .= " AND t.rowid = " . ((int)$id);
147
-        $sql .= " AND ((t.fk_user_creat = " . ((int)$user->id) . " AND t.priv = 1) OR t.priv = 0)";
145
+        $sql .= " WHERE t.fk_soc = " . ((int) $socid);
146
+        $sql .= " AND t.rowid = " . ((int) $id);
147
+        $sql .= " AND ((t.fk_user_creat = " . ((int) $user->id) . " AND t.priv = 1) OR t.priv = 0)";
148 148
 
149 149
         $result = $db->query($sql);
150 150
         if (!$result) {
Please login to merge, or discard this patch.
public/htdocs/societe/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 }
109 109
 $sql .= ' WHERE s.entity IN (' . getEntity('societe') . ')';
110 110
 if (!$user->hasRight('societe', 'client', 'voir')) {
111
-    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int)$user->id);
111
+    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
112 112
 }
113 113
 if (!$user->hasRight('fournisseur', 'lire')) {
114 114
     $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
119 119
 if (empty($reshook)) {
120 120
     if ($socid > 0) {
121
-        $sql .= " AND s.rowid = " . ((int)$socid);
121
+        $sql .= " AND s.rowid = " . ((int) $socid);
122 122
     }
123 123
 }
124 124
 $sql .= $hookmanager->resPrint;
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 $sql .= ", s.canvas, s.tms as date_modification, s.status as status";
293 293
 $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
294 294
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
295
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int)$conf->entity);
295
+    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
296 296
 }
297 297
 // TODO Replace this
298 298
 if (!$user->hasRight('societe', 'client', 'voir')) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 }
301 301
 $sql .= ' WHERE s.entity IN (' . getEntity('societe') . ')';
302 302
 if (!$user->hasRight('societe', 'client', 'voir')) {
303
-    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int)$user->id);
303
+    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
304 304
 }
305 305
 if (!$user->hasRight('fournisseur', 'lire')) {
306 306
     $sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
311 311
 if (empty($reshook)) {
312 312
     if ($socid > 0) {
313
-        $sql .= " AND s.rowid = " . ((int)$socid);
313
+        $sql .= " AND s.rowid = " . ((int) $socid);
314 314
     }
315 315
 }
316 316
 $sql .= $hookmanager->resPrint;
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 $sql .= ", sp.address as caddress, sp.phone as cphone";
415 415
 $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s, " . MAIN_DB_PREFIX . "socpeople as sp";
416 416
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
417
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int)$conf->entity);
417
+    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
418 418
 }
419 419
 // TODO Replace this
420 420
 if (!$user->hasRight('societe', 'client', 'voir')) {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 }
423 423
 $sql .= ' WHERE s.entity IN (' . getEntity('societe') . ') AND sp.fk_soc = s.rowid';
424 424
 if (!$user->hasRight('societe', 'client', 'voir')) {
425
-    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int)$user->id);
425
+    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
426 426
 }
427 427
 if (!$user->hasRight('fournisseur', 'lire')) {
428 428
     $sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
433 433
 if (empty($reshook)) {
434 434
     if ($socid > 0) {
435
-        $sql .= " AND s.rowid = " . ((int)$socid);
435
+        $sql .= " AND s.rowid = " . ((int) $socid);
436 436
     }
437 437
 }
438 438
 $sql .= $hookmanager->resPrint;
Please login to merge, or discard this patch.
public/htdocs/societe/admin/societe.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 $action = GETPOST('action', 'aZ09');
43 43
 $value = GETPOST('value', 'alpha');
44
-$modulepart = GETPOST('modulepart', 'aZ09');    // Used by actions_setmoduleoptions.inc.php
44
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
45 45
 
46 46
 if (!$user->admin) {
47 47
     accessforbidden();
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     $type = 'company';
120 120
     $sql = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity, libelle, description)";
121
-    $sql .= " VALUES ('" . $db->escape($value) . "', '" . $db->escape($type) . "', " . ((int)$conf->entity) . ", ";
121
+    $sql .= " VALUES ('" . $db->escape($value) . "', '" . $db->escape($type) . "', " . ((int) $conf->entity) . ", ";
122 122
     $sql .= ($label ? "'" . $db->escape($label) . "'" : 'null') . ", ";
123 123
     $sql .= (!empty($scandir) ? "'" . $db->escape($scandir) . "'" : "null");
124 124
     $sql .= ")";
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 if ($action == 'del') {
134 134
     $type = 'company';
135 135
     $sql = "DELETE FROM " . MAIN_DB_PREFIX . "document_model";
136
-    $sql .= " WHERE nom='" . $db->escape($value) . "' AND type='" . $db->escape($type) . "' AND entity=" . ((int)$conf->entity);
136
+    $sql .= " WHERE nom='" . $db->escape($value) . "' AND type='" . $db->escape($type) . "' AND entity=" . ((int) $conf->entity);
137 137
     $resql = $db->query($sql);
138 138
     if (!$resql) {
139 139
         dol_print_error($db);
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
     $sql_del = "DELETE FROM " . MAIN_DB_PREFIX . "document_model";
155 155
     $sql_del .= " WHERE nom = '" . $db->escape(GETPOST('value', 'alpha')) . "'";
156 156
     $sql_del .= " AND type = '" . $db->escape($type) . "'";
157
-    $sql_del .= " AND entity = " . ((int)$conf->entity);
157
+    $sql_del .= " AND entity = " . ((int) $conf->entity);
158 158
     dol_syslog("societe.php " . $sql);
159 159
     $result1 = $db->query($sql_del);
160 160
 
161 161
     $sql = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity, libelle, description)";
162
-    $sql .= " VALUES ('" . $db->escape($value) . "', '" . $db->escape($type) . "', " . ((int)$conf->entity) . ", ";
162
+    $sql .= " VALUES ('" . $db->escape($value) . "', '" . $db->escape($type) . "', " . ((int) $conf->entity) . ", ";
163 163
     $sql .= ($label ? "'" . $db->escape($label) . "'" : 'null') . ", ";
164 164
     $sql .= (!empty($scandir) ? "'" . $db->escape($scandir) . "'" : "null");
165 165
     $sql .= ")";
Please login to merge, or discard this patch.
public/htdocs/societe/consumption.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         print ' <span class="error">(' . $langs->trans("WrongCustomerCode") . ')</span>';
175 175
     }
176 176
     print '</td></tr>';
177
-    $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int)$socid);
177
+    $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "facture where fk_soc = " . ((int) $socid);
178 178
     $resql = $db->query($sql);
179 179
     if (!$resql) {
180 180
         dol_print_error($db);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         print ' <span class="error">(' . $langs->trans("WrongSupplierCode") . ')</span>';
216 216
     }
217 217
     print '</td></tr>';
218
-    $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "commande_fournisseur where fk_soc = " . ((int)$socid);
218
+    $sql = "SELECT count(*) as nb from " . MAIN_DB_PREFIX . "commande_fournisseur where fk_soc = " . ((int) $socid);
219 219
     $resql = $db->query($sql);
220 220
     if (!$resql) {
221 221
         dol_print_error($db);
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     $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, NULL as paid, ';
267 267
     $sql_select .= 'NULL as fk_product, NULL as info_bits, NULL as date_start, NULL as date_end, NULL as prod_qty, NULL as total_ht, ';
268 268
     $tables_from = MAIN_DB_PREFIX . "fichinter as f LEFT JOIN " . MAIN_DB_PREFIX . "fichinterdet as d ON d.fk_fichinter = f.rowid"; // Must use left join to work also with option that disable usage of lines.
269
-    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
269
+    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
270 270
     $where .= " AND f.entity = " . $conf->entity;
271 271
     $dateprint = 'f.datec';
272 272
     $doc_number = 'f.ref';
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     $documentstatic = new Facture($db);
276 276
     $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, d.fk_remise_except, ';
277 277
     $tables_from = MAIN_DB_PREFIX . "facture as f," . MAIN_DB_PREFIX . "facturedet as d";
278
-    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
278
+    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
279 279
     $where .= " AND d.fk_facture = f.rowid";
280 280
     $where .= " AND f.entity IN (" . getEntity('invoice') . ")";
281 281
     $dateprint = 'f.datef';
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     $documentstatic = new Propal($db);
287 287
     $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, NULL as paid,';
288 288
     $tables_from = MAIN_DB_PREFIX . "propal as c," . MAIN_DB_PREFIX . "propaldet as d";
289
-    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
289
+    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
290 290
     $where .= " AND d.fk_propal = c.rowid";
291 291
     $where .= " AND c.entity = " . $conf->entity;
292 292
     $dateprint = 'c.datep';
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     $documentstatic = new Commande($db);
299 299
     $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, NULL as paid, c.date_livraison as delivery_planned_date,';
300 300
     $tables_from = MAIN_DB_PREFIX . "commande as c," . MAIN_DB_PREFIX . "commandedet as d";
301
-    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
301
+    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
302 302
     $where .= " AND d.fk_commande = c.rowid";
303 303
     $where .= " AND c.entity = " . $conf->entity;
304 304
     $dateprint = 'c.date_commande';
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     $documentstatic = new Expedition($db);
311 311
     $sql_select = 'SELECT e.rowid as doc_id, e.ref as doc_number, \'1\' as doc_type, e.date_creation as dateprint, e.fk_statut as status, NULL as paid, e.date_delivery as delivery_planned_date,';
312 312
     $tables_from = MAIN_DB_PREFIX . "expedition as e," . MAIN_DB_PREFIX . "expeditiondet as ed," . MAIN_DB_PREFIX . "commandedet as d";
313
-    $where = " WHERE e.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
313
+    $where = " WHERE e.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
314 314
     $where .= " AND ed.fk_expedition = e.rowid";
315 315
     $where .= " AND ed.element_type = 'commande' AND ed.fk_elementdet = d.rowid";
316 316
     $where .= " AND e.entity = " . $conf->entity;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     $documentstatic = new FactureFournisseur($db);
323 323
     $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
324 324
     $tables_from = MAIN_DB_PREFIX . "facture_fourn as f," . MAIN_DB_PREFIX . "facture_fourn_det as d";
325
-    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
325
+    $where = " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
326 326
     $where .= " AND d.fk_facture_fourn = f.rowid";
327 327
     $where .= " AND f.entity = " . $conf->entity;
328 328
     $dateprint = 'f.datef';
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     $documentstatic = new SupplierProposal($db);
334 334
     $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, ';
335 335
     $tables_from = MAIN_DB_PREFIX . "supplier_proposal as c," . MAIN_DB_PREFIX . "supplier_proposaldet as d";
336
-    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
336
+    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
337 337
     $where .= " AND d.fk_supplier_proposal = c.rowid";
338 338
     $where .= " AND c.entity = " . $conf->entity;
339 339
     $dateprint = 'c.date_valid';
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     $documentstatic = new CommandeFournisseur($db);
346 346
     $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, c.date_livraison as delivery_planned_date, ';
347 347
     $tables_from = MAIN_DB_PREFIX . "commande_fournisseur as c," . MAIN_DB_PREFIX . "commande_fournisseurdet as d";
348
-    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
348
+    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
349 349
     $where .= " AND d.fk_commande = c.rowid";
350 350
     $where .= " AND c.entity = " . $conf->entity;
351 351
     $dateprint = 'c.date_valid';
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
     $documentstatic = new Reception($db);
358 358
     $sql_select = 'SELECT r.rowid as doc_id, r.ref as doc_number, \'1\' as doc_type, r.date_creation as dateprint, r.fk_statut as status, NULL as paid, r.date_delivery as delivery_planned_date, ';
359 359
     $tables_from = MAIN_DB_PREFIX . "reception as r," . MAIN_DB_PREFIX . "receptiondet_batch as rd," . MAIN_DB_PREFIX . "commande_fournisseurdet as d";
360
-    $where = " WHERE r.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
360
+    $where = " WHERE r.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
361 361
     $where .= " AND rd.fk_reception = r.rowid";
362 362
     $where .= " AND rd.fk_elementdet = d.rowid AND rd.element_type = 'supplier_order'";
363 363
     $where .= " AND r.entity = " . $conf->entity;
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     $documentstaticline = new ContratLigne($db);
371 371
     $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, NULL as paid,';
372 372
     $tables_from = MAIN_DB_PREFIX . "contrat as c," . MAIN_DB_PREFIX . "contratdet as d";
373
-    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int)$socid);
373
+    $where = " WHERE c.fk_soc = s.rowid AND s.rowid = " . ((int) $socid);
374 374
     $where .= " AND d.fk_contrat = c.rowid";
375 375
     $where .= " AND c.entity = " . $conf->entity;
376 376
     $dateprint = 'c.date_valid';
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
 
460 460
     $num = $db->num_rows($resql);
461 461
 
462
-    $param = "&socid=" . urlencode((string)($socid)) . "&type_element=" . urlencode((string)($type_element));
462
+    $param = "&socid=" . urlencode((string) ($socid)) . "&type_element=" . urlencode((string) ($type_element));
463 463
     if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
464 464
         $param .= '&contextpage=' . urlencode($contextpage);
465 465
     }
466 466
     if ($limit > 0 && $limit != $conf->liste_limit) {
467
-        $param .= '&limit=' . ((int)$limit);
467
+        $param .= '&limit=' . ((int) $limit);
468 468
     }
469 469
     if ($sprod_fulldescr) {
470 470
         $param .= "&sprod_fulldescr=" . urlencode($sprod_fulldescr);
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
         $param .= "&sref=" . urlencode($sref);
474 474
     }
475 475
     if ($month) {
476
-        $param .= "&month=" . urlencode((string)($month));
476
+        $param .= "&month=" . urlencode((string) ($month));
477 477
     }
478 478
     if ($year) {
479
-        $param .= "&year=" . urlencode((string)($year));
479
+        $param .= "&year=" . urlencode((string) ($year));
480 480
     }
481 481
     if ($optioncss) {
482 482
         $param .= '&optioncss=' . urlencode($optioncss);
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 
725 725
         print '<td class="right"><span class="amount">' . price($objp->total_ht) . '</span></td>';
726 726
 
727
-        $total_ht += (float)$objp->total_ht;
727
+        $total_ht += (float) $objp->total_ht;
728 728
 
729 729
         print '<td class="right">' . price($objp->total_ht / (empty($objp->prod_qty) ? 1 : $objp->prod_qty)) . '</td>';
730 730
 
Please login to merge, or discard this patch.