@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if ($search_account_category != '-1' && !empty($search_account_category)) { |
| 317 | 317 | $accountingcategory = new AccountancyCategory($db); |
| 318 | 318 | |
| 319 | - $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int)$search_account_category)); |
|
| 319 | + $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int) $search_account_category)); |
|
| 320 | 320 | $listofaccountsforgroup2 = array(); |
| 321 | 321 | if (is_array($listofaccountsforgroup)) { |
| 322 | 322 | foreach ($listofaccountsforgroup as $tmpval) { |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2); |
| 327 | - $param .= '&search_account_category=' . urlencode((string)($search_account_category)); |
|
| 327 | + $param .= '&search_account_category=' . urlencode((string) ($search_account_category)); |
|
| 328 | 328 | } |
| 329 | 329 | if (!empty($search_accountancy_code_start)) { |
| 330 | 330 | if ($type == 'sub') { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | if (!empty($search_mvt_num)) { |
| 350 | 350 | $filter['t.piece_num'] = $search_mvt_num; |
| 351 | - $param .= '&search_mvt_num=' . urlencode((string)($search_mvt_num)); |
|
| 351 | + $param .= '&search_mvt_num=' . urlencode((string) ($search_mvt_num)); |
|
| 352 | 352 | } |
| 353 | 353 | if (!empty($search_doc_ref)) { |
| 354 | 354 | $filter['t.doc_ref'] = $search_doc_ref; |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0); |
| 635 | 635 | } |
| 636 | 636 | //$num = count($object->lines); |
| 637 | - $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 637 | + $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 638 | 638 | |
| 639 | 639 | if ($result < 0) { |
| 640 | 640 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | $param .= '&contextpage=' . urlencode($contextpage); |
| 745 | 745 | } |
| 746 | 746 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 747 | - $param .= '&limit=' . ((int)$limit); |
|
| 747 | + $param .= '&limit=' . ((int) $limit); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); |
@@ -1051,8 +1051,8 @@ discard block |
||
| 1051 | 1051 | } |
| 1052 | 1052 | //if (empty($accountg)) $accountg = '-'; |
| 1053 | 1053 | |
| 1054 | - $colspan = 0; // colspan before field 'label of operation' |
|
| 1055 | - $colspanend = 0; // colspan after debit/credit |
|
| 1054 | + $colspan = 0; // colspan before field 'label of operation' |
|
| 1055 | + $colspanend = 0; // colspan after debit/credit |
|
| 1056 | 1056 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 1057 | 1057 | $colspan++; |
| 1058 | 1058 | } |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | if (!$i) { |
| 1316 | 1316 | $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit'; |
| 1317 | 1317 | } |
| 1318 | - $totalarray['val']['totaldebit'] += (float)$line->debit; |
|
| 1318 | + $totalarray['val']['totaldebit'] += (float) $line->debit; |
|
| 1319 | 1319 | } |
| 1320 | 1320 | |
| 1321 | 1321 | // Amount credit |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | if (!$i) { |
| 1328 | 1328 | $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; |
| 1329 | 1329 | } |
| 1330 | - $totalarray['val']['totalcredit'] += (float)$line->credit; |
|
| 1330 | + $totalarray['val']['totalcredit'] += (float) $line->credit; |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | // Amount balance |
@@ -1436,13 +1436,13 @@ discard block |
||
| 1436 | 1436 | |
| 1437 | 1437 | // Clean total values to round them |
| 1438 | 1438 | if (!empty($totalarray['val']['totaldebit'])) { |
| 1439 | - $totalarray['val']['totaldebit'] = (float)price2num($totalarray['val']['totaldebit'], 'MT'); |
|
| 1439 | + $totalarray['val']['totaldebit'] = (float) price2num($totalarray['val']['totaldebit'], 'MT'); |
|
| 1440 | 1440 | } |
| 1441 | 1441 | if (!empty($totalarray['val']['totalcredit'])) { |
| 1442 | - $totalarray['val']['totalcredit'] = (float)price2num($totalarray['val']['totalcredit'], 'MT'); |
|
| 1442 | + $totalarray['val']['totalcredit'] = (float) price2num($totalarray['val']['totalcredit'], 'MT'); |
|
| 1443 | 1443 | } |
| 1444 | 1444 | if (!empty($totalarray['val']['totalbalance'])) { |
| 1445 | - $totalarray['val']['totalbalance'] = (float)price2num($totalarray['val']['totaldebit'] - $totalarray['val']['totalcredit'], 'MT'); |
|
| 1445 | + $totalarray['val']['totalbalance'] = (float) price2num($totalarray['val']['totaldebit'] - $totalarray['val']['totalcredit'], 'MT'); |
|
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | // Show total line |
@@ -341,17 +341,17 @@ discard block |
||
| 341 | 341 | if (!empty($search_date_start)) { |
| 342 | 342 | $filter['t.doc_date>='] = $search_date_start; |
| 343 | 343 | $tmp = dol_getdate($search_date_start); |
| 344 | - $param .= '&search_date_startmonth=' . ((int)$tmp['mon']) . '&search_date_startday=' . ((int)$tmp['mday']) . '&search_date_startyear=' . ((int)$tmp['year']); |
|
| 344 | + $param .= '&search_date_startmonth=' . ((int) $tmp['mon']) . '&search_date_startday=' . ((int) $tmp['mday']) . '&search_date_startyear=' . ((int) $tmp['year']); |
|
| 345 | 345 | } |
| 346 | 346 | if (!empty($search_date_end)) { |
| 347 | 347 | $filter['t.doc_date<='] = $search_date_end; |
| 348 | 348 | $tmp = dol_getdate($search_date_end); |
| 349 | - $param .= '&search_date_endmonth=' . ((int)$tmp['mon']) . '&search_date_endday=' . ((int)$tmp['mday']) . '&search_date_endyear=' . ((int)$tmp['year']); |
|
| 349 | + $param .= '&search_date_endmonth=' . ((int) $tmp['mon']) . '&search_date_endday=' . ((int) $tmp['mday']) . '&search_date_endyear=' . ((int) $tmp['year']); |
|
| 350 | 350 | } |
| 351 | 351 | if (!empty($search_doc_date)) { |
| 352 | 352 | $filter['t.doc_date'] = $search_doc_date; |
| 353 | 353 | $tmp = dol_getdate($search_doc_date); |
| 354 | - $param .= '&doc_datemonth=' . ((int)$tmp['mon']) . '&doc_dateday=' . ((int)$tmp['mday']) . '&doc_dateyear=' . ((int)$tmp['year']); |
|
| 354 | + $param .= '&doc_datemonth=' . ((int) $tmp['mon']) . '&doc_dateday=' . ((int) $tmp['mday']) . '&doc_dateyear=' . ((int) $tmp['year']); |
|
| 355 | 355 | } |
| 356 | 356 | if (!empty($search_doc_type)) { |
| 357 | 357 | $filter['t.doc_type'] = $search_doc_type; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | if ($search_account_category != '-1' && !empty($search_account_category)) { |
| 365 | 365 | $accountingcategory = new AccountancyCategory($db); |
| 366 | 366 | |
| 367 | - $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int)$search_account_category)); |
|
| 367 | + $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int) $search_account_category)); |
|
| 368 | 368 | $listofaccountsforgroup2 = array(); |
| 369 | 369 | if (is_array($listofaccountsforgroup)) { |
| 370 | 370 | foreach ($listofaccountsforgroup as $tmpval) { |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | } |
| 373 | 373 | } |
| 374 | 374 | $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2); |
| 375 | - $param .= '&search_account_category=' . urlencode((string)($search_account_category)); |
|
| 375 | + $param .= '&search_account_category=' . urlencode((string) ($search_account_category)); |
|
| 376 | 376 | } |
| 377 | 377 | if (!empty($search_accountancy_code)) { |
| 378 | 378 | $filter['t.numero_compte'] = $search_accountancy_code; |
@@ -414,47 +414,47 @@ discard block |
||
| 414 | 414 | } |
| 415 | 415 | if (!empty($search_mvt_num)) { |
| 416 | 416 | $filter['t.piece_num'] = $search_mvt_num; |
| 417 | - $param .= '&search_mvt_num=' . urlencode((string)($search_mvt_num)); |
|
| 417 | + $param .= '&search_mvt_num=' . urlencode((string) ($search_mvt_num)); |
|
| 418 | 418 | } |
| 419 | 419 | if (!empty($search_date_creation_start)) { |
| 420 | 420 | $filter['t.date_creation>='] = $search_date_creation_start; |
| 421 | 421 | $tmp = dol_getdate($search_date_creation_start); |
| 422 | - $param .= '&search_date_creation_startmonth=' . ((int)$tmp['mon']) . '&search_date_creation_startday=' . ((int)$tmp['mday']) . '&search_date_creation_startyear=' . ((int)$tmp['year']); |
|
| 422 | + $param .= '&search_date_creation_startmonth=' . ((int) $tmp['mon']) . '&search_date_creation_startday=' . ((int) $tmp['mday']) . '&search_date_creation_startyear=' . ((int) $tmp['year']); |
|
| 423 | 423 | } |
| 424 | 424 | if (!empty($search_date_creation_end)) { |
| 425 | 425 | $filter['t.date_creation<='] = $search_date_creation_end; |
| 426 | 426 | $tmp = dol_getdate($search_date_creation_end); |
| 427 | - $param .= '&search_date_creation_endmonth=' . ((int)$tmp['mon']) . '&search_date_creation_endday=' . ((int)$tmp['mday']) . '&search_date_creation_endyear=' . ((int)$tmp['year']); |
|
| 427 | + $param .= '&search_date_creation_endmonth=' . ((int) $tmp['mon']) . '&search_date_creation_endday=' . ((int) $tmp['mday']) . '&search_date_creation_endyear=' . ((int) $tmp['year']); |
|
| 428 | 428 | } |
| 429 | 429 | if (!empty($search_date_modification_start)) { |
| 430 | 430 | $filter['t.tms>='] = $search_date_modification_start; |
| 431 | 431 | $tmp = dol_getdate($search_date_modification_start); |
| 432 | - $param .= '&search_date_modification_startmonth=' . ((int)$tmp['mon']) . '&search_date_modification_startday=' . ((int)$tmp['mday']) . '&search_date_modification_startyear=' . ((int)$tmp['year']); |
|
| 432 | + $param .= '&search_date_modification_startmonth=' . ((int) $tmp['mon']) . '&search_date_modification_startday=' . ((int) $tmp['mday']) . '&search_date_modification_startyear=' . ((int) $tmp['year']); |
|
| 433 | 433 | } |
| 434 | 434 | if (!empty($search_date_modification_end)) { |
| 435 | 435 | $filter['t.tms<='] = $search_date_modification_end; |
| 436 | 436 | $tmp = dol_getdate($search_date_modification_end); |
| 437 | - $param .= '&search_date_modification_endmonth=' . ((int)$tmp['mon']) . '&search_date_modification_endday=' . ((int)$tmp['mday']) . '&search_date_modification_endyear=' . ((int)$tmp['year']); |
|
| 437 | + $param .= '&search_date_modification_endmonth=' . ((int) $tmp['mon']) . '&search_date_modification_endday=' . ((int) $tmp['mday']) . '&search_date_modification_endyear=' . ((int) $tmp['year']); |
|
| 438 | 438 | } |
| 439 | 439 | if (!empty($search_date_export_start)) { |
| 440 | 440 | $filter['t.date_export>='] = $search_date_export_start; |
| 441 | 441 | $tmp = dol_getdate($search_date_export_start); |
| 442 | - $param .= '&search_date_export_startmonth=' . ((int)$tmp['mon']) . '&search_date_export_startday=' . ((int)$tmp['mday']) . '&search_date_export_startyear=' . ((int)$tmp['year']); |
|
| 442 | + $param .= '&search_date_export_startmonth=' . ((int) $tmp['mon']) . '&search_date_export_startday=' . ((int) $tmp['mday']) . '&search_date_export_startyear=' . ((int) $tmp['year']); |
|
| 443 | 443 | } |
| 444 | 444 | if (!empty($search_date_export_end)) { |
| 445 | 445 | $filter['t.date_export<='] = $search_date_export_end; |
| 446 | 446 | $tmp = dol_getdate($search_date_export_end); |
| 447 | - $param .= '&search_date_export_endmonth=' . ((int)$tmp['mon']) . '&search_date_export_endday=' . ((int)$tmp['mday']) . '&search_date_export_endyear=' . ((int)$tmp['year']); |
|
| 447 | + $param .= '&search_date_export_endmonth=' . ((int) $tmp['mon']) . '&search_date_export_endday=' . ((int) $tmp['mday']) . '&search_date_export_endyear=' . ((int) $tmp['year']); |
|
| 448 | 448 | } |
| 449 | 449 | if (!empty($search_date_validation_start)) { |
| 450 | 450 | $filter['t.date_validated>='] = $search_date_validation_start; |
| 451 | 451 | $tmp = dol_getdate($search_date_validation_start); |
| 452 | - $param .= '&search_date_validation_startmonth=' . ((int)$tmp['mon']) . '&search_date_validation_startday=' . ((int)$tmp['mday']) . '&search_date_validation_startyear=' . ((int)$tmp['year']); |
|
| 452 | + $param .= '&search_date_validation_startmonth=' . ((int) $tmp['mon']) . '&search_date_validation_startday=' . ((int) $tmp['mday']) . '&search_date_validation_startyear=' . ((int) $tmp['year']); |
|
| 453 | 453 | } |
| 454 | 454 | if (!empty($search_date_validation_end)) { |
| 455 | 455 | $filter['t.date_validated<='] = $search_date_validation_end; |
| 456 | 456 | $tmp = dol_getdate($search_date_validation_end); |
| 457 | - $param .= '&search_date_validation_endmonth=' . ((int)$tmp['mon']) . '&search_date_validation_endday=' . ((int)$tmp['mday']) . '&search_date_validation_endyear=' . ((int)$tmp['year']); |
|
| 457 | + $param .= '&search_date_validation_endmonth=' . ((int) $tmp['mon']) . '&search_date_validation_endday=' . ((int) $tmp['mday']) . '&search_date_validation_endyear=' . ((int) $tmp['year']); |
|
| 458 | 458 | } |
| 459 | 459 | // Due date start |
| 460 | 460 | if (!empty($search_date_due_start)) { |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | } elseif ($key == 't.subledger_account<=') { |
| 682 | 682 | $sqlwhere[] = "t.subledger_account <= '" . $db->escape($value) . "'"; |
| 683 | 683 | } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { |
| 684 | - $sqlwhere[] = $db->sanitize($key) . ' = ' . ((int)$value); |
|
| 684 | + $sqlwhere[] = $db->sanitize($key) . ' = ' . ((int) $value); |
|
| 685 | 685 | } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { |
| 686 | 686 | $sqlwhere[] = $db->sanitize($key) . " LIKE '" . $db->escape($db->escapeforlike($value)) . "%'"; |
| 687 | 687 | } elseif ($key == 't.subledger_account') { |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | $param .= '&contextpage=' . urlencode($contextpage); |
| 792 | 792 | } |
| 793 | 793 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 794 | - $param .= '&limit=' . ((int)$limit); |
|
| 794 | + $param .= '&limit=' . ((int) $limit); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | // List of mass actions available |