Fix closing }

This commit is contained in:
Laurent Destailleur 2017-06-27 17:52:50 +02:00
parent aa2ea621c3
commit 9c64ba6ad6

View File

@ -484,9 +484,10 @@ if (! $error && $action == 'writebookkeeping') {
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) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
$bookkeeping->label_compte = $objmid->labelc; $bookkeeping->label_compte = $objmid->labelc;
$bookkeeping->doc_ref = $objmid->libelle ; $bookkeeping->doc_ref = $objmid->libelle ;
}
$bookkeeping->subledger_account = ''; $bookkeeping->subledger_account = '';
$bookkeeping->numero_compte = $k; $bookkeeping->numero_compte = $k;
} else if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice } else if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
@ -619,101 +620,101 @@ if ($action == 'export_csv') {
$companystatic = new Client($db); $companystatic = new Client($db);
$userstatic = new User($db); $userstatic = new User($db);
// Bank // Bank
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');
$reflabel = $val["ref"]; $reflabel = $val["ref"];
if ($reflabel == '(SupplierInvoicePayment)') { if ($reflabel == '(SupplierInvoicePayment)') {
$reflabel = $langs->trans('Supplier'); $reflabel = $langs->trans('Supplier');
} }
if ($reflabel == '(CustomerInvoicePayment)') { if ($reflabel == '(CustomerInvoicePayment)') {
$reflabel = $langs->trans('Customer'); $reflabel = $langs->trans('Customer');
} }
if ($reflabel == '(SocialContributionPayment)') { if ($reflabel == '(SocialContributionPayment)') {
$reflabel = $langs->trans('SocialContribution'); $reflabel = $langs->trans('SocialContribution');
} }
if ($reflabel == '(DonationPayment)') { if ($reflabel == '(DonationPayment)') {
$reflabel = $langs->trans('Donation'); $reflabel = $langs->trans('Donation');
} }
if ($reflabel == '(SubscriptionPayment)') { if ($reflabel == '(SubscriptionPayment)') {
$reflabel = $langs->trans('Subscription'); $reflabel = $langs->trans('Subscription');
} }
if ($reflabel == '(ExpenseReportPayment)') { if ($reflabel == '(ExpenseReportPayment)') {
$reflabel = $langs->trans('Employee'); $reflabel = $langs->trans('Employee');
} }
$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 '"' . $journal . '"' . $sep; print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep; print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print " " . $sep; print " " . $sep;
if ($companystatic->name == '') { if ($companystatic->name == '') {
print '"' . $langs->trans('Bank') . " - " . utf8_decode($reflabel) . '"' . $sep; print '"' . $langs->trans('Bank') . " - " . utf8_decode($reflabel) . '"' . $sep;
} else {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
}
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
}
// Third party
if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) {
print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
if ($tabtype[$key] == 'payment_supplier') {
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
} else if($tabtype[$key] == 'payment') {
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
} else {
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
}
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
if ($companystatic->name == '') {
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($reflabel) . '"' . $sep;
} else {
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($companystatic->name) . '"' . $sep;
}
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n";
}
}
} else { } else {
foreach ( $tabbq[$key] as $k => $mt ) { print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
}
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
}
// Third party
if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) {
print '"' . $journal . '"' . $sep; print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep; print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
print " " . $sep; if ($tabtype[$key] == 'payment_supplier') {
if ($companystatic->name == '') { print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($reflabel) . '"' . $sep; } else if($tabtype[$key] == 'payment') {
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
} else { } else {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
}
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
if ($companystatic->name == '') {
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($reflabel) . '"' . $sep;
} else {
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($companystatic->name) . '"' . $sep;
} }
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'; print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n"; print "\n";
} }
} }
} else {
foreach ( $tabbq[$key] as $k => $mt ) {
print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
print " " . $sep;
if ($companystatic->name == '') {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($reflabel) . '"' . $sep;
} else {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
}
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n";
}
} }
} }
}
/* /*