Commit b3db6dc0 authored by niminmin's avatar niminmin

发票创建修改

parent 0e8d1774
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
function createScreen_create() function createScreen_create()
{ {
debugger;
var win = $('acr_invoice_create_invoice'); var win = $('acr_invoice_create_invoice');
var ds=$('headDs'); var ds=$('headDs');
if(!ds.validate(true)) if(!ds.validate(true))
...@@ -57,17 +58,23 @@ ...@@ -57,17 +58,23 @@
var principal=selectedDs[i].get('principal'); var principal=selectedDs[i].get('principal');
var interest=selectedDs[i].get('interest'); var interest=selectedDs[i].get('interest');
var cf_billing_amount=selectedDs[i].get('cf_billing_amount'); var cf_billing_amount=selectedDs[i].get('cf_billing_amount');
var received_amount=selectedDs[i].get('received_amount');
if(billing_amount!=due_amount &&billing_amount!=principal &&billing_amount!=interest){ // if(billing_amount!=due_amount &&billing_amount!=principal &&billing_amount!=interest){
$L.showErrorMessage("提示","本次开票金额需与应收金额,应收本金,应收利息中的某一金额一致!"); // $L.showErrorMessage("提示","本次开票金额需与应收金额,应收本金,应收利息中的某一金额一致!");
return; // return;
} // }
if(billing_amount==cf_billing_amount){ if(billing_amount==cf_billing_amount){
$L.showErrorMessage("提示","该金额已经开票过!"); $L.showErrorMessage("提示","该金额已经开票过!");
return; return;
} }
if(received_amount<plus(cf_billing_amount,billing_amount)&&selectedDs[i].get('cf_item')==1&&selectedDs[i].get('cf_status')=='BLOCK'&&selectedDs[i].get('contract_status')=='REPURING'){
$L.showErrorMessage("提示","本次开票金额+已开票金额不能超过已核销金额!");
return;
}
} }
...@@ -75,10 +82,12 @@ ...@@ -75,10 +82,12 @@
var datas = ds.getJsonData(); var datas = ds.getJsonData();
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?',function() Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?',function()
{ {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({ Leaf.request({
url: $('svcLink_create_invoice').getUrl(), url: $('svcLink_create_invoice').getUrl(),
para: datas, para: datas,
success: function(res) { success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
createScreen_close(); createScreen_close();
contractDs_grid_query(); contractDs_grid_query();
}, },
......
...@@ -49,28 +49,27 @@ ...@@ -49,28 +49,27 @@
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
return; return;
} }
//判断本次开票金额是否为租金,本金,和利息之中某一个 //判断本次开票金额是否大于(已收金额减去已开票金额)
//var selectedDs=$('selectedDs').getAll(); var selectedDs=$('selectedDs').getAll();
// for(var i=0;i<selectedDs.length;i++){ for(var i=0;i<selectedDs.length;i++){
// var billing_amount=selectedDs[i].get('billing_amount'); var billing_amount=selectedDs[i].get('billing_amount');
// var due_amount=selectedDs[i].get('due_amount'); var received_amount=selectedDs[i].get('received_amount');
// var principal=selectedDs[i].get('principal'); var cf_billing_amount=selectedDs[i].get('cf_billing_amount')||0;
// var interest=selectedDs[i].get('interest'); var temp_billing_amount=minus(received_amount,cf_billing_amount);
// var cf_billing_amount=selectedDs[i].get('cf_billing_amount');
//
// // if(billing_amount!=due_amount &&billing_amount!=principal &&billing_amount!=interest){
// if(billing_amount!=due_amount &&billing_amount!=principal &&billing_amount!=interest){ // $L.showErrorMessage("提示","本次开票金额需与应收金额,应收本金,应收利息中的某一金额一致!");
// $L.showErrorMessage("提示","本次开票金额需与应收金额,应收本金,应收利息中的某一金额一致!"); // return;
// return; // }
// } if(billing_amount>temp_billing_amount){
// if(billing_amount==cf_billing_amount){ $L.showErrorMessage("提示","开票金额填写有误!");
// $L.showErrorMessage("提示","该金额已经开票过!"); return;
// return; }
// }
//
//
// }
// }
var datas = ds.getJsonData(); var datas = ds.getJsonData();
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?',function() Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?',function()
...@@ -134,7 +133,7 @@ ...@@ -134,7 +133,7 @@
<a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true" model="acr.ACR510.acr_invoice_penalty_create" selectable="true"> <a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true" model="acr.ACR510.acr_invoice_penalty_create" selectable="true">
<a:fields> <a:fields>
<a:field name="billing_amount" readOnly="true"/> <a:field name="billing_amount" required="true"/>
<a:field name="product_name" required="true"/> <a:field name="product_name" required="true"/>
<a:field name="invoice_kind"/> <a:field name="invoice_kind"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs" required="true" returnField="invoice_kind" valueField="code_value"/> <a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs" required="true" returnField="invoice_kind" valueField="code_value"/>
...@@ -172,7 +171,7 @@ ...@@ -172,7 +171,7 @@
<a:column name="currency_desc" align="center"/> <a:column name="currency_desc" align="center"/>
<!-- <a:column name="due_amount" align="right" renderer="Leaf.formatMoney"/>--> <!-- <a:column name="due_amount" align="right" renderer="Leaf.formatMoney"/>-->
<a:column name="received_amount" align="right" renderer="Leaf.formatMoney"/> <a:column name="received_amount" align="right" renderer="Leaf.formatMoney"/>
<!-- <a:column name="cf_billing_amount" align="right" renderer="Leaf.formatMoney"/>--> <a:column name="cf_billing_amount" align="right" renderer="Leaf.formatMoney"/>
<a:column name="billing_amount" align="right" editor="selectedDs_grid_editor_nf" renderer="Leaf.formatMoney" footerRenderer="sum_foot"/> <a:column name="billing_amount" align="right" editor="selectedDs_grid_editor_nf" renderer="Leaf.formatMoney" footerRenderer="sum_foot"/>
</a:columns> </a:columns>
<a:editors> <a:editors>
......
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