Commit 08d424d9 authored by stone's avatar stone

【fix】修改付款申请书功能

parent 68f85b63
......@@ -15,6 +15,14 @@ BEGIN
alter table csh_payment_req_ln add (amount_vender number);
alter table csh_payment_req_ln add (amount_agent number);
alter table csh_payment_req_ln add (down_payment_rushoff number);
ALTER TABLE csh_payment_req_ln ADD bp_bank_full_name VARCHAR2(2000);
COMMENT ON COLUMN csh_payment_req_ln.bp_bank_full_name IS '应付我司开户行';
ALTER TABLE csh_payment_req_ln ADD vender_bank_full_name VARCHAR2(2000);
COMMENT ON COLUMN csh_payment_req_ln.vender_bank_full_name IS '厂商开户行';
ALTER TABLE csh_payment_req_ln ADD vender_bank_account_name VARCHAR2(2000);
COMMENT ON COLUMN csh_payment_req_ln.vender_bank_account_name IS '厂商账户名';
ALTER TABLE csh_payment_req_ln ADD vender_bank_account_number VARCHAR2(2000);
COMMENT ON COLUMN csh_payment_req_ln.vender_bank_account_number IS '厂商账户号';
comment on column csh_payment_req_ln.amount_vender is '应付厂商金额';
comment on column csh_payment_req_ln.amount_agent is '应付代理店金额';
......
......@@ -9,46 +9,27 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select tt.* from ( SELECT
--应付我司开户名
(SELECT hbbc.bank_full_name
FROM hls_bp_master_bank_account hbbc
WHERE hbbc.bank_account_id = V.bp_bank_account_id) agent_bank_name,
select tt.* from ( SELECT
--应付我司开户行
v.bp_bank_full_name agent_bank_name,
--代理商名称
(select bp.BP_NAME
from HLS_BP_MASTER bp
WHERE bp.BP_ID = t.bp_id_agent_level1
and bp.bp_category = 'AGENT') agent_name,
--应付我司开户行
(SELECT HBBc.bank_account_name
FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
WHERE HBBC.BANK_ACCOUNT_ID = V.BP_BANK_ACCOUNT_ID) agent_account_name,
--应付我司开户名
v.bp_bank_account_name agent_account_name,
--应付我司开户账号
(SELECT HBBC.BANK_ACCOUNT_NUM
FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
WHERE HBBC.BANK_ACCOUNT_ID = V.BP_BANK_ACCOUNT_ID) AGENT_BANK_NUM,
v.bp_bank_account_num AGENT_BANK_NUM,
--厂商开户名
(SELECT hbbc.bank_account_name
FROM hls_bp_master_bank_account hbbc
WHERE hbbc.bank_account_id = v.vender_bank_account_id) vender_account_name,
v.vender_bank_account_name vender_account_name,
--厂商开户行
(SELECT hbbc.bank_full_name
FROM hls_bp_master_bank_account hbbc
WHERE hbbc.bank_account_id = v.vender_bank_account_id) vender_bank_name,
v.vender_bank_full_name vender_bank_name,
--厂商名称
(select bp.BP_NAME
from HLS_BP_MASTER bp
WHERE bp.BP_ID = (select t1.vender_id
from hls_lease_item t1
where t1.lease_item_id =
(select t2.lease_item_id
from con_contract_lease_item t2
where t2.contract_id = t.contract_id))
) vender_name,
v.vender_name vender_name,
--应付我司开户账号
(SELECT HBBC.BANK_ACCOUNT_NUM
FROM HLS_BP_MASTER_BANK_ACCOUNT HBBC
WHERE HBBC.BANK_ACCOUNT_ID = V.VENDER_BANK_ACCOUNT_ID) VENDER_BANK_NUM,
v.vender_bank_account_number VENDER_BANK_NUM,
(to_char(SYSDATE, 'yyyy') || '年' || to_char(SYSDATE, 'mm') || '月' ||
to_char(SYSDATE, 'dd') || '日') current_date,
v.payment_req_id,
......
......@@ -9,19 +9,13 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select rownum, v.*
select rownum, v.*
from (select c.contract_number,
c.contract_name,
c.contract_id,
c.bp_id_agent_level1,
(select hli.pattern
from con_contract_lease_item ccli, hls_lease_item hli
where ccli.lease_item_id = hli.lease_item_id
and ccli.contract_id = c.contract_id) pattern,
(select ccli.machine_number
from con_contract_lease_item ccli, hls_lease_item hli
where ccli.lease_item_id = hli.lease_item_id
and ccli.contract_id = c.contract_id) machine_number,
ccli.pattern pattern,
ccli.machine_number machine_number,
--add 添加预付款的时间
(select hbm.bp_name
from hls_bp_master hbm
......@@ -55,25 +49,16 @@
and c.source_doc_id = cpr.payment_req_id
and c.transaction_type = 'PAYMENT') bank_slip_num,*/
(select h.bank_account_name
FROM hls_bp_master_bank_account h
WHERE
h.bank_account_id = cpr.bp_bank_account_id) BP_ID_AGENT_N,
cpr.bp_bank_account_name BP_ID_AGENT_N,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.bp_bank_account_id) BP_BANK_ACCOUNT_NUM,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.bp_bank_account_id) BP_BANK_ACCOUNT_NUM_N,
cpr.bp_bank_account_num BP_BANK_ACCOUNT_NUM,
cpr.bp_bank_account_num BP_BANK_ACCOUNT_NUM_N,
(select hbm.bank_account_name
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.bp_bank_account_id) BP_BANK_ACCOUNT_NAME,
cpr.bp_bank_account_name BP_BANK_ACCOUNT_NAME,
--应付我司金额
cpr.amount_agent,
cpr.amount_vender,
cpr.amount_vender,
to_char(cpr.amount_agent,'FM999,999,999,990.00') amount_agent_print,
to_char(cpr.amount_vender,'FM999,999,999,990.00') amount_vender_print,
......@@ -81,19 +66,10 @@
--未付金额
(cpr.amount_agent - nvl(cpr.amount_agent_paid, 0)) residual_agent_amount,
(cpr.amount_vender - nvl(cpr.amount_vender_paid, 0)) residual_vender_amount,
(select hbm.bank_account_name
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.vender_bank_account_id
) vender_name,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.vender_bank_account_id) vender_bank_account_number,
(select hbm.bank_account_num
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.vender_bank_account_id) vender_bank_account_number_n,
(select hbm.bank_account_name
from hls_bp_master_bank_account hbm
where hbm.bank_account_id = cpr.vender_bank_account_id) vender_bank_account_name,
cpr.vender_name vender_name,
cpr.vender_bank_account_number vender_bank_account_number,
cpr.vender_bank_account_number vender_bank_account_number_n,
cpr.vender_bank_account_name vender_bank_account_name,
cpr.amount,
c.lease_item_amount,
to_char(c.lease_item_amount,'FM999,999,999,990.00') lease_item_amount_print,
......@@ -129,8 +105,9 @@
cpr.ref_doc_line_id,
cpr.ref_doc_category
from csh_payment_req_ln cpr, con_contract c, hls_bp_master hbm
from csh_payment_req_ln cpr, con_contract c, hls_bp_master hbm,con_contract_lease_item ccli
where cpr.ref_doc_category = 'CONTRACT'
AND ccli.contract_id=cpr.ref_doc_id
and c.contract_id = cpr.ref_doc_id
and hbm.bp_id = c.bp_id_tenant) v
#WHERE_CLAUSE#
......
......@@ -230,8 +230,8 @@
// record.set('reduce_amount_total',value>record.get('unreceived_overdue_amount') ?record.get('unreceived_overdue_amount'):value);
if(value>record.get('unreceived_overdue_amount')){
$L.showErrorMessage('提示','减免金额不能大于最大减免金额!');
record.set('reduce_amount_total',record.get('unreceived_overdue_amount'));
$(ds).getAt(0).set('reduce_amount_total','');
// record.set('reduce_amount_total',record.get('unreceived_overdue_amount'));
// $(ds).getAt(0).set('reduce_amount_total','');
return;
}
var ratio = parseFloat(Leaf.formatNumber(div(record.get('reduce_amount_total'), record.get('total_overdue_amount')), 4));
......@@ -241,12 +241,12 @@
}
if (name == 'reduce_amount_total_ratio') {
/* if (name == 'reduce_amount_total_ratio') {
var amount = parseFloat(mul(record.get('reduce_amount_total_ratio'), record.get('total_overdue_amount')), 2);
// update_falg = 'Y';
record.set('reduce_amount_total', amount);
}
}*/
} else {
update_falg = 'N';
}
......
......@@ -60,6 +60,8 @@
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id"
url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="assignment_agreement_print_link"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_print.lsc"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id"
url="${/request/@context_path}/downloadFile.lview"/>
<script src="${/request/@context_path}/javascripts/jquery-1.6.4.min.js" type="text/javascript"/>
......@@ -416,13 +418,17 @@
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 sale_id = record[0].get('sale_id');
var sale_code = record[0].get('sale_code');*/
var template_name = 'payment_apply_content.xml';
// var template_name = '1.xml';
var file_name = '付款请求书打印.doc';
var url = $('cont811_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&payment_req_id=' + hd_record.get('payment_req_id') + '&file_name=' + encodeURI(file_name);
window.location.href =url;
var template_name = 'payment_apply_content.xml';
var file_name = '付款请求书打印.doc';
var url = $('cont811_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&payment_req_id=' + hd_record.get('payment_req_id') + '&file_name=' + encodeURI(file_name);
window.location.href =url;
/* var templet_code = 'CSH_PAYMENT_REQ_TEST';
var url = $('assignment_agreement_print_link').getUrl() + '?payment_req_id=' + hd_record.get('payment_req_id') + '&templet_code=' + templet_code;
window.open(url, '_self');*/
/* var templet_code = 'CSH_PAYMENT_REQ';
url = $('assignment_agreement_print_link').getUrl() + '?payment_req_id=' + hd_record.get('payment_req_id') + '&templet_code=' + templet_code;
window.open(url, '_self');*/
}
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j)
importPackage(Packages.org.apache.commons.io);
function RandomString(length) {   
var str = '';   
for (;str.length < length;str += Math.random().toString(36).substr(2));   
return str.substr(0, length); 
}
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
//按日期创建目录
function getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.file_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = d:/hls_test_files/fileupload/2018/04/
}
function write_os_to_file(file, os) {
var fis = new FileInputStream(file);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function download_file(file_path, file_name) {
$ctx["__request_type__"] = 'file';
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'utf-8'));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
try {
var os = resp.getOutputStream();
write_os_to_file(file_path, os);
//write_os_to_file(file_path+file_name, os);
os.flush();
} catch (e) {
$logger("server-script").severe(e.message);
}
}
function collection_create_content() {
try {
//第一步生成合同文本
$bm('cont.CON620.create_content_for_collection').update({
payment_req_id: $ctx.parameter.payment_req_id,
templet_code: $ctx.parameter.templet_code
});
//获取日期目录
set_parameter_file_path();
var datePath = getDatePath();
$ctx.parameter.batch_flag='Y';
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map = $bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
payment_req_id: $ctx.parameter.payment_req_id,
batch_flag:$ctx.parameter.batch_flag,
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc';
var from_file_path = record_data.file_path;
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
to_file_path = datePath + guid_file_name_tables[0].guid_file_name + 'con' + record_data.content_id;
copyFile(from_file_path, to_file_path);
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id);
} catch (e) {
raise_app_error(e);
}
$bm('cont.CON500.con_file_content_copy_update').update({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString()
});
var test=new File(to_file_path);
var test1=new File('D:'+to_file_path);
download_file(to_file_path.toString(),to_file_name.toString());
}
}
$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);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]></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