@@ -384,12 +384,12 @@ discard block |
||
384 | 384 | if ($links[$key]['type'] == 'payment') { |
385 | 385 | $paymentstatic->id = $links[$key]['url_id']; |
386 | 386 | $paymentstatic->ref = $links[$key]['url_id']; |
387 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this |
|
387 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this |
|
388 | 388 | $tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id; |
389 | 389 | } elseif ($links[$key]['type'] == 'payment_supplier') { |
390 | 390 | $paymentsupplierstatic->id = $links[$key]['url_id']; |
391 | 391 | $paymentsupplierstatic->ref = $links[$key]['url_id']; |
392 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsupplierstatic->getNomUrl(2); |
|
392 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2); |
|
393 | 393 | $tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id; |
394 | 394 | } elseif ($links[$key]['type'] == 'company') { |
395 | 395 | $societestatic->id = $links[$key]['url_id']; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $chargestatic->id = $links[$key]['url_id']; |
424 | 424 | $chargestatic->ref = $links[$key]['url_id']; |
425 | 425 | |
426 | - $tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2); |
|
426 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); |
|
427 | 427 | $reg = array(); |
428 | 428 | if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { |
429 | 429 | if ($reg[1] == 'socialcontribution') { |
@@ -440,13 +440,13 @@ discard block |
||
440 | 440 | // Retrieve the accounting code of the social contribution of the payment from link of payment. |
441 | 441 | // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. |
442 | 442 | $sqlmid = "SELECT cchgsoc.accountancy_code"; |
443 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; |
|
444 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id"; |
|
445 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid"; |
|
446 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; |
|
447 | - $sqlmid .= " WHERE bkurl.fk_bank = ".((int) $obj->rowid); |
|
443 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc"; |
|
444 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id"; |
|
445 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid"; |
|
446 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; |
|
447 | + $sqlmid .= " WHERE bkurl.fk_bank = " . ((int) $obj->rowid); |
|
448 | 448 | |
449 | - dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG); |
|
449 | + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); |
|
450 | 450 | $resultmid = $db->query($sqlmid); |
451 | 451 | if ($resultmid) { |
452 | 452 | $objmid = $db->fetch_object($resultmid); |
@@ -456,14 +456,14 @@ discard block |
||
456 | 456 | $paymentdonstatic->id = $links[$key]['url_id']; |
457 | 457 | $paymentdonstatic->ref = $links[$key]['url_id']; |
458 | 458 | $paymentdonstatic->fk_donation = $links[$key]['url_id']; |
459 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentdonstatic->getNomUrl(2); |
|
459 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2); |
|
460 | 460 | $tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id; |
461 | 461 | $tabtp[$obj->rowid][$account_pay_donation] = isset($tabtp[$obj->rowid][$account_pay_donation]) ? $tabtp[$obj->rowid][$account_pay_donation] + $amounttouse : $amounttouse; |
462 | 462 | } elseif ($links[$key]['type'] == 'member') { |
463 | 463 | $paymentsubscriptionstatic->id = $links[$key]['url_id']; |
464 | 464 | $paymentsubscriptionstatic->ref = $links[$key]['url_id']; |
465 | 465 | $paymentsubscriptionstatic->label = $links[$key]['label']; |
466 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsubscriptionstatic->getNomUrl(2); |
|
466 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsubscriptionstatic->getNomUrl(2); |
|
467 | 467 | $tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id; |
468 | 468 | $paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id); |
469 | 469 | $tabtp[$obj->rowid][$account_pay_subscription] = isset($tabtp[$obj->rowid][$account_pay_subscription]) ? $tabtp[$obj->rowid][$account_pay_subscription] + $amounttouse : $amounttouse; |
@@ -471,14 +471,14 @@ discard block |
||
471 | 471 | $paymentvatstatic->id = $links[$key]['url_id']; |
472 | 472 | $paymentvatstatic->ref = $links[$key]['url_id']; |
473 | 473 | $paymentvatstatic->label = $links[$key]['label']; |
474 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentvatstatic->getNomUrl(2); |
|
474 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2); |
|
475 | 475 | $tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id; |
476 | 476 | $tabtp[$obj->rowid][$account_pay_vat] = isset($tabtp[$obj->rowid][$account_pay_vat]) ? $tabtp[$obj->rowid][$account_pay_vat] + $amounttouse : $amounttouse; |
477 | 477 | } elseif ($links[$key]['type'] == 'payment_salary') { |
478 | 478 | $paymentsalstatic->id = $links[$key]['url_id']; |
479 | 479 | $paymentsalstatic->ref = $links[$key]['url_id']; |
480 | 480 | $paymentsalstatic->label = $links[$key]['label']; |
481 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2); |
|
481 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); |
|
482 | 482 | $tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id; |
483 | 483 | |
484 | 484 | // This part of code is no more required. it is here to solve case where a link were missing (with v14.0.0) and keep writing in accountancy complete. |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $paymentvariousstatic->id = $links[$key]['url_id']; |
527 | 527 | $paymentvariousstatic->ref = $links[$key]['url_id']; |
528 | 528 | $paymentvariousstatic->label = $links[$key]['label']; |
529 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentvariousstatic->getNomUrl(2); |
|
529 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvariousstatic->getNomUrl(2); |
|
530 | 530 | $tabpay[$obj->rowid]["paymentvariousid"] = $paymentvariousstatic->id; |
531 | 531 | $paymentvariousstatic->fetch($paymentvariousstatic->id); |
532 | 532 | $account_various = (!empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word |
@@ -537,14 +537,14 @@ discard block |
||
537 | 537 | $paymentloanstatic->id = $links[$key]['url_id']; |
538 | 538 | $paymentloanstatic->ref = $links[$key]['url_id']; |
539 | 539 | $paymentloanstatic->fk_loan = $links[$key]['url_id']; |
540 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentloanstatic->getNomUrl(2); |
|
540 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2); |
|
541 | 541 | $tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id; |
542 | 542 | //$tabtp[$obj->rowid][$account_pay_loan] += $amounttouse; |
543 | 543 | $sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest'; |
544 | - $sqlmid .= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l'; |
|
545 | - $sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.((int) $obj->rowid); |
|
544 | + $sqlmid .= ' FROM ' . MAIN_DB_PREFIX . 'payment_loan as pl, ' . MAIN_DB_PREFIX . 'loan as l'; |
|
545 | + $sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = ' . ((int) $obj->rowid); |
|
546 | 546 | |
547 | - dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG); |
|
547 | + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); |
|
548 | 548 | $resultmid = $db->query($sqlmid); |
549 | 549 | if ($resultmid) { |
550 | 550 | $objmid = $db->fetch_object($resultmid); |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | } |
555 | 555 | } elseif ($links[$key]['type'] == 'banktransfert') { |
556 | 556 | $accountLinestatic->fetch($links[$key]['url_id']); |
557 | - $tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- '.$accountLinestatic ->getNomUrl(1); |
|
557 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer") . '- ' . $accountLinestatic ->getNomUrl(1); |
|
558 | 558 | $tabtp[$obj->rowid][$account_transfer] = isset($tabtp[$obj->rowid][$account_transfer]) ? $tabtp[$obj->rowid][$account_transfer] + $amounttouse : $amounttouse; |
559 | 559 | $bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']); |
560 | 560 | $tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | if ($mt) { |
673 | 673 | if (empty($conf->cache['accountingaccountincurrententity'][$k])) { |
674 | 674 | $accountingaccount = new AccountingAccount($db); |
675 | - $accountingaccount->fetch(0, $k, true); // $k is accounting account of the bank. |
|
675 | + $accountingaccount->fetch(0, $k, true); // $k is accounting account of the bank. |
|
676 | 676 | $conf->cache['accountingaccountincurrententity'][$k] = $accountingaccount; |
677 | 677 | } else { |
678 | 678 | $accountingaccount = $conf->cache['accountingaccountincurrententity'][$k]; |
@@ -682,11 +682,11 @@ discard block |
||
682 | 682 | |
683 | 683 | $reflabel = ''; |
684 | 684 | if (!empty($val['lib'])) { |
685 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
685 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
686 | 686 | } |
687 | - $reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); |
|
687 | + $reflabel .= $langs->trans("Bank") . ' ' . dol_string_nohtmltag($val['bank_account_ref']); |
|
688 | 688 | if (!empty($val['soclib'])) { |
689 | - $reflabel .= " - ".dol_string_nohtmltag($val['soclib']); |
|
689 | + $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | $bookkeeping = new BookKeeping($db); |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
723 | 723 | $error++; |
724 | 724 | $errorforline++; |
725 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
725 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
726 | 726 | } else { |
727 | 727 | $error++; |
728 | 728 | $errorforline++; |
@@ -743,10 +743,10 @@ discard block |
||
743 | 743 | |
744 | 744 | $reflabel = ''; |
745 | 745 | if (!empty($val['lib'])) { |
746 | - $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : ""); |
|
746 | + $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib'] ? " - " : ""); |
|
747 | 747 | } |
748 | 748 | if ($tabtype[$key] == 'banktransfert') { |
749 | - $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); |
|
749 | + $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount') . ' ' . $account_transfer); |
|
750 | 750 | } else { |
751 | 751 | $reflabel .= dol_string_nohtmltag($val['soclib']); |
752 | 752 | } |
@@ -793,43 +793,43 @@ discard block |
||
793 | 793 | } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution |
794 | 794 | $bookkeeping->subledger_account = ''; |
795 | 795 | $bookkeeping->subledger_label = ''; |
796 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
796 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
797 | 797 | $bookkeeping->numero_compte = $k; |
798 | 798 | $bookkeeping->label_compte = $accountingaccount->label; |
799 | 799 | } elseif ($tabtype[$key] == 'payment_vat') { |
800 | 800 | $bookkeeping->subledger_account = ''; |
801 | 801 | $bookkeeping->subledger_label = ''; |
802 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
802 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
803 | 803 | $bookkeeping->numero_compte = $k; |
804 | 804 | $bookkeeping->label_compte = $accountingaccount->label; |
805 | 805 | } elseif ($tabtype[$key] == 'payment_donation') { |
806 | 806 | $bookkeeping->subledger_account = ''; |
807 | 807 | $bookkeeping->subledger_label = ''; |
808 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
808 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
809 | 809 | $bookkeeping->numero_compte = $k; |
810 | 810 | $bookkeeping->label_compte = $accountingaccount->label; |
811 | 811 | } elseif ($tabtype[$key] == 'member') { |
812 | 812 | $bookkeeping->subledger_account = ''; |
813 | 813 | $bookkeeping->subledger_label = ''; |
814 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
814 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
815 | 815 | $bookkeeping->numero_compte = $k; |
816 | 816 | $bookkeeping->label_compte = $accountingaccount->label; |
817 | 817 | } elseif ($tabtype[$key] == 'payment_loan') { |
818 | 818 | $bookkeeping->subledger_account = ''; |
819 | 819 | $bookkeeping->subledger_label = ''; |
820 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
820 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
821 | 821 | $bookkeeping->numero_compte = $k; |
822 | 822 | $bookkeeping->label_compte = $accountingaccount->label; |
823 | 823 | } elseif ($tabtype[$key] == 'payment_various') { |
824 | 824 | $bookkeeping->subledger_account = $k; |
825 | 825 | $bookkeeping->subledger_label = $tabcompany[$key]['name']; |
826 | - $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
826 | + $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
827 | 827 | $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; |
828 | 828 | $bookkeeping->label_compte = $accountingaccount->label; |
829 | 829 | } elseif ($tabtype[$key] == 'banktransfert') { |
830 | 830 | $bookkeeping->subledger_account = ''; |
831 | 831 | $bookkeeping->subledger_label = ''; |
832 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
832 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
833 | 833 | $bookkeeping->numero_compte = $k; |
834 | 834 | $bookkeeping->label_compte = $accountingaccount->label; |
835 | 835 | } else { |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
853 | 853 | $error++; |
854 | 854 | $errorforline++; |
855 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
855 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
856 | 856 | } else { |
857 | 857 | $error++; |
858 | 858 | $errorforline++; |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | if ($mt) { |
873 | 873 | $reflabel = ''; |
874 | 874 | if (!empty($val['lib'])) { |
875 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
875 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
876 | 876 | } |
877 | 877 | $reflabel .= dol_string_nohtmltag('WaitingAccount'); |
878 | 878 | |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
904 | 904 | $error++; |
905 | 905 | $errorforline++; |
906 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
906 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
907 | 907 | } else { |
908 | 908 | $error++; |
909 | 909 | $errorforline++; |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) { |
919 | 919 | $error++; |
920 | 920 | $errorforline++; |
921 | - setEventMessages('We tried to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors'); |
|
921 | + setEventMessages('We tried to insert a non balanced transaction in book for ' . $ref . '. Canceled. Surely a bug.', null, 'errors'); |
|
922 | 922 | } |
923 | 923 | |
924 | 924 | if (!$errorforline) { |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | |
930 | 930 | $MAXNBERRORS = 5; |
931 | 931 | if ($error >= $MAXNBERRORS) { |
932 | - setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors'); |
|
932 | + setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped") . ' (>' . $MAXNBERRORS . ')', null, 'errors'); |
|
933 | 933 | break; // Break in the foreach |
934 | 934 | } |
935 | 935 | } |
@@ -947,15 +947,15 @@ discard block |
||
947 | 947 | |
948 | 948 | // Must reload data, so we make a redirect |
949 | 949 | if (count($tabpay) != $error) { |
950 | - $param = 'id_journal='.$id_journal; |
|
951 | - $param .= '&date_startday='.$date_startday; |
|
952 | - $param .= '&date_startmonth='.$date_startmonth; |
|
953 | - $param .= '&date_startyear='.$date_startyear; |
|
954 | - $param .= '&date_endday='.$date_endday; |
|
955 | - $param .= '&date_endmonth='.$date_endmonth; |
|
956 | - $param .= '&date_endyear='.$date_endyear; |
|
957 | - $param .= '&in_bookkeeping='.$in_bookkeeping; |
|
958 | - header("Location: ".$_SERVER['PHP_SELF'].($param ? '?'.$param : '')); |
|
950 | + $param = 'id_journal=' . $id_journal; |
|
951 | + $param .= '&date_startday=' . $date_startday; |
|
952 | + $param .= '&date_startmonth=' . $date_startmonth; |
|
953 | + $param .= '&date_startyear=' . $date_startyear; |
|
954 | + $param .= '&date_endday=' . $date_endday; |
|
955 | + $param .= '&date_endmonth=' . $date_endmonth; |
|
956 | + $param .= '&date_endyear=' . $date_endyear; |
|
957 | + $param .= '&in_bookkeeping=' . $in_bookkeeping; |
|
958 | + header("Location: " . $_SERVER['PHP_SELF'] . ($param ? '?' . $param : '')); |
|
959 | 959 | exit; |
960 | 960 | } |
961 | 961 | } |
@@ -968,20 +968,20 @@ discard block |
||
968 | 968 | |
969 | 969 | $filename = 'journal'; |
970 | 970 | $type_export = 'journal'; |
971 | - include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; |
|
971 | + include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; |
|
972 | 972 | |
973 | 973 | // CSV header line |
974 | - print '"'.$langs->transnoentitiesnoconv("BankId").'"'.$sep; |
|
975 | - print '"'.$langs->transnoentitiesnoconv("Date").'"'.$sep; |
|
976 | - print '"'.$langs->transnoentitiesnoconv("PaymentMode").'"'.$sep; |
|
977 | - print '"'.$langs->transnoentitiesnoconv("AccountAccounting").'"'.$sep; |
|
978 | - print '"'.$langs->transnoentitiesnoconv("LedgerAccount").'"'.$sep; |
|
979 | - print '"'.$langs->transnoentitiesnoconv("SubledgerAccount").'"'.$sep; |
|
980 | - print '"'.$langs->transnoentitiesnoconv("Label").'"'.$sep; |
|
981 | - print '"'.$langs->transnoentitiesnoconv("AccountingDebit").'"'.$sep; |
|
982 | - print '"'.$langs->transnoentitiesnoconv("AccountingCredit").'"'.$sep; |
|
983 | - print '"'.$langs->transnoentitiesnoconv("Journal").'"'.$sep; |
|
984 | - print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep; |
|
974 | + print '"' . $langs->transnoentitiesnoconv("BankId") . '"' . $sep; |
|
975 | + print '"' . $langs->transnoentitiesnoconv("Date") . '"' . $sep; |
|
976 | + print '"' . $langs->transnoentitiesnoconv("PaymentMode") . '"' . $sep; |
|
977 | + print '"' . $langs->transnoentitiesnoconv("AccountAccounting") . '"' . $sep; |
|
978 | + print '"' . $langs->transnoentitiesnoconv("LedgerAccount") . '"' . $sep; |
|
979 | + print '"' . $langs->transnoentitiesnoconv("SubledgerAccount") . '"' . $sep; |
|
980 | + print '"' . $langs->transnoentitiesnoconv("Label") . '"' . $sep; |
|
981 | + print '"' . $langs->transnoentitiesnoconv("AccountingDebit") . '"' . $sep; |
|
982 | + print '"' . $langs->transnoentitiesnoconv("AccountingCredit") . '"' . $sep; |
|
983 | + print '"' . $langs->transnoentitiesnoconv("Journal") . '"' . $sep; |
|
984 | + print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep; |
|
985 | 985 | print "\n"; |
986 | 986 | |
987 | 987 | foreach ($tabpay as $key => $val) { |
@@ -994,24 +994,24 @@ discard block |
||
994 | 994 | if ($mt) { |
995 | 995 | $reflabel = ''; |
996 | 996 | if (!empty($val['lib'])) { |
997 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
997 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
998 | 998 | } |
999 | - $reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); |
|
999 | + $reflabel .= $langs->trans("Bank") . ' ' . dol_string_nohtmltag($val['bank_account_ref']); |
|
1000 | 1000 | if (!empty($val['soclib'])) { |
1001 | - $reflabel .= " - ".dol_string_nohtmltag($val['soclib']); |
|
1001 | + $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); |
|
1002 | 1002 | } |
1003 | 1003 | |
1004 | - print '"'.$key.'"'.$sep; |
|
1005 | - print '"'.$date.'"'.$sep; |
|
1006 | - print '"'.$val["type_payment"].'"'.$sep; |
|
1007 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
1008 | - print '"'.length_accounta(html_entity_decode($k)).'"'.$sep; |
|
1009 | - print " ".$sep; |
|
1010 | - print '"'.$reflabel.'"'.$sep; |
|
1011 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
1012 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
1013 | - print '"'.$journal.'"'.$sep; |
|
1014 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
1004 | + print '"' . $key . '"' . $sep; |
|
1005 | + print '"' . $date . '"' . $sep; |
|
1006 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
1007 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
1008 | + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; |
|
1009 | + print " " . $sep; |
|
1010 | + print '"' . $reflabel . '"' . $sep; |
|
1011 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
1012 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
1013 | + print '"' . $journal . '"' . $sep; |
|
1014 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
1015 | 1015 | print "\n"; |
1016 | 1016 | } |
1017 | 1017 | } |
@@ -1022,35 +1022,35 @@ discard block |
||
1022 | 1022 | if ($mt) { |
1023 | 1023 | $reflabel = ''; |
1024 | 1024 | if (!empty($val['lib'])) { |
1025 | - $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : ""); |
|
1025 | + $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib'] ? " - " : ""); |
|
1026 | 1026 | } |
1027 | 1027 | if ($tabtype[$key] == 'banktransfert') { |
1028 | - $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); |
|
1028 | + $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount') . ' ' . $account_transfer); |
|
1029 | 1029 | } else { |
1030 | 1030 | $reflabel .= dol_string_nohtmltag($val['soclib']); |
1031 | 1031 | } |
1032 | 1032 | |
1033 | - print '"'.$key.'"'.$sep; |
|
1034 | - print '"'.$date.'"'.$sep; |
|
1035 | - print '"'.$val["type_payment"].'"'.$sep; |
|
1036 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
1033 | + print '"' . $key . '"' . $sep; |
|
1034 | + print '"' . $date . '"' . $sep; |
|
1035 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
1036 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
1037 | 1037 | if ($tabtype[$key] == 'payment_supplier') { |
1038 | - print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER').'"'.$sep; |
|
1038 | + print '"' . getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') . '"' . $sep; |
|
1039 | 1039 | } elseif ($tabtype[$key] == 'payment') { |
1040 | - print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER').'"'.$sep; |
|
1040 | + print '"' . getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') . '"' . $sep; |
|
1041 | 1041 | } elseif ($tabtype[$key] == 'payment_expensereport') { |
1042 | - print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT').'"'.$sep; |
|
1042 | + print '"' . getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') . '"' . $sep; |
|
1043 | 1043 | } elseif ($tabtype[$key] == 'payment_salary') { |
1044 | - print '"'.getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT').'"'.$sep; |
|
1044 | + print '"' . getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') . '"' . $sep; |
|
1045 | 1045 | } else { |
1046 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
1046 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
1047 | 1047 | } |
1048 | - print '"'.length_accounta(html_entity_decode($k)).'"'.$sep; |
|
1049 | - print '"'.$reflabel.'"'.$sep; |
|
1050 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
1051 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
1052 | - print '"'.$journal.'"'.$sep; |
|
1053 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
1048 | + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; |
|
1049 | + print '"' . $reflabel . '"' . $sep; |
|
1050 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
1051 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
1052 | + print '"' . $journal . '"' . $sep; |
|
1053 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
1054 | 1054 | print "\n"; |
1055 | 1055 | } |
1056 | 1056 | } |
@@ -1059,21 +1059,21 @@ discard block |
||
1059 | 1059 | if ($mt) { |
1060 | 1060 | $reflabel = ''; |
1061 | 1061 | if (!empty($val['lib'])) { |
1062 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
1062 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
1063 | 1063 | } |
1064 | 1064 | $reflabel .= dol_string_nohtmltag('WaitingAccount'); |
1065 | 1065 | |
1066 | - print '"'.$key.'"'.$sep; |
|
1067 | - print '"'.$date.'"'.$sep; |
|
1068 | - print '"'.$val["type_payment"].'"'.$sep; |
|
1069 | - print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')).'"'.$sep; |
|
1070 | - print '"'.length_accounta(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')).'"'.$sep; |
|
1066 | + print '"' . $key . '"' . $sep; |
|
1067 | + print '"' . $date . '"' . $sep; |
|
1068 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
1069 | + print '"' . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')) . '"' . $sep; |
|
1070 | + print '"' . length_accounta(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')) . '"' . $sep; |
|
1071 | 1071 | print $sep; |
1072 | - print '"'.$reflabel.'"'.$sep; |
|
1073 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
1074 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
1075 | - print '"'.$journal.'"'.$sep; |
|
1076 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
1072 | + print '"' . $reflabel . '"' . $sep; |
|
1073 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
1074 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
1075 | + print '"' . $journal . '"' . $sep; |
|
1076 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
1077 | 1077 | print "\n"; |
1078 | 1078 | } |
1079 | 1079 | } |
@@ -1098,23 +1098,23 @@ discard block |
||
1098 | 1098 | $salarystatic = new Salary($db); |
1099 | 1099 | $variousstatic = new PaymentVarious($db); |
1100 | 1100 | |
1101 | - $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); |
|
1102 | - $help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Génération_des_écritures_en_comptabilité'; |
|
1101 | + $title = $langs->trans("GenerationOfAccountingEntries") . ' - ' . $accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); |
|
1102 | + $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Génération_des_écritures_en_comptabilité'; |
|
1103 | 1103 | llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-bankjournal'); |
1104 | 1104 | |
1105 | 1105 | $nom = $title; |
1106 | 1106 | $builddate = dol_now(); |
1107 | 1107 | //$description = $langs->trans("DescFinanceJournal") . '<br>'; |
1108 | - $description = $langs->trans("DescJournalOnlyBindedVisible").'<br>'; |
|
1108 | + $description = $langs->trans("DescJournalOnlyBindedVisible") . '<br>'; |
|
1109 | 1109 | |
1110 | 1110 | $listofchoices = array( |
1111 | 1111 | 'notyet' => $langs->trans("NotYetInGeneralLedger"), |
1112 | 1112 | 'already' => $langs->trans("AlreadyInGeneralLedger") |
1113 | 1113 | ); |
1114 | - $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); |
|
1115 | - $period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); |
|
1114 | + $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); |
|
1115 | + $period .= ' - ' . $langs->trans("JournalizationInLedgerStatus") . ' ' . $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); |
|
1116 | 1116 | |
1117 | - $varlink = 'id_journal='.$id_journal; |
|
1117 | + $varlink = 'id_journal=' . $id_journal; |
|
1118 | 1118 | $periodlink = ''; |
1119 | 1119 | $exportlink = ''; |
1120 | 1120 | |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | 1 => $langs->trans("TransfertAllBankLines"), |
1123 | 1123 | 2 => $langs->trans("TransfertOnlyConciliatedBankLine") |
1124 | 1124 | ); |
1125 | - $moreoptions = [ "BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)]; |
|
1125 | + $moreoptions = ["BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)]; |
|
1126 | 1126 | |
1127 | 1127 | journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink, $moreoptions); |
1128 | 1128 | |
@@ -1131,14 +1131,14 @@ discard block |
||
1131 | 1131 | if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') { |
1132 | 1132 | // Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed) |
1133 | 1133 | // Fiscal period test |
1134 | - $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity); |
|
1134 | + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "accounting_fiscalyear WHERE entity = " . ((int) $conf->entity); |
|
1135 | 1135 | $resql = $db->query($sql); |
1136 | 1136 | if ($resql) { |
1137 | 1137 | $obj = $db->fetch_object($resql); |
1138 | 1138 | if ($obj->nb == 0) { |
1139 | - print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined"); |
|
1140 | - $desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}'); |
|
1141 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc); |
|
1139 | + print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("TheFiscalPeriodIsNotDefined"); |
|
1140 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}'); |
|
1141 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("FiscalPeriod") . '</strong>', $desc); |
|
1142 | 1142 | print $desc; |
1143 | 1143 | print '</div>'; |
1144 | 1144 | } |
@@ -1148,14 +1148,14 @@ discard block |
||
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | // Bank test |
1151 | - $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."bank_account WHERE entity = ".((int) $conf->entity)." AND fk_accountancy_journal IS NULL AND clos=0"; |
|
1151 | + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "bank_account WHERE entity = " . ((int) $conf->entity) . " AND fk_accountancy_journal IS NULL AND clos=0"; |
|
1152 | 1152 | $resql = $db->query($sql); |
1153 | 1153 | if ($resql) { |
1154 | 1154 | $obj = $db->fetch_object($resql); |
1155 | 1155 | if ($obj->nb > 0) { |
1156 | - print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount"); |
|
1157 | - $desc = ' : '.$langs->trans("AccountancyAreaDescBank", 6, '{link}'); |
|
1158 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>', $desc); |
|
1156 | + print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount"); |
|
1157 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescBank", 6, '{link}'); |
|
1158 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("BankAccounts") . '</strong>', $desc); |
|
1159 | 1159 | print $desc; |
1160 | 1160 | print '</div>'; |
1161 | 1161 | } |
@@ -1171,9 +1171,9 @@ discard block |
||
1171 | 1171 | || (isModEnabled("expensereport") && (getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT') == '-1'))) { |
1172 | 1172 | |
1173 | 1173 | |
1174 | - print($desc ? '' : '<br>').'<div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
|
1175 | - $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
|
1176 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc); |
|
1174 | + print($desc ? '' : '<br>') . '<div class="warning">' . img_warning() . ' ' . $langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
|
1175 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
|
1176 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>', $desc); |
|
1177 | 1177 | print $desc; |
1178 | 1178 | print '</div>'; |
1179 | 1179 | } |
@@ -1182,17 +1182,17 @@ discard block |
||
1182 | 1182 | print '<br><div class="tabsAction tabsActionNoBottom centerimp">'; |
1183 | 1183 | |
1184 | 1184 | if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') { |
1185 | - print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />'; |
|
1185 | + print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />'; |
|
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1' |
1189 | 1189 | || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1') { |
1190 | - print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />'; |
|
1190 | + print '<input type="button" class="butActionRefused classfortooltip" title="' . dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")) . '" value="' . $langs->trans("WriteBookKeeping") . '" />'; |
|
1191 | 1191 | } else { |
1192 | 1192 | if ($in_bookkeeping == 'notyet') { |
1193 | - print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />'; |
|
1193 | + print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />'; |
|
1194 | 1194 | } else { |
1195 | - print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>'; |
|
1195 | + print '<a class="butActionRefused classfortooltip" name="writebookkeeping">' . $langs->trans("WriteBookKeeping") . '</a>'; |
|
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | |
@@ -1224,14 +1224,14 @@ discard block |
||
1224 | 1224 | print '<div class="div-table-responsive">'; |
1225 | 1225 | print '<table class="noborder centpercent">'; |
1226 | 1226 | print '<tr class="liste_titre">'; |
1227 | - print "<td>".$langs->trans("Date")."</td>"; |
|
1228 | - print "<td>".$langs->trans("Piece").' ('.$langs->trans("ObjectsRef").")</td>"; |
|
1229 | - print "<td>".$langs->trans("AccountAccounting")."</td>"; |
|
1230 | - print "<td>".$langs->trans("SubledgerAccount")."</td>"; |
|
1231 | - print "<td>".$langs->trans("LabelOperation")."</td>"; |
|
1232 | - print '<td class="center">'.$langs->trans("PaymentMode")."</td>"; |
|
1233 | - print '<td class="right">'.$langs->trans("AccountingDebit")."</td>"; |
|
1234 | - print '<td class="right">'.$langs->trans("AccountingCredit")."</td>"; |
|
1227 | + print "<td>" . $langs->trans("Date") . "</td>"; |
|
1228 | + print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("ObjectsRef") . ")</td>"; |
|
1229 | + print "<td>" . $langs->trans("AccountAccounting") . "</td>"; |
|
1230 | + print "<td>" . $langs->trans("SubledgerAccount") . "</td>"; |
|
1231 | + print "<td>" . $langs->trans("LabelOperation") . "</td>"; |
|
1232 | + print '<td class="center">' . $langs->trans("PaymentMode") . "</td>"; |
|
1233 | + print '<td class="right">' . $langs->trans("AccountingDebit") . "</td>"; |
|
1234 | + print '<td class="right">' . $langs->trans("AccountingCredit") . "</td>"; |
|
1235 | 1235 | print "</tr>\n"; |
1236 | 1236 | |
1237 | 1237 | $r = ''; |
@@ -1246,29 +1246,29 @@ discard block |
||
1246 | 1246 | if ($mt) { |
1247 | 1247 | $reflabel = ''; |
1248 | 1248 | if (!empty($val['lib'])) { |
1249 | - $reflabel .= $val['lib']." - "; |
|
1249 | + $reflabel .= $val['lib'] . " - "; |
|
1250 | 1250 | } |
1251 | - $reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref']; |
|
1251 | + $reflabel .= $langs->trans("Bank") . ' ' . $val['bank_account_ref']; |
|
1252 | 1252 | if (!empty($val['soclib'])) { |
1253 | - $reflabel .= " - ".$val['soclib']; |
|
1253 | + $reflabel .= " - " . $val['soclib']; |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | //var_dump($tabpay[$key]); |
1257 | - print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->'; |
|
1257 | + print '<!-- Bank bank.rowid=' . $key . ' type=' . $tabpay[$key]['type'] . ' ref=' . $tabpay[$key]['ref'] . '-->'; |
|
1258 | 1258 | print '<tr class="oddeven">'; |
1259 | 1259 | |
1260 | 1260 | // Date |
1261 | - print "<td>".$date."</td>"; |
|
1261 | + print "<td>" . $date . "</td>"; |
|
1262 | 1262 | |
1263 | 1263 | // Ref |
1264 | - print "<td>".dol_escape_htmltag($ref)."</td>"; |
|
1264 | + print "<td>" . dol_escape_htmltag($ref) . "</td>"; |
|
1265 | 1265 | |
1266 | 1266 | // Ledger account |
1267 | 1267 | $accounttoshow = length_accountg($k); |
1268 | 1268 | if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { |
1269 | - $accounttoshow = '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>'; |
|
1269 | + $accounttoshow = '<span class="error">' . $langs->trans("BankAccountNotDefined") . '</span>'; |
|
1270 | 1270 | } |
1271 | - print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
|
1271 | + print '<td class="maxwidth300" title="' . dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)) . '">'; |
|
1272 | 1272 | print $accounttoshow; |
1273 | 1273 | print "</td>"; |
1274 | 1274 | |
@@ -1284,12 +1284,12 @@ discard block |
||
1284 | 1284 | |
1285 | 1285 | // Label operation |
1286 | 1286 | print '<td>'; |
1287 | - print $reflabel; // This is already html escaped content |
|
1287 | + print $reflabel; // This is already html escaped content |
|
1288 | 1288 | print "</td>"; |
1289 | 1289 | |
1290 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
1291 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1292 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1290 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
1291 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1292 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1293 | 1293 | print "</tr>"; |
1294 | 1294 | |
1295 | 1295 | $i++; |
@@ -1302,22 +1302,22 @@ discard block |
||
1302 | 1302 | if ($mt) { |
1303 | 1303 | $reflabel = ''; |
1304 | 1304 | if (!empty($val['lib'])) { |
1305 | - $reflabel .= $val['lib'].(isset($val['soclib']) ? " - " : ""); |
|
1305 | + $reflabel .= $val['lib'] . (isset($val['soclib']) ? " - " : ""); |
|
1306 | 1306 | } |
1307 | 1307 | if ($tabtype[$key] == 'banktransfert') { |
1308 | - $reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer; |
|
1308 | + $reflabel .= $langs->trans('TransitionalAccount') . ' ' . $account_transfer; |
|
1309 | 1309 | } else { |
1310 | 1310 | $reflabel .= isset($val['soclib']) ? $val['soclib'] : ""; |
1311 | 1311 | } |
1312 | 1312 | |
1313 | - print '<!-- Thirdparty bank.rowid='.$key.' -->'; |
|
1313 | + print '<!-- Thirdparty bank.rowid=' . $key . ' -->'; |
|
1314 | 1314 | print '<tr class="oddeven">'; |
1315 | 1315 | |
1316 | 1316 | // Date |
1317 | - print "<td>".$date."</td>"; |
|
1317 | + print "<td>" . $date . "</td>"; |
|
1318 | 1318 | |
1319 | 1319 | // Ref |
1320 | - print "<td>".dol_escape_htmltag($ref)."</td>"; |
|
1320 | + print "<td>" . dol_escape_htmltag($ref) . "</td>"; |
|
1321 | 1321 | |
1322 | 1322 | // Ledger account |
1323 | 1323 | $account_ledger = $k; |
@@ -1348,9 +1348,9 @@ discard block |
||
1348 | 1348 | if ($tabtype[$key] == 'unknown') { |
1349 | 1349 | // We will accept writing, but into a waiting account |
1350 | 1350 | if (!getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') || getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') == '-1') { |
1351 | - $accounttoshow = '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>'; |
|
1351 | + $accounttoshow = '<span class="error small">' . $langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking') . '</span>'; |
|
1352 | 1352 | } else { |
1353 | - $accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))).'</span>'; // We will use a waiting account |
|
1353 | + $accounttoshow = '<span class="warning small">' . $langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))) . '</span>'; // We will use a waiting account |
|
1354 | 1354 | } |
1355 | 1355 | } else { |
1356 | 1356 | // We will refuse writing |
@@ -1373,11 +1373,11 @@ discard block |
||
1373 | 1373 | if ($tabtype[$key] == 'member') { |
1374 | 1374 | $errorstring = 'MainAccountForSubscriptionPaymentNotDefined'; |
1375 | 1375 | } |
1376 | - $accounttoshow = '<span class="error small">'.$langs->trans($errorstring).'</span>'; |
|
1376 | + $accounttoshow = '<span class="error small">' . $langs->trans($errorstring) . '</span>'; |
|
1377 | 1377 | } |
1378 | 1378 | } |
1379 | - print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
|
1380 | - print $accounttoshow; // This is a HTML string |
|
1379 | + print '<td class="maxwidth300" title="' . dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)) . '">'; |
|
1380 | + print $accounttoshow; // This is a HTML string |
|
1381 | 1381 | print "</td>"; |
1382 | 1382 | |
1383 | 1383 | // Subledger account |
@@ -1393,12 +1393,12 @@ discard block |
||
1393 | 1393 | if (!empty($tabcompany[$key]['code_compta'])) { |
1394 | 1394 | if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) { |
1395 | 1395 | // For such case, if subledger is not defined, we won't use subledger accounts. |
1396 | - $accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>'; |
|
1396 | + $accounttoshowsubledger = '<span class="warning small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored") . '</span>'; |
|
1397 | 1397 | } else { |
1398 | - $accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>'; |
|
1398 | + $accounttoshowsubledger = '<span class="warning small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']) . '</span>'; |
|
1399 | 1399 | } |
1400 | 1400 | } else { |
1401 | - $accounttoshowsubledger = '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>'; |
|
1401 | + $accounttoshowsubledger = '<span class="error small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking") . '</span>'; |
|
1402 | 1402 | } |
1403 | 1403 | } |
1404 | 1404 | } else { |
@@ -1406,16 +1406,16 @@ discard block |
||
1406 | 1406 | } |
1407 | 1407 | } |
1408 | 1408 | print '<td class="maxwidth300">'; |
1409 | - print $accounttoshowsubledger; // This is a html string |
|
1409 | + print $accounttoshowsubledger; // This is a html string |
|
1410 | 1410 | print "</td>"; |
1411 | 1411 | |
1412 | - print "<td>".$reflabel."</td>"; |
|
1412 | + print "<td>" . $reflabel . "</td>"; |
|
1413 | 1413 | |
1414 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
1414 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
1415 | 1415 | |
1416 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1416 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1417 | 1417 | |
1418 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1418 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1419 | 1419 | |
1420 | 1420 | print "</tr>"; |
1421 | 1421 | |
@@ -1427,14 +1427,14 @@ discard block |
||
1427 | 1427 | if ($mt) { |
1428 | 1428 | $reflabel = ''; |
1429 | 1429 | if (!empty($val['lib'])) { |
1430 | - $reflabel .= $val['lib']." - "; |
|
1430 | + $reflabel .= $val['lib'] . " - "; |
|
1431 | 1431 | } |
1432 | 1432 | $reflabel .= 'WaitingAccount'; |
1433 | 1433 | |
1434 | - print '<!-- Wait bank.rowid='.$key.' -->'; |
|
1434 | + print '<!-- Wait bank.rowid=' . $key . ' -->'; |
|
1435 | 1435 | print '<tr class="oddeven">'; |
1436 | - print "<td>".$date."</td>"; |
|
1437 | - print "<td>".$ref."</td>"; |
|
1436 | + print "<td>" . $date . "</td>"; |
|
1437 | + print "<td>" . $ref . "</td>"; |
|
1438 | 1438 | // Ledger account |
1439 | 1439 | print "<td>"; |
1440 | 1440 | /*if (empty($accounttoshow) || $accounttoshow == 'NotDefined') |
@@ -1447,10 +1447,10 @@ discard block |
||
1447 | 1447 | // Subledger account |
1448 | 1448 | print "<td>"; |
1449 | 1449 | print "</td>"; |
1450 | - print "<td>".dol_escape_htmltag($reflabel)."</td>"; |
|
1451 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
1452 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1453 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1450 | + print "<td>" . dol_escape_htmltag($reflabel) . "</td>"; |
|
1451 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
1452 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1453 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1454 | 1454 | print "</tr>"; |
1455 | 1455 | |
1456 | 1456 | $i++; |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | |
1462 | 1462 | if (!$i) { |
1463 | 1463 | $colspan = 8; |
1464 | - print '<tr class="oddeven"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
1464 | + print '<tr class="oddeven"><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | print "</table>"; |
@@ -1516,77 +1516,77 @@ discard block |
||
1516 | 1516 | $sqlmid = ''; |
1517 | 1517 | if ($typerecord == 'payment') { |
1518 | 1518 | if (getDolGlobalInt('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { |
1519 | - $sqlmid = "SELECT payfac.fk_facture as id, ".$db->ifsql('f1.rowid IS NULL', 'f.ref', 'f1.ref')." as ref"; |
|
1520 | - $sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac"; |
|
1521 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture"; |
|
1522 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."societe_remise_except as sre ON sre.fk_facture_source = payfac.fk_facture"; |
|
1523 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f1 ON f1.rowid = sre.fk_facture"; |
|
1524 | - $sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']); |
|
1519 | + $sqlmid = "SELECT payfac.fk_facture as id, " . $db->ifsql('f1.rowid IS NULL', 'f.ref', 'f1.ref') . " as ref"; |
|
1520 | + $sqlmid .= " FROM " . $db->prefix() . "paiement_facture as payfac"; |
|
1521 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "facture as f ON f.rowid = payfac.fk_facture"; |
|
1522 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "societe_remise_except as sre ON sre.fk_facture_source = payfac.fk_facture"; |
|
1523 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "facture as f1 ON f1.rowid = sre.fk_facture"; |
|
1524 | + $sqlmid .= " WHERE payfac.fk_paiement=" . ((int) $val['paymentid']); |
|
1525 | 1525 | } else { |
1526 | 1526 | $sqlmid = "SELECT payfac.fk_facture as id, f.ref as ref"; |
1527 | - $sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac"; |
|
1528 | - $sqlmid .= " INNER JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture"; |
|
1529 | - $sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']); |
|
1527 | + $sqlmid .= " FROM " . $db->prefix() . "paiement_facture as payfac"; |
|
1528 | + $sqlmid .= " INNER JOIN " . $db->prefix() . "facture as f ON f.rowid = payfac.fk_facture"; |
|
1529 | + $sqlmid .= " WHERE payfac.fk_paiement=" . ((int) $val['paymentid']); |
|
1530 | 1530 | } |
1531 | 1531 | $ref = $langs->transnoentitiesnoconv("Invoice"); |
1532 | 1532 | } elseif ($typerecord == 'payment_supplier') { |
1533 | 1533 | $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; |
1534 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
1535 | - $sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".((int) $val["paymentsupplierid"]); |
|
1534 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac, " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
1535 | + $sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=" . ((int) $val["paymentsupplierid"]); |
|
1536 | 1536 | $ref = $langs->transnoentitiesnoconv("SupplierInvoice"); |
1537 | 1537 | } elseif ($typerecord == 'payment_expensereport') { |
1538 | 1538 | $sqlmid = 'SELECT e.rowid as id, e.ref'; |
1539 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e"; |
|
1540 | - $sqlmid .= " WHERE pe.rowid=".((int) $val["paymentexpensereport"])." AND pe.fk_expensereport = e.rowid"; |
|
1539 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as pe, " . MAIN_DB_PREFIX . "expensereport as e"; |
|
1540 | + $sqlmid .= " WHERE pe.rowid=" . ((int) $val["paymentexpensereport"]) . " AND pe.fk_expensereport = e.rowid"; |
|
1541 | 1541 | $ref = $langs->transnoentitiesnoconv("ExpenseReport"); |
1542 | 1542 | } elseif ($typerecord == 'payment_salary') { |
1543 | 1543 | $sqlmid = 'SELECT s.rowid as ref'; |
1544 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; |
|
1545 | - $sqlmid .= " WHERE s.rowid=".((int) $val["paymentsalid"]); |
|
1544 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s"; |
|
1545 | + $sqlmid .= " WHERE s.rowid=" . ((int) $val["paymentsalid"]); |
|
1546 | 1546 | $ref = $langs->transnoentitiesnoconv("SalaryPayment"); |
1547 | 1547 | } elseif ($typerecord == 'sc') { |
1548 | 1548 | $sqlmid = 'SELECT sc.rowid as ref'; |
1549 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc"; |
|
1550 | - $sqlmid .= " WHERE sc.rowid=".((int) $val["paymentscid"]); |
|
1549 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementcharge as sc"; |
|
1550 | + $sqlmid .= " WHERE sc.rowid=" . ((int) $val["paymentscid"]); |
|
1551 | 1551 | $ref = $langs->transnoentitiesnoconv("SocialContribution"); |
1552 | 1552 | } elseif ($typerecord == 'payment_vat') { |
1553 | 1553 | $sqlmid = 'SELECT v.rowid as ref'; |
1554 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v"; |
|
1555 | - $sqlmid .= " WHERE v.rowid=".((int) $val["paymentvatid"]); |
|
1554 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v"; |
|
1555 | + $sqlmid .= " WHERE v.rowid=" . ((int) $val["paymentvatid"]); |
|
1556 | 1556 | $ref = $langs->transnoentitiesnoconv("PaymentVat"); |
1557 | 1557 | } elseif ($typerecord == 'payment_donation') { |
1558 | 1558 | $sqlmid = 'SELECT payd.fk_donation as ref'; |
1559 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd"; |
|
1560 | - $sqlmid .= " WHERE payd.fk_donation=".((int) $val["paymentdonationid"]); |
|
1559 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd"; |
|
1560 | + $sqlmid .= " WHERE payd.fk_donation=" . ((int) $val["paymentdonationid"]); |
|
1561 | 1561 | $ref = $langs->transnoentitiesnoconv("Donation"); |
1562 | 1562 | } elseif ($typerecord == 'payment_loan') { |
1563 | 1563 | $sqlmid = 'SELECT l.rowid as ref'; |
1564 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l"; |
|
1565 | - $sqlmid .= " WHERE l.rowid=".((int) $val["paymentloanid"]); |
|
1564 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l"; |
|
1565 | + $sqlmid .= " WHERE l.rowid=" . ((int) $val["paymentloanid"]); |
|
1566 | 1566 | $ref = $langs->transnoentitiesnoconv("LoanPayment"); |
1567 | 1567 | } elseif ($typerecord == 'payment_various') { |
1568 | 1568 | $sqlmid = 'SELECT v.rowid as ref'; |
1569 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v"; |
|
1570 | - $sqlmid .= " WHERE v.rowid=".((int) $val["paymentvariousid"]); |
|
1569 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_various as v"; |
|
1570 | + $sqlmid .= " WHERE v.rowid=" . ((int) $val["paymentvariousid"]); |
|
1571 | 1571 | $ref = $langs->transnoentitiesnoconv("VariousPayment"); |
1572 | 1572 | } |
1573 | 1573 | // Add warning |
1574 | 1574 | if (empty($sqlmid)) { |
1575 | - dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING); |
|
1575 | + dol_syslog("Found a typerecord=" . $typerecord . " not supported", LOG_WARNING); |
|
1576 | 1576 | } |
1577 | 1577 | |
1578 | 1578 | if ($sqlmid) { |
1579 | - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG); |
|
1579 | + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); |
|
1580 | 1580 | $resultmid = $db->query($sqlmid); |
1581 | 1581 | if ($resultmid) { |
1582 | 1582 | while ($objmid = $db->fetch_object($resultmid)) { |
1583 | - $ref .= ' '.$objmid->ref; |
|
1583 | + $ref .= ' ' . $objmid->ref; |
|
1584 | 1584 | } |
1585 | 1585 | } else { |
1586 | 1586 | dol_print_error($db); |
1587 | 1587 | } |
1588 | 1588 | } |
1589 | 1589 | |
1590 | - $ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300 |
|
1590 | + $ref = dol_trunc($langs->transnoentitiesnoconv("BankId") . ' ' . $val['fk_bank'] . ' - ' . $ref, 295); // 295 + 3 dots (...) is < than max size of 300 |
|
1591 | 1591 | return $ref; |
1592 | 1592 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
86 | 86 | $object = new BookKeeping($db); |
87 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
87 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
88 | 88 | |
89 | 89 | $formaccounting = new FormAccounting($db); |
90 | 90 | $formother = new FormOther($db); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
469 | 469 | $sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance"; |
470 | 470 | $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t"; |
471 | - $sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features |
|
471 | + $sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features |
|
472 | 472 | $sql .= " AND t.doc_date < '" . $db->idate($search_date_start) . "'"; |
473 | 473 | $sql .= " GROUP BY t.numero_compte"; |
474 | 474 |
@@ -617,7 +617,7 @@ |
||
617 | 617 | |
618 | 618 | print '<br>'; |
619 | 619 | |
620 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
620 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
621 | 621 | |
622 | 622 | if ($result < 0) { |
623 | 623 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | |
681 | 681 | if ($setfields) { |
682 | 682 | $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; |
683 | - $sql .= " SET " . $setfields; // $setfields is already a sanitized SQL string |
|
683 | + $sql .= " SET " . $setfields; // $setfields is already a sanitized SQL string |
|
684 | 684 | $sql .= " WHERE rowid = " . ((int) $movement->id); |
685 | 685 | |
686 | 686 | $result = $db->query($sql); |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | $form_question['formatexport'] = array( |
794 | 794 | 'name' => 'formatexport', |
795 | 795 | 'type' => 'select', |
796 | - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
796 | + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
797 | 797 | 'values' => $listofformat, |
798 | 798 | 'default' => $formatexportset, |
799 | 799 | 'morecss' => 'minwidth200 maxwidth200' |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | |
1321 | 1321 | $labeltoshow = ''; |
1322 | 1322 | $labeltoshowalt = ''; |
1323 | - if (($objectstatic instanceof CommonObject) && in_array($line->doc_type, array('customer_invoice', 'supplier_invoice', 'expense_report'))) { |
|
1323 | + if (($objectstatic instanceof CommonObject) && in_array($line->doc_type, array('customer_invoice', 'supplier_invoice', 'expense_report'))) { |
|
1324 | 1324 | if ($objectstatic->id > 0) { |
1325 | 1325 | $labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); |
1326 | 1326 | $labeltoshow .= $documentlink; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $search_date_endday = GETPOSTINT('search_date_endday'); |
58 | 58 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
59 | 59 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
60 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
60 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
61 | 61 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
62 | 62 | |
63 | 63 | // Load variable for pagination |
@@ -66,7 +66,7 @@ |
||
66 | 66 | $search_date_endday = GETPOSTINT('search_date_endday'); |
67 | 67 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
68 | 68 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
69 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
69 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
70 | 70 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
71 | 71 | |
72 | 72 | // Define begin binding date |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $changeaccount = GETPOST('changeaccount'); |
50 | 50 | // Search Getpost |
51 | 51 | $search_societe = GETPOST('search_societe', 'alpha'); |
52 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
52 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
53 | 53 | $search_ref = GETPOST('search_ref', 'alpha'); |
54 | 54 | $search_invoice = GETPOST('search_invoice', 'alpha'); |
55 | 55 | //$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $search_date_endday = GETPOSTINT('search_date_endday'); |
65 | 65 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
66 | 66 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
67 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
67 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
68 | 68 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
69 | 69 | $search_country = GETPOST('search_country', 'aZ09'); |
70 | 70 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $mesCasesCochees = GETPOST('toselect', 'array'); |
59 | 59 | |
60 | 60 | // Search Getpost |
61 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
61 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
62 | 62 | $search_societe = GETPOST('search_societe', 'alpha'); |
63 | 63 | $search_ref = GETPOST('search_ref', 'alpha'); |
64 | 64 | $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $search_date_endday = GETPOSTINT('search_date_endday'); |
75 | 75 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
76 | 76 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
77 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
77 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
78 | 78 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
79 | 79 | $search_country = GETPOST('search_country', 'aZ09'); |
80 | 80 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | $thirdpartystatic->email = $objp->email; |
586 | 586 | $thirdpartystatic->country_code = $objp->country_code; |
587 | 587 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
588 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
588 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
589 | 589 | |
590 | 590 | $product_static->ref = $objp->product_ref; |
591 | 591 | $product_static->id = $objp->product_id; |
@@ -201,7 +201,7 @@ |
||
201 | 201 | $thirdpartystatic->email = $objp->email; |
202 | 202 | $thirdpartystatic->country_code = $objp->country_code; |
203 | 203 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
204 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
204 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
205 | 205 | |
206 | 206 | $product_static->ref = $objp->product_ref; |
207 | 207 | $product_static->id = $objp->product_id; |