Merge pull request #22761 from aspangaro/17b12

NEW Accountancy - Add a graphic option to enable lettering function - FPC21
This commit is contained in:
Laurent Destailleur 2022-11-09 18:51:06 +01:00 committed by GitHub
commit 125af0867b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -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 '</tr>';
print '</table>';
// Lettering params
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans('Options').' '.$langs->trans('Lettering').'</td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_LETTERING").'</td>';
if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '</table>';
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '</form>';

View File

@ -336,6 +336,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
NotExportLettering=Do not export the lettering when generating the file