Add some information in bank_journal
This commit is contained in:
parent
7d2d818679
commit
d1e1d64b42
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -24,9 +24,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with bank journal
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
@ -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 . '/compta/bank/class/paymentvarious.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
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
@ -143,6 +145,7 @@ $paymentvatstatic = new TVA($db);
|
||||
$paymentsalstatic = new PaymentSalary($db);
|
||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||
$paymentvariousstatic = new PaymentVarious($db);
|
||||
$paymentloanstatic = new PaymentLoan($db);
|
||||
|
||||
// Get code of finance journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
@ -254,7 +257,7 @@ if ($result) {
|
||||
// Now loop on each link of record in bank.
|
||||
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
|
||||
|
||||
@ -358,6 +361,13 @@ if ($result) {
|
||||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||
$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') {
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
|
||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||
@ -548,6 +558,11 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$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') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
@ -713,8 +728,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"' . $langs->trans("LedgerAccount") . '"' . $sep;
|
||||
print '"' . $langs->trans("SubledgerAccount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Label"). '"' . $sep;
|
||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Debit") . '"' . $sep;
|
||||
print '"' . $langs->trans("Credit") . '"' . $sep;
|
||||
print '"' . $langs->trans("Journal") . '"' . $sep;
|
||||
print '"' . $langs->trans("Note") . '"' . $sep;
|
||||
print "\n";
|
||||
@ -822,6 +837,7 @@ if (empty($action) || $action == 'view') {
|
||||
$expensereportstatic = new ExpenseReport($db);
|
||||
$vatstatic = new Tva($db);
|
||||
$donationstatic = new Don($db);
|
||||
$loanstatic = new Loan($db);
|
||||
$salarystatic = new PaymentSalary($db);
|
||||
$variousstatic = new PaymentVarious($db);
|
||||
|
||||
@ -893,7 +909,7 @@ if (empty($action) || $action == 'view') {
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td></td>";
|
||||
@ -1119,6 +1135,9 @@ function getSourceDocRef($val, $typerecord)
|
||||
if ($ref == '(ExpenseReportPayment)') {
|
||||
$ref = $langs->trans('Employee');
|
||||
}
|
||||
if ($ref == '(LoanPayment)') {
|
||||
$ref = $langs->trans('Loan');
|
||||
}
|
||||
if ($ref == '(payment_salary)') {
|
||||
$ref = $langs->trans('Employee');
|
||||
}
|
||||
@ -1173,6 +1192,13 @@ function getSourceDocRef($val, $typerecord)
|
||||
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
|
||||
$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')
|
||||
{
|
||||
$sqlmid = 'SELECT v.rowid as ref';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user