Update Agiris Export
This commit is contained in:
parent
7ab189b054
commit
211635ada9
@ -1121,7 +1121,7 @@ class AccountancyExport
|
|||||||
$tab[] = $date_document;
|
$tab[] = $date_document;
|
||||||
//print 'EUR';
|
//print 'EUR';
|
||||||
|
|
||||||
$output = implode($tab).$end_line;
|
$output = implode($separator, $tab).$end_line;
|
||||||
if ($exportFile) {
|
if ($exportFile) {
|
||||||
fwrite($exportFile, $output);
|
fwrite($exportFile, $output);
|
||||||
} else {
|
} else {
|
||||||
@ -1134,39 +1134,47 @@ class AccountancyExport
|
|||||||
/**
|
/**
|
||||||
* Export format : Agiris Isacompta
|
* Export format : Agiris Isacompta
|
||||||
*
|
*
|
||||||
* @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 exportAgiris($objectLines)
|
public function exportAgiris($objectLines, $exportFile = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$separator = ';';
|
$separator = ';';
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
$date_document = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
|
|
||||||
print $line->piece_num.$separator;
|
$tab = array();
|
||||||
print self::toAnsi($line->label_operation).$separator;
|
|
||||||
print $date.$separator;
|
$tab[] = $line->piece_num;
|
||||||
print self::toAnsi($line->label_operation).$separator;
|
$tab[] = self::toAnsi($line->label_operation);
|
||||||
|
$tab[] = $date_document;
|
||||||
|
$tab[] = self::toAnsi($line->label_operation);
|
||||||
|
|
||||||
if (empty($line->subledger_account)) {
|
if (empty($line->subledger_account)) {
|
||||||
print length_accountg($line->numero_compte).$separator;
|
$tab[] = length_accountg($line->numero_compte);
|
||||||
print self::toAnsi($line->label_compte).$separator;
|
$tab[] = self::toAnsi($line->label_compte);
|
||||||
} else {
|
} else {
|
||||||
print length_accounta($line->subledger_account).$separator;
|
$tab[] = length_accounta($line->subledger_account);
|
||||||
print self::toAnsi($line->subledger_label).$separator;
|
$tab[] = self::toAnsi($line->subledger_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
print self::toAnsi($line->doc_ref).$separator;
|
$tab[] = self::toAnsi($line->doc_ref);
|
||||||
print price($line->debit).$separator;
|
$tab[] = price($line->debit);
|
||||||
print price($line->credit).$separator;
|
$tab[] = price($line->credit);
|
||||||
print price(abs($line->debit - $line->credit)).$separator;
|
$tab[] = price(abs($line->debit - $line->credit));
|
||||||
print $line->sens.$separator;
|
$tab[] = $line->sens;
|
||||||
print $line->lettering_code.$separator;
|
$tab[] = $line->lettering_code;
|
||||||
print $line->code_journal;
|
$tab[] = $line->code_journal;
|
||||||
print $end_line;
|
|
||||||
|
$output = implode($separator, $tab).$end_line;
|
||||||
|
if ($exportFile) {
|
||||||
|
fwrite($exportFile, $output);
|
||||||
|
} else {
|
||||||
|
print $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user