Commit a9881dd8 authored by gzj34291's avatar gzj34291

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

parent de8be8fd
......@@ -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_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_TYPE_N" prompt="发票种类"/>
<bm:field name="rl_flag"/>
<bm:field name="business_type" />
</bm:fields>
<bm:operations>
<bm:operation name="query">
......@@ -112,7 +113,8 @@
'N'
else
''
end rl_flag
end rl_flag,
con.business_type
from acr_invoice_create_tmp t,
con_contract_v con,
con_contract_cashflow_all_v cf,
......
......@@ -3,39 +3,59 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
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
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type = 'PAPER'
AND v.code_value IN ('PAPER_GENERAL','PAPER_SPECIAL'))
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
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type = 'ECT'
AND v.code_value IN ('ELECTRONIC_GENERAL','ELECTRONIC_SPECIAL'))
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
WHERE t.record_id = ${/parameter/@record_id}
AND t.invoice_type not in('PAPER','ECT')
AND v.code_value IN ('RECEIPT'))
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 t.invoice_type = 'PAPER'
AND v.code_value IN ('PAPER_GENERAL', 'PAPER_SPECIAL'))
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.business_type !='LEASEBACK'
AND t.invoice_type = 'ECT'
and cc.contract_id=t.contract_id
AND v.code_value IN ('ELECTRONIC_GENERAL','ELECTRONIC_SPECIAL'))
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.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:operation>
</bm:operations>
......
......@@ -43,7 +43,7 @@
function createScreen_create()
{
debugger;
var message_flag =false;
var win = $('acr_invoice_create_invoice');
var ds=$('headDs');
if(!ds.validate(true))
......@@ -54,6 +54,7 @@
//判断本次开票金额是否为租金,本金,和利息之中某一个
var selectedDs=$('selectedDs').getAll();
for(var i=0;i<selectedDs.length;i++){
debugger;
var billing_amount=selectedDs[i].get('billing_amount');
var due_amount=selectedDs[i].get('due_amount');
var principal=selectedDs[i].get('principal');
......@@ -70,18 +71,33 @@
$L.showErrorMessage("提示","该金额已经开票过!");
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'){
$L.showErrorMessage("提示","本次开票金额+已开票金额不能超过已核销金额!");
return;
}
}
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.request({
......@@ -100,7 +116,8 @@
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
scope: this,
sync: true
});
},function (){
Leaf.Masker.unmask(Ext.getBody());
......@@ -109,6 +126,8 @@
}
function unSelect_selectedDs(ds,record){
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