Commit d0ee2e8b authored by stone's avatar stone

【fix】销项发票修改

parent 4162ca94
......@@ -3,7 +3,8 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select t1.spv_company_id,
SELECT * FROM( select t1.spv_company_id,
t1.company_id,
t1.project_id,
t1.project_number,
......@@ -47,12 +48,12 @@
t2.last_received_date,
t2.due_date,
t2.due_amount,
(SELECT wm_concat(distinct c.bp_bank_account_name)
to_char((SELECT wm_concat(distinct c.bp_bank_account_name)
FROM csh_transaction c
WHERE c.transaction_id IN
(SELECT coo.csh_transaction_id
FROM csh_write_off coo
WHERE coo.cashflow_id = t2.cashflow_id)) account_name,
WHERE coo.cashflow_id = t2.cashflow_id))) account_name,
decode(t1.lease_channel,'01',null,t2.principal) principal,
decode(t1.lease_channel,'01',null,t2.interest) interest,
t2.received_amount,
......@@ -94,7 +95,17 @@
to_char(t2.due_date,'yyyy-mm') <= to_char(SYSDATE,'yyyy-mm')) or t2.write_off_flag = 'FULL')
and ((t2.cf_item = '8' and t2.write_off_flag = 'FULL') or
t2.cf_item <> '8')
ORDER BY t1.contract_id,t2.times,t2.due_date,t2.cf_item)vv
AND cf_item<> 9
AND cf_status='RELEASE'
and nvl(t2.billing_status,'NOT') != 'FULL'
and t2.cf_direction='INFLOW'
and ((decode(t2.cf_item,
'250',
t1.inv_object_taxpayer_type,
t1.object_taxpayer_type) <> 'SMALL_SCALE_TAXPAYER' and
received_amount>0) OR 1=1 )
)vv
#WHERE_CLAUSE#
]]></bm:query-sql>
......@@ -138,10 +149,10 @@
<bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" required="true"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
<bm:field name="invoice_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TYPE_DESC"/>
<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" required="true"/>
<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID"/>
<bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" required="true"/>
<bm:field name="cf_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_ITEM_DESC"/>
<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" required="true"/>
<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES"/>
<bm:field name="last_received_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_RECEIVED_DATE"/>
<bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE"/>
<bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT"/>
......@@ -214,11 +225,7 @@
<bm:data-filters>
<!--<bm:data-filter enforceOperations="query" expression="nvl(t2.billing_amount,0)&lt;t2.received_amount"/>-->
<!--<bm:data-filter enforceOperations="query" expression="t1.contract_id = vv.contract_id"/>-->
<bm:data-filter name="cf_item" enforceOperations="query" expression="vv.cf_item in(&apos;2&apos;,&apos;1&apos;,&apos;9&apos;,&apos;8&apos;,&apos;200&apos;,&apos;250&apos;)"/>
<bm:data-filter enforceOperations="query" expression="vv.cf_status = &apos;RELEASE&apos;"/>
<bm:data-filter enforceOperations="query" expression="nvl(vv.billing_status,&apos;NOT&apos;) != &apos;FULL&apos; and vv.cf_direction=&apos;INFLOW&apos;"/>
<bm:data-filter name="contract_status" enforceOperations="query" expression="vv.contract_status in(&apos;NEW&apos;,&apos;INCEPT&apos;,&apos;ETING&apos;,&apos;REPURING&apos;,&apos;CLOSED&apos;)"/>
<bm:data-filter name="received_amount" enforceOperations="query" expression="vv.received_amount &lt;&gt; 0"/>
<!-- <bm:data-filter name="contract_status" enforceOperations="query" expression="vv.contract_status in(&apos;NEW&apos;,&apos;INCEPT&apos;,&apos;ETING&apos;,&apos;REPURING&apos;,&apos;CLOSED&apos;)"/>-->
</bm:data-filters>
</bm:model>
......@@ -13,6 +13,7 @@
<a:link id="pageLink_select_cashflow" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_select_cashflow.lview"/>
<a:link id="pageLink_conditionScreen_welcome" url="${/request/@context_path}/welcome.screen"/>
<a:link id="pageLink_invoice_create" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_create_invoice.lview"/>
<a:link id="pageLink_penalty_create" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_penalty_invoice.lview"/>
<a:link id="svcLink_save_selected" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_save_selected.lsc"/>
<!--
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
......@@ -90,6 +91,30 @@
contractDs_grid_query();
});
}
function winOpen_penalty_create()
{
var final_bill_flag = $('allConditionDs').getAt(0).get('final_bill_flag');
var group_billing_method;
if (final_bill_flag == 'Y'){
group_billing_method = 'GROUP_BY_CONTRACT';
}else{
group_billing_method = 'GROUP_BY_TIMES';
}
var win = new Leaf.Window({
id: 'acr_invoice_penalty_invoice',
url: $('pageLink_penalty_create').getUrl(),
params:{
company_id:'${/session/@company_id}',
group_billing_method:group_billing_method
},
title: '${l:ACR510.WIN_TITLE.CREATE}',
fullScreen:true
});
win.on('close',function(){
contractDs_grid_query();
});
}
function invoiceHd_confirm()
......@@ -109,25 +134,60 @@
return;
}
var datas = ds.getJsonData(true);
for(var i=0;i<datas.length;i++){
datas[i].final_bill_flag=final_bill_flag;
datas[i].cat_ini_flag=cat_ini_flag;
}
Leaf.request({
url: $('svcLink_save_selected').getUrl(),
para: datas,
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
winOpen_invoice_create();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
//判断是不是罚息
var first_cf_item=datas[0].cf_item;
//全是罚息
if (first_cf_item==9) {
var invoice_flag1=true;
for (var i = 0; i < datas.length; i++) {
if(datas[i].cf_item!=9){
invoice_flag1=false;
$L.showErrorMessage('提示','罚息不能和其他类型的现金流同时开票!');
Leaf.Masker.unmask(Ext.getBody());
return;
}
}
//跳转到新的页面
if(invoice_flag1){
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
winOpen_penalty_create();
}
}else {
var invoice_flag2 = true;
for (var i = 0; i < datas.length; i++) {
if (datas[i].cf_item == 9) {
invoice_flag2 = false;
$L.showErrorMessage('提示', '罚息不能和其他类型的现金流同时开票!');
Leaf.Masker.unmask(Ext.getBody());
return;
}
}
//跳转页面
if (invoice_flag2) {
for (var i = 0; i < datas.length; i++) {
datas[i].final_bill_flag = final_bill_flag;
datas[i].cat_ini_flag = cat_ini_flag;
}
Leaf.request({
url: $('svcLink_save_selected').getUrl(),
para: datas,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
winOpen_invoice_create();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
}
}
function queryUpdateFunction(ds, record, name, value, oldvalue) {
......@@ -299,23 +359,25 @@
<a:gridButton click="invoiceHd_confirm" text="ACR510.BUTTON.COMFIRM"/>
</a:screenTopToolbar>
<a:queryForm id="condition_queryForm" bindTarget="allConditionDs" createSearchButton="false" resultTarget="contractDs">
<a:formToolBar labelWidth="100">
<a:formToolBar labelWidth="80">
<a:hBox>
<a:lov name="billing_object_name" bindTarget="allConditionDs" prompt="开票对象"/>
<a:lov name="billing_object_name" bindTarget="allConditionDs" prompt="开票对象" width="95"/>
<!--
<a:comboBox name="bill_object_bp_class_desc" bindTarget="allConditionDs" prompt="客户类型"/>
-->
<a:textField name="contract_number" bindTarget="allConditionDs" prompt="合同号"/>
<a:textField name="contract_number" bindTarget="allConditionDs" prompt="合同号" width="95"/>
<!--
<a:comboBox name="invoice_type_desc" bindTarget="allConditionDs" prompt="发票类型"/>
-->
<a:lov name="bp_id_agent_level1_n" bindTarget="allConditionDs" prompt="代理店"/>
<a:lov name="cf_item_desc" bindTarget="allConditionDs" prompt="HLS.RECEIVE_PROJECT"/>
<!-- <a:lov name="bp_id_agent_level1_n" bindTarget="allConditionDs" prompt="代理店"/>-->
<a:datePicker name="due_date_from" bindTarget="allConditionDs" prompt="应收日从" width="95"/>
<a:datePicker name="due_date_to" bindTarget="allConditionDs" prompt="应收日到" width="95"/>
<a:lov name="cf_item_desc" bindTarget="allConditionDs" prompt="HLS.RECEIVE_PROJECT" width="95"/>
</a:hBox>
<a:hBox>
<a:comboBox name="contract_status_desc" bindTarget="allConditionDs" prompt="合同状态"/>
<a:comboBox name="object_taxpayer_type_desc" bindTarget="allConditionDs" prompt="纳税人类型"/>
<a:comboBox name="contract_status_desc" bindTarget="allConditionDs" prompt="合同状态" width="95"/>
<a:comboBox name="object_taxpayer_type_desc" bindTarget="allConditionDs" prompt="纳税人类型" width="95"/>
</a:hBox>
</a:formToolBar>
<!-- <a:formBody column="4" labelWidth="400">
......
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