Merge pull request #24638 from noec764/16_FIX_Expense_report_TTC_autofill
FIX: expense report autofill ttc input if force ttc conf is enabled
This commit is contained in:
commit
48358ef3a5
@ -2643,10 +2643,22 @@ if ($action == 'create') {
|
|||||||
,async:false
|
,async:false
|
||||||
,dataType:"json"
|
,dataType:"json"
|
||||||
,success:function(response) {
|
,success:function(response) {
|
||||||
if (response.response_status == "success"){
|
if (response.response_status == "success"){';
|
||||||
jQuery("#value_unit_ht").val(response.data);
|
|
||||||
jQuery("#value_unit_ht").trigger("change");
|
if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) {
|
||||||
jQuery("#value_unit").val("");
|
print '
|
||||||
|
jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100);
|
||||||
|
jQuery("#value_unit").trigger("change");
|
||||||
|
';
|
||||||
|
} else {
|
||||||
|
print '
|
||||||
|
jQuery("#value_unit_ht").val(response.data);
|
||||||
|
jQuery("#value_unit_ht").trigger("change");
|
||||||
|
jQuery("#value_unit").val("");
|
||||||
|
';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '
|
||||||
} else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){
|
} else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){
|
||||||
$.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } );
|
$.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } );
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user