Fix accountancy

This commit is contained in:
Florian HENRY 2016-02-02 10:58:12 +01:00
parent 48b191b1ff
commit 564594c3d7
3 changed files with 27 additions and 20 deletions

View File

@ -413,8 +413,9 @@ if ($action == 'export_csv') {
$companystatic = new Client($db);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
// Model Cegid Expert Export
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2)
{
$sep = ";";
foreach ( $tabpay as $key => $val ) {
@ -473,9 +474,8 @@ if ($action == 'export_csv') {
}
}
}
}
} else // Model Classic Export
{
} else {
// Model Classic Export
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day');
@ -576,10 +576,12 @@ if ($action == 'export_csv') {
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day');
if ($val["lib"] == '(SupplierInvoicePayment)')
if ($val["lib"] == '(SupplierInvoicePayment)') {
$reflabel = $langs->trans('SupplierInvoicePayment');
if ($val["lib"] == '(CustomerInvoicePayment)')
}
if ($val["lib"] == '(CustomerInvoicePayment)') {
$reflabel = $langs->trans('CustomerInvoicePayment');
}
// Bank
foreach ( $tabbq[$key] as $k => $mt ) {

View File

@ -267,8 +267,9 @@ if ($action == 'export_csv') {
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
// Model Cegid Expert Export
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2)
{
$sep = ";";
foreach ( $tabfac as $key => $val ) {
@ -320,8 +321,8 @@ if ($action == 'export_csv') {
print "\n";
}
}
} else // Model Classic Export
{
} else {
// Model Classic Export
foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day');
@ -380,10 +381,12 @@ if ($action == 'export_csv') {
$exportlink = '';
$builddate = time();
$description = $langs->trans("DescPurchasesJournal") . '<br>';
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("DepositsAreNotIncluded");
else
} else {
$description .= $langs->trans("DepositsAreIncluded");
}
$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);
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
'action' => ''

View File

@ -287,14 +287,15 @@ if ($action == 'writebookkeeping') {
// Export
if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
$companystatic = new Client($db);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
// Model Cegid Expert Export
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2)
{
$sep = ";";
foreach ( $tabfac as $key => $val ) {
@ -318,14 +319,15 @@ if ($action == 'export_csv') {
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) {
$accountingaccount_static = new AccountingAccount($db);
if ($accountingaccount_static->fetch(null, $k)) {
print $date . $sep;
print $sell_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep;
print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print dol_trunc($val["description"], 32) . $sep;
print dol_trunc($accountingaccount_static->label, 32) . $sep;
print $val["ref"];
print "\n";
}
@ -346,8 +348,8 @@ if ($action == 'export_csv') {
}
}
}
} else // Model Classic Export
{
} else {
// Model Classic Export
foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];