FIX: Accountancy - Update Cogilog export
This commit is contained in:
parent
b58395883b
commit
0e3685a4ab
@ -611,6 +611,7 @@ class AccountancyExport
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : COGILOG
|
* Export format : COGILOG
|
||||||
|
* Last review for this format : 2022-07-12 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||||
*
|
*
|
||||||
* @param array $objectLines data
|
* @param array $objectLines data
|
||||||
* @param resource $exportFile [=null] File resource to export or print if null
|
* @param resource $exportFile [=null] File resource to export or print if null
|
||||||
@ -618,18 +619,39 @@ class AccountancyExport
|
|||||||
*/
|
*/
|
||||||
public function exportCogilog($objectLines, $exportFile = null)
|
public function exportCogilog($objectLines, $exportFile = null)
|
||||||
{
|
{
|
||||||
$separator = ";";
|
$separator = "\t";
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
$date_document = dol_print_date($line->doc_date, '%d%m%Y');
|
$date_document = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
|
|
||||||
|
$refInvoice = '';
|
||||||
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
|
// Customer invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
$invoice = new Facture($this->db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref;
|
||||||
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
|
// Supplier invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||||
|
$invoice = new FactureFournisseur($this->db);
|
||||||
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
|
$refInvoice = $invoice->ref_supplier;
|
||||||
|
}
|
||||||
|
|
||||||
$tab = array();
|
$tab = array();
|
||||||
|
|
||||||
$tab[] = $line->code_journal;
|
$tab[] = $line->code_journal;
|
||||||
$tab[] = $date_document;
|
$tab[] = $date_document;
|
||||||
$tab[] = $line->piece_num;
|
$tab[] = $refInvoice;
|
||||||
$tab[] = length_accountg($line->numero_compte);
|
if (empty($line->subledger_account)) {
|
||||||
|
$tab[] = length_accountg($line->numero_compte);
|
||||||
|
} else {
|
||||||
|
$tab[] = length_accounta($line->subledger_account);
|
||||||
|
}
|
||||||
$tab[] = "";
|
$tab[] = "";
|
||||||
$tab[] = $line->label_operation;
|
$tab[] = $line->label_operation;
|
||||||
$tab[] = $date_document;
|
$tab[] = $date_document;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user