Add some information in bank_journal
This commit is contained in:
parent
7d2d818679
commit
d1e1d64b42
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -53,8 +53,10 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/paymentvarious.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/paymentvarious.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/loan/class/paymentloan.class.php';
|
||||||
|
|
||||||
$langs->loadLangs(array("companies","other","compta","banks",'bills','donations',"accountancy","trips","salaries","hrm"));
|
$langs->loadLangs(array("companies","other","compta","banks","bills","donations","loan","accountancy","trips","salaries","hrm"));
|
||||||
|
|
||||||
// Multi journal
|
// Multi journal
|
||||||
$id_journal = GETPOST('id_journal', 'int');
|
$id_journal = GETPOST('id_journal', 'int');
|
||||||
@ -143,6 +145,7 @@ $paymentvatstatic = new TVA($db);
|
|||||||
$paymentsalstatic = new PaymentSalary($db);
|
$paymentsalstatic = new PaymentSalary($db);
|
||||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||||
$paymentvariousstatic = new PaymentVarious($db);
|
$paymentvariousstatic = new PaymentVarious($db);
|
||||||
|
$paymentloanstatic = new PaymentLoan($db);
|
||||||
|
|
||||||
// Get code of finance journal
|
// Get code of finance journal
|
||||||
$accountingjournalstatic = new AccountingJournal($db);
|
$accountingjournalstatic = new AccountingJournal($db);
|
||||||
@ -254,7 +257,7 @@ if ($result) {
|
|||||||
// Now loop on each link of record in bank.
|
// Now loop on each link of record in bank.
|
||||||
foreach ($links as $key => $val) {
|
foreach ($links as $key => $val) {
|
||||||
|
|
||||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_salary', 'payment_various')))
|
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_loan', 'payment_salary', 'payment_various')))
|
||||||
{
|
{
|
||||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||||
|
|
||||||
@ -358,6 +361,13 @@ if ($result) {
|
|||||||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||||
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
||||||
|
} else if ($links[$key]['type'] == 'payment_loan') {
|
||||||
|
$paymentloanstatic->id = $links[$key]['url_id'];
|
||||||
|
$paymentloanstatic->ref = $links[$key]['url_id'];
|
||||||
|
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2);
|
||||||
|
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
|
||||||
|
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
} else if ($links[$key]['type'] == 'banktransfert') {
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
|
||||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||||
@ -548,6 +558,11 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->label_compte = '';
|
||||||
|
} else if ($tabtype[$key] == 'payment_loan') {
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
} else if ($tabtype[$key] == 'payment_various') {
|
} else if ($tabtype[$key] == 'payment_various') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
@ -713,8 +728,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"' . $langs->trans("LedgerAccount") . '"' . $sep;
|
print '"' . $langs->trans("LedgerAccount") . '"' . $sep;
|
||||||
print '"' . $langs->trans("SubledgerAccount") . '"' . $sep;
|
print '"' . $langs->trans("SubledgerAccount") . '"' . $sep;
|
||||||
print '"' . $langs->trans("Label"). '"' . $sep;
|
print '"' . $langs->trans("Label"). '"' . $sep;
|
||||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
print '"' . $langs->trans("Debit") . '"' . $sep;
|
||||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
print '"' . $langs->trans("Credit") . '"' . $sep;
|
||||||
print '"' . $langs->trans("Journal") . '"' . $sep;
|
print '"' . $langs->trans("Journal") . '"' . $sep;
|
||||||
print '"' . $langs->trans("Note") . '"' . $sep;
|
print '"' . $langs->trans("Note") . '"' . $sep;
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -822,6 +837,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
$expensereportstatic = new ExpenseReport($db);
|
$expensereportstatic = new ExpenseReport($db);
|
||||||
$vatstatic = new Tva($db);
|
$vatstatic = new Tva($db);
|
||||||
$donationstatic = new Don($db);
|
$donationstatic = new Don($db);
|
||||||
|
$loanstatic = new Loan($db);
|
||||||
$salarystatic = new PaymentSalary($db);
|
$salarystatic = new PaymentSalary($db);
|
||||||
$variousstatic = new PaymentVarious($db);
|
$variousstatic = new PaymentVarious($db);
|
||||||
|
|
||||||
@ -1119,6 +1135,9 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
if ($ref == '(ExpenseReportPayment)') {
|
if ($ref == '(ExpenseReportPayment)') {
|
||||||
$ref = $langs->trans('Employee');
|
$ref = $langs->trans('Employee');
|
||||||
}
|
}
|
||||||
|
if ($ref == '(LoanPayment)') {
|
||||||
|
$ref = $langs->trans('Loan');
|
||||||
|
}
|
||||||
if ($ref == '(payment_salary)') {
|
if ($ref == '(payment_salary)') {
|
||||||
$ref = $langs->trans('Employee');
|
$ref = $langs->trans('Employee');
|
||||||
}
|
}
|
||||||
@ -1173,6 +1192,13 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
|
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
|
||||||
$ref = $langs->trans("Donation");
|
$ref = $langs->trans("Donation");
|
||||||
}
|
}
|
||||||
|
elseif ($typerecord == 'payment_loan')
|
||||||
|
{
|
||||||
|
$sqlmid = 'SELECT l.rowid as ref';
|
||||||
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l";
|
||||||
|
$sqlmid .= " WHERE l.rowid=" . $val["paymentloanid"];
|
||||||
|
$ref = $langs->trans("LoanPayment");
|
||||||
|
}
|
||||||
elseif ($typerecord == 'payment_various')
|
elseif ($typerecord == 'payment_various')
|
||||||
{
|
{
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user