Merge branch 'NEW/12.0_new_payments_on_vat' of github.com:ATM-Consulting/dolibarr into NEW/14.0_new_payments_on_vat_default_checkbox_value
This commit is contained in:
commit
186dcab1b7
@ -110,7 +110,12 @@ if ($action == 'update') {
|
|||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
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 "<br>\n";
|
|||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
|
||||||
|
print '<br/><br/>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// Options
|
||||||
|
|
||||||
|
echo '<div>';
|
||||||
|
echo '<table class="noborder centpercent">';
|
||||||
|
echo '<thead>';
|
||||||
|
echo '<tr class="liste_titre"><th>' . $langs->trans('Parameter') . '</th><th>' . $langs->trans('Value') . '</th></tr>';
|
||||||
|
echo '</thead>';
|
||||||
|
echo '<tbody>';
|
||||||
|
|
||||||
|
$key = 'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
|
||||||
|
echo '<tr><td>', $langs->trans($key), '</td><td>', ajax_constantonoff($key), '</td></tr>';
|
||||||
|
|
||||||
|
echo '</tbody>';
|
||||||
|
echo '</table>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
|
||||||
if (!empty($conf->accounting->enabled))
|
if (!empty($conf->accounting->enabled))
|
||||||
|
|||||||
@ -43,7 +43,11 @@ $id = GETPOST("id", 'int');
|
|||||||
$action = GETPOST("action", "alpha");
|
$action = GETPOST("action", "alpha");
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
$refund = GETPOST("refund", "int");
|
$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;
|
if (empty($refund)) $refund = 0;
|
||||||
|
|
||||||
@ -377,17 +381,10 @@ if ($action == 'create')
|
|||||||
if (!empty($conf->use_javascript_ajax))
|
if (!empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print '$(document).ready(function () {
|
print /** @lang JavaScript */'
|
||||||
$("#radiopayment").click(function() {
|
$(document).ready(function () {
|
||||||
$("#label").val($(this).data("label"));
|
let onAutoCreatePaiementChange = function () {
|
||||||
|
if($("#auto_create_paiement").is(":checked")) {
|
||||||
});
|
|
||||||
$("#radiorefund").click(function() {
|
|
||||||
$("#label").val($(this).data("label"));
|
|
||||||
|
|
||||||
});
|
|
||||||
$("#auto_create_paiement").click(function() {
|
|
||||||
if($(this).is(":checked")) {
|
|
||||||
$("#label_fk_account").addClass("fieldrequired");
|
$("#label_fk_account").addClass("fieldrequired");
|
||||||
$("#label_type_payment").addClass("fieldrequired");
|
$("#label_type_payment").addClass("fieldrequired");
|
||||||
$(".hide_if_no_auto_create_payment").show();
|
$(".hide_if_no_auto_create_payment").show();
|
||||||
@ -396,21 +393,21 @@ if ($action == 'create')
|
|||||||
$("#label_type_payment").removeClass("fieldrequired");
|
$("#label_type_payment").removeClass("fieldrequired");
|
||||||
$(".hide_if_no_auto_create_payment").hide();
|
$(".hide_if_no_auto_create_payment").hide();
|
||||||
}
|
}
|
||||||
});';
|
};
|
||||||
|
$("#radiopayment").click(function() {
|
||||||
|
$("#label").val($(this).data("label"));
|
||||||
|
});
|
||||||
|
$("#radiorefund").click(function() {
|
||||||
|
$("#label").val($(this).data("label"));
|
||||||
|
|
||||||
if ($_REQUEST['action'] === 'add') { // form has been send but there is at least one error
|
});
|
||||||
if (empty($auto_create_payment)) {
|
$("#auto_create_paiement").click(function () {
|
||||||
print '$("#label_fk_account").removeClass("fieldrequired");
|
onAutoCreatePaiementChange();
|
||||||
$("#label_type_payment").removeClass("fieldrequired");
|
});
|
||||||
$(".hide_if_no_auto_create_payment").hide();';
|
onAutoCreatePaiementChange();
|
||||||
} else {
|
});
|
||||||
print '$("#label_fk_account").addClass("fieldrequired");
|
';
|
||||||
$("#label_type_payment").addClass("fieldrequired");
|
|
||||||
$(".hide_if_no_auto_create_payment").show();';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '});';
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +472,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Auto create payment
|
// Auto create payment
|
||||||
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
|
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
|
||||||
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.($_REQUEST['action'] === 'add' ? (empty($auto_create_payment) ? '' : 'checked="checked"') : 'checked="checked"').' value="1"></td></tr>'."\n";
|
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
print '<tr class="hide_if_no_auto_create_payment"><td>'.$langs->trans('Numero');
|
print '<tr class="hide_if_no_auto_create_payment"><td>'.$langs->trans('Numero');
|
||||||
|
|||||||
@ -1742,6 +1742,7 @@ YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Se
|
|||||||
AccountancyCode=Accounting Code
|
AccountancyCode=Accounting Code
|
||||||
AccountancyCodeSell=Sale account. code
|
AccountancyCodeSell=Sale account. code
|
||||||
AccountancyCodeBuy=Purchase 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 #####
|
##### Agenda #####
|
||||||
AgendaSetup=Events and agenda module setup
|
AgendaSetup=Events and agenda module setup
|
||||||
PasswordTogetVCalExport=Key to authorize export link
|
PasswordTogetVCalExport=Key to authorize export link
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user