NEW: expense reports: conf to force amounts to be entered only including taxes

This commit is contained in:
Marc de Lima Lucio 2021-09-30 17:24:57 +02:00
parent 673a2982a5
commit d3e90e8f76
3 changed files with 14 additions and 3 deletions

View File

@ -145,7 +145,10 @@ if ($action == 'updateMask') {
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
if (!$res1 > 0 || !$res2 > 0) {
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
if (!$res1 > 0 || !$res2 > 0 || !$res3 > 0) {
$error++;
}
@ -458,6 +461,11 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
print '<tr class="oddeven"><td>';
print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
print '</td><td class="right">';
print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1);
print '</td></tr>';
print '</table>';
print $form->buttonsSaveCancel("Save", '');

View File

@ -1565,6 +1565,8 @@ if ($action == 'create') {
print '</form>';
} else {
$taxlessUnitPriceDisabled = ! empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : '';
print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip');
// Clone confirmation
@ -2281,7 +2283,7 @@ if ($action == 'create') {
// Unit price
print '<td class="right">';
print '<input type="text" min="0" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag(price2num($line->value_unit_ht)).'" />';
print '<input type="text" min="0" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag(price2num($line->value_unit_ht)).'"'.$taxlessUnitPriceDisabled.' />';
print '</td>';
// Unit price with tax
@ -2460,7 +2462,7 @@ if ($action == 'create') {
// Unit price net
print '<td class="right">';
print '<input type="text" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag($value_unit_ht).'">';
print '<input type="text" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag($value_unit_ht).'"'.$taxlessUnitPriceDisabled.' />';
print '</td>';
// Unit price with tax

View File

@ -517,6 +517,7 @@ Field=Field
ProductDocumentTemplates=Document templates to generate product document
FreeLegalTextOnExpenseReports=Free legal text on expense reports
WatermarkOnDraftExpenseReports=Watermark on draft expense reports
ForceExpenseReportsLineAmountsIncludingTaxesOnly=Force expense report amounts to be input only including taxes
AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable)
FilesAttachedToEmail=Attach file
SendEmailsReminders=Send agenda reminders by emails