Commit 22c4ac37 authored by stone's avatar stone

【fix】bug

parents baa98435 c68b21a2
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
...@@ -58,7 +58,7 @@ public class MailSend { ...@@ -58,7 +58,7 @@ public class MailSend {
try { try {
MimeMessage message = new MimeMessage(session); MimeMessage message = new MimeMessage(session);
message.addHeader("X-Mailer", "Microsoft Outlook Express 6.00.2900.2869"); message.addHeader("X-Mailer", "Microsoft Outlook Express 6.00.2900.2869");
message.setFrom(new InternetAddress(from)); message.setFrom(new InternetAddress(from,"建机系统","utf-8"));
//如果含有分号则去掉 //如果含有分号则去掉
//收件人可能有多个 //收件人可能有多个
String[] toParams = jsonObject.optString("toAddress").split(";"); String[] toParams = jsonObject.optString("toAddress").split(";");
...@@ -137,10 +137,10 @@ public class MailSend { ...@@ -137,10 +137,10 @@ public class MailSend {
jb.put("toCcAddress", ""); jb.put("toCcAddress", "");
jb.put("toSubject", "123"); jb.put("toSubject", "123");
jb.put("toBody", "<span style=\"white-space:nowrap;\">复制测试最后一百年</span>"); jb.put("toBody", "<span style=\"white-space:nowrap;\">复制测试最后一百年</span>");
jb.put("content_type", "text/plain"); jb.put("content_type", "text/html");
jb.put("attch_flag", "Y"); jb.put("attch_flag", "Y");
jb.put("attch_file_name", "财务收支一览表.xlsx"); jb.put("attch_file_name", "财务收支一览表.xlsx");
jb.put("attch_file_path", "/u01/hls_file/excel/excel1587545458258.xlsx"); jb.put("attch_file_path", "d:/222.txt");
try{ try{
mailSend.sendMain(jb.toString()); mailSend.sendMain(jb.toString());
}catch(Exception e){ }catch(Exception e){
......
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
<bm:query-field name="document_type" queryExpression="vv.document_type=${@document_type}"/> <bm:query-field name="document_type" queryExpression="vv.document_type=${@document_type}"/>
<bm:query-field name="contract_status" queryExpression="vv.contract_status = ${@contract_status}"/> <bm:query-field name="contract_status" queryExpression="vv.contract_status = ${@contract_status}"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="vv.bp_id_agent_level1 = ${@bp_id_agent_level1}"/> <bm:query-field name="bp_id_agent_level1" queryExpression="vv.bp_id_agent_level1 = ${@bp_id_agent_level1}"/>
<bm:query-field name="bp_id_agent_level1_n" queryExpression="vv.bp_id_agent_level1_n like ${@bp_id_agent_level1_n}"/> <bm:query-field name="bp_id_agent_level1_n" queryExpression="vv.bp_id_agent_level1_n like &apos;%&apos;||${@bp_id_agent_level1_n}||&apos;%&apos;"/>
<bm:query-field name="termination_date_from" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@termination_date_from},&apos;yyyy-mm-dd&apos;)"/> <bm:query-field name="termination_date_from" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@termination_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="termination_date_to" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@termination_date_to},&apos;yyyy-mm-dd&apos;)"/> <bm:query-field name="termination_date_to" queryExpression="to_date(t1.termination_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@termination_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel=${@lease_channel}"/> <bm:query-field name="lease_channel" queryExpression="t1.lease_channel=${@lease_channel}"/>
......
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select * from ( select h.bp_name, h.bp_id SELECT *
from hls_bp_master h FROM (SELECT h.bp_name, h.bp_id
where h.bp_category = 'VENDER' FROM hls_bp_master h
and h.enabled_flag='Y') WHERE h.bp_category = 'VENDER'
AND h.enabled_flag = 'Y'
UNION ALL
SELECT '买断机' bp_name, -100 bp_id
FROM dual)
#WHERE_CLAUSE# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
......
...@@ -63,10 +63,7 @@ ...@@ -63,10 +63,7 @@
<bm:field name="finance_type"/> <bm:field name="finance_type"/>
<bm:field name="secondary_lease"/> <bm:field name="secondary_lease"/>
<bm:field name="vender_id"/> <bm:field name="vender_id"/>
<bm:field name="vender_id_n" expression="(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)" forInsert="false" forUpdate="false"/> <bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
<bm:field name="pay_method"/>
<bm:field name="pay_method_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;PAY_METHODS&apos; and scv.code_value = t1.pay_method)" forInsert="false" forUpdate="false"/>
<bm:field name="finance_type_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;FINANCE_TYPE&apos; and scv.code_value = t1.finance_type)" forInsert="false" forUpdate="false"/> <bm:field name="finance_type_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;FINANCE_TYPE&apos; and scv.code_value = t1.finance_type)" forInsert="false" forUpdate="false"/>
</bm:fields> </bm:fields>
......
<?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-field name="extra_nam" queryExpression="t.extra_name like &apos;%&apos; || ${@extra_nam} || &apos;%&apos;"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t.session_id=${/session/@session_id}"/>
<bm:data-filter enforceOperations="query" expression="exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 WHERE a1.trx_category = 'CONTRACT' and a1.trx_id = t.contract_id AND trunc(sysdate) between a1.start_date AND nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id AND a1.trx_category = a2.trx_category AND a2.authorized_user_id = ${/session/@user_id} AND trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate)))"/>
</bm:data-filters>
</bm:model>
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
(select 1 (select 1
from exp_emp_assign_e_v ee from exp_emp_assign_e_v ee
where ee.user_id = ${/session/@user_id} where ee.user_id = ${/session/@user_id}
and ee.unit_id not in (1565,1552,1564,1551,1559,1547,1560,1545,1546,1568,1566,1570,1550,1569,1555,1571,1558)
and ee.unit_id=(SELECT h.unit_id FROM hls_bp_master h WHERE h.bp_id=t1.bp_id) and ee.unit_id=(SELECT h.unit_id FROM hls_bp_master h WHERE h.bp_id=t1.bp_id)
and ${/session/@role_id} in (select v.role_id from sys_role_vl v where v.role_code in ('0018','0019')) ) ) and ${/session/@role_id} in (select v.role_id from sys_role_vl v where v.role_code in ('0018','0019')) ) )
or (${/session/@role_id} not in (select v.role_id from sys_role_vl v where v.role_code in ('0018','0019')) ))"/> or (${/session/@role_id} not in (select v.role_id from sys_role_vl v where v.role_code in ('0018','0019')) ))"/>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) purchase_amount, --留购金 AND ct.contract_id = contract_id)) purchase_amount, --留购金
(SELECT SUM(due_amount - nvl(received_amount, 0)) (SELECT SUM(due_amount - nvl(received_amount, 0))
FROM con_contract_cashflow FROM con_contract_cashflow
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) down_payment, --首付款 AND ct.contract_id = contract_id)) down_payment, --首付款
(SELECT SUM(due_amount) (SELECT SUM(due_amount)
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) lease_amount, --租金 AND ct.contract_id = contract_id)) lease_amount, --租金
(CASE (CASE
WHEN to_char(SYSDATE, 'dd') <= 20 AND WHEN to_char(SYSDATE, 'dd') <= 20 AND
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymmdd') = to_char(SYSDATE, 'yyyymmdd') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
'NO_DEDUCTION'),0) + 'NO_DEDUCTION'),0) +
NVL((SELECT SUM(nvl(c.lease_item_amount, 0) - NVL((SELECT SUM(nvl(c.lease_item_amount, 0) -
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymmdd') = to_char(SYSDATE, 'yyyymmdd') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
'NO_DEDUCTION'),0) 'NO_DEDUCTION'),0)
WHEN to_char(SYSDATE, 'dd') > 20 AND WHEN to_char(SYSDATE, 'dd') > 20 AND
...@@ -83,20 +83,20 @@ ...@@ -83,20 +83,20 @@
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(c.lease_start_date, 'yyyymmdd') = AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE, 'yyyymmdd') to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
'NO_DEDUCTION'),0)+ 'NO_DEDUCTION'),0)+
NVL((SELECT SUM(nvl(c.lease_item_amount, 0) - NVL((SELECT SUM(nvl(c.lease_item_amount, 0) -
nvl(c.down_payment, 0)) nvl(c.down_payment, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(c.lease_start_date, 'yyyymmdd') = AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE, 'yyyymmdd') to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
'NO_DEDUCTION'),0) 'NO_DEDUCTION'),0)
ELSE ELSE
0 null
END) outflow_amount END) outflow_amount
FROM (SELECT s.calendar_date FROM (SELECT s.calendar_date
FROM fnd_calendar_details s FROM fnd_calendar_details s
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
(SELECT 1 (SELECT 1
FROM con_contract t FROM con_contract t
WHERE t.contract_status IN WHERE t.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND t.contract_id = ccc.contract_id AND t.contract_id = ccc.contract_id
AND t.data_class = 'NORMAL')) AND t.data_class = 'NORMAL'))
ORDER BY s.calendar_date) t) v ORDER BY s.calendar_date) t) v
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) purchase_amount, --留购金 AND ct.contract_id = contract_id)) purchase_amount, --留购金
(SELECT SUM(due_amount - nvl(received_amount, 0)) (SELECT SUM(due_amount - nvl(received_amount, 0))
FROM con_contract_cashflow FROM con_contract_cashflow
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) down_payment, --首付款 AND ct.contract_id = contract_id)) down_payment, --首付款
(SELECT SUM(due_amount) (SELECT SUM(due_amount)
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND ct.contract_id = contract_id)) lease_amount, --租金 AND ct.contract_id = contract_id)) lease_amount, --租金
(CASE (CASE
WHEN to_char(SYSDATE, 'dd') <= 20 AND WHEN to_char(SYSDATE, 'dd') <= 20 AND
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymmdd') = to_char(SYSDATE, 'yyyymmdd') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
'NO_DEDUCTION'),0) + 'NO_DEDUCTION'),0) +
NVL((SELECT SUM(nvl(c.lease_item_amount, 0) - NVL((SELECT SUM(nvl(c.lease_item_amount, 0) -
...@@ -74,11 +74,11 @@ ...@@ -74,11 +74,11 @@
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymmdd') = to_char(SYSDATE, 'yyyymmdd') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
'NO_DEDUCTION'),0) 'NO_DEDUCTION'),0)
WHEN to_char(SYSDATE, 'dd') > 20 AND WHEN to_char(SYSDATE, 'dd') > 20 AND
to_char(add_months(t.calendar_date, -1), 'yyyymmdd') = to_char(add_months(t.calendar_date, -1), 'yyyymm') =
to_char(SYSDATE, 'yyyymm') || 20 THEN to_char(SYSDATE, 'yyyymm') || 20 THEN
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
(SELECT 1 (SELECT 1
FROM con_contract t FROM con_contract t
WHERE t.contract_status IN WHERE t.contract_status IN
('INCEPT', 'ETING', 'REPURING') ('INCEPT', 'PENDING','ETING', 'REPURING')
AND t.contract_id = ccc.contract_id AND t.contract_id = ccc.contract_id
AND t.data_class = 'NORMAL')) AND t.data_class = 'NORMAL'))
ORDER BY s.calendar_date) t) v ORDER BY s.calendar_date) t) v
......
...@@ -58,8 +58,7 @@ SELECT h.period_year, ...@@ -58,8 +58,7 @@ SELECT h.period_year,
WHERE cashflow_id = l.cashflow_id)) due_date, WHERE cashflow_id = l.cashflow_id)) due_date,
DECODE(h.je_transaction_code, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', 'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)), SUM(decode(reference6, NULL, nvl(l.amount_dr,0), 0)),
'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount (SELECT due_amount
FROM con_contract_cashflow FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) due_amount, WHERE cashflow_id = l.cashflow_id)) due_amount,
...@@ -109,14 +108,13 @@ SELECT h.period_year, ...@@ -109,14 +108,13 @@ SELECT h.period_year,
FROM hls_journal_header h, hls_journal_detail l FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null and h.sbo_num is not null
AND h.je_transaction_code IN AND h.je_transaction_code ='HL_SALES_TAX_ACT_NEW'
('HL_SALES_TAX_ACT_NEW', 'HL_CSH_CONSOLIDATION_DALAY')
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd')))) and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1 AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK' AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period} AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id)) li.ref_n04 = l.journal_line_id))
GROUP BY l.reference1, GROUP BY l.reference1,
...@@ -216,7 +214,64 @@ SELECT h.period_year, ...@@ -216,7 +214,64 @@ SELECT h.period_year,
AND hi.vat_interface_status = 'BACK' AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period} AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND ((hi.contract_id = l.source_doc_id AND li.cf_item IN (2)))) AND ((hi.contract_id = l.source_doc_id AND li.cf_item IN (2))))
) t1
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
SUM(calc_tax_amount(l.amount_dr)) amount_tax,
'违约金' times,
h.journal_date due_date,
SUM(l.amount_dr) due_amount,
NULL principal,
SUM(l.amount_dr) interest,
SUM(calc_tax_amount(l.amount_dr)) vat_due_amount,
nvl(ROUND( SUM(calc_tax_amount(l.amount_dr))/
(SUM(amount_dr) -SUM(calc_tax_amount(l.amount_dr))
),
2) * 100,
0) || '%' vat_rate,
h.je_transaction_code
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
AND h.je_transaction_code ='HL_CSH_CONSOLIDATION_DALAY'
AND l.amount_dr IS NOT NULL
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND li.ref_n04 = l.journal_line_id)
GROUP BY l.reference1,
reference3,
reference4,
h.sbo_num,
l.cashflow_id,
l.journal_header_id,
h.je_transaction_code,
h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date
) t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
select * from ( select * from (
SELECT t.contract_id, SELECT t.contract_id,
t.invoice_hd_id, t.invoice_hd_id,
t.invoice_line_id,
(SELECT v.code_value_name (SELECT v.code_value_name
FROM sys_code_values_v v FROM sys_code_values_v v
WHERE v.code = 'ACR510_INVOICE_KIND' WHERE v.code = 'ACR510_INVOICE_KIND'
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
WHERE t.session_id=${/session/@session_id} WHERE t.session_id=${/session/@session_id}
) t1 ) t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
order by invoice_hd_id order by invoice_hd_id,due_date ASC,invoice_line_id asc
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="update">
......
var override_queryfields = [
];
var add_datafilters = [ {
name : 'record_id',
expression : " t1.record_id = ${@record_id}"
} ];
add_datafilter();
override();
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
if (name == 'object_tax_registry_num' || name == 'invoice_bp_address_phone_num' || name == 'invoice_bp_bank_account') { if (name == 'object_tax_registry_num' || name == 'invoice_bp_address_phone_num' || name == 'invoice_bp_bank_account') {
if (Ext.isEmpty(value)) { if (Ext.isEmpty(value)) {
//if (record.get('bill_object_bp_class') == 'NP' || record.get('object_taxpayer_type') == 'SMALL_SCALE_TAXPAYER' || record.get('tax_type_vat') != 'Y') { //if (record.get('bill_object_bp_class') == 'NP' || record.get('object_taxpayer_type') == 'SMALL_SCALE_TAXPAYER' || record.get('tax_type_vat') != 'Y') {
if (record.get('bill_object_bp_class') == 'NP') { if (record.get('bill_object_bp_class') == 'NP'||record.get('object_taxpayer_type')=='SMALL_SCALE_TAXPAYER') {
return true; return true;
} else if (record.get('bill_object_bp_class') == 'ORG') { } else if (record.get('bill_object_bp_class') == 'ORG') {
return '必输字段不能为空!'; return '必输字段不能为空!';
...@@ -396,6 +396,7 @@ ...@@ -396,6 +396,7 @@
<a:comboBox name="object_taxpayer_type_desc" bindTarget="allConditionDs" prompt="纳税人类型"/> <a:comboBox name="object_taxpayer_type_desc" bindTarget="allConditionDs" prompt="纳税人类型"/>
<a:datePicker name="last_received_date_from" bindTarget="allConditionDs" prompt="收款日期从"/> <a:datePicker name="last_received_date_from" bindTarget="allConditionDs" prompt="收款日期从"/>
<a:datePicker name="last_received_date_to" bindTarget="allConditionDs" prompt="收款日期到"/> <a:datePicker name="last_received_date_to" bindTarget="allConditionDs" prompt="收款日期到"/>
<a:lov name="bp_id_agent_level1_n" bindTarget="allConditionDs" prompt="代理店"/>
</a:hBox> </a:hBox>
<!-- <a:formBody column="4" labelWidth="400"> <!-- <a:formBody column="4" labelWidth="400">
<a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/> <a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/>
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
<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="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[ <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) { 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){ if(name=='transaction_date_from' &&value){
...@@ -22,6 +24,32 @@ ...@@ -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> ]]></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:view> </a:view>
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
} catch (e) { } catch (e) {
raise_app_error(e); raise_app_error(e);
} }
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX') { if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK') {
// word转pdf // word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id; var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
<!-- <a:comboBox name="lease_organization_name" bindTarget="con560_contract_query_ds" prompt="事业部"/>--> <!-- <a:comboBox name="lease_organization_name" bindTarget="con560_contract_query_ds" prompt="事业部"/>-->
<a:comboBox name="contract_status_n" bindTarget="con560_contract_query_ds" prompt="合同状态"/> <a:comboBox name="contract_status_n" bindTarget="con560_contract_query_ds" prompt="合同状态"/>
</a:form> </a:form>
<a:grid id="con560_con_contract_grid_ds" bindTarget="con560_contract_result_ds" height="250" <a:grid id="con560_con_contract_grid_ds" bindTarget="con560_contract_result_ds" height="350"
marginWidth="30" navBar="true"> marginWidth="30" navBar="true">
<a:toolBar> <a:toolBar>
......
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
hdrecord.set('currency_code', currency_code); hdrecord.set('currency_code', currency_code);
hdrecord.set('currency_name', currency_name); hdrecord.set('currency_name', currency_name);
record.set('act_amount', minus(record.get('amount'), record.get('sum_ddct_amount') || 0)); record.set('act_amount', minus(record.get('amount'), record.get('sum_ddct_amount') || 0));
} else if(name=='amount_vender'&& value){ } else if(name=='amount_vender'){
var due_amount=record.get('due_amount'); var due_amount=record.get('due_amount');
var other_payment2=record.get('other_payment2'); var other_payment2=record.get('other_payment2');
var amount_agent=minus(minus(due_amount,other_payment2),value); var amount_agent=minus(minus(due_amount,other_payment2),value);
...@@ -443,22 +443,9 @@ ...@@ -443,22 +443,9 @@
function csh501_print() { function csh501_print() {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'); var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var records_l = $(lnds_id).getAll();
var hd_record = $(hdds_id).getCurrentRecord(); var hd_record = $(hdds_id).getCurrentRecord();
//add by st
var url;
/* url = $('tre_loan_con_print_excel_link_id').getUrl() + '?payment_req_id=' +hd_record.get('payment_req_id');
window.open(href = url);*/
var templet_code = 'CSH_PAYMENT_REQ';
// 根据不同的厂商调用不用的模板
if(hd_record.get('vender_name').indexOf('永立')>=0){
var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ_YL&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
}else{
var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON'; var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
}
window.open(href = url_l, target = "_self"); window.open(href = url_l, target = "_self");
...@@ -774,13 +761,16 @@ ...@@ -774,13 +761,16 @@
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return; return;
} }
console.log('${/parameter/@division}');
var total_amount_agent=0; var total_amount_agent=0;
var total_amount_vender=0; var total_amount_vender=0;
var total_apply_amount=0; var total_apply_amount=0;
//检验输入的数据是否符合要求 //检验输入的数据是否符合要求
var check_due_amount_flag=true; var check_due_amount_flag=true;
var line_datas=$(ds_line_id).data; var line_datas=$(ds_line_id).data;
var head_record=$(ds_id).getAt(0);
//高空作业车个数
var gk_contract_num=0;
for(var i=0;i<line_datas.length;i++){ for(var i=0;i<line_datas.length;i++){
var line_data=line_datas[i]; var line_data=line_datas[i];
//应付我司金额 //应付我司金额
...@@ -796,6 +786,10 @@ ...@@ -796,6 +786,10 @@
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false; return false;
} }
//买断机合同 个数
if(amount_vender==0 || '${/parameter/@division}'==30){
gk_contract_num=gk_contract_num+1;
}
//根据金额判断代理店和厂商不能为空 //根据金额判断代理店和厂商不能为空
if(amount_agent>0 &&!bp_bank_account_id){ if(amount_agent>0 &&!bp_bank_account_id){
...@@ -805,7 +799,7 @@ ...@@ -805,7 +799,7 @@
} }
if(amount_vender>0 &&!vender_bank_account_id){ if(amount_vender>0 &&!vender_bank_account_id){
$L.showErrorMessage("提示",'请选择厂商账号信息!'); $L.showErrorMessage("提示",'请选择委托付款金额不为0的厂商账号信息!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false; return false;
} }
...@@ -823,10 +817,10 @@ ...@@ -823,10 +817,10 @@
total_amount_vender=plus(total_amount_vender,amount_vender); total_amount_vender=plus(total_amount_vender,amount_vender);
} }
//取消提示 if(gk_contract_num<line_datas.length&&gk_contract_num!=0){
/* if(!check_due_amount_flag){ $L.showErrorMessage("提示",'买断机合同(即厂商的付款金额为0)不可与其他正常合同同时进行付款申请支付');
$L.showInfoMessage("提示",'应付金额应等于应付我司金额,委托付款金额和首付款抵充金额之和!'); return false;
}*/ }
//给头表赋值 //给头表赋值
$(ds_id).getAt(0).set('amount_agent_total',total_amount_agent); $(ds_id).getAt(0).set('amount_agent_total',total_amount_agent);
$(ds_id).getAt(0).set('amount_vender_total',total_amount_vender); $(ds_id).getAt(0).set('amount_vender_total',total_amount_vender);
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<a:model-query fetchAll="true" model="rpt.RPT5090.atm_update" rootPath="/model/day"/> <a:model-query fetchAll="true" model="rpt.RPT5090.atm_update" rootPath="/model/day"/>
<a:model-query fetchAll="true" model="rpt.RPT5090.atm_update_month" rootPath="/model/month"/> <a:model-query fetchAll="true" model="rpt.RPT5090.atm_update_month" rootPath="/model/month"/>
<s:server-script><![CDATA[ <s:server-script><![CDATA[
var para = $ctx.current_parameter || $ctx.parameter; <!-- var para = $ctx.current_parameter || $ctx.parameter;-->
println(para.toXML()); <!-- println(para.toXML());-->
$ctx.parameter.file_name='财务收支一览表.xlsx'; $ctx.parameter.file_name='财务收支一览表.xlsx';
$ctx.parameter.file_path = '/u01/hls_file/task_excel/'; $ctx.parameter.file_path = '/u01/hls_file/task_excel/';
]]></s:server-script> ]]></s:server-script>
......
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