1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-17 下午06:23:23
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.invoice_hd_id,
t1.document_number,
to_char(t1.invoice_date, 'yyyy-mm-dd') as invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
t1.contract_name,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.vat_interface_status,
t1.vat_interface_status_desc,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
to_char(t1.accounting_date, 'yyyy-mm-dd') as accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
to_char(t1.express_date, 'yyyy-mm-dd') express_date,
t1.express_status,
t1.express_status_desc,
t1.express_num,
t1.express_company,
t1.express_by,
t1.express_note,
t1.express_by_name,
t1.confirmed_by,
t1.confirmed_by_name,
t1.CREATE_JE_FLAG,
t1.reversed_flag,
t1.reversed_flag_desc,
t1.source_document_number,
t1.receipt_print_status,
t1.receipt_number,
decode(t1.receipt_print_status,'Y','已打印','未打印') receipt_print_status_des,
to_char(t1.last_receipt_print_time, 'yyyy-mm-dd') as last_receipt_print_time,
t1.vat_invoice_code
FROM acr_invoice_hd_v t1
#WHERE_CLAUSE#
order by t1.invoice_date desc , t1.document_number desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number >= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number <= ${@document_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number >= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number <= ${@invoice_number_t}"/>
<bm:query-field name="project_number_f" queryExpression="t1.project_number >= ${@project_number_f}"/>
<bm:query-field name="project_number_t" queryExpression="t1.project_number <= ${@project_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number >= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number <= ${@contract_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date >= to_date(${@invoice_date_f},'yyyy-mm-dd')"/>
<bm:query-field name="invoice_date_t" queryExpression="t1.invoice_date <= to_date(${@invoice_date_t},'yyyy-mm-dd')"/>
<bm:query-field name="accounting_date_f" queryExpression="t1.accounting_date >= to_date(${@accounting_date_f},'yyyy-mm-dd')"/>
<bm:query-field name="accounting_date_t" queryExpression="t1.accounting_date <= to_date(${@accounting_date_t},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount >= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount <= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code >= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code <= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status = ${@invoice_status}"/>
<bm:query-field name="vat_interface_status" queryExpression="t1.vat_interface_status = ${@vat_interface_status}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<bm:query-field name="received_flag" queryExpression="(nvl(t1.express_status,'UNDELIVERED') !='RECEIVED' or ${@received_flag}='Y')"/>
<bm:query-field name="express_status" queryExpression="t1.express_status = ${@express_status}"/>
<bm:query-field name="confirmed_by" queryExpression="t1.confirmed_by = ${@confirmed_by}"/>
<bm:query-field name="reversed_flag" queryExpression="t1.reversed_flag = ${@reversed_flag}"/>
<bm:query-field name="receipt_print_status" queryExpression="nvl(t1.receipt_print_status,'N') = ${@receipt_print_status}"/>
<!-- <bm:query-field name="query_contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/> -->
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression=" t1.company_id = ${/session/@company_id}"/>
</bm:data-filters>
</bm:model>