Commit 21a93df8 authored by chenzhuo's avatar chenzhuo

进项发票导入校验

parent 47c6d298
......@@ -42,6 +42,7 @@
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;
}
......@@ -84,6 +85,13 @@
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
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){
Leaf.showMessage('提示', '本次发票明细含税总计不等于该合同设备价!');
......@@ -133,6 +141,17 @@
var invoice_date = strs[5];
//检验设备价格需要大于不含税金额
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({
url: $('acp_invoice_inf_import_link').getUrl(),
para: {
......
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