Commit 949d2912 authored by Darming's avatar Darming

Merge branch 'feature/write_off_bugs' into develop

parents 450123aa 060e6e18
Pipeline #3150 canceled with stages
......@@ -139,6 +139,17 @@
<artifactId>jaxen</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
<build>
<finalName>hlcm</finalName>
......
......@@ -18,7 +18,7 @@
AND sc.code_value = t1.contract_status) contract_status_desc
from con_contract t1
where
t1.contract_status in ('INCEPT','ET')
t1.contract_status in ('INCEPT','ET','NEW')
and t1.data_class = 'NORMAL'
and t1.company_id in ((
select company_id
......@@ -29,7 +29,8 @@ union
select t.parent_company_id company_id
from fnd_companies t
where t.parent_company_id is not null
and (t.company_id = ${/session/@company_id} or t.parent_company_id = ${/session/@company_id})))) t
and (t.company_id = ${/session/@company_id} or t.parent_company_id = ${/session/@company_id})))
) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -53,7 +54,8 @@ select t.parent_company_id company_id
queryExpression="due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field field="dd_bank_account_num" queryOperator="="/>
<bm:query-field field="dd_bank_account_name" queryOperator="="/>
<bm:query-field name="bp_id" queryExpression="(t.bp_id_tenant = ${@bp_id} or t.bp_id_agent_level1 = ${@bp_id})"/>
<bm:query-field name="bp_id"
queryExpression="(t.bp_id_tenant = ${@bp_id} or t.bp_id_agent_level1 = ${@bp_id})"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like '%' || ${@bp_name} || '%'"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2014-1-8 下午3:44:11
$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.*
from (select null employee_id,
null employee_code,
null email,
-1 * cv.company_id unit_id,
cv.company_code unit_code,
cv.company_short_name unit_name,
null name,
null parent_unit_id,
null position_code,
rpad(cv.company_code, 10, '0') || rpad('0', 10, '0') as seq
from fnd_companies_vl cv
where cv.enabled_flag = 'Y'
union all
SELECT null employee_id,
null employee_code,
null email,
u.unit_id,
u.unit_code,
u.unit_name,
null name,
-1 * u.company_id parent_unit_id,
null position_code,
rpad(u.unit_code, 10, '0') || rpad('0', 10, '0') as seq
FROM exp_org_unit_v u
WHERE u.enabled_flag = 'Y'
union all
select e.employee_id,
e.employee_code,
e.email,
null unit_id,
d.unit_code,
null unit_name,
e.name,
d.unit_id parent_unit_id,
c.position_code,
rpad(d.unit_code, 10, '0') || rpad(c.position_code, 10, '0')||e.employee_code as seq
from exp_employees e,
exp_employee_assigns b,
exp_org_position c,
exp_org_unit_v d
WHERE e.employee_id = b.employee_id
AND b.position_id = c.position_id(+)
AND c.unit_id = d.unit_id(+)
AND b.enabled_flag = 'Y'
AND c.enabled_flag(+) = 'Y'
AND d.enabled_flag(+) = 'Y') t1
START WITH parent_unit_id is null
connect by t1.parent_unit_id = prior t1.unit_id
ORDER BY t1.seq
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangxing5129
$Date: 2014-7-24 下午07:21:28
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
SELECT zj_sys_mail_pkg.get_mail_filename(p_table_pk_value => ${@mail_list_id},
p_table_name => 'ZJ_SYS_MAILING_LIST',
p_user_id => ${/session/@user_id} )
into ${@file_name} FROM dual ;
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="file_name" output="true" outputPath="/parameter/@file_name"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangxing5129
$Date: 2014-9-1 下午02:08:43
$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 zj_sys_mailing_list_s.nextval mail_list_id from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2014-1-8 下午4:01:48
$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.contact_person as person, t1.cell_phone as mobile
from hls_bp_master_contact_info t1
where t1.ref_v01 = 'Y'
order by person
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangyu
$Date: 2019-3-5 上午9:14:12
$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
sms.mail_smtp_host,
sms.mail_protocol,
sms.mail_port_number,
sms.mail_address,
sms.mail_username,
sms.mail_password,
sms.attch_directory
FROM
sys_mail_server sms
WHERE
sms.enabled_flag = 'Y' and sms.DEFAULT_FLAG = 'Y'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="mail_smtp_host"/>
<bm:field name="mail_protocol"/>
<bm:field name="mail_port_number"/>
<bm:field name="mail_address"/>
<bm:field name="mail_username"/>
<bm:field name="mail_password"/>
<bm:field name="attch_directory"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2014-1-15 上午10:50:46
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
update zj_sys_mailing_list m
set m.sent_flag = 'N',
m.error_times = 0,
m.creation_date = sysdate
where m.mailing_list_id = ${@mailing_list_id};
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
zj_sys_mail_pkg.insert_mailing_list(p_mail_list_id =>${@mail_list_id},
p_mail_to => ${@mail_to},
p_mail_cc => ${@mail_cc},
p_subject => ${@subject},
p_body => ${@body},
p_user_id => ${/session/@user_id},
p_content_type => 'text/html');
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangyu
$Date: 2019-3-8 下午2:34:18
$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
faa.file_name,
faa.file_path
FROM
fnd_atm_attachment faa,
fnd_atm_attachment_multi faam
WHERE
faa.attachment_id = faam.attachment_id AND
faa.source_type_code = 'fnd_atm_attachment_multi' AND
faa.source_pk_value = faam.record_id AND
faam.table_name = 'ZJ_SYS_MAILING_LIST'
and faam.table_pk_value = ${@mailing_list_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangyu
$Date: 2019-3-5 上午9:59:57
$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
mailing_list_id,
mail_to,
mail_cc,
subject,
body,
content_type
FROM
zj_sys_mailing_list
WHERE
sent_flag = 'N' AND
error_times <= 3 AND
(
sysdate - creation_date
)
< 3
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
DECLARE
v_mailing_list_id NUMBER;
v_notify_record_id NUMBER;
v_mail_to VARCHAR2(4000);
v_mail_cc VARCHAR2(4000);
v_subject VARCHAR2(2000);
v_attch_file_name VARCHAR2(2000);
v_created_by NUMBER;
v_creation_date DATE;
v_last_updated_by NUMBER;
v_last_update_date DATE;
v_body Long;
BEGIN
UPDATE
zj_sys_notify_record r
SET r.status = 'SENT',
r.send_time = sysdate,
r.last_update_date = sysdate
WHERE r.record_id =
(SELECT l.notify_record_id
FROM zj_sys_mailing_list l
WHERE l.mailing_list_id = ${@mailing_list_id}
);
SELECT t.mailing_list_id,
t.notify_record_id,
t.mail_to,
t.mail_cc,
t.subject,
t.created_by,
t.creation_date,
t.last_updated_by,
t.last_update_date,
t.body,
t.attch_file_name
INTO
v_mailing_list_id,
v_notify_record_id,
v_mail_to,
v_mail_cc,
v_subject,
v_created_by,
v_creation_date,
v_last_updated_by,
v_last_update_date,
v_body,
v_attch_file_name
FROM zj_sys_mailing_list t
WHERE t.mailing_list_id = ${@mailing_list_id};
INSERT
INTO zj_sys_mailing_list_ht
(mailing_list_id,
notify_record_id,
mail_to,
mail_cc,
subject,
Body,
note,
sent_flag,
sent_date,
attch_file_name,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (v_mailing_list_id,
v_notify_record_id,
v_mail_to,
v_mail_cc,
v_subject,
v_body,
'',
'Y',
Sysdate,
v_attch_file_name,
v_created_by,
v_creation_date,
v_last_updated_by,
v_last_update_date);
DELETE FROM zj_sys_mailing_list WHERE mailing_list_id = ${@mailing_list_id};
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
zj_sys_mailing_list
SET note = '发送失败',
error_times = error_times + 1,
last_update_date = sysdate
WHERE mailing_list_id = ${@mailing_list_id};
UPDATE
zj_sys_notify_record r
SET r.status = 'ERROR',
r.last_update_date = sysdate
WHERE r.record_id =
(SELECT l.notify_record_id
FROM zj_sys_mailing_list l
WHERE l.mailing_list_id = ${@mailing_list_id}
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="mail_to"/>
<bm:field name="mailing_list_id"/>
<bm:field name="mail_cc"/>
<bm:field name="subject"/>
<bm:field name="body"/>
<bm:field name="content_type"/>
</bm:fields>
</bm:model>
......@@ -79,7 +79,7 @@
} else {
var saveData = [];
var transaction_type = '${/parameter/transaction_type}';
var transaction_type = '${/parameter/@transaction_type}';
// if (receipt_type == 'WITHHOLD') { //划扣
// if (all.length != records.length) {
// Leaf.showInfoMessage("提示", "该现金事务不支付部分反冲");
......@@ -96,37 +96,44 @@
Leaf.showInfoMessage("提示", "该现金事务不支付部分反冲");
return;
}
}
var gld_batch_id = records[0].get('gld_batch_id');
for (var i = 0; i < records.length; i++) {
if (records[i].get('gld_batch_id') != gld_batch_id) {
Leaf.showInfoMessage("提示", "请选择同一批次号的记录反冲!");
return;
for (var i = 0; i < records.length; i++) {
records[i].set('reversed_date', head_record.get('reversed_date'));
records[i].set('description', head_record.get('description'));
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
records[i].set('reversed_date', head_record.get('reversed_date'));
records[i].set('description', head_record.get('description'));
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
//同批次未勾选的
var allR = $('csh_transaction_receipt_write_off_reverse_detail_result_ds').getAll();
var unR = [];
for (var i = 0; i < allR.length; i++) {
if (records.indexOf(allR[i]) === -1) {
unR.push(allR[i]);
} else {
var gld_batch_id = records[0].get('gld_batch_id');
for (var i = 0; i < records.length; i++) {
if (records[i].get('gld_batch_id') != gld_batch_id) {
Leaf.showInfoMessage("提示", "请选择同一批次号的记录反冲!");
return;
}
records[i].set('reversed_date', head_record.get('reversed_date'));
records[i].set('description', head_record.get('description'));
records[i].set('_status', 'update');
saveData.push(records[i].data);
}
}
for (var i = 0; i < unR.length; i++) {
if(unR[i].get('gld_batch_id') == gld_batch_id){
Leaf.showInfoMessage("提示", "请选择全部同一批次号的记录反冲!");
return;
//同批次未勾选的
var allR = $('csh_transaction_receipt_write_off_reverse_detail_result_ds').getAll();
var unR = [];
for (var i = 0; i < allR.length; i++) {
if (records.indexOf(allR[i]) === -1) {
unR.push(allR[i]);
}
}
for (var i = 0; i < unR.length; i++) {
if (unR[i].get('gld_batch_id') == gld_batch_id) {
Leaf.showInfoMessage("提示", "请选择全部同一批次号的记录反冲!");
return;
}
}
}
//排序
saveData.sort(function(a,b){
return b.write_off_id - a.write_off_id;
});
//排序
saveData.sort(function (a, b) {
return b.write_off_id - a.write_off_id;
});
}
//区别批量核销和单笔核销
var url;
......@@ -163,8 +170,8 @@
return;
}, null, null);
}
}
}
function csh514_write_off_reverse_return() {
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:s="leaf.plugin.script" xmlns:msg="leaf.application.features.msg"
xmlns:a="http://www.leaf-framework.org/application" xmlns:dr="leaf.plugin.excelreport"
xmlns:excel="leaf.application.task.excel" xmlns:t="uncertain.composite.transform"
xmlns:mail="leaf.plugin.mail" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.hl.mail);
try {
var mail_server_bm = $bm('sys.SYS405.sys_get_mail_server');
var mail_server_result = mail_server_bm.queryAsMap().getChildren();
var mail_list_bm = $bm('sys.SYS405.zj_sys_mailing_list');
var mail_list_result = mail_list_bm.queryAsMap().getChildren();
println('###############' + mail_list_result.length + '###############');
for (var i = 0; i < mail_list_result.length; i++) {
var mb = new HlMailBean();
mb.setHost(mail_server_result[0].mail_smtp_host); // 设置SMTP主机(163),若用126,则设为:smtp.126.com
mb.setPort(mail_server_result[0].mail_port_number); //设置端口号
mb.setUsername(mail_server_result[0].mail_username); // 设置发件人邮箱的用户名
mb.setPassword(mail_server_result[0].mail_password); // 设置发件人邮箱的密码,需将*号改成正确的密码
mb.setFrom(mail_server_result[0].mail_address); // 设置发件人的邮箱
mb.setTo(mail_list_result[i].mail_to); // 设置收件人的邮箱
println(mail_list_result[i].mail_to);
if (mail_list_result[i].mail_cc) {
mb.setCc(mail_list_result[i].mail_cc); // 设置抄送人的邮箱
} else {
mb.setCc(mail_list_result[i].mail_to);
}
mb.setSubject(mail_list_result[i].subject); // 设置邮件的主题
mb.setContent(mail_list_result[i].body); // 设置邮件的正文
//mb.setContent(mail_list_result[i].content_type); // 设置邮件的格式 text/html为html,text/plain为纯文本
//设置附件
//mb.attachFile("D:\\abc.xlsx"); // 往邮件中添加附件
var mail_file_bm = $bm('sys.SYS405.zj_sys_mailing_file');
var mail_file_result = mail_file_bm.queryAsMap({
mailing_list_id: mail_list_result[i].mailing_list_id
}).getChildren();
for (var j = 0; j < mail_file_result.length; j++) {
mb.attachFile(mail_file_result[j].file_path);
}
var sm = new HlSendMail();
if (mail_list_result[i].content_type == "text/html") {
println(mail_list_result[i].mailing_list_id);
if (sm.sendHtmlMail(mb)) {
$bm('sys.SYS405.zj_sys_mailing_list').update({
mailing_list_id: mail_list_result[i].mailing_list_id
});
} else {
$bm('sys.SYS405.zj_sys_mailing_list').execute({
mailing_list_id: mail_list_result[i].mailing_list_id
});
}
} else {
if (sm.sendMail(mb)) {
$bm('sys.SYS405.zj_sys_mailing_list').update({
mailing_list_id: mail_list_result[i].mailing_list_id
});
} else {
$bm('sys.SYS405.zj_sys_mailing_list').execute({
mailing_list_id: mail_list_result[i].mailing_list_id
});
}
}
}
} catch (e) {
raise_app_error(e);
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
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