@@ -21,7 +21,7 @@ |
||
| 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 | } |
@@ -243,22 +243,22 @@ discard block |
||
| 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 |
||
| 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"; |
@@ -118,13 +118,13 @@ |
||
| 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"; |
@@ -529,8 +529,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 { |
@@ -142,9 +142,9 @@ |
||
| 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) { |
@@ -108,7 +108,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -41,7 +41,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 .= ")"; |
@@ -174,7 +174,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -135,20 +135,20 @@ discard block |
||
| 135 | 135 | $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
| 136 | 136 | $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
| 137 | 137 | $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
| 138 | -$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
| 138 | +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
| 139 | 139 | $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
| 140 | 140 | $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
| 141 | 141 | $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
| 142 | -$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
| 142 | +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
| 143 | 143 | |
| 144 | 144 | $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); |
| 145 | 145 | $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); |
| 146 | 146 | $search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); |
| 147 | -$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
| 147 | +$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
| 148 | 148 | $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); |
| 149 | 149 | $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); |
| 150 | 150 | $search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); |
| 151 | -$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
| 151 | +$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
| 152 | 152 | |
| 153 | 153 | $type = GETPOST('type', 'alpha'); |
| 154 | 154 | $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 324 | 324 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 325 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 325 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 326 | 326 | |
| 327 | 327 | // Security check |
| 328 | 328 | $socid = GETPOSTINT('socid'); |
@@ -351,11 +351,11 @@ discard block |
||
| 351 | 351 | $invoice->module_source = 'takepos'; |
| 352 | 352 | $invoice->pos_source = $_SESSION["takeposterminal"]; |
| 353 | 353 | $placeid = $invoice->create($user); |
| 354 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int)$placeid); |
|
| 354 | + $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int) $placeid); |
|
| 355 | 355 | $db->query($sql); |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set fk_soc=" . ((int)$idcustomer) . " where ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")'"; |
|
| 358 | + $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set fk_soc=" . ((int) $idcustomer) . " where ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")'"; |
|
| 359 | 359 | $resql = $db->query($sql); ?> |
| 360 | 360 | <script> |
| 361 | 361 | console.log("Reload page invoice.php with place=<?php print $place; ?>"); |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | if ($search_sale == -2) { |
| 597 | 597 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = s.rowid)"; |
| 598 | 598 | } elseif ($search_sale > 0) { |
| 599 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
| 599 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | |
@@ -609,9 +609,9 @@ discard block |
||
| 609 | 609 | $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; |
| 610 | 610 | } elseif (intval($searchCategoryCustomer) > 0) { |
| 611 | 611 | if ($searchCategoryCustomerOperator == 0) { |
| 612 | - $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int)$searchCategoryCustomer) . ")"; |
|
| 612 | + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int) $searchCategoryCustomer) . ")"; |
|
| 613 | 613 | } else { |
| 614 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryCustomer); |
|
| 614 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryCustomer); |
|
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | 617 | } |
@@ -638,9 +638,9 @@ discard block |
||
| 638 | 638 | $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; |
| 639 | 639 | } elseif (intval($searchCategorySupplier) > 0) { |
| 640 | 640 | if ($searchCategorySupplierOperator == 0) { |
| 641 | - $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int)$searchCategorySupplier) . ")"; |
|
| 641 | + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int) $searchCategorySupplier) . ")"; |
|
| 642 | 642 | } else { |
| 643 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategorySupplier); |
|
| 643 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategorySupplier); |
|
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | } |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 808 | 808 | if (empty($reshook)) { |
| 809 | 809 | if ($socid) { |
| 810 | - $sql .= " AND s.rowid = " . ((int)$socid); |
|
| 810 | + $sql .= " AND s.rowid = " . ((int) $socid); |
|
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | 813 | $sql .= $hookmanager->resPrint; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | $param .= '&contextpage=' . urlencode($contextpage); |
| 897 | 897 | } |
| 898 | 898 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 899 | - $param .= '&limit=' . ((int)$limit); |
|
| 899 | + $param .= '&limit=' . ((int) $limit); |
|
| 900 | 900 | } |
| 901 | 901 | if ($optioncss != '') { |
| 902 | 902 | $param .= '&optioncss=' . urlencode($optioncss); |
@@ -905,16 +905,16 @@ discard block |
||
| 905 | 905 | $param = "&search_all=" . urlencode($search_all); |
| 906 | 906 | } |
| 907 | 907 | if ($search_categ_cus > 0) { |
| 908 | - $param .= '&search_categ_cus=' . urlencode((string)($search_categ_cus)); |
|
| 908 | + $param .= '&search_categ_cus=' . urlencode((string) ($search_categ_cus)); |
|
| 909 | 909 | } |
| 910 | 910 | if ($search_categ_sup > 0) { |
| 911 | - $param .= '&search_categ_sup=' . urlencode((string)($search_categ_sup)); |
|
| 911 | + $param .= '&search_categ_sup=' . urlencode((string) ($search_categ_sup)); |
|
| 912 | 912 | } |
| 913 | 913 | if ($searchCategoryCustomerOperator == 1) { |
| 914 | - $param .= "&search_category_customer_operator=" . urlencode((string)($searchCategoryCustomerOperator)); |
|
| 914 | + $param .= "&search_category_customer_operator=" . urlencode((string) ($searchCategoryCustomerOperator)); |
|
| 915 | 915 | } |
| 916 | 916 | if ($searchCategorySupplierOperator == 1) { |
| 917 | - $param .= "&search_category_supplier_operator=" . urlencode((string)($searchCategorySupplierOperator)); |
|
| 917 | + $param .= "&search_category_supplier_operator=" . urlencode((string) ($searchCategorySupplierOperator)); |
|
| 918 | 918 | } |
| 919 | 919 | foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { |
| 920 | 920 | $param .= "&search_category_customer_list[]=" . urlencode($searchCategoryCustomer); |
@@ -923,10 +923,10 @@ discard block |
||
| 923 | 923 | $param .= "&search_category_supplier_list[]=" . urlencode($searchCategorySupplier); |
| 924 | 924 | } |
| 925 | 925 | if ($search_sale > 0) { |
| 926 | - $param .= '&search_sale=' . ((int)$search_sale); |
|
| 926 | + $param .= '&search_sale=' . ((int) $search_sale); |
|
| 927 | 927 | } |
| 928 | 928 | if ($search_id > 0) { |
| 929 | - $param .= "&search_id=" . ((int)$search_id); |
|
| 929 | + $param .= "&search_id=" . ((int) $search_id); |
|
| 930 | 930 | } |
| 931 | 931 | if ($search_nom != '') { |
| 932 | 932 | $param .= "&search_nom=" . urlencode($search_nom); |
@@ -1007,13 +1007,13 @@ discard block |
||
| 1007 | 1007 | $param .= '&search_price_level=' . urlencode($search_price_level); |
| 1008 | 1008 | } |
| 1009 | 1009 | if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { |
| 1010 | - $param .= '&search_type_thirdparty=' . urlencode((string)($search_type_thirdparty)); |
|
| 1010 | + $param .= '&search_type_thirdparty=' . urlencode((string) ($search_type_thirdparty)); |
|
| 1011 | 1011 | } |
| 1012 | 1012 | if ($search_type != '') { |
| 1013 | 1013 | $param .= '&search_type=' . urlencode($search_type); |
| 1014 | 1014 | } |
| 1015 | 1015 | if ($search_status != '') { |
| 1016 | - $param .= '&search_status=' . urlencode((string)($search_status)); |
|
| 1016 | + $param .= '&search_status=' . urlencode((string) ($search_status)); |
|
| 1017 | 1017 | } |
| 1018 | 1018 | if (is_array($search_level) && count($search_level)) { |
| 1019 | 1019 | foreach ($search_level as $slevel) { |
@@ -1035,49 +1035,49 @@ discard block |
||
| 1035 | 1035 | $param .= '&type=' . urlencode($type); |
| 1036 | 1036 | } |
| 1037 | 1037 | if ($search_date_creation_startmonth) { |
| 1038 | - $param .= '&search_date_creation_startmonth=' . urlencode((string)($search_date_creation_startmonth)); |
|
| 1038 | + $param .= '&search_date_creation_startmonth=' . urlencode((string) ($search_date_creation_startmonth)); |
|
| 1039 | 1039 | } |
| 1040 | 1040 | if ($search_date_creation_startyear) { |
| 1041 | - $param .= '&search_date_creation_startyear=' . urlencode((string)($search_date_creation_startyear)); |
|
| 1041 | + $param .= '&search_date_creation_startyear=' . urlencode((string) ($search_date_creation_startyear)); |
|
| 1042 | 1042 | } |
| 1043 | 1043 | if ($search_date_creation_startday) { |
| 1044 | - $param .= '&search_date_creation_startday=' . urlencode((string)($search_date_creation_startday)); |
|
| 1044 | + $param .= '&search_date_creation_startday=' . urlencode((string) ($search_date_creation_startday)); |
|
| 1045 | 1045 | } |
| 1046 | 1046 | if ($search_date_creation_start) { |
| 1047 | 1047 | $param .= '&search_date_creation_start=' . urlencode($search_date_creation_start); |
| 1048 | 1048 | } |
| 1049 | 1049 | if ($search_date_creation_endmonth) { |
| 1050 | - $param .= '&search_date_creation_endmonth=' . urlencode((string)($search_date_creation_endmonth)); |
|
| 1050 | + $param .= '&search_date_creation_endmonth=' . urlencode((string) ($search_date_creation_endmonth)); |
|
| 1051 | 1051 | } |
| 1052 | 1052 | if ($search_date_creation_endyear) { |
| 1053 | - $param .= '&search_date_creation_endyear=' . urlencode((string)($search_date_creation_endyear)); |
|
| 1053 | + $param .= '&search_date_creation_endyear=' . urlencode((string) ($search_date_creation_endyear)); |
|
| 1054 | 1054 | } |
| 1055 | 1055 | if ($search_date_creation_endday) { |
| 1056 | - $param .= '&search_date_creation_endday=' . urlencode((string)($search_date_creation_endday)); |
|
| 1056 | + $param .= '&search_date_creation_endday=' . urlencode((string) ($search_date_creation_endday)); |
|
| 1057 | 1057 | } |
| 1058 | 1058 | if ($search_date_creation_end) { |
| 1059 | 1059 | $param .= '&search_date_creation_end=' . urlencode($search_date_creation_end); |
| 1060 | 1060 | } |
| 1061 | 1061 | if ($search_date_modif_startmonth) { |
| 1062 | - $param .= '&search_date_modif_startmonth=' . urlencode((string)($search_date_modif_startmonth)); |
|
| 1062 | + $param .= '&search_date_modif_startmonth=' . urlencode((string) ($search_date_modif_startmonth)); |
|
| 1063 | 1063 | } |
| 1064 | 1064 | if ($search_date_modif_startyear) { |
| 1065 | - $param .= '&search_date_modif_startyear=' . urlencode((string)($search_date_modif_startyear)); |
|
| 1065 | + $param .= '&search_date_modif_startyear=' . urlencode((string) ($search_date_modif_startyear)); |
|
| 1066 | 1066 | } |
| 1067 | 1067 | if ($search_date_modif_startday) { |
| 1068 | - $param .= '&search_date_modif_startday=' . urlencode((string)($search_date_modif_startday)); |
|
| 1068 | + $param .= '&search_date_modif_startday=' . urlencode((string) ($search_date_modif_startday)); |
|
| 1069 | 1069 | } |
| 1070 | 1070 | if ($search_date_modif_start) { |
| 1071 | 1071 | $param .= '&search_date_modif_start=' . urlencode($search_date_modif_start); |
| 1072 | 1072 | } |
| 1073 | 1073 | if ($search_date_modif_endmonth) { |
| 1074 | - $param .= '&search_date_modif_endmonth=' . urlencode((string)($search_date_modif_endmonth)); |
|
| 1074 | + $param .= '&search_date_modif_endmonth=' . urlencode((string) ($search_date_modif_endmonth)); |
|
| 1075 | 1075 | } |
| 1076 | 1076 | if ($search_date_modif_endyear) { |
| 1077 | - $param .= '&search_date_modif_endyear=' . urlencode((string)($search_date_modif_endyear)); |
|
| 1077 | + $param .= '&search_date_modif_endyear=' . urlencode((string) ($search_date_modif_endyear)); |
|
| 1078 | 1078 | } |
| 1079 | 1079 | if ($search_date_modif_endday) { |
| 1080 | - $param .= '&search_date_modif_endday=' . urlencode((string)($search_date_modif_endday)); |
|
| 1080 | + $param .= '&search_date_modif_endday=' . urlencode((string) ($search_date_modif_endday)); |
|
| 1081 | 1081 | } |
| 1082 | 1082 | if ($search_date_modif_end) { |
| 1083 | 1083 | $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | 1262 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 1263 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1263 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1264 | 1264 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
| 1265 | 1265 | $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 1266 | 1266 | |
@@ -1704,19 +1704,19 @@ discard block |
||
| 1704 | 1704 | print $hookmanager->resPrint; |
| 1705 | 1705 | if (!empty($arrayfields['s.datec']['checked'])) { |
| 1706 | 1706 | print_liste_field_titre($arrayfields['s.datec']['label'], $_SERVER["PHP_SELF"], "s.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
| 1707 | - $totalarray['nbfield']++; // For the column action |
|
| 1707 | + $totalarray['nbfield']++; // For the column action |
|
| 1708 | 1708 | } |
| 1709 | 1709 | if (!empty($arrayfields['s.tms']['checked'])) { |
| 1710 | 1710 | print_liste_field_titre($arrayfields['s.tms']['label'], $_SERVER["PHP_SELF"], "s.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
| 1711 | - $totalarray['nbfield']++; // For the column action |
|
| 1711 | + $totalarray['nbfield']++; // For the column action |
|
| 1712 | 1712 | } |
| 1713 | 1713 | if (!empty($arrayfields['s.status']['checked'])) { |
| 1714 | 1714 | print_liste_field_titre($arrayfields['s.status']['label'], $_SERVER["PHP_SELF"], "s.status", "", $param, '', $sortfield, $sortorder, 'center '); |
| 1715 | - $totalarray['nbfield']++; // For the column action |
|
| 1715 | + $totalarray['nbfield']++; // For the column action |
|
| 1716 | 1716 | } |
| 1717 | 1717 | if (!empty($arrayfields['s.import_key']['checked'])) { |
| 1718 | 1718 | print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center '); |
| 1719 | - $totalarray['nbfield']++; // For the column action |
|
| 1719 | + $totalarray['nbfield']++; // For the column action |
|
| 1720 | 1720 | } |
| 1721 | 1721 | // Action column |
| 1722 | 1722 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |