FIX Accountancy - Review of Winfic - eWinfic - Winsis compta export format
This commit is contained in:
parent
f45f3740e2
commit
4bd9bdaccd
@ -657,7 +657,7 @@ class AccountancyExport
|
||||
|
||||
/**
|
||||
* Export format : WinFic - eWinfic - WinSis Compta
|
||||
* Last review for this format : 2022-10-28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
* Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf
|
||||
*
|
||||
@ -670,10 +670,14 @@ class AccountancyExport
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
$index = 1;
|
||||
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
|
||||
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account)) {
|
||||
@ -691,11 +695,11 @@ class AccountancyExport
|
||||
|
||||
$Tab['folio'] = ' 1';
|
||||
|
||||
$Tab['num_ecriture'] = str_pad(dol_trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_ecriture'] = str_pad(dol_trunc($index, 6), 6, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
|
||||
|
||||
$Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6), 6, '0');
|
||||
$Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0');
|
||||
|
||||
if ($data->sens == 'D') {
|
||||
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
@ -707,11 +711,11 @@ class AccountancyExport
|
||||
$Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
|
||||
$Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30);
|
||||
|
||||
$Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left'), 2);
|
||||
|
||||
$Tab['code_piece'] = str_repeat(' ', 5);
|
||||
$Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5), 5, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
@ -735,6 +739,8 @@ class AccountancyExport
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
print implode('|', $Tab);
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user