diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 4efc95061d4..4b24c5617df 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -110,7 +110,12 @@ if ($action == 'update') { setEventMessages($langs->trans("Error"), null, 'errors'); } } - +// Set boolean (on/off) constants +elseif (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) { + if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) { + dol_print_error($db); + } +} /* @@ -248,11 +253,26 @@ print "
\n"; print '
'; print ''; +print '

'; print '
'; print ''; +// Options +echo '
'; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; + +$key = 'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT'; +echo ''; + +echo ''; +echo '
' . $langs->trans('Parameter') . '' . $langs->trans('Value') . '
', $langs->trans($key), '', ajax_constantonoff($key), '
'; +echo '
'; if (!empty($conf->accounting->enabled)) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index a961d4f1994..360340d84f6 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -43,7 +43,11 @@ $id = GETPOST("id", 'int'); $action = GETPOST("action", "alpha"); $confirm = GETPOST('confirm'); $refund = GETPOST("refund", "int"); -$auto_create_payment = GETPOST("auto_create_paiement", "int"); +if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { + $auto_create_payment = GETPOST("auto_create_paiement", "int"); +} else { + $auto_create_payment = empty($conf->global->CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT); +} if (empty($refund)) $refund = 0; @@ -377,17 +381,10 @@ if ($action == 'create') if (!empty($conf->use_javascript_ajax)) { print "\n".''."\n"; } @@ -475,7 +472,7 @@ if ($action == 'create') // Auto create payment print ''.$langs->trans('AutomaticCreationPayment').''; - print ''."\n"; + print ''."\n"; // Number print ''.$langs->trans('Numero'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 641cb8fb0af..f70f2a54758 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1742,6 +1742,7 @@ YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Se AccountancyCode=Accounting Code AccountancyCodeSell=Sale account. code AccountancyCodeBuy=Purchase account. code +CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=By default, leave the checkbox “Automatically create a total payment” empty when creating a new tax object ##### Agenda ##### AgendaSetup=Events and agenda module setup PasswordTogetVCalExport=Key to authorize export link