Commit 51bf8ca7 authored by 王炜's avatar 王炜

增值税台账-日立返还金调整

parent 49238652
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
SELECT t.contract_id,
t.invoice_hd_id,
t.invoice_line_id,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'ACR510_INVOICE_KIND'
AND v.code_value = t.invoice_kind)invoice_kind_n,
t.cashflow_id,
t.tax_apply_month invoice_month,
t.invoice_date,
t.invoice_number,
t.invoice_tax_amount total_amount,
t.apply_flag for_invoice_flag,
t.tenant_name bp_name,
t.contract_number,
t.acr_tax_amount return_tax_amount,
t.journal_tax_amount amount_cr,
t.journal_month je_month,
t.journal_date je_date,
t.journal_num,
t.times,
t.due_date,
t.due_amount,
t.principal,
t.interest,
t.tax_amount vat_due_amount,
t.created_by,
t.creation_date,
t.last_updated_by,
t.last_update_date
FROM vat_account_tmp t
WHERE t.session_id=${/session/@session_id}
) t1
#WHERE_CLAUSE#
order by invoice_hd_id,due_date ASC,invoice_number asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
acr_invoice_pkg.vat_account_data_process(p_base_period => ${@base_period},
p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<!-- <bm:data-filter enforceOperations="query" expression="to_char(t1.invoice_date,'yyyymm') = ${@base_period}"/>-->
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<!-- <bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>-->
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
SELECT t.contract_id,
t.invoice_hd_id,
t.invoice_line_id,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'ACR510_INVOICE_KIND'
AND v.code_value = t.invoice_kind)invoice_kind_n,
t.cashflow_id,
t.tax_apply_month invoice_month,
t.invoice_date,
t.invoice_number,
t.invoice_tax_amount total_amount,
t.apply_flag for_invoice_flag,
t.tenant_name bp_name,
t.contract_number,
t.acr_tax_amount return_tax_amount,
t.journal_tax_amount amount_cr,
t.journal_month je_month,
t.journal_date je_date,
t.journal_num,
t.times,
t.due_date,
t.due_amount,
t.principal,
t.interest,
t.tax_amount vat_due_amount,
t.created_by,
t.creation_date,
t.last_updated_by,
t.last_update_date,
t.tax_type_rate
FROM vat_account_tmp t
WHERE t.session_id=${/session/@session_id}
) t1
#WHERE_CLAUSE#
--order by invoice_hd_id,due_date ASC,invoice_line_id asc
order by invoice_hd_id, invoice_number asc, due_date ASC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hl_cm_vat_report_pkg.vat_account_data_process(p_base_period => ${@base_period},
p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<!-- <bm:data-filter enforceOperations="query" expression="to_char(t1.invoice_date,'yyyymm') = ${@base_period}"/>-->
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<!-- <bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>-->
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="vat_6_flag" queryExpression="((${@vat_6_flag}='Y' and t1.tax_type_rate=0.06) or(${@vat_6_flag}!='Y' and t1.tax_type_rate!=0.06))"/>
</bm:query-fields>
</bm:model>
var override_queryfields = [
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.journal_date,'yyyymm') < ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: "t1.journal_date <= add_months(last_day(to_date(${@base_period},'yyyymm')),-1) and (t1.invoice_date is null or t1.invoice_date >= TRUNC(to_date(${@base_period},'yyyymm'),'dd'))"
}];
override();
add_datafilter();
\ No newline at end of file
var override_queryfields = [
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.journal_date,'yyyymm') = ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: " to_char(t1.journal_date,'yyyymm') = ${@base_period} and (t1.invoice_date is null or to_char(t1.invoice_date,'yyyymm') < ${@base_period})"
}];
override();
add_datafilter();
\ No newline at end of file
var override_queryfields = [
{
name: 'invoice_kind',
queryexpression: "t1.invoice_kind = ${@invoice_kind}"
},
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.je_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'invoice_date',
queryexpression: "to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.je_date,'yyyymm') <= ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: "to_char(t1.invoice_date,'yyyymm') = ${@base_period}"
}];
override();
add_datafilter();
\ No newline at end of file
......@@ -15,19 +15,33 @@
//查询数据
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
//var grid_ds_id_before = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT', 'con_contract');
// var grid_ds_id_current = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT', 'con_contract');
var grid_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT', 'con_contract');
var grid_vat_6_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT_6', 'con_contract');
var grid_ds_id_before = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT', 'con_contract');
var grid_ds_id_before_6 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT_6', 'con_contract');
var grid_ds_id_current = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT', 'con_contract');
var grid_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT', 'con_contract');
$(grid_ds_id_before).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query');
$(grid_ds_id_current).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query');
var grid_ds_id_current_6 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT_6', 'con_contract');
$(grid_ds_id_before).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query?vat_6_flag=N');
$(grid_ds_id_before_6).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query?vat_6_flag=Y');
$(grid_ds_id_current).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query?vat_6_flag=N');
$(grid_ds_id_current_6).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query?vat_6_flag=Y');
//先进行数据的处理
$(grid_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query');
$(grid_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query?vat_6_flag=N');
$(grid_vat_6_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query?vat_6_flag=Y');
var detail_mask = Ext.getBody();
$(grid_ds_id_before).setQueryDataSet($(form_ds_id));
$(grid_ds_id_current).setQueryDataSet($(form_ds_id));
// $(grid_ds_id_before).setQueryDataSet($(form_ds_id));
// $(grid_ds_id_current).setQueryDataSet($(form_ds_id));
$(grid_ds_id_total).setQueryDataSet($(form_ds_id));
$(grid_ds_id_total).setQueryParameter('vat_6_flag','N');
$(grid_vat_6_ds_id_total).setQueryDataSet($(form_ds_id));
$(grid_vat_6_ds_id_total).setQueryParameter('vat_6_flag','Y');
$(grid_ds_id_before).query();
$(grid_ds_id_before_6).query();
$(grid_ds_id_current).query();
$(grid_ds_id_current_6).query();
Leaf.Masker.mask(detail_mask, '正在保存中。。。');
Leaf.request({
url: $('process_vat_account_data_link').getUrl(),
......@@ -36,8 +50,9 @@
tmp_date: new Date()
},
success: function () {
Leaf.Masker.unmask(detail_mask);
$(grid_ds_id_total).query();
$(grid_vat_6_ds_id_total).query();
Leaf.Masker.unmask(detail_mask);
},
failure: function () {
Leaf.Masker.unmask(detail_mask);
......@@ -52,4 +67,4 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
</a:screen>
\ No newline at end of file
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