@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $param .= '&contextpage=' . urlencode($contextpage); |
194 | 194 | } |
195 | 195 | if ($limit > 0 && $limit != $conf->liste_limit) { |
196 | - $param .= '&limit=' . ((int)$limit); |
|
196 | + $param .= '&limit=' . ((int) $limit); |
|
197 | 197 | } |
198 | 198 | if ($search_label) { |
199 | 199 | $param .= '&search_label=' . urlencode($search_label); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $sql .= natural_search("t.lastresult", $search_lastresult, 1); |
304 | 304 | } |
305 | 305 | if (GETPOSTISSET('search_processing')) { |
306 | - $sql .= " AND t.processing = " . ((int)$search_processing); |
|
306 | + $sql .= " AND t.processing = " . ((int) $search_processing); |
|
307 | 307 | } |
308 | 308 | // Manage filter |
309 | 309 | if (is_array($filter) && count($filter) > 0) { |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $param .= '&contextpage=' . urlencode($contextpage); |
350 | 350 | } |
351 | 351 | if ($limit > 0 && $limit != $conf->liste_limit) { |
352 | - $param .= '&limit=' . ((int)$limit); |
|
352 | + $param .= '&limit=' . ((int) $limit); |
|
353 | 353 | } |
354 | 354 | if ($search_status) { |
355 | 355 | $param .= '&search_status=' . urlencode($search_status); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | $object->status = $obj->status; |
542 | 542 | $object->priority = $obj->priority; |
543 | 543 | $object->processing = $obj->processing; |
544 | - $object->lastresult = (string)$obj->lastresult; |
|
544 | + $object->lastresult = (string) $obj->lastresult; |
|
545 | 545 | $object->datestart = $db->jdate($obj->datestart); |
546 | 546 | $object->dateend = $db->jdate($obj->dateend); |
547 | 547 | $object->module_name = $obj->module_name; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | print '<td class="center tdlastresultcode" title="' . dol_escape_htmltag($obj->lastresult) . '">'; |
680 | 680 | if ($obj->lastresult != '') { |
681 | 681 | if (empty($obj->lastresult)) { |
682 | - print $obj->lastresult; // Print '0' |
|
682 | + print $obj->lastresult; // Print '0' |
|
683 | 683 | } else { |
684 | 684 | print '<span class="error">' . dol_escape_htmltag(dol_trunc($obj->lastresult)) . '</div>'; |
685 | 685 | } |
@@ -116,8 +116,8 @@ |
||
116 | 116 | $invoicedet_id = $tmp_array[1]; |
117 | 117 | if (!empty($invoicedet_id)) { |
118 | 118 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facturedet'; |
119 | - $sql .= " SET buy_price_ht = " . ((float)price2num($value)); |
|
120 | - $sql .= ' WHERE rowid = ' . ((int)$invoicedet_id); |
|
119 | + $sql .= " SET buy_price_ht = " . ((float) price2num($value)); |
|
120 | + $sql .= ' WHERE rowid = ' . ((int) $invoicedet_id); |
|
121 | 121 | $result = $db->query($sql); |
122 | 122 | if (!$result) { |
123 | 123 | setEventMessages($db->lasterror, null, 'errors'); |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | $sql .= " AND d.fk_facture = f.rowid"; |
179 | 179 | if ($agentid > 0) { |
180 | 180 | if (getDolGlobalString('AGENT_CONTACT_TYPE')) { |
181 | - $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = " . ((int)$agentid) . ") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = " . ((int)$agentid) . "))"; |
|
181 | + $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = " . ((int) $agentid) . ") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = " . ((int) $agentid) . "))"; |
|
182 | 182 | } else { |
183 | - $sql .= " AND sc.fk_user = " . ((int)$agentid); |
|
183 | + $sql .= " AND sc.fk_user = " . ((int) $agentid); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | if (!empty($startdate)) { |
@@ -211,22 +211,22 @@ discard block |
||
211 | 211 | $param .= "&agentid=" . urlencode($agentid); |
212 | 212 | } |
213 | 213 | if (!empty($startdateday)) { |
214 | - $param .= "&startdateday=" . urlencode((string)($startdateday)); |
|
214 | + $param .= "&startdateday=" . urlencode((string) ($startdateday)); |
|
215 | 215 | } |
216 | 216 | if (!empty($startdatemonth)) { |
217 | - $param .= "&startdatemonth=" . urlencode((string)($startdatemonth)); |
|
217 | + $param .= "&startdatemonth=" . urlencode((string) ($startdatemonth)); |
|
218 | 218 | } |
219 | 219 | if (!empty($startdateyear)) { |
220 | - $param .= "&startdateyear=" . urlencode((string)($startdateyear)); |
|
220 | + $param .= "&startdateyear=" . urlencode((string) ($startdateyear)); |
|
221 | 221 | } |
222 | 222 | if (!empty($enddateday)) { |
223 | - $param .= "&enddateday=" . urlencode((string)($enddateday)); |
|
223 | + $param .= "&enddateday=" . urlencode((string) ($enddateday)); |
|
224 | 224 | } |
225 | 225 | if (!empty($enddatemonth)) { |
226 | - $param .= "&enddatemonth=" . urlencode((string)($enddatemonth)); |
|
226 | + $param .= "&enddatemonth=" . urlencode((string) ($enddatemonth)); |
|
227 | 227 | } |
228 | 228 | if (!empty($enddateyear)) { |
229 | - $param .= "&enddateyear=" . urlencode((string)($enddateyear)); |
|
229 | + $param .= "&enddateyear=" . urlencode((string) ($enddateyear)); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | // sql nb sellers |
299 | 299 | $sql_seller = "SELECT COUNT(sc.rowid) as nb"; |
300 | 300 | $sql_seller .= " FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; |
301 | - $sql_seller .= " WHERE sc.fk_soc = " . ((int)$objp->socid); |
|
301 | + $sql_seller .= " WHERE sc.fk_soc = " . ((int) $objp->socid); |
|
302 | 302 | $sql_seller .= " LIMIT 1"; |
303 | 303 | |
304 | 304 | $resql_seller = $db->query($sql_seller); |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | |
147 | 147 | // calcul marge |
148 | 148 | if ($pu_ht_remise < 0) { |
149 | - $marge = -1 * (abs((float)$pu_ht_remise) - $pa_ht_ret); |
|
149 | + $marge = -1 * (abs((float) $pu_ht_remise) - $pa_ht_ret); |
|
150 | 150 | } else { |
151 | - $marge = (float)$pu_ht_remise - $pa_ht_ret; |
|
151 | + $marge = (float) $pu_ht_remise - $pa_ht_ret; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // calcul taux marge |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | // calcul taux marque |
159 | 159 | if ($pu_ht_remise != 0) { |
160 | - $marque_tx_ret = (100 * $marge) / (float)$pu_ht_remise; |
|
160 | + $marque_tx_ret = (100 * $marge) / (float) $pu_ht_remise; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | return array($pa_ht_ret, $marge_tx_ret, $marque_tx_ret); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $sql .= " AND f.fk_statut NOT IN (" . $db->sanitize(implode(', ', $invoice_status_except_list)) . ")"; |
207 | 207 | $sql .= " AND d.fk_facture = f.rowid"; |
208 | 208 | if ($id > 0) { |
209 | - $sql .= " AND d.fk_product =" . ((int)$id); |
|
209 | + $sql .= " AND d.fk_product =" . ((int) $id); |
|
210 | 210 | } |
211 | 211 | if (!empty($TSelectedCats)) { |
212 | 212 | $sql .= ' AND cp.fk_categorie IN (' . $db->sanitize(implode(',', $TSelectedCats)) . ')'; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | // TODO: calculate total to display then restore pagination |
233 | 233 | //$sql.= $db->plimit($conf->liste_limit +1, $offset); |
234 | 234 | |
235 | -$param = '&id=' . ((int)$id); |
|
235 | +$param = '&id=' . ((int) $id); |
|
236 | 236 | if (GETPOSTINT('startdatemonth')) { |
237 | 237 | $param .= '&startdateyear=' . GETPOSTINT('startdateyear'); |
238 | 238 | $param .= '&startdatemonth=' . GETPOSTINT('startdatemonth'); |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | } |
239 | 239 | $sql .= " WHERE f.fk_soc = s.rowid"; |
240 | 240 | if ($socid > 0) { |
241 | - $sql .= ' AND s.rowid = ' . ((int)$socid); |
|
241 | + $sql .= ' AND s.rowid = ' . ((int) $socid); |
|
242 | 242 | } |
243 | 243 | if (!$user->hasRight('societe', 'client', 'voir')) { |
244 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int)$user->id); |
|
244 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
245 | 245 | } |
246 | 246 | $sql .= " AND f.fk_statut NOT IN (" . $db->sanitize(implode(', ', $invoice_status_except_list)) . ")"; |
247 | 247 | $sql .= ' AND s.entity IN (' . getEntity('societe') . ')'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // TODO: calculate total to display then restore pagination |
276 | 276 | //$sql.= $db->plimit($conf->liste_limit +1, $offset); |
277 | 277 | |
278 | -$param = '&socid=' . ((int)$socid); |
|
278 | +$param = '&socid=' . ((int) $socid); |
|
279 | 279 | if (GETPOSTINT('startdatemonth')) { |
280 | 280 | $param .= '&startdateyear=' . GETPOSTINT('startdateyear'); |
281 | 281 | $param .= '&startdatemonth=' . GETPOSTINT('startdatemonth'); |
@@ -140,7 +140,7 @@ |
||
140 | 140 | |
141 | 141 | $param = "&socid=" . $socid; |
142 | 142 | if ($limit > 0 && $limit != $conf->liste_limit) { |
143 | - $param .= '&limit=' . ((int)$limit); |
|
143 | + $param .= '&limit=' . ((int) $limit); |
|
144 | 144 | } |
145 | 145 | if ($search_invoice_date_start) { |
146 | 146 | $param .= '&search_invoice_date_start_day=' . dol_print_date($search_invoice_date_start, '%d') . '&search_invoice_date_start_month=' . dol_print_date($search_invoice_date_start, '%m') . '&search_invoice_date_start_year=' . dol_print_date($search_invoice_date_start, '%Y'); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | $param = "&id=" . $object->id; |
147 | 147 | if ($limit > 0 && $limit != $conf->liste_limit) { |
148 | - $param .= '&limit=' . ((int)$limit); |
|
148 | + $param .= '&limit=' . ((int) $limit); |
|
149 | 149 | } |
150 | 150 | if ($search_invoice_date_start) { |
151 | 151 | $param .= '&search_invoice_date_start_day=' . dol_print_date($search_invoice_date_start, '%d') . '&search_invoice_date_start_month=' . dol_print_date($search_invoice_date_start, '%m') . '&search_invoice_date_start_year=' . dol_print_date($search_invoice_date_start, '%Y'); |
@@ -219,12 +219,12 @@ discard block |
||
219 | 219 | $sql .= " AND f.fk_statut > 0"; |
220 | 220 | $sql .= " AND f.entity IN (" . getEntity('invoice') . ")"; |
221 | 221 | $sql .= " AND d.fk_facture = f.rowid"; |
222 | - $sql .= " AND d.fk_product = " . ((int)$object->id); |
|
222 | + $sql .= " AND d.fk_product = " . ((int) $object->id); |
|
223 | 223 | if (!$user->hasRight('societe', 'client', 'voir')) { |
224 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int)$user->id); |
|
224 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
225 | 225 | } |
226 | 226 | if (!empty($socid)) { |
227 | - $sql .= " AND f.fk_soc = " . ((int)$socid); |
|
227 | + $sql .= " AND f.fk_soc = " . ((int) $socid); |
|
228 | 228 | } |
229 | 229 | $sql .= " AND d.buy_price_ht IS NOT NULL"; |
230 | 230 | // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. |
@@ -434,7 +434,7 @@ |
||
434 | 434 | |
435 | 435 | $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp"; |
436 | 436 | $sql .= " FROM " . MAIN_DB_PREFIX . "localtax as pv"; |
437 | - $sql .= " WHERE pv.entity = " . $conf->entity . " AND localtaxtype = " . ((int)$j); |
|
437 | + $sql .= " WHERE pv.entity = " . $conf->entity . " AND localtaxtype = " . ((int) $j); |
|
438 | 438 | if ($year > 0) { |
439 | 439 | // If period defined, we use it as dat criteria, if not we use date echeance, |
440 | 440 | // so we are compatible when period is not mandatory |