Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
ca6cd7a2
Commit
ca6cd7a2
authored
Apr 30, 2021
by
李贺贺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发票认领申请、发票认领确认电子发票邮件发送
parent
1b019a8b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
267 additions
and
2 deletions
+267
-2
acr_atm_update.lwm
...main/webapp/WEB-INF/classes/acr/ACR516/acr_atm_update.lwm
+35
-0
acr_bpname_for_bpmster.lwm
...app/WEB-INF/classes/acr/ACR516/acr_bpname_for_bpmster.lwm
+13
-0
acr_invoice_claim_application_new.lwm
.../classes/acr/ACR604/acr_invoice_claim_application_new.lwm
+1
-0
acr_invoice_claim_confirm_new.lwm
...-INF/classes/acr/ACR605/acr_invoice_claim_confirm_new.lwm
+1
-0
acr_invoice_claim_application.lview
...pp/modules/acr/ACR516/acr_invoice_claim_application.lview
+60
-0
import_invoice_to_email.lsc
...ain/webapp/modules/acr/ACR516/import_invoice_to_email.lsc
+124
-0
acr_invoice_claim_confirm.lview
...webapp/modules/acr/ACR517/acr_invoice_claim_confirm.lview
+33
-2
No files found.
src/main/webapp/WEB-INF/classes/acr/ACR516/acr_atm_update.lwm
0 → 100644
View file @
ca6cd7a2
<?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.file_name,t.file_path
FROM (SELECT fa.file_name, fa.file_path
FROM fnd_atm_attachment fa, fnd_atm_attachment_multi m
WHERE m.attachment_id = fa.attachment_id
AND fa.source_type_code = 'fnd_atm_attachment_multi'
AND fa.source_pk_value = m.record_id
AND m.table_name = 'ACR_INVOICE_HD'
AND m.table_pk_value = ${@invoice_hd_id}) t
WHERE rownum = 1
]]>
</bm:query-sql>
</bm:operation>
<bm:operation
name=
"update"
>
<bm:update-sql>
<![CDATA[
begin
acr_invoice_pkg.send_invoice_mail(
p_file_name =>
${@file_name},
p_file_path => ${@file_path} ,
p_file_size => ${@file_size},
p_user_id => ${/session/@user_id},
p_bp_id => ${@bp_id}
);
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field
name=
"file_name"
databaseType=
"VARCHAR2"
datatype=
"java.lang.String"
physicalName=
"FILE_NAME"
/>
<bm:field
name=
"file_path"
databaseType=
"VARCHAR2"
datatype=
"java.lang.String"
physicalName=
"FILE_PATH"
/>
</bm:fields>
</bm:model>
\ No newline at end of file
src/main/webapp/WEB-INF/classes/acr/ACR516/acr_bpname_for_bpmster.lwm
0 → 100644
View file @
ca6cd7a2
<?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 hb.bp_name from hls_bp_master hb where hb.bp_id = ${@bp_id}
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field
name=
"bp_name"
databaseType=
"VARCHAR2"
datatype=
"java.lang.String"
physicalName=
"BP_NAME"
/>
</bm:fields>
</bm:model>
\ No newline at end of file
src/main/webapp/WEB-INF/classes/acr/ACR604/acr_invoice_claim_application_new.lwm
View file @
ca6cd7a2
...
@@ -132,6 +132,7 @@
...
@@ -132,6 +132,7 @@
invoice_apply_num,
invoice_apply_num,
( ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id))csh_transaction_flag,
( ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id))csh_transaction_flag,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
invoice_type,
invoice_kind_type,
invoice_kind_type,
invoice_kind_type_n
invoice_kind_type_n
FROM acr_invoice_hd_v t) t1
FROM acr_invoice_hd_v t) t1
...
...
src/main/webapp/WEB-INF/classes/acr/ACR605/acr_invoice_claim_confirm_new.lwm
View file @
ca6cd7a2
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
invoice_apply_num,
invoice_apply_num,
ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id)csh_transaction_flag,
ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id)csh_transaction_flag,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
decode(ACR_INVOICE_WFL_PKG.get_invoice_transaction_flag(t.invoice_hd_id),'NOT','未收款','PARTIAL','部分收款','FULL','完全收款')csh_transaction_flag_desc,
invoice_type,
invoice_kind_type,
invoice_kind_type,
invoice_kind_type_n
invoice_kind_type_n
...
...
src/main/webapp/modules/acr/ACR516/acr_invoice_claim_application.lview
View file @
ca6cd7a2
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
url=
"${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"
/>
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"
<a:link
id=
"con_contract_get_layout_code_link_id"
model=
"cont.CON500.con_contract_get_layout_code"
modelaction=
"update"
/>
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[
<script
type=
"text/javascript"
>
<![CDATA[
...
@@ -76,7 +77,65 @@
...
@@ -76,7 +77,65 @@
function
submit_success_btn(ds)
{
function
submit_success_btn(ds)
{
$('acr516_invoice_result_ds').query();
$('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(!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
});
}
});
},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>
]]
></script>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
<a:dataSets>
<a:dataSets>
...
@@ -141,6 +200,7 @@
...
@@ -141,6 +200,7 @@
<a:toolbarButton
click=
"acr516_invoice_query"
text=
"HLS.QUERY"
/>
<a:toolbarButton
click=
"acr516_invoice_query"
text=
"HLS.QUERY"
/>
<a:toolbarButton
click=
"acr516_invoice_reset"
text=
"HLS.RESET"
/>
<a:toolbarButton
click=
"acr516_invoice_reset"
text=
"HLS.RESET"
/>
<a:toolbarButton
click=
"acr516_invoice_apply"
text=
"申请"
/>
<a:toolbarButton
click=
"acr516_invoice_apply"
text=
"申请"
/>
<a:toolbarButton
click=
"acr516_invoice_send"
text=
"发送电子发票"
/>
</a:screenTopToolbar>
</a:screenTopToolbar>
<a:form
marginWidth=
"30"
padding=
"0"
title=
"查询条件"
column=
"4"
>
<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=
"document_number"
bindTarget=
"acr516_invoice_query_ds"
prompt=
"单据编号"
width=
"120"
/>
...
...
src/main/webapp/modules/acr/ACR516/import_invoice_to_email.lsc
0 → 100644
View file @
ca6cd7a2
<?xml version="1.0" encoding="UTF-8"?>
<a:service
xmlns:a=
"http://www.leaf-framework.org/application"
xmlns:dr=
"leaf.plugin.excelreport"
xmlns:s=
"leaf.plugin.script"
trace=
"true"
>
<a:init-procedure>
<s:server-script>
<![CDATA[
importPackage(java.util.zip);
importPackage(java.io);
//系统参数获取
function info_query(parameter_code) {
var info = new Object();
var data = null;
var parameter_map = $bm('wx.WX100.sys_parameter_value').queryAsMap({
parameter_code:parameter_code
});
var data = parameter_map.getChildren();
info.code_value = data[0].code_value;
return info;
}
//打包文件路径
var file_dir = info_query('ELE_ACR_DIR').code_value;
function writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
//zos.setEncoding("UTF-8");//如果是org.apache.tools.zip需要追加字符集
zos.putNextEntry(ze);
var fis = new FileInputStream(fp);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
zos.write(b, 0, len);
}
fis.close();
}
//获取商业伙伴名称
function getBpName(str){
var bp_map = $bm('acr.ACR516.acr_bpname_for_bpmster').queryAsMap({
bp_id: str
});
var bp_att = bp_map.getChildren();
var bp_name = bp_att[0].bp_name;
return bp_name;
}
try {
var resultStr = $ctx.parameter.result_map;
//println(resultStr);
var jm = JSON.parse(resultStr);
//println(typeof jm);
//压缩次数
for(var key in jm){
var fileP = [];
var fileN = [];
//转为数字
var bp_id = parseInt(key);
var bp_name = getBpName(bp_id);
//println(key);
var hds = jm[key];
println(hds);
//转为数组
var hdsArr = hds.split(',');
//println(typeof hdsArr);
//println(hdsArr.length);
//压缩文件夹
var zip_filename = '['+bp_name+']'+bp_id+'电子发票.zip';
var tranfer_file_path = file_dir + zip_filename;
var zipFile= new File(String(tranfer_file_path));
if(!zipFile.exists()){//如果文件夹不存在,创建文件夹
zipFile.createNewFile();
}
var zos = new ZipOutputStream(new FileOutputStream(zipFile));
for(var i =0; i< hdsArr.length; i++){
var hd_id = hdsArr[i];
var file_list = $bm('acr.ACR516.acr_atm_update').queryAsMap({
invoice_hd_id : hd_id
});
var files = file_list.getChildren();
var file_name = files[0].file_name;
var file_path = files[0].file_path;
//println(files[0].file_name);
//println(files[0].file_path);
if (file_path) {
writeFile(zos, file_name,file_path);
}
}
zos.close();
//插入到邮件表
var file = new File(tranfer_file_path);
var file_size = 0;
if(file.exists()){
file_size = file.length().toString();
}
// 往邮箱插入待发送的数据,插附件表
//println(zip_filename);
//println(tranfer_file_path);
//println( file_size);
var filename =zip_filename.toString();
var filepath =tranfer_file_path.toString();
var bpid = bp_id.toString();
var atm_bm = $bm('acr.ACR516.acr_atm_update');
atm_bm.update({
file_name :filename,
file_path :filepath,//文件名
file_size :file_size,
bp_id : bp_id
});
}
$ctx.success = "true";
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
//$bm('rollback').update({});
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
println(result);
]]>
</s:server-script>
</a:init-procedure>
<a:service-output
output=
"/parameter"
/>
</a:service>
src/main/webapp/modules/acr/ACR517/acr_invoice_claim_confirm.lview
View file @
ca6cd7a2
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
<a:link
id=
"acr_invoice_refuse_link_id"
model=
"acr.ACR605.acr_invoice_claim_return"
modelaction=
"batch_update"
/>
<a:link
id=
"acr_invoice_refuse_link_id"
model=
"acr.ACR605.acr_invoice_claim_return"
modelaction=
"batch_update"
/>
<a:link
id=
"con_contract_modify_link"
url=
"${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"
/>
<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=
"con_contract_get_layout_code_link_id"
model=
"cont.CON500.con_contract_get_layout_code"
modelaction=
"update"
/>
<a:link
id=
"acr517_invoice_send_to_email_link"
url=
"${/request/@context_path}/modules/acr/ACR516/import_invoice_to_email.lsc"
/>
<script
type=
"text/javascript"
>
<![CDATA[
<script
type=
"text/javascript"
>
<![CDATA[
...
@@ -43,18 +44,34 @@
...
@@ -43,18 +44,34 @@
// $('acr517_invoice_result_ds').setSubmitUrl('${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update');
// $('acr517_invoice_result_ds').setSubmitUrl('${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update');
var records=$('acr517_invoice_result_ds').getSelected();
var records=$('acr517_invoice_result_ds').getSelected();
var datas = [];
var datas = [];
var r_map = new Map();
for (var i = 0;i
< records.length
;i++)
{
for (var i = 0;i
< records.length
;i++)
{
datas.push({
datas.push({
'invoice_hd_id':records[i].get('invoice_hd_id'),
'invoice_hd_id':records[i].get('invoice_hd_id'),
'_status':
'update'
'_status':
'update'
})
})
if(records[i].get('invoice_type')
==
'ECT'){
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);
$L.showConfirm("提示",'确认执行该操作?',function(){
$L.showConfirm("提示",'确认执行该操作?',function(){
Leaf.request({
Leaf.request({
url:
'${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update',
url:
'${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update',
para:
datas,
para:
datas,
success:
function
()
{
success:
function
()
{
Leaf.request({
url:
$('acr517_invoice_send_to_email_link').getUrl(),
para:
{
result_map
:
result_map
}
});
Leaf.SideBar.show({
Leaf.SideBar.show({
msg:
'操作成功',
msg:
'操作成功',
duration:
2000
duration:
2000
...
@@ -130,7 +147,21 @@
...
@@ -130,7 +147,21 @@
function
submit_success_btn(){
function
submit_success_btn(){
$('acr517_invoice_result_ds').query();
$('acr517_invoice_result_ds').query();
}
}
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>
]]
></script>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
<a:dataSets>
<a:dataSets>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment