Commit 5891b570 authored by 陆正友's avatar 陆正友

发票优化

parent 074f6433
......@@ -6,6 +6,7 @@
</a:init-procedure>
<a:view>
<a:link id="acp_invoice_inf_import_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="update"/>
<a:link id="acp_invoice_inf_import_total_link" model="acp.ACP522.acp_invoice_inf_import_total" modelaction="update"/>
<a:link id="acp_invoice_inf_import_submit_link" model="acp.ACP522.acp_invoice_inf_import" modelaction="execute"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<script><![CDATA[
......@@ -16,13 +17,13 @@
Leaf.onReady(function () {
//document.getElementById("ext-gen935").placeholder = "在这输入姓名..";
// document.getElementById("ext-gen124").style.backgroundColor = 'red';
// document.getElementById("ext-gen124").setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
// document.getElementById("ext-gen124").style.backgroundColor = 'red';
// document.getElementById("ext-gen124").setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
//document.getElementById("ext-gen124").style.color = 'red';
//document.getElementById("ext-gen124").style.backgroundColor = '#FF7744';
var first=document.getElementsByClassName("item-input-wrap");
var second=first[2].getElementsByClassName('item-textField');
var third=second[0];
var first=document.getElementsByClassName("item-input-wrap");
var second=first[2].getElementsByClassName('item-textField');
var third=second[0];
third.setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
third.style.backgroundColor = '#FF7744';
});
......@@ -42,7 +43,6 @@
var hd_record = $(hd_id).getAt(0);
var lease_item_amount=hd_record.get('lease_item_amount');
if($(ds_id).getAll().dirty){
alert(111);
return;
}
......@@ -81,11 +81,11 @@
// }
// }
// 营业外收入或营业外支出科目金额超过0.5,请联系系统管理员!
// 营业外收入或营业外支出科目金额超过1,请联系系统管理员!
if (!isNaN(records[i].get('tax_amount')||0)) {
sum_tax=plus((records[i].get('tax_amount')||0),(sum_tax||0));
}
//校验重复发票号码 add by 26887cz 2021-09-07
//校验重复发票号码 add by 26887cz 2021-09-07
for(var j =i+1;j < records.length;j++){
if(records[i].get('invoice_number')==records[j].get('invoice_number')){
Leaf.showMessage('提示', '发票号码重复,请重新扫描输入!');
......@@ -99,8 +99,8 @@
}
var diff = ((net_lease_item_amount + sum_tax - lease_item_amount) > 0 ? (net_lease_item_amount + sum_tax - lease_item_amount) : (lease_item_amount - sum_tax - net_lease_item_amount));
if(diff > 0.5){
Leaf.showMessage('提示', '营业外收入或营业外支出科目金额超过0.5,请联系系统管理员!');
if(diff >1){
Leaf.showMessage('提示', '营业外收入或营业外支出科目金额超过1,请联系系统管理员!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '确定提交审批吗?', function() {
......@@ -139,9 +139,10 @@
var invoice_number = strs[3];
var net_amount = strs[4];
var invoice_date = strs[5];
var total_amount =strs[4];
//检验设备价格需要大于不含税金额
if (strs.length ==9) {
//校验重复发票号码 add by 26887cz 2021-09-07
//校验重复发票号码 add by 26887cz 2021-09-07
var acr_records = $(acp_ds_id).getAll();
for(var i= 0 ; i<acr_records.length ;i++){
if(acr_records[i].get("invoice_number") == invoice_number){
......@@ -162,24 +163,70 @@
invoice_date: invoice_date,
contract_id: contract_id
},
success: function () {
Leaf.SideBar.show({
msg: '导入成功',
duration: 2000
}
);
setTimeout(function() {
setTimeout(function () {
record.set('invoice', '');
}, 50);
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
},failure: function() {
setTimeout(function() {
}, failure: function () {
setTimeout(function () {
record.set('invoice', '');
}, 50);
},
error: function() {
setTimeout(function() {
error: function () {
setTimeout(function () {
record.set('invoice', '');
}, 50);
},
scope: this
});
} else if (strs.length == 8) {
//校验重复发票号码 add by 26887cz 2021-09-07
var acr_records = $(acp_ds_id).getAll();
for (var i = 0; i < acr_records.length; i++) {
if (acr_records[i].get("invoice_number") == invoice_number) {
Leaf.showMessage('提示', '发票号码重复,请重新扫描!');
setTimeout(function () {
record.set('invoice', '');
}, 50);
return;
}
}
Leaf.request({
url: $('acp_invoice_inf_import_total_link').getUrl(),
para: {
invoice_type: invoice_type,
invoice_code: invoice_code,
invoice_number: invoice_number,
total_amount: total_amount,
invoice_date: invoice_date,
contract_id: contract_id
},
success: function () {
Leaf.SideBar.show({
msg: '导入成功',
duration: 2000
}
);
setTimeout(function () {
record.set('invoice', '');
}, 50);
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query();
}, failure: function () {
setTimeout(function () {
record.set('invoice', '');
}, 50);
},
error: function () {
setTimeout(function () {
record.set('invoice', '');
}, 50);
},
......@@ -187,7 +234,7 @@
});
} else {
Leaf.showMessage('提示', '发票信息有错误,请重新扫描!');
setTimeout(function() {
setTimeout(function () {
record.set('invoice', '');
}, 50);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment