Skip to content

Commit

Permalink
Merge pull request #13083 from atm-greg/FIX_bookkeeping_LD_Compta_Export
Browse files Browse the repository at this point in the history
fix missing fields in LD Compta Export
  • Loading branch information
eldy committed Feb 12, 2020
2 parents 3a9125b + fc170c1 commit ccb895e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
31 changes: 15 additions & 16 deletions htdocs/accountancy/class/accountancyexport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ public function exportLDCompta($objectLines)
foreach ($objectLines as $line) {
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_lim_reglement = dol_print_date($line->date_lim_reglement, '%Y%m%d');

// TYPE
$type_enregistrement = 'E'; // For write movement
Expand All @@ -951,7 +952,7 @@ public function exportLDCompta($objectLines)
// LIBE
print $line->label_operation.$separator;
// DATH
print $line->date_lim_reglement.$separator;
print $date_lim_reglement.$separator;
// CNPI
if ($line->doc_type == 'supplier_invoice') {
if ($line->montant < 0) {
Expand All @@ -970,21 +971,19 @@ public function exportLDCompta($objectLines)
}
print $nature_piece.$separator;
// RACI
/*
if (! empty($line->subledger_account)) {
if ($line->doc_type == 'supplier_invoice') {
$racine_subledger_account = '40';
} elseif ($line->doc_type == 'customer_invoice') {
$racine_subledger_account = '41';
} else {
$nature_piece = '';
}
print $racine_subledger_account . $separator;
} else {
print $separator;
}
*/
print $separator; // deprecated CPTG & CPTA use instead
// if (! empty($line->subledger_account)) {
// if ($line->doc_type == 'supplier_invoice') {
// $racine_subledger_account = '40';
// } elseif ($line->doc_type == 'customer_invoice') {
// $racine_subledger_account = '41';
// } else {
// $racine_subledger_account = '';
// }
// } else {
$racine_subledger_account = ''; // for records of type E leave this field blank
// }

print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead
// MONT
print price(abs($line->montant), 0, '', 1, 2).$separator;
// CODC
Expand Down
4 changes: 4 additions & 0 deletions htdocs/accountancy/class/bookkeeping.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$sql .= " t.debit,";
$sql .= " t.credit,";
$sql .= " t.lettering_code,";
$sql .= " t.date_lettering,";
$sql .= " t.montant,";
$sql .= " t.sens,";
$sql .= " t.fk_user_author,";
Expand All @@ -934,6 +935,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.date_lim_reglement,";
$sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
Expand Down Expand Up @@ -1006,12 +1008,14 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$line->montant = $obj->montant;
$line->sens = $obj->sens;
$line->lettering_code = $obj->lettering_code;
$line->date_lettering = $obj->date_lettering;
$line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal;
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num;
$line->date_creation = $this->db->jdate($obj->date_creation);
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
$line->date_modification = $this->db->jdate($obj->date_modification);
$line->date_export = $this->db->jdate($obj->date_export);

Expand Down

0 comments on commit ccb895e

Please sign in to comment.