FIX show export full documents checkbox on change format in accountancy export (#37468)

* FIX show export full documents checkbox on change format in accountancy export

* FIX remove unused var
This commit is contained in:
lvessiller-opendsi 2026-03-12 13:46:23 +01:00 committed by GitHub
parent 3016301ae8
commit ea60298eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -764,16 +764,35 @@ if ($action == 'export_file') {
}
// add documents in an archive for accountancy export (Quadratus)
if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) {
$form_question['notifiedexportfull'] = array(
'name' => 'notifiedexportfull',
'type' => 'checkbox',
'label' => $langs->trans('NotifiedExportFull'),
'value' => 'false',
);
}
$exportTypesWithDocs = array(
AccountancyExport::$EXPORT_TYPE_QUADRATUS,
);
$form_question['notifiedexportfull'] = array(
'name' => 'notifiedexportfull',
'type' => 'checkbox',
'label' => $langs->trans('NotifiedExportFull'),
'value' => 'false',
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600);
$formconfirm .= '<script>
jQuery(document).ready(function() {
const exportTypesWithDocs = ['.implode(',', $exportTypesWithDocs).'];
const $formatExport = jQuery("#formatexport");
function toggleExportFull() {
const $checkbox = jQuery("#notifiedexportfull");
const show = exportTypesWithDocs.indexOf(parseInt($formatExport.val())) !== -1;
$checkbox.closest(".tagtr").toggle(show);
if (!show) {
$checkbox.prop("checked", false); // remove checked if hidden
}
}
$formatExport.on("change", toggleExportFull);
toggleExportFull();
});
</script>';
}
// Print form confirm