Merge pull request #15819 from aspangaro/14a6
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
This commit is contained in:
commit
9ab67bf728
@ -467,7 +467,7 @@ if (!empty($sortfield)) {
|
||||
|
||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||
// Must be after definition of $sql
|
||||
if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
|
||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
|
||||
|
||||
@ -495,6 +495,7 @@ if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " SET date_export = '".$db->idate($now)."'";
|
||||
$sql .= " , date_validated = '".$db->idate($now)."'";
|
||||
$sql .= " WHERE rowid = ".$movement->id;
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||
@ -566,7 +567,25 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
if ($action == 'export_file') {
|
||||
$form_question = array();
|
||||
|
||||
$form_question['notifiedexportdate'] = array(
|
||||
'name' => 'notifiedexportdate',
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedExportDate'),
|
||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'),
|
||||
);
|
||||
$form_question['notifiedvalidationdate'] = array(
|
||||
'name' => 'notifiedvalidationdate',
|
||||
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
|
||||
'label' => $langs->trans('NotifiedValidationDate'),
|
||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
}
|
||||
if ($action == 'delmouv') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
||||
print $formconfirm;
|
||||
|
||||
@ -840,17 +840,19 @@ class AccountancyExport
|
||||
print "DateLet".$separator;
|
||||
print "ValidDate".$separator;
|
||||
print "Montantdevise".$separator;
|
||||
print "Idevise";
|
||||
print "Idevise".$separator;
|
||||
print "DateLimitReglmt";
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
unset($array[$line]);
|
||||
} else {
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
@ -865,13 +867,13 @@ class AccountancyExport
|
||||
print $date_document.$separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte.$separator;
|
||||
print length_accountg($line->numero_compte).$separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte).$separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account.$separator;
|
||||
print length_accounta($line->subledger_account).$separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label).$separator;
|
||||
@ -880,7 +882,7 @@ class AccountancyExport
|
||||
print $line->doc_ref.$separator;
|
||||
|
||||
// FEC:PieceDate
|
||||
print dol_string_unaccent($date_creation).$separator;
|
||||
print $date_creation.$separator;
|
||||
|
||||
// FEC:EcritureLib
|
||||
print dol_string_unaccent($line->label_operation).$separator;
|
||||
@ -904,7 +906,10 @@ class AccountancyExport
|
||||
print $line->multicurrency_amount.$separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
print $line->multicurrency_code.$separator;
|
||||
|
||||
// FEC_suppl:DateLimitReglmt
|
||||
print $date_limit_payment;
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
@ -939,7 +944,8 @@ class AccountancyExport
|
||||
print "DateLet".$separator;
|
||||
print "ValidDate".$separator;
|
||||
print "Montantdevise".$separator;
|
||||
print "Idevise";
|
||||
print "Idevise".$separator;
|
||||
print "DateLimitReglmt";
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
@ -950,6 +956,7 @@ class AccountancyExport
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal . $separator;
|
||||
@ -964,13 +971,13 @@ class AccountancyExport
|
||||
print $date_creation . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte . $separator;
|
||||
print length_accountg($line->numero_compte) . $separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account . $separator;
|
||||
print length_accounta($line->subledger_account) . $separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label) . $separator;
|
||||
@ -1003,7 +1010,10 @@ class AccountancyExport
|
||||
print $line->multicurrency_amount . $separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
print $line->multicurrency_code . $separator;
|
||||
|
||||
// FEC_suppl:DateLimitReglmt
|
||||
print $date_limit_payment;
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ CREATE TABLE llx_accounting_bookkeeping
|
||||
multicurrency_code varchar(255), -- FEC:Idevise
|
||||
lettering_code varchar(255), -- FEC:EcritureLet
|
||||
date_lettering datetime, -- FEC:DateLet
|
||||
date_lim_reglement datetime DEFAULT NULL, -- | date limite de reglement
|
||||
date_lim_reglement datetime DEFAULT NULL, -- FEC_suppl:DateLimitReglmt | payment deadline
|
||||
fk_user_author integer NOT NULL, -- | user creating
|
||||
fk_user_modif integer, -- | user making last change
|
||||
date_creation datetime, -- FEC:EcritureDate | creation date
|
||||
|
||||
Loading…
Reference in New Issue
Block a user