From 578b63fea6ae48ee54c05168b767d4f009e06ce4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Nov 2022 05:16:18 +0100 Subject: [PATCH] NEW Accountancy - Add a graphic option to enable lettering function --- htdocs/accountancy/admin/index.php | 35 +++++++++++++++++++++++++++++ htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 36 insertions(+) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 8236b83eb3d..385c105451e 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -247,6 +247,20 @@ if ($action == 'setdisablebindingonexpensereports') { } } +if ($action == 'setenablelettering') { + $setenablelettering = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + /* * View @@ -466,6 +480,27 @@ print ''; print ''; +// Lettering params +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; +if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + print ''; +} else { + print ''; +} +print ''; + +print '
'.$langs->trans('Options').' '.$langs->trans('Lettering').'
'.$langs->trans("ACCOUNTING_ENABLE_LETTERING").''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
'; + print '
'; print ''; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 40482298e63..2582b6e3c90 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -335,6 +335,7 @@ NumberOfAccountancyMovements=Number of movements ACCOUNTING_DISABLE_BINDING_ON_SALES=Disable binding & transfer in accountancy on sales (customer invoices will not be taken into account in accounting) ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountancy on purchases (vendor invoices will not be taken into account in accounting) ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) +ACCOUNTING_ENABLE_LETTERING=Enable the lettering function in the accounting ## Export NotifiedExportDate=Flag exported lines as Exported (to modify a line, you will need to delete the whole transaction and re-transfert it into accounting)