Commit 21a93df8 authored by chenzhuo's avatar chenzhuo

进项发票导入校验

parent 47c6d298
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
Leaf.onReady(function () { Leaf.onReady(function () {
//document.getElementById("ext-gen935").placeholder = "在这输入姓名.."; //document.getElementById("ext-gen935").placeholder = "在这输入姓名..";
// document.getElementById("ext-gen124").style.backgroundColor = 'red'; // document.getElementById("ext-gen124").style.backgroundColor = 'red';
// document.getElementById("ext-gen124").setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。'); // document.getElementById("ext-gen124").setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
//document.getElementById("ext-gen124").style.color = 'red'; //document.getElementById("ext-gen124").style.color = 'red';
//document.getElementById("ext-gen124").style.backgroundColor = '#FF7744'; //document.getElementById("ext-gen124").style.backgroundColor = '#FF7744';
var first=document.getElementsByClassName("item-input-wrap"); var first=document.getElementsByClassName("item-input-wrap");
var second=first[2].getElementsByClassName('item-textField'); var second=first[2].getElementsByClassName('item-textField');
var third=second[0]; var third=second[0];
third.setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。'); third.setAttribute('placeholder','注:扫描时请将鼠标光标放在此处。。。');
third.style.backgroundColor = '#FF7744'; third.style.backgroundColor = '#FF7744';
}); });
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
var hd_record = $(hd_id).getAt(0); var hd_record = $(hd_id).getAt(0);
var lease_item_amount=hd_record.get('lease_item_amount'); var lease_item_amount=hd_record.get('lease_item_amount');
if($(ds_id).getAll().dirty){ if($(ds_id).getAll().dirty){
alert(111);
return; return;
} }
...@@ -84,6 +85,13 @@ ...@@ -84,6 +85,13 @@
if (!isNaN(records[i].get('tax_amount')||0)) { if (!isNaN(records[i].get('tax_amount')||0)) {
sum_tax=plus((records[i].get('tax_amount')||0),(sum_tax||0)); sum_tax=plus((records[i].get('tax_amount')||0),(sum_tax||0));
} }
//校验重复发票号码 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('提示', '发票号码重复,请重新扫描输入!');
return;
}
}
} }
if(sum!=lease_item_amount){ if(sum!=lease_item_amount){
Leaf.showMessage('提示', '本次发票明细含税总计不等于该合同设备价!'); Leaf.showMessage('提示', '本次发票明细含税总计不等于该合同设备价!');
...@@ -133,6 +141,17 @@ ...@@ -133,6 +141,17 @@
var invoice_date = strs[5]; var invoice_date = strs[5];
//检验设备价格需要大于不含税金额 //检验设备价格需要大于不含税金额
if (strs.length ==9) { if (strs.length ==9) {
//校验重复发票号码 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({ Leaf.request({
url: $('acp_invoice_inf_import_link').getUrl(), url: $('acp_invoice_inf_import_link').getUrl(),
para: { para: {
...@@ -152,8 +171,8 @@ ...@@ -152,8 +171,8 @@
setTimeout(function() { setTimeout(function() {
record.set('invoice', ''); record.set('invoice', '');
}, 50); }, 50);
$(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); $(acp_ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
$(acp_ds_id).query(); $(acp_ds_id).query();
},failure: function() { },failure: function() {
setTimeout(function() { setTimeout(function() {
record.set('invoice', ''); record.set('invoice', '');
......
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