Commit 219d7dbe authored by gzj34291's avatar gzj34291

I-11321【建机】售后回租开票判断逻辑修改

parent 6d70eb6c
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/> <bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/> <bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/>
<bm:field name="rl_flag"/> <bm:field name="rl_flag"/>
<bm:field name="business_type" />
</bm:fields> </bm:fields>
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
...@@ -112,7 +113,8 @@ ...@@ -112,7 +113,8 @@
'N' 'N'
else else
'' ''
end rl_flag end rl_flag,
con.business_type
from acr_invoice_create_tmp t, from acr_invoice_create_tmp t,
con_contract_v con, con_contract_v con,
con_contract_cashflow_all_v cf, con_contract_cashflow_all_v cf,
......
...@@ -3,39 +3,59 @@ ...@@ -3,39 +3,59 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT v.code_value AS value_code, v.code_value_name AS value_name SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM sys_code_values_v v FROM sys_code_values_v v
WHERE v.code_enabled_flag = 'Y' WHERE v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y' AND v.code_value_enabled_flag = 'Y'
AND v.code = 'ACR512_INVOICE_KIND_TYPE' AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS AND EXISTS
(SELECT 1 (SELECT 1
FROM acr_invoice_create_tmp t FROM acr_invoice_create_tmp t,con_contract cc
WHERE t.record_id = ${/parameter/@record_id} WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type = 'PAPER' and cc.contract_id=t.contract_id
AND v.code_value IN ('PAPER_GENERAL','PAPER_SPECIAL')) AND cc.business_type !='LEASEBACK'
UNION ALL AND t.invoice_type = 'PAPER'
SELECT v.code_value AS value_code, v.code_value_name AS value_name AND v.code_value IN ('PAPER_GENERAL', 'PAPER_SPECIAL'))
FROM sys_code_values_v v UNION ALL
WHERE v.code_enabled_flag = 'Y' SELECT v.code_value AS value_code, v.code_value_name AS value_name
AND v.code_value_enabled_flag = 'Y' FROM sys_code_values_v v
AND v.code = 'ACR512_INVOICE_KIND_TYPE' WHERE v.code_enabled_flag = 'Y'
AND EXISTS (SELECT 1 AND v.code_value_enabled_flag = 'Y'
FROM acr_invoice_create_tmp t AND v.code = 'ACR512_INVOICE_KIND_TYPE'
WHERE t.record_id = ${/parameter/@record_id} AND EXISTS
AND t.invoice_type = 'ECT' (SELECT 1
AND v.code_value IN ('ELECTRONIC_GENERAL','ELECTRONIC_SPECIAL')) FROM acr_invoice_create_tmp t,con_contract cc
UNION ALL WHERE t.record_id = ${/parameter/@record_id}
SELECT v.code_value AS value_code, v.code_value_name AS value_name AND cc.business_type !='LEASEBACK'
FROM sys_code_values_v v AND t.invoice_type = 'ECT'
WHERE v.code_enabled_flag = 'Y' and cc.contract_id=t.contract_id
AND v.code_value_enabled_flag = 'Y' AND v.code_value IN ('ELECTRONIC_GENERAL','ELECTRONIC_SPECIAL'))
AND v.code = 'ACR512_INVOICE_KIND_TYPE' UNION ALL
AND EXISTS (SELECT 1 SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM acr_invoice_create_tmp t FROM sys_code_values_v v
WHERE t.record_id = ${/parameter/@record_id} WHERE v.code_enabled_flag = 'Y'
AND t.invoice_type not in('PAPER','ECT') AND v.code_value_enabled_flag = 'Y'
AND v.code_value IN ('RECEIPT')) AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS (SELECT 1
FROM acr_invoice_create_tmp t,con_contract cc
WHERE t.record_id = ${/parameter/@record_id}
AND cc.business_type !='LEASEBACK'
AND t.invoice_type not in ('PAPER', 'ECT')
and cc.contract_id=t.contract_id
AND v.code_value IN ('RECEIPT'))
UNION ALL
SELECT v.code_value AS value_code, v.code_value_name AS value_name
FROM sys_code_values_v v
WHERE v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code = 'ACR512_INVOICE_KIND_TYPE'
AND EXISTS
(SELECT 1
FROM acr_invoice_create_tmp t,con_contract cc
WHERE t.record_id = ${/parameter/@record_id}
and cc.contract_id=t.contract_id
AND cc.business_type='LEASEBACK'
AND v.code_value IN ('PAPER_GENERAL','ELECTRONIC_GENERAL'))
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
function createScreen_create() function createScreen_create()
{ {
debugger; var message_flag =false;
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))
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
//判断本次开票金额是否为租金,本金,和利息之中某一个 //判断本次开票金额是否为租金,本金,和利息之中某一个
var selectedDs=$('selectedDs').getAll(); var selectedDs=$('selectedDs').getAll();
for(var i=0;i<selectedDs.length;i++){ for(var i=0;i<selectedDs.length;i++){
debugger;
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 due_amount=selectedDs[i].get('due_amount');
var principal=selectedDs[i].get('principal'); var principal=selectedDs[i].get('principal');
...@@ -70,18 +71,33 @@ ...@@ -70,18 +71,33 @@
$L.showErrorMessage("提示","该金额已经开票过!"); $L.showErrorMessage("提示","该金额已经开票过!");
return; return;
} }
//add by gzj 售后回租只能开普票
var business_type= selectedDs[i].get('business_type');
var kind_type=selectedDs[i].get('invoice_kind_type');
if(business_type=='LEASEBACK'&&(kind_type!='PAPER_GENERAL'&&kind_type!='ELECTRONIC_GENERAL')){
Leaf.showMessage("提示","售后回租只能开普通发票!");
return;
}
if(business_type=='LEASEBACK'&&kind_type!='ELECTRONIC_GENERAL'){
message_flag =true;
// Leaf.showMessage("提示","回租建议选择增值税电子普票!");
}
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'){ 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("提示","本次开票金额+已开票金额不能超过已核销金额!"); $L.showErrorMessage("提示","本次开票金额+已开票金额不能超过已核销金额!");
return; return;
} }
} }
var datas = ds.getJsonData(); var datas = ds.getJsonData();
Leaf.showConfirm('${l:HLS.PROMPT}','是否确认开票?',function() var message_info;
if(message_flag==false){
message_info= '是否确认开票?';
}else {
message_info= "回租建议选择增值税电子普票!是否确认开票?";
}
Leaf.showConfirm('${l:HLS.PROMPT}',message_info,function()
{ {
Leaf.Masker.mask(Ext.getBody(),'${l:HLS.EXECUTING}'); Leaf.Masker.mask(Ext.getBody(),'${l:HLS.EXECUTING}');
Leaf.request({ Leaf.request({
...@@ -100,7 +116,8 @@ ...@@ -100,7 +116,8 @@
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
}, },
scope: this scope: this,
sync: true
}); });
},function (){ },function (){
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
...@@ -109,6 +126,8 @@ ...@@ -109,6 +126,8 @@
} }
function unSelect_selectedDs(ds,record){ function unSelect_selectedDs(ds,record){
record.dirty = false; record.dirty = false;
} }
......
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