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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="con_contract_modify_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="acr516_invoice_send_to_email_link" url="${/request/@context_path}/modules/acr/ACR516/import_invoice_to_email.lsc"/>
<script type="text/javascript"><![CDATA[
function document_number_render(value, record, name) {
if (name == 'document_number' && value) {
return '<a href="javascript:open_document_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
}
function open_document_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'ACR513';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'UPDATE';
param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
}
//发票超练级
function acr516_invoice_query() {
$('acr516_invoice_result_ds').query();
}
function acr516_invoice_reset() {
$('acr516_invoice_query_ds').reset();
}
function acr516_invoice_apply() {
var records = $('acr516_invoice_result_ds').getSelected();
var datas = [];
for (var i = 0; i < records.length; i++) {
datas.push({
'invoice_hd_id': records[i].get('invoice_hd_id'),
'_status': 'update'
})
}
$L.showConfirm("提示", '确认执行该操作?', function () {
Leaf.Masker.mask(Ext.getBody(),'正在操作...');
Leaf.request({
url: '${/request/@context_path}/autocrud/acr.ACR604.acr_invoice_claim_application_new/batch_update',
para: datas,
success: function () {
Leaf.Masker.unmask(Ext.getBody());
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('acr516_invoice_result_ds').query();
},
failure: function () {
Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
})
}
function submit_success_btn(ds) {
$('acr516_invoice_result_ds').query();
}
//add by lihh 202104262 电子发票发送
function acr516_invoice_send(){
//debugger;
var ds = $('acr516_invoice_result_ds');
var records = ds.getSelected();
if (records.length == 0) {
Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350);
return;
}
var r_map = new Map();
for(var i = 0;i <records.length;i++){
if(records[i].get('claim_status') != 'CONFIRMED'){
Leaf.showMessage('提示','请勾选认领状态为已确认的单据');
return;
}
if(records[i].get('invoice_type') != 'ECT'){
Leaf.showMessage('提示','请勾选电子发票进行发送');
return;
}
if(records[i].get('division') == '70'){
if(!r_map.has(records[i].get('bp_id_agent_level1'))){
var arr = new Array();
arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('bp_id_agent_level1'),arr);
}else{
r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id'));
}
} else if(!r_map.has(records[i].get('invoice_bp_id'))){
var arr = new Array();
arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('invoice_bp_id'),arr);
}else{
r_map.get(records[i].get('invoice_bp_id')).add(records[i].get('invoice_hd_id'));
}
}
var result_map = MapTOJson(r_map);
Leaf.showConfirm('提示', '是否确认发送电子发票邮件?', function() {
Leaf.request({
url: $('acr516_invoice_send_to_email_link').getUrl(),
para: {
result_map : result_map
},
success: function(){
Leaf.SideBar.show({
msg: '发送成功',
duration: 2000
});
$('acr516_invoice_result_ds').query();
}
});
},null);
}
function MapTOJson(m) {
var str = '{';
var i = 1;
m.forEach(function (item, key, mapObj) {
if (mapObj.size == i) {
str += '"' + key + '":"' + item + '"';
} else {
str += '"' + key + '":"' + item + '",';
}
i++;
});
str += '}';
//console.log(str);
return str;
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<!--<a:dataSet id="acr516_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
<a:dataSet id="acr516_invoice_kind_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
<a:dataSet id="overdue_status_ds" lookupCode="YES_NO"/>
<a:dataSet id="acr516_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
<a:dataSet id="acr516_claim_status_ds" lookupCode="CLAIM_STATUS"/>
<a:dataSet id="cf_item_options">
<a:datas dataSource="/model/hls_cashflow_item_list"/>
</a:dataSet>
<a:dataSet id="claim_status_ds" loadData="true" lookupCode="CLAIM_STATUS"/>
<a:dataSet id="csh_transaction_flag_ds">
<a:datas>
<a:record code_value="NOT" code_value_name="未收款"/>
<a:record code_value="FULL" code_value_name="完全收款"/>
<a:record code_value="PARTIAL" code_value_name="部分收款"/>
</a:datas>
</a:dataSet>
<a:dataSet id="acr516_invoice_query_ds" autoCreate="true">
<a:fields>
<a:field name="invoice_apply_num"/>
<!--<a:field name="invoice_kind_desc" displayField="code_value_name" options="acr516_invoice_kind_ds"
returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type"/>
<a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr516_invoice_kind_ds"
returnField="invoice_kind_type" valueField="code_value"/>
<a:field name="full_elec_invoice_flag"/>
<a:field name="full_elec_invoice_flag_n" displayField="code_value_name" options="overdue_status_ds"
returnField="full_elec_invoice_flag" valueField="code_value"/>
<a:field name="invoice_status_desc" displayField="code_value_name" options="acr516_invoice_statu_ds"
returnField="invoice_status" valueField="code_value"/>
<a:field name="total_amount"/>
<a:field name="csh_transaction_flag"/>
<a:field name="csh_transaction_flag_desc" options="csh_transaction_flag_ds"
displayField="code_value_name" returnField="csh_transaction_flag" valueField="code_value"/>
<a:field name="cf_item"/>
<a:field name="cf_item_n" options="cf_item_options" displayField="description" returnField="cf_item"
valueField="cf_item"/>
<a:field name="claim_status_n" options="claim_status_ds" displayField="code_value_name"
valueField="code_value" returnField="claim_status"/>
<a:field name="cf_item_desc" autoComplete="true" lovGridHeight="350" lovHeight="500"
lovLabelWidth="100" lovService="acr.ACR510.hls_cashflow_item_v_lov" lovWidth="520"
title="现金流项目">
<a:mapping>
<a:map from="cf_item" to="cf_item"/>
<a:map from="cf_item_desc" to="cf_item_desc"/>
</a:mapping>
</a:field>
<a:field name="claim_status" displayField="code_value_name" options="acr516_claim_status_ds"
returnField="claim_status" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="acr516_invoice_result_ds" fetchAll="false" autoPageSize="true" autoQuery="true"
model="acr.ACR604.acr_invoice_claim_application_new" queryDataSet="acr516_invoice_query_ds"
selectable="true">
<a:events>
<a:event name="submitsuccess" handler="submit_success_btn"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="acr516_invoice_query" text="HLS.QUERY"/>
<a:toolbarButton click="acr516_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr516_invoice_apply" text="申请"/>
<a:toolbarButton click="acr516_invoice_send" text="发送电子发票"/>
</a:screenTopToolbar>
<a:form marginWidth="30" padding="0" title="查询条件" column="4">
<a:textField name="document_number" bindTarget="acr516_invoice_query_ds" prompt="单据编号" width="120"/>
<a:textField name="contract_number" bindTarget="acr516_invoice_query_ds" prompt="合同编号" width="120"/>
<a:textField name="contract_name" bindTarget="acr516_invoice_query_ds" prompt="合同名称" width="120"/>
<!-- <a:lov name="cf_item_desc" bindTarget="acr516_invoice_query_ds" prompt="现金流项目" width="135"/>-->
<a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr516_invoice_query_ds"
prompt="开票金额含税额从" width="120"/>
<a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr516_invoice_query_ds"
prompt="开票金额含税额到" width="120"/>
<a:textField name="invoice_title" bindTarget="acr516_invoice_query_ds" prompt="发票抬头" width="120"/>
<!--<a:comboBox name="invoice_kind_desc" bindTarget="acr516_invoice_query_ds" prompt="ACR.INVOICE_KIND"
width="120"/>-->
<a:comboBox name="invoice_kind_type_n" bindTarget="acr516_invoice_query_ds" prompt="发票种类"
width="120"/>
<!-- <a:comboBox name="invoice_status_desc" bindTarget="acr516_invoice_query_ds" prompt="发票状态" width="135"/>-->
<a:textField name="vat_invoice_code" bindTarget="acr516_invoice_query_ds" prompt="发票代码" width="120"/>
<a:textField name="invoice_number" bindTarget="acr516_invoice_query_ds" prompt="发票号码" width="120"/>
<a:comboBox name="claim_status_n" bindTarget="acr516_invoice_query_ds" prompt="认领状态" width="120"/>
<a:comboBox name="csh_transaction_flag_desc" bindTarget="acr516_invoice_query_ds" prompt="收款标记"
width="120"/>
<a:textField name="invoice_apply_num" bindTarget="acr516_invoice_query_ds" prompt="申请编号" width="120"/>
<a:datePicker name="invoice_date_from" bindTarget="acr516_invoice_query_ds" prompt="发票日期从" width="120"/>
<a:datePicker name="invoice_date_to" bindTarget="acr516_invoice_query_ds" prompt="发票日期到" width="120"/>
<a:comboBox name="full_elec_invoice_flag_n" bindTarget="acr516_invoice_query_ds" prompt="是否全电发票"
width="120"/>
</a:form>
<a:grid id="acr516_invoice_grid_id" bindTarget="acr516_invoice_result_ds" marginHeight="225"
marginWidth="30" navBar="true">
<a:columns>
<a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" width="120"
renderer="document_number_render"/>
<a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true"
width="150"/>
<!-- <a:column name="contract_name" width="150" prompt="合同名称"/>-->
<a:column name="bp_agent_name" prompt="代理商" width="100"/>
<!-- <a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>-->
<a:column name="invoice_kind_type_n" prompt="发票类型" width="200"/>
<!--<a:column name="invoice_number" width="120" prompt="发票号码"/>-->
<a:column name="vat_invoice_code" width="120" prompt="发票代码"/>
<a:column name="invoice_date" renderer="Leaf.formatDate" prompt="发票日期" width="100"/>
<a:column name="invoice_bp_code" prompt="开票客户编号" width="100"/>
<!-- <a:column name="invoice_bp_name" autoAdjust="false" showTitle="true" prompt="开票客户名称" width="150"/>-->
<a:column name="invoice_title" autoAdjust="false" showTitle="true" prompt="发票抬头" width="150"/>
<a:column name="total_amount" align="right" renderer="Leaf.formatMoney" prompt="发票金额" width="100"/>
<a:column name="tax_amount" align="right" renderer="Leaf.formatMoney" prompt="税额" width="100"/>
<a:column name="net_amount" align="right" renderer="Leaf.formatMoney" prompt="不含税金额" width="100"/>
<!-- <a:column name="currency" prompt="币种" width="80"/>-->
<a:column name="created_by_name" autoAdjust="false" showTitle="true" prompt="创建人" width="150"/>
<!-- <a:column name="invoice_status_desc" prompt="发票状态" width="100"/>-->
<!-- <a:column name="vat_interface_status_desc" prompt="金税状态" width="100"/>-->
<a:column name="accounting_date" renderer="Leaf.formatDate" prompt="期间序号" width="100"/>
<!-- <a:column name="create_je_flag" prompt="凭证标志" width="60"/>-->
<a:column name="bp_tax_registry_num" prompt="纳税人识别号"/>
<a:column name="claim_status_n" prompt="认领状态" width="100"/>
<a:column name="invoice_apply_num" prompt="申请编号" width="120"/>
<a:column name="csh_transaction_flag_desc" prompt="收款标记" width="80"/>
<a:column name="full_elec_invoice_flag_n" prompt="是否全电发票" width="80"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>