Commit ce2823a7 authored by stone's avatar stone

【feat】业务冲销查询

parent d10eb32c
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool ACP_INVOICE_LN.log
PROMPT
PROMPT CREATING TABLE TRAIN_CONFIG
PROMPT ============================
PROMPT
CREATE TABLE business_write_detail (
business_detail_id NUMBER,
write_off_id NUMBER,
cashflow_id NUMBER,
contract_id NUMBER,
transaction_id NUMBER,
transaction_number VARCHAR2(100),
transaction_type VARCHAR2(100),
times NUMBER,
cf_item_n VARCHAR2(100),
extra_name VARCHAR2(1000),
contract_number VARCHAR2(1000),
machine_number VARCHAR2(100),
bp_code_tenant VARCHAR2(100),
bp_name VARCHAR2(100),
id_card_no VARCHAR2(100),
contract_amount NUMBER,
due_date DATE,
due_amount NUMBER,
due_amount_penalty NUMBER,
transaction_date DATE,
write_off_date DATE,
received_amount NUMBER,
unreceived_amount NUMBER,
received_amount_penalty NUMBER
);
CREATE SEQUENCE business_write_detail_s;
ALTER TABLE business_write_detail ADD (write_off_amount NUMBER);
ALTER TABLE business_write_detail ADD (session_id NUMBER);
ALTER TABLE business_write_detail ADD (rest_due_amount NUMBER);
CREATE SEQUENCE business_write_detail_s;
create index index_cashflowid on business_write_detail(cashflow_id);
drop index index_cashflowid;
select t.business_detail_id, write_off_id, cashflow_id, contract_id, transaction_id, transaction_number, transaction_type, times, cf_item_n, extra_name, contract_number, machine_number, bp_code_tenant, bp_name, id_card_no, contract_amount, due_date, due_amount, due_amount_penalty, transaction_date, write_off_date, received_amount, unreceived_amount, received_amount_penalty, write_off_amount, session_id, rest_due_amount from business_write_detail t;
SPOOL OFF
EXIT
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.cashflow_id,
t.transaction_number transaction_num,
t.transaction_type,
t.times,
t.session_id,
t.contract_id,
t.cf_item_n,
t.extra_name extra_nam,
t.contract_number,
t.machine_number,
t.bp_code_tenant bp_id_tenant,
t.bp_name,
t.id_card_no,
t.contract_amount total_amount,
t.due_date,
t.due_amount -
(nvl((SELECT SUM(v.write_off_amount)
FROM business_write_detail v
WHERE v.cashflow_id = t.cashflow_id
and v.session_id=${/session/@session_id}
AND v.business_detail_id<t.business_detail_id),
0)) due_amount,
t.transaction_date,
t.write_off_date,
t.received_amount,
(t.due_amount- (nvl((SELECT SUM(v.write_off_amount)
FROM business_write_detail v
WHERE v.cashflow_id = t.cashflow_id
and v.session_id=${/session/@session_id}
AND v.business_detail_id<t.business_detail_id),
0))-t.write_off_amount)unreceived_amount,
t.write_off_amount received_amount
FROM business_write_detail t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
contract_item_query_pkg.calc_business_write_report(p_user_id => ${/session/@user_id},
p_session_id => ${/session/@session_id});
end;]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t.contract_number like &apos;%&apos; || ${@contract_number} || &apos;%&apos;"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like &apos;%&apos; || ${@bp_name} || &apos;%&apos;"/>
<bm:query-field name="transaction_date_from" queryExpression="trunc(t.transaction_date) &gt;= trunc(to_date(${@transaction_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="transaction_date_to" queryExpression="trunc(t.transaction_date) &lt;= trunc(to_date(${@transaction_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="journal_date_from" queryExpression="trunc(t.write_off_date) &gt;= trunc(to_date(${@journal_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="journal_date_to" queryExpression="trunc(t.write_off_date) &lt;= trunc(to_date(${@journal_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="transaction_num" queryExpression="t.transaction_number like &apos;%&apos; || ${@transaction_num} || &apos;%&apos;"/>
<bm:query-field name="cf_item_n" queryExpression="t.cf_item_n like &apos;%&apos; || ${@cf_item_n} || &apos;%&apos;"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t.session_id=${/session/@session_id}"/>
</bm:data-filters>
</bm:model>
......@@ -6,9 +6,11 @@
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="business_write_detail_link" model="cont.CON3100N.business_write_detail_report"
modelaction="execute"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_CONTRACT_RESULT', 'con_contract');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
if(name=='transaction_date_from' &&value){
......@@ -22,6 +24,32 @@
}
}
}
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); Leaf.request({
url: $('business_write_detail_link').getUrl(),
para: {},
success: function() {
$(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3100N.business_write_detail_report/query');
$(ds_id).setQueryDataSet($(form_ds_id));
Leaf.Masker.unmask(Ext.getBody());
$(ds_id).query();
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
}
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'F_WRITE_OFF_LIST', 'con_contract_cashflow');
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
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