Spaces !!!
This commit is contained in:
parent
ba6dadb6fa
commit
0136a1742e
@ -23,9 +23,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/journal/bankjournal.php
|
* \file htdocs/accountancy/journal/bankjournal.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Advanced accountancy
|
||||||
* \brief Page with bank journal
|
* \brief Page with bank journal
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ $now = dol_now();
|
|||||||
if ($user->societe_id > 0 && empty($id_bank_account))
|
if ($user->societe_id > 0 && empty($id_bank_account))
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = strftime("%Y", dol_now());
|
||||||
@ -127,7 +127,7 @@ $journal = $bank_code_journal->accountancy_journal;
|
|||||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
// Variables
|
// Variables
|
||||||
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
|
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
|
||||||
@ -135,22 +135,22 @@ if ($result) {
|
|||||||
$accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
|
$accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
|
||||||
$accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
|
$accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
|
||||||
$tabpay = array ();
|
$tabpay = array ();
|
||||||
$tabbq = array ();
|
$tabbq = array ();
|
||||||
$tabtp = array ();
|
$tabtp = array ();
|
||||||
$tabtype = array ();
|
$tabtype = array ();
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ( $i < $num ) {
|
while ( $i < $num ) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
$tabcompany[$obj->rowid] = array (
|
$tabcompany[$obj->rowid] = array (
|
||||||
'id' => $obj->socid,
|
'id' => $obj->socid,
|
||||||
'name' => $obj->name,
|
'name' => $obj->name,
|
||||||
'code_client' => $obj->code_compta
|
'code_client' => $obj->code_compta
|
||||||
);
|
);
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
$compta_bank = $obj->account_number;
|
$compta_bank = $obj->account_number;
|
||||||
if ($obj->label == '(SupplierInvoicePayment)')
|
if ($obj->label == '(SupplierInvoicePayment)')
|
||||||
@ -159,8 +159,8 @@ if ($result) {
|
|||||||
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
|
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
|
||||||
if ($obj->typeop == '(BankTransfert)')
|
if ($obj->typeop == '(BankTransfert)')
|
||||||
$compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
|
$compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
|
||||||
|
|
||||||
// Variable bookkeeping
|
// Variable bookkeeping
|
||||||
$tabpay[$obj->rowid]["date"] = $obj->do;
|
$tabpay[$obj->rowid]["date"] = $obj->do;
|
||||||
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type;
|
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type;
|
||||||
$tabpay[$obj->rowid]["ref"] = $obj->label;
|
$tabpay[$obj->rowid]["ref"] = $obj->label;
|
||||||
@ -171,12 +171,12 @@ if ($result) {
|
|||||||
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
||||||
}
|
}
|
||||||
$links = $object->get_url($obj->rowid);
|
$links = $object->get_url($obj->rowid);
|
||||||
|
|
||||||
// get_url may return -1 which is not traversable
|
// get_url may return -1 which is not traversable
|
||||||
if (is_array($links)) {
|
if (is_array($links)) {
|
||||||
foreach ( $links as $key => $val ) {
|
foreach ( $links as $key => $val ) {
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||||
|
|
||||||
if ($links[$key]['type'] == 'payment') {
|
if ($links[$key]['type'] == 'payment') {
|
||||||
$paymentstatic->id = $links[$key]['url_id'];
|
$paymentstatic->id = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
||||||
@ -197,7 +197,7 @@ if ($result) {
|
|||||||
} else if ($links[$key]['type'] == 'sc') {
|
} else if ($links[$key]['type'] == 'sc') {
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
if ($reg[1] == 'socialcontribution')
|
if ($reg[1] == 'socialcontribution')
|
||||||
@ -208,14 +208,14 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
$chargestatic->ref = $chargestatic->lib;
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
|
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
if ($resultmid) {
|
if ($resultmid) {
|
||||||
@ -247,9 +247,9 @@ if ($result) {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
||||||
|
|
||||||
// if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
// if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
|
|
||||||
$i ++;
|
$i ++;
|
||||||
@ -265,7 +265,7 @@ if ($result) {
|
|||||||
// Write bookkeeping
|
// Write bookkeeping
|
||||||
if ($action == 'writebookkeeping') {
|
if ($action == 'writebookkeeping') {
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
// Bank
|
// Bank
|
||||||
@ -286,9 +286,9 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->code_journal = $journal;
|
$bookkeeping->code_journal = $journal;
|
||||||
$bookkeeping->fk_user_author = $user->id;
|
$bookkeeping->fk_user_author = $user->id;
|
||||||
$bookkeeping->date_create = $now;
|
$bookkeeping->date_create = $now;
|
||||||
|
|
||||||
if ($tabtype[$key] == 'payment') {
|
if ($tabtype[$key] == 'payment') {
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
$sqlmid = 'SELECT fac.facnumber';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||||
@ -301,7 +301,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
$bookkeeping->doc_ref = $objmid->facnumber;
|
||||||
}
|
}
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||||
|
|
||||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||||
@ -315,7 +315,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -338,12 +338,12 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->code_journal = $journal;
|
$bookkeeping->code_journal = $journal;
|
||||||
$bookkeeping->fk_user_author = $user->id;
|
$bookkeeping->fk_user_author = $user->id;
|
||||||
$bookkeeping->date_create = $now;
|
$bookkeeping->date_create = $now;
|
||||||
|
|
||||||
if ($tabtype[$key] == 'sc') {
|
if ($tabtype[$key] == 'sc') {
|
||||||
$bookkeeping->code_tiers = '';
|
$bookkeeping->code_tiers = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
} else if ($tabtype[$key] == 'payment') {
|
} else if ($tabtype[$key] == 'payment') {
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
$sqlmid = 'SELECT fac.facnumber';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||||
@ -358,7 +358,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->code_tiers = $k;
|
$bookkeeping->code_tiers = $k;
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||||
|
|
||||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||||
@ -373,7 +373,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->code_tiers = $k;
|
$bookkeeping->code_tiers = $k;
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
} else if ($tabtype[$key] == 'company') {
|
} else if ($tabtype[$key] == 'company') {
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
$sqlmid = 'SELECT fac.facnumber';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||||
@ -392,7 +392,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->doc_ref = $k;
|
$bookkeeping->doc_ref = $k;
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -400,7 +400,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
@ -408,25 +408,25 @@ if ($action == 'writebookkeeping') {
|
|||||||
// Export
|
// Export
|
||||||
if ($action == 'export_csv') {
|
if ($action == 'export_csv') {
|
||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
$companystatic = new Client($db);
|
$companystatic = new Client($db);
|
||||||
|
|
||||||
// Model Cegid Expert Export
|
// Model Cegid Expert Export
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2)
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2)
|
||||||
{
|
{
|
||||||
$sep = ";";
|
$sep = ";";
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
|
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||||
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print $date . $sep;
|
print $date . $sep;
|
||||||
@ -439,7 +439,7 @@ if ($action == 'export_csv') {
|
|||||||
print $val["ref"] . $sep;
|
print $val["ref"] . $sep;
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
@ -477,10 +477,10 @@ if ($action == 'export_csv') {
|
|||||||
// Model Classic Export
|
// Model Classic Export
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print '"' . $date . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
@ -491,7 +491,7 @@ if ($action == 'export_csv') {
|
|||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
@ -520,23 +520,23 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("FinanceJournal"));
|
llxHeader('', $langs->trans("FinanceJournal"));
|
||||||
|
|
||||||
$nom = $langs->trans("FinanceJournal") . ' - ' . $journal;
|
$nom = $langs->trans("FinanceJournal") . ' - ' . $journal;
|
||||||
$builddate = time();
|
$builddate = time();
|
||||||
$description = $langs->trans("DescFinanceJournal") . '<br>';
|
$description = $langs->trans("DescFinanceJournal") . '<br>';
|
||||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||||
|
|
||||||
$varlink = 'id_account=' . $id_bank_account;
|
$varlink = 'id_account=' . $id_bank_account;
|
||||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
||||||
'action' => ''
|
'action' => ''
|
||||||
), '', $varlink);
|
), '', $varlink);
|
||||||
|
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
|
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function launch_export() {
|
function launch_export() {
|
||||||
@ -550,12 +550,12 @@ if ($action == 'export_csv') {
|
|||||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||||
}
|
}
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show result array
|
* Show result array
|
||||||
*/
|
*/
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
@ -566,10 +566,10 @@ if ($action == 'export_csv') {
|
|||||||
print "<td>" . $langs->trans("PaymentMode") . "</td>";
|
print "<td>" . $langs->trans("PaymentMode") . "</td>";
|
||||||
print "<td align='right'>" . $langs->trans("Debit") . "</td><td align='right'>" . $langs->trans("Credit") . "</td>";
|
print "<td align='right'>" . $langs->trans("Debit") . "</td><td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
$r = '';
|
$r = '';
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
@ -579,8 +579,8 @@ if ($action == 'export_csv') {
|
|||||||
if ($val["lib"] == '(CustomerInvoicePayment)') {
|
if ($val["lib"] == '(CustomerInvoicePayment)') {
|
||||||
$reflabel = $langs->trans('CustomerInvoicePayment');
|
$reflabel = $langs->trans('CustomerInvoicePayment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<tr " . $bc[$var] . ">";
|
||||||
print "<td>" . $date . "</td>";
|
print "<td>" . $date . "</td>";
|
||||||
@ -592,7 +592,7 @@ if ($action == 'export_csv') {
|
|||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
@ -623,9 +623,9 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
}
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user