Update Cogilog Export
This commit is contained in:
parent
f94d2c2ece
commit
c22d5d076e
@ -612,33 +612,43 @@ class AccountancyExport
|
|||||||
/**
|
/**
|
||||||
* Export format : COGILOG
|
* Export format : COGILOG
|
||||||
*
|
*
|
||||||
* @param array $objectLines data
|
* @param array $objectLines data
|
||||||
* @return void
|
* @param resource $exportFile [=null] File resource to export or print if null
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportCogilog($objectLines)
|
public function exportCogilog($objectLines, $exportFile = null)
|
||||||
{
|
{
|
||||||
foreach ($objectLines as $line) {
|
$separator = ";";
|
||||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
$end_line = "\n";
|
||||||
$separator = ";";
|
|
||||||
$end_line = "\n";
|
|
||||||
|
|
||||||
print $line->code_journal.$separator;
|
foreach ($objectLines as $line) {
|
||||||
print $date.$separator;
|
$date_document = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
print $line->piece_num.$separator;
|
|
||||||
print length_accountg($line->numero_compte).$separator;
|
$tab = array();
|
||||||
print $separator;
|
|
||||||
print $line->label_operation.$separator;
|
$tab[] = $line->code_journal;
|
||||||
print $date.$separator;
|
$tab[] = $date_document;
|
||||||
|
$tab[] = $line->piece_num;
|
||||||
|
$tab[] = length_accountg($line->numero_compte);
|
||||||
|
$tab[] = "";
|
||||||
|
$tab[] = $line->label_operation;
|
||||||
|
$tab[] = $date_document;
|
||||||
if ($line->sens == 'D') {
|
if ($line->sens == 'D') {
|
||||||
print price($line->debit).$separator;
|
$tab[] = price($line->debit);
|
||||||
print $separator;
|
$tab[] = "";
|
||||||
} elseif ($line->sens == 'C') {
|
} elseif ($line->sens == 'C') {
|
||||||
print $separator;
|
$tab[] = "";
|
||||||
print price($line->credit).$separator;
|
$tab[] = price($line->credit);
|
||||||
|
}
|
||||||
|
$tab[] = $line->doc_ref;
|
||||||
|
$tab[] = $line->label_operation;
|
||||||
|
|
||||||
|
$output = implode($separator, $tab).$end_line;
|
||||||
|
if ($exportFile) {
|
||||||
|
fwrite($exportFile, $output);
|
||||||
|
} else {
|
||||||
|
print $output;
|
||||||
}
|
}
|
||||||
print $line->doc_ref.$separator;
|
|
||||||
print $line->label_operation.$separator;
|
|
||||||
print $end_line;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user