Commit 8140a839 authored by niminmin's avatar niminmin

[feat]回租部分开发

parent 026e1e52
......@@ -2,7 +2,7 @@ CREATE OR REPLACE Package acr_invoice_pkg Is
-- Author : DJ
-- Created : 2013/7/5 15:00:02
-- Purpose : 应收发票创建
-- Purpose : 应收发票创建
-- Version : 1.30
Procedure tmp_delete_session(p_session_id Number);
......@@ -46,7 +46,7 @@ CREATE OR REPLACE Package acr_invoice_pkg Is
p_tax_amount Number Default Null,
p_product_name Varchar2,
p_user_id Number);
--创建发票
--创建发票
Procedure create_invoice(p_session_id Number,
p_company_id Number,
p_group_billing_method Varchar2,
......@@ -55,7 +55,7 @@ CREATE OR REPLACE Package acr_invoice_pkg Is
p_user_id Number,
p_role_id Number);
--宏菱建机罚息开票
--宏菱建机罚息开票
Procedure create_penalty_invoice(p_session_id Number,
p_company_id Number,
p_group_billing_method Varchar2,
......@@ -63,29 +63,29 @@ CREATE OR REPLACE Package acr_invoice_pkg Is
p_accounting_date Date,
p_user_id Number,
p_role_id Number);
--删除发票
--删除发票
Procedure delete_invoice(p_invoice_hd_id Number, p_user_id Number);
--确认发票
--确认发票
Procedure confirm_invoice(p_invoice_hd_id Number, p_user_id Number);
--反冲发票
--反冲发票
Procedure reverse_invoice(p_invoice_hd_id Number,
p_reverse_date Date,
p_vat_red_notice_num Varchar2,
p_user_id Number,
p_role_id Number);
--发票行合并
--add by Yenick 宏菱项目 增加发票行合并
--发票行合并
--add by Yenick 宏菱项目 增加发票行合并
Procedure invoice_row_merge(p_invoice_hd_id In Number,
p_user_id Number,
p_merge_flag Varchar2);
--发票提交
--发票提交
Procedure acr_invoice_submit(p_batch_id Number, p_user_id Number);
--发票审批通过
--发票审批通过
Procedure acr_invoice_approved(p_batch_id Number, p_user_id Number);
-- function ss(p_batch_id out number) return number;
--发票审批拒绝
--发票审批拒绝
Procedure acr_invoice_reject(p_batch_id Number, p_user_id Number);
-- add by shen
Procedure acr_invoice_status_change(p_invoice_hd Number,
......@@ -98,7 +98,7 @@ CREATE OR REPLACE Package acr_invoice_pkg Is
p_document_number Out Varchar2,
p_business_type Out Varchar2,
p_ln_step_length Out Number);
--增值税台账 数据处理
--增值税台账 数据处理
Procedure vat_account_data_process(p_base_period Varchar2,
p_session_id Number,
p_user_id Number);
......@@ -167,8 +167,8 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
g_package_name Varchar2(255) := upper('ACR_INVOICE_PKG');
--拆分类型
--与syscode ACR510_BILL_DETAIL_METHOD 保持一致
--拆分类型
--与syscode ACR510_BILL_DETAIL_METHOD 保持一致
g_divide_t_b_equipment Varchar2(30) := 'BILLING_EQUIPMENT';
g_divide_t_b_rental Varchar2(30) := 'BILLING_RENTAL';
g_divide_t_b_principal Varchar2(30) := 'BILLING_PRINCIPAL';
......@@ -185,7 +185,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
g_document_category Constant Varchar2(30) := 'AR_INVOICE';
g_htjs_tolerance Number := 0.0625; --金税头税额与行税额合计的容差
g_htjs_tolerance Number := 0.0625; --金税头税额与行税额合计的容差
Function cashflow_get_record(p_cashflow_id Number)
Return con_contract_cashflow%Rowtype Is
......@@ -255,13 +255,13 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If v_vat_flag = 'Y' Then
If v_taxpayer_type = 'GENERAL_TAXPAYER' Then
--普通纳税人:专票
--普通纳税人:专票
Return '0';
Elsif v_taxpayer_type = 'SMALL_SCALE_TAXPAYER' Then
--小规模纳税人:普票
--小规模纳税人:普票
Return '2';
Else
--其余算入 小规模纳税人:普票
--其余算入 小规模纳税人:普票
Return '2';
End If;
Else
......@@ -269,7 +269,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
End;
--现金流处理之后
--现金流处理之后
Procedure cf_type_after_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
......@@ -301,13 +301,13 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
--modify by shen
/*v_tmp.billing_amount := nvl(v_tmp.received_amount, 0) -
v_tmp.cf_billing_amount;*/
--开票金额改为应收减已开票,无论是否收到钱
--开票金额改为应收减已开票,无论是否收到钱
v_tmp.billing_amount := nvl(v_tmp.due_amount, 0) -
v_tmp.cf_billing_amount;
End If;
If nvl(v_tmp.billing_amount, 0) > 0 Then
--发票金额为0,则不生成
--发票金额为0,则不生成
v_tmp.cashflow_id := p_cashflow.cashflow_id;
v_tmp.record_id := invoice_get_id;
v_tmp.contract_id := p_cashflow.contract_id;
......@@ -319,7 +319,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
End;
--现金流处理之前
--现金流处理之前
Procedure cf_type_before_handle(p_tmp In Out acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
......@@ -330,7 +330,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_tmp.received_amount := nvl(p_cashflow.received_amount, 0);
End;
--设备款处理cf_type=109
--设备款处理cf_type=109
Procedure cf_type_109_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -348,7 +348,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.due_amount := nvl(p_cashflow.due_amount, 0);
v_tmp.cf_billing_amount := nvl(p_cashflow.billing_amount, 0);
--获取 invoice kind
--获取 invoice kind
If p_billmethodprop.equipment_invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -359,7 +359,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If p_billmethodprop.equipment_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -385,7 +385,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--利息处理cf_type=101
--利息处理cf_type=101
Procedure cf_type_101_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -406,7 +406,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.cf_type := 101;
v_tmp.cf_item := 101;
--获取 invoice kind
--获取 invoice kind
If p_billmethodprop.interest_invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -417,7 +417,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If p_billmethodprop.interest_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -443,7 +443,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--本金处理cf_type=100
--本金处理cf_type=100
Procedure cf_type_100_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -465,7 +465,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.cf_type := 100;
v_tmp.cf_item := 100;
--获取 invoice kind
--获取 invoice kind
If p_billmethodprop.principal_invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -476,7 +476,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If p_billmethodprop.principal_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -502,7 +502,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--租金处理cf_type=1
--租金处理cf_type=1
Procedure cf_type_1_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -514,7 +514,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp := p_tmp;
If p_billmethodprop.rental_billing_flag = 'Y' Then
-- 按租金开票
-- 按租金开票
cf_type_before_handle(p_tmp => v_tmp,
p_cashflow => p_cashflow,
......@@ -524,7 +524,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.received_amount := nvl(p_cashflow.received_amount, 0);
v_tmp.cf_billing_amount := nvl(p_cashflow.billing_amount, 0);
--获取 invoice kind
--获取 invoice kind
Select *
Into r_hls_bp_master
From hls_bp_master m
......@@ -532,11 +532,11 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If nvl(r_hls_bp_master.taxpayer_type, 'SMALL_SCALE_TAXPAYER') =
'GENERAL_TAXPAYER' Then
--普通纳税人:专票
--普通纳税人:专票
v_tmp.invoice_kind := '0';
Elsif nvl(r_hls_bp_master.taxpayer_type, 'SMALL_SCALE_TAXPAYER') =
'SMALL_SCALE_TAXPAYER' Then
--小规模纳税人:普票
--小规模纳税人:普票
v_tmp.invoice_kind := '2';
End If;
......@@ -550,7 +550,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
end if;*/
--获取 tax rate
--获取 tax rate
If p_billmethodprop.rental_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -575,13 +575,13 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Else
--本金开票
--本金开票
If p_billmethodprop.principal_billing_flag = 'Y' Then
cf_type_100_handle(p_tmp, p_cashflow, p_contract, p_billmethodprop);
End If;
--利息开票
--利息开票
If p_billmethodprop.interest_billing_flag = 'Y' Then
cf_type_101_handle(p_tmp, p_cashflow, p_contract, p_billmethodprop);
......@@ -590,7 +590,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
End;
--利息处理cf_type=101 addby wuts
--利息处理cf_type=101 addby wuts
Procedure cf_item_301_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -611,7 +611,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.cf_type := 301;
v_tmp.cf_item := 301;
--获取 invoice kind
--获取 invoice kind
/* if p_billmethodprop.interest_invoice_kind_tp = '10' then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -621,9 +621,9 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.invoice_kind := p_billmethodprop.interest_invoice_kind;
end if;*/
--管理费 专用发票 modify by wuts
--管理费 专用发票 modify by wuts
v_tmp.invoice_kind := '0';
--获取 tax rate
--获取 tax rate
If p_billmethodprop.interest_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -648,7 +648,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
End;
--租金处理cf_type=301
--租金处理cf_type=301
Procedure cf_type_301_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -659,7 +659,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp := p_tmp;
If p_billmethodprop.rental_billing_flag = 'Y' Then
-- 按租金开票
-- 按租金开票
cf_type_before_handle(p_tmp => v_tmp,
p_cashflow => p_cashflow,
......@@ -669,7 +669,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_tmp.received_amount := nvl(p_cashflow.received_amount, 0);
v_tmp.cf_billing_amount := nvl(p_cashflow.billing_amount, 0);
--获取 invoice kind
--获取 invoice kind
/*if p_billmethodprop.rental_invoice_kind_tp = '10' then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -680,9 +680,9 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
end if;
*/
--管理费 专用发票 modify by wuts
--管理费 专用发票 modify by wuts
v_tmp.invoice_kind := '0';
--获取 tax rate
--获取 tax rate
If p_billmethodprop.rental_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -706,7 +706,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_billmethodprop => p_billmethodprop);
Else
--利息开票
--利息开票
If p_billmethodprop.interest_billing_flag = 'Y' Then
cf_item_301_handle(p_tmp, p_cashflow, p_contract, p_billmethodprop);
......@@ -716,7 +716,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--end wuts
--其他处理
--其他处理
Procedure cf_type_others_handle(p_tmp acr_invoice_create_tmp%Rowtype,
p_cashflow con_contract_cashflow%Rowtype,
p_contract con_contract%Rowtype,
......@@ -743,7 +743,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If v_cf_method.enabled_flag = 'Y' Then
--获取 invoice kind
--获取 invoice kind
If v_cf_method.invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -754,7 +754,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If v_cf_method.tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -785,7 +785,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If p_billmethodprop.other_billing_flag = 'Y' Then
--获取 invoice kind
--获取 invoice kind
If p_billmethodprop.other_invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -796,7 +796,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If p_billmethodprop.other_tax_rate_tp = '10' Then
If p_cashflow.tax_type_id Is Not Null Or
p_cashflow.tax_type_rate Is Not Null Then
......@@ -843,7 +843,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If v_cf_method.enabled_flag = 'Y' Then
--获取 invoice kind
--获取 invoice kind
If v_cf_method.invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -854,7 +854,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If v_cf_method.tax_rate_tp = '10' Then
v_tmp.tax_type_id := p_contract.tax_type_id;
Elsif v_cf_method.tax_rate_tp = '20' Then
......@@ -877,7 +877,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If p_billmethodprop.other_billing_flag = 'Y' Then
--获取 invoice kind
--获取 invoice kind
If p_billmethodprop.other_invoice_kind_tp = '10' Then
v_tmp.invoice_kind := get_invoicekind_by_taxpayer(p_contract_id => p_contract.contract_id);
......@@ -888,7 +888,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
--获取 tax rate
--获取 tax rate
If p_billmethodprop.other_tax_rate_tp = '10' Then
v_tmp.tax_type_id := p_contract.tax_type_id;
Elsif p_billmethodprop.other_tax_rate_tp = '20' Then
......@@ -908,7 +908,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
-- add by niminmin
--罚息开票 不按现金流开票
--罚息开票 不按现金流开票
Procedure split_penalty_cashflow(p_contract_id Number,
p_journal_header_id Number,
p_journal_line_id Number,
......@@ -979,7 +979,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Exception
When e_bill_status Then
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '未找到对应销项税,请联系管理员!',
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '未找到对应销项税,请联系管理员!',
p_created_by => p_user_id,
p_package_name => g_package_name,
p_procedure_function_name => v_programe_name);
......@@ -1060,10 +1060,10 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_cashflow.received_interest := v_cashflow.received_interest_cny;
End If;
--管理费
--管理费
If v_cashflow.cf_type = 301 Then
cf_type_301_handle(v_paras, v_cashflow, v_contract, v_billmethodprop);
--租金
--租金
Elsif v_cashflow.cf_type = 1 Then
cf_type_1_handle(v_paras, v_cashflow, v_contract, v_billmethodprop);
Elsif v_cashflow.cf_type = 100 Then
......@@ -1139,7 +1139,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
and t.invoice_kind = '0'
and t.cf_type in (100, 2));
raise e_leaseback_invoice_kind_err;--回租业务本金部分不能开具增值税专用发票
raise e_leaseback_invoice_kind_err;--回租业务本金部分不能开具增值税专用发票
exception
when no_data_found then
null;
......@@ -1156,7 +1156,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And t.invoice_kind <> 'RECEIPT'
And t.cf_type = 5);
Raise e_receipt_cf_type_err; --保证金只能开收据
Raise e_receipt_cf_type_err; --保证金只能开收据
Exception
When no_data_found Then
Null;
......@@ -1176,7 +1176,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And (b.bp_class = 'NP' Or
b.taxpayer_type = 'SMALL_SCALE_TAXPAYER'));
Raise e_bp_class_taxpayer_err;
--合同BP为自然人hls_bp_master.bp_class=NP、或纳税人类型为小规模纳税人hls_bp_master. taxpayer_type=SMALL_SCALE_TAXPAYER,不能开增值税专用发票
--合同BP为自然人hls_bp_master.bp_class=NP、或纳税人类型为小规模纳税人hls_bp_master. taxpayer_type=SMALL_SCALE_TAXPAYER,不能开增值税专用发票
Exception
When no_data_found Then
Null;
......@@ -1197,7 +1197,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And nvl(tt.vat_flag, 'N') = 'N'
And t.invoice_kind In ('0', '2'));
Raise e_vat_flag_err;
--合同税种不为增值税VAT_FLAG=N,不能开增值税发票(InvKind≠0,2),只能开营业税发票或收据
--合同税种不为增值税VAT_FLAG=N,不能开增值税发票(InvKind≠0,2),只能开营业税发票或收据
Exception
When no_data_found Then
Null;
......@@ -1260,7 +1260,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Raise e_period_not_found;
End;
--航天金税 税额检查
--航天金税 税额检查
Procedure check_htjs_tolerance(p_invoice_hd_rec acr_invoice_hd%Rowtype,
p_tax_type_rate Number) Is
v_hd_tax_amt Number;
......@@ -1278,7 +1278,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--更新发票头上的4个组织字段
--更新发票头上的4个组织字段
Procedure update_org_info(p_invoice_hd_rec In Out acr_invoice_hd%Rowtype) Is
v_penalty_count Number;
Begin
......@@ -1367,7 +1367,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
End;
--更新发票头上的字段
--更新发票头上的字段
Procedure update_hd_info(p_invoice_hd_rec In Out Nocopy acr_invoice_hd%Rowtype) Is
v_total_ln_tax_amt Number;
v_total_ln_amt Number;
......@@ -1393,7 +1393,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--插入单据流
--插入单据流
Procedure insert_doc_flow(p_invoice_hd_rec In Out acr_invoice_hd%Rowtype) Is
Begin
For c_ln In (Select a.invoice_ln_id,
......@@ -1432,7 +1432,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_trx_id => p_invoice_hd_rec.invoice_hd_id);
End;
--创建完的发票,整张检查
--创建完的发票,整张检查
Procedure created_invoice_check(p_invoice_hd_rec In Out acr_invoice_hd%Rowtype,
p_user_id In Number,
p_role_id In Number) Is
......@@ -1560,7 +1560,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
If p_invoice_ln_rec.cf_type = 100 Then
--本金cf
--本金cf
v_billing_principal := nvl(r_cashflow_rec.billing_principal, 0) +
nvl(p_invoice_ln_rec.total_amount, 0);
v_billing_interest := r_cashflow_rec.billing_interest;
......@@ -1575,7 +1575,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If r_billing_method.rental_billing_flag = 'Y' Or
(r_billing_method.principal_billing_flag = 'Y' And
r_billing_method.interest_billing_flag = 'Y') Then
--本+利 or 租金
--本+利 or 租金
If v_billing_amount = r_cashflow_rec.due_amount Then
v_billing_status := g_bill_status_full;
Elsif v_billing_amount = 0 Then
......@@ -1586,7 +1586,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Elsif r_billing_method.principal_billing_flag = 'Y' And
nvl(r_billing_method.interest_billing_flag, 'N') = 'N' Then
--
--
If v_billing_principal = r_cashflow_rec.principal Then
v_billing_status := g_bill_status_full;
Elsif v_billing_principal = 0 Then
......@@ -1596,7 +1596,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Elsif nvl(r_billing_method.principal_billing_flag, 'N') = 'N' And
r_billing_method.interest_billing_flag = 'Y' Then
--
--
If v_billing_interest = r_cashflow_rec.interest Then
v_billing_status := g_bill_status_full;
Elsif v_billing_interest = 0 Then
......@@ -1607,7 +1607,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Elsif p_invoice_ln_rec.cf_type = 101 Then
--利息cf
--利息cf
v_billing_principal := r_cashflow_rec.billing_principal;
v_billing_interest := nvl(r_cashflow_rec.billing_interest, 0) +
......@@ -1622,7 +1622,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
If r_billing_method.rental_billing_flag = 'Y' Or
(r_billing_method.principal_billing_flag = 'Y' And
r_billing_method.interest_billing_flag = 'Y') Then
--本+利
--本+利
If v_billing_amount = r_cashflow_rec.due_amount Then
v_billing_status := g_bill_status_full;
Elsif v_billing_amount = 0 Then
......@@ -1633,7 +1633,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Elsif r_billing_method.principal_billing_flag = 'Y' And
nvl(r_billing_method.interest_billing_flag, 'N') = 'N' Then
--
--
If v_billing_principal = r_cashflow_rec.principal Then
v_billing_status := g_bill_status_full;
Elsif v_billing_principal = 0 Then
......@@ -1643,7 +1643,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Elsif nvl(r_billing_method.principal_billing_flag, 'N') = 'N' And
r_billing_method.interest_billing_flag = 'Y' Then
--
--
If v_billing_interest = r_cashflow_rec.interest Then
v_billing_status := g_bill_status_full;
Elsif v_billing_interest = 0 Then
......@@ -1654,7 +1654,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Else
--其他类型cf
--其他类型cf
v_billing_principal := r_cashflow_rec.billing_principal;
v_billing_interest := r_cashflow_rec.billing_interest;
......@@ -1703,9 +1703,9 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_avg_split_tax_amt Number;
v_avg_split_net_amt Number;
v_remain_split_total_amt Number; --剩余拆分金额
v_remain_split_tax_amt Number; --剩余拆分税额
v_remain_split_net_amt Number; --剩余拆分不含税金额
v_remain_split_total_amt Number; --剩余拆分金额
v_remain_split_tax_amt Number; --剩余拆分税额
v_remain_split_net_amt Number; --剩余拆分不含税金额
v_invoice_line_limit hls_billing_method.invoice_line_limit%Type;
v_bill_of_sale hls_billing_method.bill_of_sale%Type;
......@@ -1723,18 +1723,18 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_acr_invoice_hd_id Number;
v_acr_invoice_ln_id Number;
v_cash_total_amount Number; --应收金额总额
v_cash_total_vat_amount Number; -- 税额总额
v_cash_total_amount Number; --应收金额总额
v_cash_total_vat_amount Number; -- 税额总额
Procedure amt_split Is
Begin
--金额拆分
--金额拆分
Select Sum(net_amount), Sum(total_amount)
Into v_total_net_amount, v_total_amount
From acr_invoice_ln
Where invoice_hd_id = p_invoice_hd_rec.invoice_hd_id;
-- @Description:现金流需开票总金额, 开票总税额 @Date:20/6.16 @Modified:Liyuan.Chen
-- @Description:现金流需开票总金额, 开票总税额 @Date:20/6.16 @Modified:Liyuan.Chen
Select Sum(t.due_amount), Sum(t.vat_due_amount)
Into v_cash_total_amount, v_cash_total_vat_amount
From acr_invoice_ln l, con_contract_cashflow t
......@@ -1762,11 +1762,11 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
From acr_invoice_ln
Where invoice_hd_id = p_invoice_hd_rec.invoice_hd_id;
------------------平均拆分---------------------
------------------平均拆分---------------------
--拆分发票的数量
--拆分发票的数量
v_avg_split_qty := floor(v_total_net_amount / v_invoice_limit) + 1;
--拆分发票的平均金额
--拆分发票的平均金额
If r_invoice_ln_rec.tax_included_flag = 'Y' Then
......@@ -1779,7 +1779,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
g_round_n);
v_avg_split_net_amt := v_avg_split_amt - v_avg_split_tax_amt;
--检查最后一张拆分发票的剩余金额是否还超过限额
--检查最后一张拆分发票的剩余金额是否还超过限额
v_remain_split_total_amt := v_total_amount -
(v_avg_split_amt *
(v_avg_split_qty - 1));
......@@ -1800,7 +1800,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_avg_split_amt := v_avg_split_net_amt + v_avg_split_tax_amt;
--检查最后一张拆分发票的剩余金额是否还超过限额
--检查最后一张拆分发票的剩余金额是否还超过限额
v_remain_split_net_amt := v_total_net_amount -
(v_avg_split_net_amt *
(v_avg_split_qty - 1));
......@@ -1830,7 +1830,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
g_round_n);
v_avg_split_net_amt := v_avg_split_amt - v_avg_split_tax_amt;
--最后一张拆分发票的剩余金额
--最后一张拆分发票的剩余金额
v_remain_split_total_amt := v_total_amount -
(v_avg_split_amt *
(v_avg_split_qty - 1));
......@@ -1852,7 +1852,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_avg_split_amt := v_avg_split_net_amt + v_avg_split_tax_amt;
--最后一张拆分发票的剩余金额
--最后一张拆分发票的剩余金额
v_remain_split_net_amt := v_total_net_amount -
(v_avg_split_net_amt *
(v_avg_split_qty - 1));
......@@ -1869,7 +1869,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Else
--最大限额拆分
--最大限额拆分
If v_invoice_split_limit Is Null Then
created_invoice_check(p_invoice_hd_rec => p_invoice_hd_rec,
......@@ -1906,7 +1906,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_avg_split_amt := v_avg_split_net_amt + v_avg_split_tax_amt;
--检查最后一张拆分发票的剩余金额是否还超过限额
--检查最后一张拆分发票的剩余金额是否还超过限额
/*v_remain_split_net_amt := v_total_net_amount -
((v_avg_split_qty - 1) *
......@@ -1916,7 +1916,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
((v_avg_split_qty - 1) *
v_avg_split_tax_amt);*/
-- @Description:应业务要求, 用现金流需开票总金额相减得最后一张发票金额 @Date:20/6.16 @Modified:Liyuan.Chen
-- @Description:应业务要求, 用现金流需开票总金额相减得最后一张发票金额 @Date:20/6.16 @Modified:Liyuan.Chen
v_remain_split_net_amt := v_cash_total_amount -
v_cash_total_vat_amount -
......@@ -1943,7 +1943,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_avg_split_amt := v_avg_split_net_amt + v_avg_split_tax_amt;
--检查最后一张拆分发票的剩余金额是否还超过限额
--检查最后一张拆分发票的剩余金额是否还超过限额
/*v_remain_split_net_amt := v_total_net_amount -
(v_avg_split_net_amt *
(v_avg_split_qty - 1));
......@@ -1952,7 +1952,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
((v_avg_split_qty - 1) *
v_avg_split_tax_amt);*/
-- @Description:应业务要求, 用现金流需开票总金额相减得最后一张发票金额 @Date:20/6.16 @Modified:Liyuan.Chen
-- @Description:应业务要求, 用现金流需开票总金额相减得最后一张发票金额 @Date:20/6.16 @Modified:Liyuan.Chen
v_remain_split_net_amt := v_cash_total_amount -
v_cash_total_vat_amount -
......@@ -1984,7 +1984,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_invoice_hd_new_rec.total_amount := v_avg_split_amt;
r_invoice_hd_new_rec.tax_amount := v_avg_split_tax_amt;
--创建新的发票行记录
--创建新的发票行记录
r_invoice_ln_new_rec := r_invoice_ln_rec;
r_invoice_ln_new_rec.invoice_ln_id := v_acr_invoice_ln_id;
r_invoice_ln_new_rec.invoice_hd_id := r_invoice_hd_new_rec.invoice_hd_id;
......@@ -1994,9 +1994,9 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_invoice_ln_new_rec.net_amount := v_avg_split_net_amt;
r_invoice_ln_new_rec.net_price := v_avg_split_net_amt;
--插入新的发票头
--插入新的发票头
insert_invoice_hd(r_invoice_hd_new_rec);
--插入新的发票行
--插入新的发票行
insert_invoice_ln(r_invoice_ln_new_rec);
created_invoice_check(p_invoice_hd_rec => r_invoice_hd_new_rec,
......@@ -2005,7 +2005,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End Loop;
--重算原(第1张)发票头(行)的金额字段
--重算原(第1张)发票头(行)的金额字段
p_invoice_hd_rec.total_amount := v_remain_split_total_amt;
p_invoice_hd_rec.tax_amount := v_remain_split_tax_amt;
......@@ -2029,11 +2029,11 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_role_id => p_role_id);
/*else
------------------最大金额拆分 -----------------------
------------------最大金额拆分 -----------------------
loop
exit when v_total_amount <= v_invoice_split_limit;
--创建新的发票头记录
--创建新的发票头记录
r_invoice_hd_new_rec := p_invoice_hd_rec;
r_invoice_hd_new_rec.invoice_hd_id := acr_invoice_hd_s.nextval;
r_invoice_hd_new_rec.document_number := get_invoice_number(p_document_type => p_invoice_hd_rec.document_type,
......@@ -2045,7 +2045,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_invoice_hd_new_rec.total_amount := v_invoice_split_limit;
--创建新的发票行记录
--创建新的发票行记录
r_invoice_ln_new_rec := r_invoice_ln_rec;
r_invoice_ln_new_rec.invoice_ln_id := acr_invoice_ln_s.nextval;
r_invoice_ln_new_rec.invoice_hd_id := r_invoice_hd_new_rec.invoice_hd_id;
......@@ -2060,15 +2060,15 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_invoice_ln_new_rec.net_amount;
r_invoice_ln_new_rec.net_price := r_invoice_ln_new_rec.net_amount;
--插入新的发票头
--插入新的发票头
insert_invoice_hd(r_invoice_hd_new_rec);
--插入新的发票行
--插入新的发票行
insert_invoice_ln(r_invoice_ln_new_rec);
created_invoice_check(p_invoice_hd_rec => r_invoice_hd_new_rec,
p_user_id => p_user_id,
p_role_id => p_role_id);
--重算原(第1张)发票头(行)的金额字段
--重算原(第1张)发票头(行)的金额字段
r_invoice_ln_rec.total_amount := r_invoice_ln_rec.total_amount - r_invoice_ln_new_rec.total_amount;
r_invoice_ln_rec.net_amount := r_invoice_ln_rec.net_amount - r_invoice_ln_new_rec.net_amount;
r_invoice_ln_rec.tax_amount := r_invoice_ln_rec.tax_amount - r_invoice_ln_new_rec.tax_amount;
......@@ -2108,7 +2108,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_transaction_date => p_invoice_hd_rec.accounting_date,
p_company_id => p_invoice_hd_rec.company_id,
p_user_id => p_invoice_hd_rec.created_by);
--得到第i张发票的总金额
--得到第i张发票的总金额
Select Sum(total_amount)
Into r_invoice_hd_new_rec.total_amount
From acr_invoice_ln
......@@ -2116,7 +2116,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And line_number >
p_ln_step_length * v_invoice_line_limit * (i - 1)
And line_number <= p_ln_step_length * v_invoice_line_limit * i;
--将新发票的发票头id,以及发票行号 更新
--将新发票的发票头id,以及发票行号 更新
Update acr_invoice_ln
Set invoice_hd_id = r_invoice_hd_new_rec.invoice_hd_id,
line_number = line_number -
......@@ -2125,12 +2125,12 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And line_number >
p_ln_step_length * v_invoice_line_limit * (i - 1)
And line_number <= p_ln_step_length * v_invoice_line_limit * i;
--查询新发票头
--查询新发票头
insert_invoice_hd(r_invoice_hd_new_rec);
created_invoice_check(p_invoice_hd_rec => r_invoice_hd_new_rec,
p_user_id => p_user_id,
p_role_id => p_role_id);
--将第1张发票头总金额重新设置
--将第1张发票头总金额重新设置
Select Sum(total_amount)
Into p_invoice_hd_rec.total_amount
......@@ -2157,7 +2157,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Begin
--收据 不用拆分
--收据 不用拆分
If p_invoice_hd_rec.invoice_kind = 'RECEIPT' Then
created_invoice_check(p_invoice_hd_rec => p_invoice_hd_rec,
p_user_id => p_user_id,
......@@ -2165,7 +2165,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Return;
End If;
--总发票行数
--总发票行数
Select Count(1)
Into v_ln_count
From acr_invoice_ln
......@@ -2271,10 +2271,10 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_invoice_limit := v_invoice_split_limit;
------------------------金额拆分 ---------------------------------
------------------------金额拆分 ---------------------------------
amt_split;
------------------------行数拆分 ---------------------------------
------------------------行数拆分 ---------------------------------
qty_split;
End;
......@@ -2359,7 +2359,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End;
--add by niminmin
--罚息开票不记录现金流,取凭证维度
--罚息开票不记录现金流,取凭证维度
Procedure create_invoice_ln_penalty(p_invoice_tmp_hd_rec In invoice_hd_tmp_type,
p_invoice_hd_rec In acr_invoice_hd%Rowtype,
p_ln_step_length In Number,
......@@ -2377,9 +2377,9 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_contract con_contract%Rowtype;
v_round_n Number;
v_old_sum_total_amount number; --本次开票之前已开票总额
v_old_sum_tax_amount number; --本次开票之前已开票税额
v_old_tax_amount number; --凭证上税额
v_old_sum_total_amount number; --本次开票之前已开票总额
v_old_sum_tax_amount number; --本次开票之前已开票税额
v_old_tax_amount number; --凭证上税额
n Number := 0;
v_acr_invoice_ln_id Number;
......@@ -2417,14 +2417,14 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And nvl(t.exchange_rate_quotation, 'DIRECT QUOTATION') =
p_invoice_tmp_hd_rec.exchange_rate_quotation
And nvl(t.exchange_rate, 1) = p_invoice_tmp_hd_rec.exchange_rate
--以下三个字段条件: 原始表上字段不会为空的
--以下三个字段条件: 原始表上字段不会为空的
And (c.contract_id = p_invoice_tmp_hd_rec.contract_id Or
p_invoice_tmp_hd_rec.contract_id Is Null)
And (c.project_id = p_invoice_tmp_hd_rec.project_id Or
p_invoice_tmp_hd_rec.project_id Is Null)
And (t.times = p_invoice_tmp_hd_rec.times Or
(p_invoice_tmp_hd_rec.times Is Null))
--以下字段条件:等号两边都有可能为空
--以下字段条件:等号两边都有可能为空
And (t.invoice_title = p_invoice_tmp_hd_rec.bp_name Or
(t.invoice_title Is Null And
p_invoice_tmp_hd_rec.bp_name Is Null))
......@@ -2532,7 +2532,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Exception
When billing_amount_error Then
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '开票金额有误!',
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '开票金额有误!',
p_created_by => p_user_id,
p_package_name => 'ACR_INVOICE_PKG',
p_procedure_function_name => 'create_invoice_ln');
......@@ -2547,7 +2547,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Raise;
End;
--modify by Spencer 3893 20161012 税率取根据规则获取的acr_invoice_create_tmp,不取合同表
--modify by Spencer 3893 20161012 税率取根据规则获取的acr_invoice_create_tmp,不取合同表
Procedure create_invoice_ln(p_invoice_tmp_hd_rec In invoice_hd_tmp_type,
p_invoice_hd_rec In acr_invoice_hd%Rowtype,
p_ln_step_length In Number,
......@@ -2601,14 +2601,14 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And nvl(t.exchange_rate_quotation, 'DIRECT QUOTATION') =
p_invoice_tmp_hd_rec.exchange_rate_quotation
And nvl(t.exchange_rate, 1) = p_invoice_tmp_hd_rec.exchange_rate
--以下三个字段条件: 原始表上字段不会为空的
--以下三个字段条件: 原始表上字段不会为空的
And (c.contract_id = p_invoice_tmp_hd_rec.contract_id Or
p_invoice_tmp_hd_rec.contract_id Is Null)
And (c.project_id = p_invoice_tmp_hd_rec.project_id Or
p_invoice_tmp_hd_rec.project_id Is Null)
And (t.times = p_invoice_tmp_hd_rec.times Or
(p_invoice_tmp_hd_rec.times Is Null))
--以下字段条件:等号两边都有可能为空
--以下字段条件:等号两边都有可能为空
And (t.invoice_title = p_invoice_tmp_hd_rec.bp_name Or
(t.invoice_title Is Null And
p_invoice_tmp_hd_rec.bp_name Is Null))
......@@ -2709,7 +2709,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_invoice_ln.tax_type_rate := p_invoice_tmp_hd_rec.tax_type_rate;
r_invoice_ln.tax_included_flag := 'Y';
r_invoice_ln.total_amount := r_invoice_tmp_ln.billing_amount;
--modify by shen 税额取现金流表上对应的税额
--modify by shen 税额取现金流表上对应的税额
Select *
Into r_con_contract_cashflow
From con_contract_cashflow ccc
......@@ -2732,7 +2732,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_con_contract_cashflow.principal Then
v_tax_amount := nvl(r_con_contract_cashflow.vat_principal, 0);
v_net_amount := nvl(r_con_contract_cashflow.net_principal, 0);
--modify by shen 利息税等于租金税减去本金税,利息不含税等于利息-利息税
--modify by shen 利息税等于租金税减去本金税,利息不含税等于利息-利息税
Elsif r_invoice_tmp_ln.billing_amount =
r_con_contract_cashflow.interest Then
v_tax_amount := nvl(r_con_contract_cashflow.vat_due_amount, 0) -
......@@ -2796,7 +2796,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Exception
When billing_amount_error Then
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '开票金额有误!',
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '开票金额有误!',
p_created_by => p_user_id,
p_package_name => 'ACR_INVOICE_PKG',
p_procedure_function_name => 'create_invoice_ln');
......@@ -2819,7 +2819,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Where t.invoice_hd_id =
p_invoice_hd_rec.invoice_hd_id) Loop
Select acr_invoice_batch_ln_s.nextval Into v_id From dual;
--单据复制
--单据复制
hls_document_transfer_pkg.doc_to_doc(p_from_doc_table => 'ACR_INVOICE_LN',
p_from_doc_pk => acr_invoice_ln_rec.invoice_ln_id,
p_to_doc_table => 'ACR_INVOICE_BATCH_LN',
......@@ -2829,7 +2829,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End Loop;
--null;
End;
--modify by Spencer 3893 20161012 税率取根据规则获取的acr_invoice_create_tmp,不取合同表
--modify by Spencer 3893 20161012 税率取根据规则获取的acr_invoice_create_tmp,不取合同表
Procedure create_invoice_group_by_times(p_session_id Number,
p_invoice_date Date,
p_accounting_date Date,
......@@ -2926,7 +2926,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
......@@ -3008,7 +3008,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
End Loop;
......@@ -3106,7 +3106,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
End Loop;
......@@ -3205,7 +3205,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
End Loop;
......@@ -3304,7 +3304,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
End Loop;
......@@ -3401,14 +3401,14 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_session_id => p_session_id,
p_user_id => p_user_id,
p_role_id => p_role_id);
--插入发票行合并表
--插入发票行合并表
save_acr_invoice_batch(p_invoice_hd_rec => r_invoice_hd,
p_user_id => p_user_id);
End Loop;
Close cur_group_by_tenant_hd;
End;
--宏菱建机罚息开票
--宏菱建机罚息开票
Procedure create_penalty_invoice(p_session_id Number,
p_company_id Number,
p_group_billing_method Varchar2,
......@@ -3604,10 +3604,10 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
r_acr_invoice_hd_rec acr_invoice_hd%Rowtype;
e_invoice_delete_status_err Exception;
Begin
--锁表
--锁表
r_acr_invoice_hd_rec := lock_acr_invoice(p_invoice_hd_id => p_invoice_hd_id);
--状态检查
--状态检查
If r_acr_invoice_hd_rec.invoice_status != g_status_new And
r_acr_invoice_hd_rec.invoice_status != 'REJECT' Then
Raise e_invoice_delete_status_err;
......@@ -3616,36 +3616,36 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
For c_acr_invoice_ln In (Select *
From acr_invoice_ln
Where invoice_hd_id = p_invoice_hd_id) Loop
--以负数 重新更新cashflow行状态
--以负数 重新更新cashflow行状态
c_acr_invoice_ln.total_amount := -c_acr_invoice_ln.total_amount;
update_cashflow_ln(p_invoice_hd_rec => r_acr_invoice_hd_rec,
p_invoice_ln_rec => c_acr_invoice_ln,
p_user_id => p_user_id);
--删除发票行
--删除发票行
Delete From acr_invoice_ln
Where invoice_ln_id = c_acr_invoice_ln.invoice_ln_id;
End Loop;
--删除发票头
--删除发票头
Delete From acr_invoice_hd Where invoice_hd_id = p_invoice_hd_id;
--删除单据流
--删除单据流
hls_document_flow_pkg.delete_document_flow(p_doc_category => 'AR_INVOICE',
p_doc_id => p_invoice_hd_id,
p_doc_line_id => Null);
--删除权限表
--删除权限表
aut_document_authority_pkg.delete_trx_authority(p_document_category => 'AR_INVOICE',
p_document_id => p_invoice_hd_id);
--删除操作表
--删除操作表
hls_doc_operate_history_pkg.delete_doc_operate_history_all(p_document_category => 'AR_INVOICE',
p_document_id => p_invoice_hd_id);
Exception
When e_invoice_delete_status_err Then
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '复核中的单据不能删除',
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => '复核中的单据不能删除',
p_created_by => p_user_id,
p_package_name => 'ACR_INVOICE_PKG',
p_procedure_function_name => 'delete_invoice');
......@@ -3676,23 +3676,23 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
e_invoice_confirm_status_err Exception;
Begin
--锁表
--锁表
r_acr_invoice_hd_rec := lock_acr_invoice(p_invoice_hd_id => p_invoice_hd_id);
--状态检查
--状态检查
If Not r_acr_invoice_hd_rec.invoice_status = g_status_confirming Then
Raise e_invoice_confirm_status_err;
End If;
--更新状态
--更新状态
Update acr_invoice_hd
Set invoice_status = g_status_confirm,
confirmed_date = Sysdate,
confirmed_by = p_user_id
Where invoice_hd_id = p_invoice_hd_id;
--生成凭证
--按照吉利要求,回传之后才生成凭证
--生成凭证
--按照吉利要求,回传之后才生成凭证
/*acr_invoice_je_pkg.create_acr_invoice_je(p_invoice_hd_id => p_invoice_hd_id,
p_user_id => p_user_id);*/
......@@ -3742,14 +3742,14 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
v_acr_invoice_ln_id Number;
r_acr_invoice_hd_rec acr_invoice_hd%Rowtype;
r_acr_invoice_hd_r_rec acr_invoice_hd%Rowtype; --反冲的发票头记录
r_acr_invoice_hd_r_rec acr_invoice_hd%Rowtype; --反冲的发票头记录
e_reverse_date_error Exception;
e_invoice_reverse_status_err Exception;
e_invoice_reverse_flag_err Exception;
Begin
--锁表
--锁表
r_acr_invoice_hd_rec := lock_acr_invoice(p_invoice_hd_id => p_invoice_hd_id);
If p_reverse_date < r_acr_invoice_hd_rec.accounting_date Then
......@@ -3762,7 +3762,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_period_name => v_period_name,
p_internal_period_num => v_internal_period_num);
--状态检查
--状态检查
If Not r_acr_invoice_hd_rec.invoice_status = g_status_confirm Then
Raise e_invoice_reverse_status_err;
End If;
......@@ -3772,7 +3772,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End If;
Select acr_invoice_hd_s.nextval Into v_acr_invoice_hd_id From dual;
--插入反冲的发票头和行记录
--插入反冲的发票头和行记录
r_acr_invoice_hd_r_rec := r_acr_invoice_hd_rec;
r_acr_invoice_hd_r_rec.invoice_hd_id := v_acr_invoice_hd_id;
r_acr_invoice_hd_r_rec.document_number := get_invoice_number(p_document_type => r_acr_invoice_hd_r_rec.document_type,
......@@ -3831,7 +3831,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
insert_trx_user_authority(p_invoice_hd_rec => r_acr_invoice_hd_r_rec,
p_user_id => p_user_id);
--更新状态
--更新状态
Update acr_invoice_hd
Set reversed_flag = 'W',
reverse_date = p_reverse_date,
......@@ -3839,7 +3839,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
last_updated_by = p_user_id,
last_update_date = Sysdate
Where invoice_hd_id = p_invoice_hd_id;
--生成反冲凭证
--生成反冲凭证
acr_invoice_je_pkg.create_acr_invoice_reverse_je(p_invoice_hd_id => r_acr_invoice_hd_r_rec.invoice_hd_id,
p_user_id => p_user_id);
......@@ -3903,7 +3903,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
raise_application_error(sys_raise_app_error_pkg.c_error_number,
sys_raise_app_error_pkg.g_err_line_id);
End;
--add by Yenick 宏菱项目 增加发票行合并
--add by Yenick 宏菱项目 增加发票行合并
Procedure invoice_row_merge(p_invoice_hd_id In Number,
p_user_id Number,
p_merge_flag Varchar2) Is
......@@ -3934,7 +3934,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
From acr_invoice_ln t
Where t.invoice_hd_id = p_invoice_hd_id
And rownum = 1;
--删除行合并表中的行明细记录
--删除行合并表中的行明细记录
Delete From acr_invoice_batch_ln t
Where t.invoice_hd_id = p_invoice_hd_id;
If r_acr_invoice_hd.merge_flag = 'Y' Then
......@@ -4013,7 +4013,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
raise_application_error(sys_raise_app_error_pkg.c_error_number,
sys_raise_app_error_pkg.g_err_line_id);
End invoice_row_merge;
--发票提交
--发票提交
Procedure acr_invoice_submit(p_batch_id Number, p_user_id Number) Is
r_acr_invoice_hd acr_invoice_hd%Rowtype;
v_instance_id Number;
......@@ -4036,11 +4036,11 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And rownum = 1;
If v_count = 1 Then
v_document_info := v_bp_name || '提交发票审批';
v_document_info := v_bp_name || '提交发票审批';
Elsif v_count > 1 Then
v_document_info := v_bp_name || '等提交发票审批';
v_document_info := v_bp_name || '等提交发票审批';
End If;
--提交审批
--提交审批
hls_workflow_pkg.workflow_start(p_instance_id => v_instance_id,
p_document_category => 'AR_INVOICE',
p_document_type => 'STD',
......@@ -4054,10 +4054,10 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
p_parameter_3_value => p_batch_id,
p_parameter_4 => 'SUBMIT_DATE',
p_parameter_4_value => to_char(Sysdate,
'yyyy"年"mm"月"dd"日"'));
'yyyy"年"mm"月"dd"日"'));
End acr_invoice_submit;
--更新为同一批次
--更新为同一批次
Procedure acr_invoice_update_batch(p_user_id Number,
p_batch_id Number,
p_invoice_hd_id In Number) Is
......@@ -4075,7 +4075,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
return p_batch_id;
end;*/
--发票审批通过
--发票审批通过
Procedure acr_invoice_approved(p_batch_id Number, p_user_id Number) Is
Begin
Update acr_invoice_hd t
......@@ -4084,7 +4084,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
t.last_updated_by = p_user_id
Where t.batch_id = p_batch_id;
End;
--发票审批拒绝
--发票审批拒绝
Procedure acr_invoice_reject(p_batch_id Number, p_user_id Number) Is
Begin
Update acr_invoice_hd t
......@@ -4119,7 +4119,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Exception
When e_exists_err Then
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '发票明细行有误,请检查!',
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '发票明细行有误,请检查!',
p_created_by => p_user_id,
p_package_name => 'ACR_INVOICE_PKG',
p_procedure_function_name => 'acr_invoice_status_change');
......@@ -4128,7 +4128,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
sys_raise_app_error_pkg.g_err_line_id);
When e_status_err Then
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '发票状态有误!',
sys_raise_app_error_pkg.raise_sys_others_error(p_message => '发票状态有误!',
p_created_by => p_user_id,
p_package_name => 'ACR_INVOICE_PKG',
p_procedure_function_name => 'acr_invoice_status_change');
......@@ -4353,11 +4353,11 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
1,
to_char(al.times),
2,
'首付款',
'首付款',
8,
'留购金',
'留购金',
9,
'违约金') times,
'违约金') times,
al.cashflow_id,
al.cf_item,
Case
......@@ -4493,7 +4493,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
vat_account_tmp_cur.tax_apply_month := cur_temp.invoice_month;
vat_account_tmp_cur.invoice_date := cur_temp.invoice_date;
vat_account_tmp_cur.invoice_number := cur_temp.invoice_number;
--含税金额
--含税金额
vat_account_tmp_cur.invoice_tax_amount := cur_temp.total_amount;
vat_account_tmp_cur.apply_flag := cur_temp.for_invoice_flag;
vat_account_tmp_cur.tenant_name := cur_temp.bp_name;
......@@ -4518,7 +4518,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Insert Into vat_account_tmp Values vat_account_tmp_cur;
End Loop;
--插入调差凭证
--插入调差凭证
For cur_distance_je In (Select l.amount_cr,
ach.invoice_hd_id,
to_char(h.journal_date, 'yyyymm') je_month,
......@@ -4556,15 +4556,15 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
cur_distance_je.je_month,
cur_distance_je.journal_date,
cur_distance_je.sbo_num,
--调差凭证标志
--调差凭证标志
'ADJUST_JOURNAL',
p_user_id,
Sysdate,
p_user_id,
Sysdate);
End Loop;
--更新表中的数据
--统计不是本金利益分开开票的情况
--更新表中的数据
--统计不是本金利益分开开票的情况
For acr_invoice_ln In (Select trunc(Min(t.due_date)) min_due_date,
t.invoice_hd_id
From vat_account_tmp t,
......@@ -4589,7 +4589,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
Where vat.invoice_hd_id = acr_invoice_ln.invoice_hd_id
And vat.session_id = p_session_id
And trunc(vat.due_date) > trunc(acr_invoice_ln.min_due_date);
--单独判断最后一期租金和留购金的情况,删除留购金的数据
--单独判断最后一期租金和留购金的情况,删除留购金的数据
Select Count(1)
Into v_purchase_amount_flag
From vat_account_tmp t
......@@ -4613,7 +4613,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And vat.cf_item = 8;
End If;
End Loop;
--本利拆开
--本利拆开
For acr_invoice_ln_dif In (Select t.invoice_line_id,
t.invoice_tax_amount,
ccc.interest,
......@@ -4625,7 +4625,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And t.cashflow_id = ccc.cashflow_id
And l.invoice_ln_id = t.invoice_line_id
And l.total_amount <> ccc.due_amount) Loop
--将利息置空
--将利息置空
If acr_invoice_ln_dif.invoice_tax_amount =
acr_invoice_ln_dif.interest Then
Update vat_account_tmp vat
......@@ -4644,7 +4644,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
End Loop;
--罚息的数据单独处理
--罚息的数据单独处理
For acr_invoice_ln In (Select trunc(Min(t.due_date)) min_due_date,
t.invoice_hd_id,
Min(t.invoice_line_id) min_invoice_ln_id
......@@ -4667,7 +4667,7 @@ CREATE OR REPLACE Package Body acr_invoice_pkg Is
And trunc(vat.due_date) > trunc(acr_invoice_ln.min_due_date)
And vat.cf_item = 9;
--如果罚息是同一天的,也需要单独处理
--如果罚息是同一天的,也需要单独处理
Select Count(1)
Into v_penalty_amount_flag
From vat_account_tmp vat
......
......@@ -155,7 +155,8 @@
v.code_value = r.req_status
)req_status_n,
r.created_by,
(SELECT su.description FROM sys_user su WHERE su.user_id=r.created_by)req_employee_n
(SELECT su.description FROM sys_user su WHERE su.user_id=r.created_by)req_employee_n,
to_char(r.termination_date,'yyyy-mm-dd')termination_date
FROM
con_contract t,
hls_bp_master b,
......@@ -193,6 +194,8 @@
<bm:query-field name="division" queryExpression="t1.division = ${@division}"/>
<bm:query-field name="contract_status" queryExpression="t1.contract_status = ${@contract_status}"/>
<bm:query-field name="lease_execution_date_from" queryexpression="to_char(t1.lease_execution_date,'YYYY-MM-DD') &gt;= ${@lease_execution_date_from}"/>
<bm:query-field name="termination_date_to" queryexpression="t1.termination_date&lt;= ${@termination_date_to}"/>
<bm:query-field name="termination_date_from" queryexpression="t1.termination_date &gt;= ${@termination_date_from}"/>
<bm:query-field name="lease_execution_date_to" queryexpression="to_char(t1.lease_execution_date,'YYYY-MM-DD') &lt;= ${@lease_execution_date_to}"/>
<bm:query-field name="req_employee_n" datatype="java.lang.String" queryexpression="t1.req_employee_n like &apos;%&apos; || ${@req_employee_n} || &apos;%&apos;"/>
<bm:query-field name="req_status" queryExpression="t1.req_status = ${@req_status}"/>
......
......@@ -81,7 +81,9 @@
FROM hls_bp_master_bank_account hb
WHERE hb.bank_account_id = v.bp_bank_account_id)) sap_bvtyp_n,
v.pattern,
v.machine_number
v.machine_number,
v.repur_con_amt,
v.repur_con_ddct_amt
FROM (SELECT t.contract_id,
(SELECT hbbc.bank_account_id
FROM hls_bp_master_bank_account hbbc
......@@ -263,7 +265,9 @@
'01',
'CNYB')) sap_bvtyp_n,
i.pattern,
i.machine_number
i.machine_number,
nvl((select due_amount from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_amt,
nvl((select due_amount from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_ddct_amt
FROM con_contract_cashflow f
join con_contract t
on t.contract_id = f.contract_id
......
......@@ -116,7 +116,9 @@
cpr.payment_req_ln_type,
cpr.ref_doc_id,
cpr.ref_doc_line_id,
cpr.ref_doc_category
cpr.ref_doc_category,
nvl(cpr.repur_con_amt,0)repur_con_amt,
nvl(cpr.repur_con_ddct_amt,0)repur_con_ddct_amt
from csh_payment_req_ln cpr,
con_contract c,
......
......@@ -10,12 +10,8 @@
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
update csh_transaction
set LAST_UPDATE_DATE = sysdate,
last_updated_by = ${/session/@user_id},
confirmed_flag = 'ACCAUDITING'
where transaction_id = ${@transaction_id}
and confirmed_flag in ('NEW','CT_REJECTED');
csh_transaction_pkg.check_csh_trans_tenant_atm(p_transaction_id=> ${@transaction_id},
p_user_id=> ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
......
......@@ -17,7 +17,7 @@
to_char(due_date, 'yyyy-mm-dd') due_date,
decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t.cashflow_id,
p_calc_date=>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) due_amount,
......@@ -27,7 +27,7 @@
interest - nvl(received_interest, 0) unreceived_interest,
decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=>t.cashflow_id,
p_calc_date=>to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_calc_date=>decode(nvl(${@deposit_flag},'N'),'Y',sysdate,to_date(${@transaction_date}, 'yyyy-mm-dd')),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) -
......
......@@ -80,6 +80,7 @@
<bm:field name="receipt_type_des" expression="(select v.code_value_name from sys_code_values_v v where v.code=&apos;RECEIPT_TYPE&apos; and v.code_value=t1.receipt_type)"/>
<bm:field name="ref_contract_id"/>
<bm:field name="contract_number" expression="(select cc.contract_number from con_contract cc where cc.contract_id = t1.ref_contract_id)"/>
<bm:field name="contract_name" expression="(select cc.contract_number from con_contract cc where cc.contract_id = t1.ref_contract_id)"/>
<bm:field name="collection_classes"/>
<bm:field name="collection_classes_desc" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'DS_COLLECTION_CLASSES' and v.code_value =t1.collection_classes)" forInsert="false" forUpdate="false"/>
<bm:field name="confirmed_flag_desc" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'CONFIRMED_FLAG' and v.code_value =t1.confirmed_flag)" forInsert="false" forUpdate="false"/>
......@@ -101,6 +102,7 @@
<bm:field name="acc_confirmed_by_desc" expression="(select description from sys_user where user_id=t1.acc_confirmed_by)" forInsert="false" forUpdate="false"/>
<bm:field name="receipt_type_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'RECEIPT_TYPE' and v.code_value =t1.receipt_type)" forInsert="false" forUpdate="false"/>
<bm:field name="deposit_trans_type"/>
<bm:field name="bp_id_telnet_code" expression="(select hb.bp_code from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_telnet_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_name_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_agent_level1)" forInsert="false" forUpdate="false"/>
<bm:field name="deposit_trans_type_desc" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'DEPOSIT_TRANS_TYPE' and v.code_value =t1.deposit_trans_type)" forInsert="false" forUpdate="false"/>
......
......@@ -4,7 +4,7 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select cr.return_id,
cr.return_date,
to_char(cr.return_date,'yyyy-mm-dd') return_date,
cr.return_amount,
ct.period_name,
cr.opposite_band_na,
......@@ -38,7 +38,13 @@
cr.csh_return_bp_id,
(select a.bp_name
from hls_bp_master a
where a.bp_id = cr.csh_return_bp_id) csh_return_bp_name
where a.bp_id = cr.csh_return_bp_id) csh_return_bp_name,
(select hb.bp_code from hls_bp_master hb,con_contract cc where cc.contract_id=ct.ref_contract_id and hb.bp_id=cc.bp_id_tenant)bp_id_telnet_code,
(select hb.bp_name from hls_bp_master hb,con_contract cc where cc.contract_id=ct.ref_contract_id and hb.bp_id=cc.bp_id_tenant)bp_id_telnet_n,
(select cc.contract_number from con_contract cc where cc.contract_id = ct.ref_contract_id) contract_number,
(select a.bp_name
from hls_bp_master a
where a.bp_id = ct.bp_id) bp_agent_name
from csh_transaction ct, csh_transaction_return cr
where ct.transaction_id = cr.transaction_id
)v
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: hp
$Date: 2015-5-15 上午11:46:44
$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 t1.status from CSH_TRANSACTION_RETURN t1 #WHERE_CLAUSE# ]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="status"/>
</bm:fields>
</bm:model>
......@@ -176,9 +176,10 @@
<bm:query-field field="bp_id" queryOperator="="/>
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="bank_account_num" queryExpression="(select a.bank_account_num from csh_bank_account a where a.bank_account_id=t1.bank_account_id) like &apos;%&apos;||upper(${@bank_account_num})||&apos;%&apos;"/>
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>--> <bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like ${@bp_id_telnet_n}"/>
<!--<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||upper(${@contract_number})||&apos;%&apos;"/>-->
<bm:query-field name="bp_id_telnet_n" queryExpression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant) like &apos;%&apos;||${@bp_id_telnet_n}||&apos;%&apos; "/>
<bm:query-field name="contract_number" queryExpression="(SELECT cc.contract_number FROM con_contract cc WHERE cc.contract_id = t1.ref_contract_id) like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like ${@bp_name_n} "/>
<bm:query-field name="bp_name_n" queryExpression="(select d.bp_name from hls_bp_master_v d where d.bp_id=t1.bp_id) like &apos;%&apos;||${@bp_name_n}||&apos;%&apos; "/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.deposit_trans_type=${@deposit_trans_type}"/>
</bm:query-fields>
</bm:model>
......@@ -4,6 +4,7 @@
<bm:operation name="update">
<bm:parameters>
<bm:parameter name="document_category" dataType="java.lang.String" input="true" output="false"/>
<bm:parameter name="business_type" dataType="java.lang.String" input="true" output="false"/>
<bm:parameter name="document_type" dataType="java.lang.String" input="true" output="false"/>
<bm:parameter name="company_id" dataType="java.lang.Long" input="true" output="false"/>
<bm:parameter name="lease_channel" dataType="java.lang.String" input="true" output="false"/>
......@@ -17,6 +18,7 @@
HLS_DOCUMENT_SAVE_PKG.GET_NEW_PRJ_NUMBER
(
p_document_category=>${@document_category},
p_business_type=>${@business_type},
p_document_type=>${@document_type},
p_company_id=>${/session/@company_id},
p_lease_channel=>${@lease_channel},
......
......@@ -57,7 +57,7 @@
(case when
${/session/@role_id} in(2318,2319) then
'同意'
elsemodules/cont/CON620/con_contract_rent_dun_query.lview
else
t1.comment_text
end ),t1.comment_text),t1.comment_text) comment_text,
-- t1.comment_text,
......@@ -140,16 +140,17 @@
WHERE
t1.instance_id =${@instance_id} ) v where (v.bp_category = 'AGENT' and v.record_type not like 'TRANSFER')
UNION
SELECT
NULL AS node_id,
SELECT NULL AS node_id,
NULL AS workflow_code,
NULL AS workflow_desc,
00 AS node_sequence_num,
'00--提交节点' AS node_desc,
pp.wfl_instance_id AS instance_id,
zw.instance_id AS instance_id,
NULL AS action_taken,
NULL AS action_type,
'提交--租赁申请流程' AS action_type_desc,
('提交--' || (select zww.workflow_desc
from zj_wfl_workflow zww
where zww.workflow_id = zw.workflow_id)) AS action_type_desc,
NULL AS record_type,
'提交' AS comment_text,
NULL AS comment_text_out,
......@@ -158,10 +159,11 @@
NULL AS rcpt_record_id,
NULL AS disabled_flag,
NULL AS note,
to_char((select zi.creation_date from zj_wfl_workflow_instance zi where zi.instance_id=pp.wfl_instance_id),'yyyy-mm-dd hh24:mi:ss') AS create_date_fmt,
(SELECT su.description FROM sys_user su WHERE su.user_id = pp.owner_user_id
) approver,
'Y' AS agent_flag,
to_char(zw.creation_date, 'yyyy-mm-dd hh24:mi:ss') AS create_date_fmt,
(SELECT su.description
FROM sys_user su
WHERE su.user_id = zw.created_by) approver,
'N' AS agent_flag,
1 AS record_approve_count,
1 AS instance_approve_count,
'N' AS node_hide_approve_record,
......@@ -171,11 +173,10 @@
NULL AS wfl_show_all_approve_ht,
NULL AS attach_count,
NULL AS bp_category
FROM
prj_project pp
WHERE
pp.wfl_instance_id = ${@instance_id} AND
pp.wfl_instance_id IS NOT NULL
FROM zj_wfl_workflow_instance zw
WHERE zw.instance_id =${@instance_id}
) t1 #WHERE_CLAUSE#
ORDER BY
create_date_fmt DESC
......
......@@ -321,12 +321,12 @@
<a:dataSet id="acr512_invoice_result_ds" autoPageSize="true" autoQuery="true"
model="acr.ACR512.acr_invoice_update_query" queryDataSet="acr512_invoice_query_ds"
selectable="true"/>
<a:fields>
<a:field name="compare_date_flag"/>
</a:fields>
<a:events>
<a:event name="load" handler="load_do_info"/>
</a:events>
<!-- <a:fields>-->
<!-- <a:field name="compare_date_flag"/>-->
<!-- </a:fields>-->
<!-- <a:events>-->
<!-- <a:event name="load" handler="load_do_info"/>-->
<!-- </a:events>-->
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
......
......@@ -67,11 +67,11 @@
function open_project_Window(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
//项目类layout_code
maintain_type = 'QUERY';
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_code'] = 'PRJ501Q';
param['function_usage'] = 'MODIFY';
param['function_code'] = 'PRJ501_WFL';
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_link_readonly', ds_id);
......
......@@ -61,6 +61,21 @@
});
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if (ds_id == ds.id && ds_id) {
if (record.get('business_type') == 'LEASEBACK'&&'${/parameter/@function_usage}'=='MODIFY') {
record.set('submit_date',null);
record.set('guarantee_letter_f','NO');
record.set('guarantee_letter_f_n','否');
}else if(record.get('business_type') == 'LEASE'){
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none';
}
}
};
// window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
......@@ -511,6 +526,7 @@
document_category: 'CONTRACT',
contract_status:record.get('contract_status'),
maintain_type: 'MODIFY',
business_type: record.get('business_type'),
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: cashflow_ds_id,
......
<?xml version="1.0" encoding="UTF-8"?><!-- $Author: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name=='attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; }else if(name == 'attach_file_name_new'){ link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if(record.get('bp_category') =='AGENT'){ param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; }else{ param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if(record.get('attachment_tab_group')=='CREDIT_CHECK' && '${/parameter/@query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='N'){ url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url //add by lijingjing 2019-11-15 if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path+'?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id=record.get('contract_id'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if($(ds_id).validate()){ Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function() { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id:contract_id }, scope: this, success: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } } if ('${/parameter/@source_type}' == 'WFL'){ zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if($(con_ds_id).isModified()){ Leaf.showMessage('${HLS.PROMPT}','请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function(){ var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if(ds_id){ $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id','${/parameter/@contract_id}'); $(ds_id).query(); } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!-- $Author: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name=='attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; }else if(name == 'attach_file_name_new'){ link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if(record.get('bp_category') =='AGENT'){ param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; }else{ param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if(record.get('attachment_tab_group')=='CREDIT_CHECK' && '${/parameter/@query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='N'){ url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url //add by lijingjing 2019-11-15 if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path+'?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK'&&'${/parameter/@function_usage}'=='MODIFY') { record.getField('entrusted_amount').setRequired(true); }else if(record.get('business_type') == 'LEASE'){ document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } } }; // /*保存前调用,生成项目编号*/ // window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { // var check_flag = true; // var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); // var prj_record = $(prj_project_ds_id).getAt(0); // // var project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); // // var lease_item_ds_id = '${/parameter/@layout_code}' + '_G_CAR_INFO_prj_project_lease_item_ds'; // var lease_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item'); // var project_record = $(project_ds_id).getCurrentRecord(); // // var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail'); // var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord(); // // if (bp_tenant_detail_r && ds.id == prj_project_ds_id) { // for (var key in bp_tenant_detail_r.data) { // if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n') { // if(!bp_tenant_detail_r.get(key)){ // Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!"); // bp_rate_flag = false; // break; // }else{ // bp_rate_flag = true; // } // } // } // } // if(!bp_rate_flag){ // return false; // } // if (prj_record.get('project_number')) { // return true; // } // window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); // // return check_flag; // // }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id=record.get('contract_id'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if($(ds_id).validate()){ Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function() { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id:contract_id }, scope: this, success: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } } if ('${/parameter/@source_type}' == 'WFL'){ zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if($(con_ds_id).isModified()){ Leaf.showMessage('${HLS.PROMPT}','请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function(){ var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if(ds_id){ $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id','${/parameter/@contract_id}'); $(ds_id).query(); } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen>
\ No newline at end of file
......
......@@ -155,7 +155,7 @@
<a:map from="document_type_desc" to="et_type_dis"/>
</a:mapping>
</a:field>
<a:field name="termination_date" datatype="date" required="true"/>
<!-- <a:field name="termination_date" datatype="date" required="true"/>-->
<a:field name="overdue_status" checkedValue="Y" uncheckedValue="N"/>
<a:field name="trial" checkedValue="Y" uncheckedValue="N"/>
<a:field name="lease_execution_date" datatype="date"/>
......@@ -173,7 +173,7 @@
<a:gridButton click="contractQueryScreen_reset" text="HLS.RESET"/>
<a:gridButton click="con_gur_np_pint" text="合同文本打印" id="con_gur_np_pint_id"/>
</a:screenTopToolbar>
<a:form column="4" labelWidth="100" marginWidth="40" title="HLS.QUERY_TITLE">
<a:form column="3" labelWidth="100" marginWidth="40" title="HLS.QUERY_TITLE">
<a:textField name="change_req_number" bindTarget="contractQueryScreen_paraDs" prompt="变更申请编号"/>
<a:textField name="contract_number" bindTarget="contractQueryScreen_paraDs" prompt="合同编号"/>
<a:textField name="contract_name" bindTarget="contractQueryScreen_paraDs" prompt="合同名称"/>
......@@ -181,6 +181,8 @@
<!-- <a:lov name="bp_agent" bindTarget="contractQueryScreen_paraDs" prompt="代理店"/>-->
<a:comboBox name="division_n" bindTarget="contractQueryScreen_paraDs" prompt="租赁物"/>
<a:textField name="req_employee_n" bindTarget="contractQueryScreen_paraDs" prompt="申请人"/>
<a:datePicker name="termination_date_from" bindTarget="contractQueryScreen_paraDs" prompt="提前结清日从"/>
<a:datePicker name="termination_date_to" bindTarget="contractQueryScreen_paraDs" prompt="提前结清日到"/>
<a:comboBox name="req_status_n" bindTarget="contractQueryScreen_paraDs" prompt="变更审批状态"/>
</a:form>
<a:grid id="contractQueryScreen_mainDs_grid" bindTarget="contractQueryScreen_mainDs" marginHeight="230" marginWidth="40" navBar="true">
......@@ -192,6 +194,7 @@
<a:column name="bp_agent" prompt="代理店" width="200" align="left"/>
<a:column name="division_n" prompt="租赁物" width="120" align="left"/>
<a:column name="req_employee_n" prompt="申请人" width="80" align="right"/>
<a:column name="termination_date" prompt="提前结清日" width="100" align="center"/>
<a:column name="req_status_n" prompt="变更审批状态" width="100" align="center"/>
</a:columns>
</a:grid>
......
......@@ -36,7 +36,8 @@
<a:link id="csh_payment_req_prepayment_dk_detail_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_prepayment_dk_detail.lview"/>
<a:link id="csh_payment_req_ln_del_link" model="csh.CSH504.csh_payment_req_ln_del" modelaction="batch_update"/>
<a:link id="csh501d_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="csh501d_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="update_csh_payment_hd_info_link" model="csh.CSH501.csh_payment_req_get_num" modelaction="execute"/>
<a:link id="csh_payment_req_pay_win_link"
url="${/request/@context_path}/modules/csh/CSH502/csh_payment_req_pay.lview"/>
......@@ -78,7 +79,8 @@
<a:link id="get_xml" model="cont.CON501.con_change_case_submit" modelaction="execute"/>
<!-- 生成Excel文件-->
<a:link id="tre_loan_con_print_excel_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_contract_export.lsc"/>
<a:link id="tre_loan_con_print_excel_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_contract_export.lsc"/>
<script type="text/javascript"><![CDATA[
......@@ -92,9 +94,9 @@
// if ('${/parameter/@re_param}' == 'node1') {
if (type == 'agree') {
var records = $(lnds_id).getAll();
for ( var i = 0;i< records.length;i++) {
if(records[i].get('billing_status_n')!='已开票' ||records[i].get('invoice_status_n')!='已确认'){
$L.showErrorMessage("提示",'请选择开票状态为已开票,发票状态为已确认的现金流!');
for (var i = 0; i < records.length; i++) {
if (records[i].get('billing_status_n') != '已开票' || records[i].get('invoice_status_n') != '已确认') {
$L.showErrorMessage("提示", '请选择开票状态为已开票,发票状态为已确认的现金流!');
return false;
}
}
......@@ -104,15 +106,15 @@
});
}
//如果头id 不为空,就使用自在定义的ds进行查询
Leaf.onReady(function(){
Leaf.onReady(function () {
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var payment_req_id='${/parameter/@payment_req_id}';
if(payment_req_id){
var payment_req_id = '${/parameter/@payment_req_id}';
if (payment_req_id) {
$(lnds_id).setQueryUrl('${/request/@context_path}/autocrud/csh.CSH501.csh_payment_req_ln_query_after_save/query');
$(lnds_id).setQueryParameter("payment_req_id",payment_req_id);
$(lnds_id).setQueryParameter("payment_req_id", payment_req_id);
$(lnds_id).query();
$(hdds_id).setQueryParameter("payment_req_id",payment_req_id);
$(hdds_id).setQueryParameter("payment_req_id", payment_req_id);
$(hdds_id).query();
}
......@@ -206,16 +208,45 @@
hdrecord.set('currency_code', currency_code);
hdrecord.set('currency_name', currency_name);
record.set('act_amount', minus(record.get('amount'), record.get('sum_ddct_amount') || 0));
} else if(name=='amount_vender'){
var due_amount=record.get('due_amount');
var other_payment2=record.get('other_payment2');
var amount_agent=minus(minus(due_amount,other_payment2),value);
if(amount_agent<0){
$L.showErrorMessage("提示",'委托付款金额和首付款抵充金额不能大于应付金额!');
} else if (name == 'amount_vender') {
var due_amount = record.get('due_amount');
var other_payment2 = record.get('other_payment2');
var amount_agent = minus(minus(due_amount, other_payment2), value);
if (amount_agent < 0) {
$L.showErrorMessage("提示", '委托付款金额和首付款抵充金额不能大于应付金额!');
return;
}
record.set('amount_agent',amount_agent);
} else if (name == 'act_amount') {
record.set('amount_agent', amount_agent);
}
else if (name == 'repur_con_ddct_amt') {
var repur_con_amt = record.get('repur_con_amt');
var other_payment2 = record.get('other_payment2');
var amount_vender=record.get('amount_vender');
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '回购租金抵冲金额应大于等于0!');
setTimeout(function () {
record.set('repur_con_ddct_amt', 0);
}, 5);
return;
}
if (value > repur_con_amt) {
$L.showErrorMessage("提示", '回购租金抵冲金额不能大于回购租金金额!');
setTimeout(function () {
record.set('repur_con_ddct_amt', 0);
}, 5);
return;
}
var amount_agent = minus(minus(minus(due_amount, other_payment2), amount_vender),value);
if (amount_agent < 0) {
$L.showErrorMessage("提示", '委托付款金额,首付款抵充金额和回购租金抵冲金额不能大于应付金额!');
setTimeout(function () {
record.set('repur_con_ddct_amt', 0);
}, 5);
return;
}
record.set('amount_agent', amount_agent);
}
else if (name == 'act_amount') {
hdrecord.set('sum_act_amount', plus(minus(hdrecord.get('sum_act_amount') || 0, old_value || 0), value || 0));
}
if (lineRecords.length == 1) {
......@@ -293,8 +324,8 @@
if (!record.get('apply_pay_date')) {
//添加时间为预定的每月20号
var pre_date= [new Date().getFullYear(),new Date().getMonth()+1,20].join('-');
record.set('apply_pay_date',pre_date);
var pre_date = [new Date().getFullYear(), new Date().getMonth() + 1, 20].join('-');
record.set('apply_pay_date', pre_date);
}
$(lnds_id).create(Ext.apply({}, record.data));
}
......@@ -438,6 +469,7 @@
scope: this
});
}
//打印
function csh501_print() {
......@@ -482,7 +514,7 @@
ln_records = ln_ds.getAll();
if (ln_records.length > 0 && !ln_records[0].get('payment_req_ln_id')) {
Leaf.showMessage('${HLS.PROMPT}', '请先保存!');
}else{
} else {
csh501_print();
}
/*else {
......@@ -531,8 +563,8 @@
//发票确认
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var datas=$(lnds_id).getAt(0);
var contract_id =datas.get('contract_id') ;
var datas = $(lnds_id).getAt(0);
var contract_id = datas.get('contract_id');
var param = {};
param['function_code'] = 'ACR_INVOICE_QUERY_N';
param['function_usage'] = 'QUERY';
......@@ -668,7 +700,7 @@
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
if(line_records.length>1){
if (line_records.length > 1) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:PROMPT}', '一次支付只支持同一合同!');
return;
......@@ -696,8 +728,8 @@
//支付金额为应付代理店
var this_pay_amount=plus(line_record.get('residual_agent_amount'),line_record.get('residual_vender_amount'));
if (this_pay_amount <=0) {
var this_pay_amount = plus(line_record.get('residual_agent_amount'), line_record.get('residual_vender_amount'));
if (this_pay_amount <= 0) {
Leaf.showMessage('${l:PROMPT}', '本次支付金额为空!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
......@@ -712,20 +744,20 @@
bp_bank_account_code = line_record.get('bp_bank_account_code');
bp_bank_account_num = line_record.get('bp_bank_account_num');
var vender_bank_account_num=line_record.get('vender_bank_account_number');
var vender_bank_account_num = line_record.get('vender_bank_account_number');
bp_bank_account_name = line_record.get('bp_bank_account_name');
bp_bank_account_code_n = line_record.get('bp_bank_account_code_n');
bp_bank_account_id = line_record.get('bp_bank_account_id');
contract_id = line_record.get('contract_id');
line_record.set('loan_date',hd_record.get('loan_date'));
line_record.set('hdds_id',hdds_id);
line_record.set('lnds_id',lnds_id);
line_record.set('vender_bank_account_num',vender_bank_account_num);
line_record.set('winid','csh_payment_req_pay_win');
line_record.set('loan_date', hd_record.get('loan_date'));
line_record.set('hdds_id', hdds_id);
line_record.set('lnds_id', lnds_id);
line_record.set('vender_bank_account_num', vender_bank_account_num);
line_record.set('winid', 'csh_payment_req_pay_win');
var win = new Leaf.Window({
id: 'csh_payment_req_pay_win',
url: $('csh_payment_req_pay_win_link').getUrl(),
params:line_record.data,
params: line_record.data,
/* {
payment_req_id: payment_req_id,
winid: 'csh_payment_req_pay_win',
......@@ -751,85 +783,86 @@
};
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = false;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var ds_line_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
if($(ds_line_id).data.length<=0){
$L.showErrorMessage("错误",'无付款记录,不可提交审批!');
if ($(ds_line_id).data.length <= 0) {
$L.showErrorMessage("错误", '无付款记录,不可提交审批!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
console.log('${/parameter/@division}');
var total_amount_agent=0;
var total_amount_vender=0;
var total_apply_amount=0;
var total_amount_agent = 0;
var total_amount_vender = 0;
var total_apply_amount = 0;
//检验输入的数据是否符合要求
var check_due_amount_flag=true;
var line_datas=$(ds_line_id).data;
var head_record=$(ds_id).getAt(0);
var check_due_amount_flag = true;
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++){
var line_data=line_datas[i];
var gk_contract_num = 0;
for (var i = 0; i < line_datas.length; i++) {
var line_data = line_datas[i];
//应付我司金额
var amount_agent=line_data.get('amount_agent');
var amount_vender= line_data.get('amount_vender');
var due_amount= line_data.get('due_amount');
var bp_bank_account_id=line_data.get('bp_bank_account_id');
var vender_bank_account_id=line_data.get('vender_bank_account_id');
var amount_agent = line_data.get('amount_agent');
var amount_vender = line_data.get('amount_vender');
var due_amount = line_data.get('due_amount');
var bp_bank_account_id = line_data.get('bp_bank_account_id');
var vender_bank_account_id = line_data.get('vender_bank_account_id');
//首付款抵充金额
var other_payment2=line_data.get('other_payment2');
if(amount_agent<0||amount_vender<0){
$L.showErrorMessage("提示",'应付我司金额和首付款抵充金额不能为负数!');
var other_payment2 = line_data.get('other_payment2');
var repur_con_ddct_amt=line_data.get('repur_con_ddct_amt');
if (amount_agent < 0 || amount_vender < 0) {
$L.showErrorMessage("提示", '应付我司金额和首付款抵冲金额不能为负数!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
//买断机合同 个数
if(amount_vender==0 || '${/parameter/@division}'==30){
gk_contract_num=gk_contract_num+1;
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) {
$L.showErrorMessage("提示",'请选择代理店账号信息!');
$L.showErrorMessage("提示", '请选择代理店账号信息!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if(amount_vender>0 &&!vender_bank_account_id){
if (amount_vender > 0 && !vender_bank_account_id) {
$L.showErrorMessage("提示",'请选择委托付款金额不为0的厂商账号信息!');
$L.showErrorMessage("提示", '请选择委托付款金额不为0的厂商账号信息!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if(plus(plus(amount_agent,amount_vender),other_payment2)!=due_amount){
$L.showErrorMessage("提示",'应付我司金额,委托付款金额和首付款抵充金额之后应等于应付金额!');
if (plus(plus(plus(amount_agent, amount_vender), other_payment2),repur_con_ddct_amt) != due_amount) {
$L.showErrorMessage("提示", '应付我司金额,委托付款金额,首付款抵冲金额和回购租金抵冲金额之和应等于应付金额!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
//本次申请金额等于委托加我司
var this_apply_amount=plus(amount_agent,amount_vender);
total_apply_amount=plus(total_apply_amount,this_apply_amount);
line_data.set('amount',this_apply_amount);
total_amount_agent=plus(total_amount_agent,amount_agent);
total_amount_vender=plus(total_amount_vender,amount_vender);
var this_apply_amount = plus(amount_agent, amount_vender);
total_apply_amount = plus(total_apply_amount, this_apply_amount);
line_data.set('amount', this_apply_amount);
total_amount_agent = plus(total_amount_agent, amount_agent);
total_amount_vender = plus(total_amount_vender, amount_vender);
}
if(gk_contract_num<line_datas.length&&gk_contract_num!=0){
$L.showErrorMessage("提示",'买断机合同(即厂商的付款金额为0)不可与其他正常合同同时进行付款申请支付');
if (gk_contract_num < line_datas.length && gk_contract_num != 0) {
$L.showErrorMessage("提示", '买断机合同(即厂商的付款金额为0)不可与其他正常合同同时进行付款申请支付');
return false;
}
//给头表赋值
$(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',total_apply_amount);
$(ds_id).getAt(0).set('company_id','${/session/@company_id}');
$(ds_id).getAt(0).set('transaction_category','BUSINESS');
$(ds_id).getAt(0).set('submitted_flag','N');
$(ds_id).getAt(0).set('printed_flag','N');
$(ds_id).getAt(0).set('document_category','PAYMENT_REQ');
$(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', total_apply_amount);
$(ds_id).getAt(0).set('company_id', '${/session/@company_id}');
$(ds_id).getAt(0).set('transaction_category', 'BUSINESS');
$(ds_id).getAt(0).set('submitted_flag', 'N');
$(ds_id).getAt(0).set('printed_flag', 'N');
$(ds_id).getAt(0).set('document_category', 'PAYMENT_REQ');
//确认保存
var hd_record = $(ds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
......@@ -866,7 +899,7 @@
}
return check_flag||false;
return check_flag || false;
};
//调用合同后督
......@@ -1035,12 +1068,13 @@
Leaf.request({
url: $('update_csh_payment_hd_info_link').getUrl(),
para: {
payment_req_id:payment_req_id
payment_req_id: payment_req_id
},
success: function () {
Leaf.Masker.unmask(Ext.getBody());
$(hdds_id).setQueryParameter('payment_req_id', payment_req_id);
$(hdds_id).query(); },
$(hdds_id).query();
},
failure: function () {
Leaf.Masker.unmask(detail_mask);
},
......@@ -1097,7 +1131,7 @@
var path = res.result.record.file_path;
path = path.substr(path.indexOf('hls_attachment'));
var tomcat_source = '${/parameter/@tomcat_source}';
var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path+'?type=pdf';
var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf';
var oWin = window.open(source_path);
},
scope: this
......@@ -1262,6 +1296,7 @@
qpara['payment_bp_id'] = '${/parameter/@payment_bp_id}';
}
// function on_csh_payment_req_temp_ln_ds_update( dataSet, record, name, value,oldvalue) {
// if(name=='amount_vender'&&value){
// var due_amount=record.get('due_amount');
......@@ -1283,7 +1318,7 @@
sum = plus(sum, n);
}
}
var total = (typeof(sum) == 'undefined' ? '' : parseFloat(sum));
var total = (typeof (sum) == 'undefined' ? '' : parseFloat(sum));
return '<font>' + Leaf.formatMoney(total) + '</font>';
}
......@@ -1323,14 +1358,13 @@
// };
//工作流中隐藏按钮
Leaf.onReady(function() {
Leaf.onReady(function () {
if ('${/parameter/@source_type}' == 'WFL') {
document.getElementById('${/parameter/@layout_code}_save').style.display = "none";
}
});
window['${/parameter/@layout_code}_upload_layout_dynamic_click'] = function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
......@@ -1356,7 +1390,8 @@
};
]]></script>
<a:link id="${/parameter/@layout_code}csh511_csh_payment_req_hd_query" model="csh.CSH511.csh_payment_req_hd" modelaction="query" />
<a:link id="${/parameter/@layout_code}csh511_csh_payment_req_hd_query" model="csh.CSH511.csh_payment_req_hd"
modelaction="query"/>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="csh_payment_req_temp_ln_ds" autoQuery="true" fetchAll="true"
......
......@@ -822,7 +822,9 @@
<!--对方账户账号-->
<!-- <a:lov name="bp_bank_account_num" bindTarget="csh_transaction_receipt_maintain_query_ds"-->
<!-- prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>-->
<a:textField style="display:none"/>
<!-- <a:textField style="display:none"/>-->
<a:comboBox name="receipt_type_des" bindTarget="csh_transaction_receipt_maintain_query_ds"
prompt="收款类型"/>
<a:lov name="bp_name" bindTarget="csh_transaction_receipt_maintain_query_ds"
prompt="CSH510.CSH_TRANSACTION.BUSINESS_PARTNER"/>
<a:comboBox name="confirmed_flag_desc" bindTarget="csh_transaction_receipt_maintain_query_ds"
......@@ -850,6 +852,8 @@
<a:column name="transaction_amount" align="right" prompt="CSH510.CSH_TRANSACTION.RECEIPT_AMOUNT"
width="100" renderer="Leaf.formatMoney"/>
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center"/>
<a:column name="receipt_type_n" prompt="收款类型"
align="center"/>
<a:column name="returned_amount" prompt="CSH510.CSH_TRANSACTION.RETURN_AMOUNT" align="right"
renderer="Leaf.formatMoney"/>
<a:column name="use_money_amount" prompt="CSH510.CSH_TRANSACTION.USEFUL_AMOUNT" align="right"
......
......@@ -30,13 +30,17 @@
/* var record = $(ds_id).findById(record_id);
var mortgage_id = record.get('mortgage_id');*/
var header_id = record.get('transaction_id');
if(record.get('transaction_type') == 'ADVANCE_RECEIPT'){
header_id = record.get('source_csh_trx_id');
}
var win = new Leaf.Window({
id: 'hn2050_upload_win',
url: $('hn2050_upload_win_link').getUrl(),
params: {
winid: 'hn2050_upload_win',
table_name: 'CSH_TRANSACTION',
header_id: record.get('transaction_id')
header_id: header_id
},
width: 900,
height: 400
......
......@@ -494,7 +494,7 @@
var record = ds.getCurrentRecord();
// var header_id = '${/parameter/@transaction_id}';
var header_id = record.get('transaction_id');
if(record.get('transaction_type') == 'ADVANCE_RECEIPT'){
if(record.get('transaction_type') == 'ADVANCE_RECEIPT'||record.get('transaction_type') == 'DEPOSIT'){
header_id = record.get('source_csh_trx_id');
}
var url = $('transaction_downloadFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
......
<?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>
<a:model-update model="hls.HLS811.hls_doc_file_templet_get_atm"/>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.com.hand.hls.hlcm.util);
importPackage(java.io);
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 transfer(file_path, os) {
println(file_path);
var fis = new FileInputStream(file_path);
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_name, file_path) {
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'UTF-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
}
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var from_file_data = result.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
// var to_file_name = record_data.to_file_name;
var to_file_name = $ctx.parameter.file_name+'.docx';
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 = to_file_path + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
$bm('hls.HLS811.hls_file_content_copy_update').update({
table_name: 'HLS_DOC_FILE_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: $ctx.parameter.source_type
});
try {
$bm('csh.CSH501.csh_transaction_return_print').update({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table
});
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.toString(), 'COMMON');
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
HlsFileUtil.downloadFile(encodeURI(to_file_path,'utf-8'),encodeURI(to_file_name,'utf-8'),resp);
// download_file(encodeURI(to_file_name,'utf-8'), to_file_path);
// print(to_file_name);
} catch (e) {
raise_app_error(e);
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
......@@ -17,7 +17,8 @@
<a:link id="csh560_start_wfl_link" model="cus_deposit.CUS_DEPOSIT106.return_workflow_start"
modelaction="execute"/>
<script type="text/javascript"><![CDATA[
var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
function csh515_return_back() {
$('${/parameter/@winId}').close();
}
......@@ -79,8 +80,8 @@ var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
opposite_band_na: record.get('opposite_band_na'),
bp_bank_account_num: record.get('bp_bank_account_num'),
description: record.get('description'),
csh_return_atm_id:csh_return_atm_id,
csh_return_bp_id:record.get('csh_return_bp_id')
csh_return_atm_id: csh_return_atm_id,
csh_return_bp_id: record.get('csh_return_bp_id')
},
success: function (res) {
var return_id = res.result.return_id;
......@@ -123,6 +124,7 @@ var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
}
}
//附件上传
function upload_attachment_win() {
......@@ -150,7 +152,9 @@ var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
<a:field name="return_date" defaultValue="${/model/sys_time_default_value_path/record/@now_time}"
required="true"/>
<a:field name="return_amount" required="true"/>
<a:field name="csh_return_bp_name" lovGridHeight="350" lovHeight="500" lovService="cus_deposit.CUS_DEPOSIT106.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE" required="true">
<a:field name="csh_return_bp_name" lovGridHeight="350" lovHeight="500"
lovService="cus_deposit.CUS_DEPOSIT106.hls_bp_master_v_for_lov" lovWidth="500"
title="HLS.BP_TITLE" required="true">
<a:mapping>
<a:map from="bp_id" to="csh_return_bp_id"/>
<a:map from="bp_name" to="csh_return_bp_name"/>
......@@ -173,46 +177,39 @@ var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
<a:form title="CSH515.CSH_REFUND">
<a:box column="4" labelWidth="115">
<a:datePicker name="return_date" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="经济业务发生日" renderer="Leaf.formatDate"/>
prompt="经济业务发生日" renderer="Leaf.formatDate" width="180"/>
<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false"
bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH515.CSH_REFUND_AMOUNT"/>
<a:numberField name="unwrite_off_amount" allowDecimals="true" allowFormat="true"
allowNegative="false" bindTarget="csh_transaction_receipt_return_maintain_ds"
prompt="剩余可用金额" readOnly="true"/>
<a:lov name="csh_return_bp_name" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="退款用户"/>
<!--<a:lov name="period_name" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="HLS.ACCOUNT_PERIOD_NAME"/>-->
<!--<a:comboBox name="payment_method_display" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="HLS.PAYMENT_METHOD"/>-->
<!--<a:numberField name="exchange_rate" allowNegative="false" bindTarget="csh_transaction_receipt_return_maintain_ds" decimalPrecision="-1" prompt="HLS.EXCHANGE_RATE"/>-->
prompt="剩余可用金额" readOnly="true" width="170" allowdecimals="false"/>
<a:lov name="csh_return_bp_name" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="退款用户" width="185"/>
</a:box>
<a:box column="4" labelWidth="115">
<a:textField name="contract_number" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="合同编号" readOnly="true" width="180"/>
<a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="承租人编码" readOnly="true"/>
<a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="承租人名称" readOnly="true" width="170"/>
<!-- <a:datePicker name="lasted_account_date" bindTarget="csh_transaction_deposit_return_maintain_ds"-->
<!-- prompt="最后一次入账时间" width="185" readOnly="true"/>-->
</a:box>
<a:box column="4" labelWidth="115">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" width="180"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
<a:numberField name="bp_bank_account_num" allowdecimals="false" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" width="170"/>
<a:hBox>
<a>附件上传:</a><a href="javascript:upload_attachment_win()" style="color:red"> 附件上传</a>
</a:hBox>
<!-- <a href="javascript:upload_attachment_win()" style="color:red;margin-right:5px;">附件上传</a>-->
<!--<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="CSH515.CSH_REFUND_AMOUNT"/>-->
<!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="银行流水号"/>-->
<!--<a:comboBox name="currency_name" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="HLS.CURRENCY"/>-->
<!--<a:comboBox name="exchange_rate_type_display" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="HLS.EXCHANGE_RATE_TYPE_DESC"/>-->
</a:box>
<!--<a:box column="4">-->
<!--<a:lov name="bank_account_code" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH515.CSH_REFUND_ACCOUNT"/>-->
<!--<a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH511.BANK_ACCOUNT_NUM"/>-->
<!--<a:lov name="bp_bank_account_code" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH511.BP_BANK_ACCOUNT_CODE"/>-->
<!--<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH511.BANK_ACCOUNT_NUM"/>-->
<!--</a:box>-->
<!--<a:box column="2">-->
<!--<a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH511.BANK_ACCOUNT_NAME" width="383"/>-->
<!--<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_receipt_return_maintain_ds" prompt="CSH511.BANK_ACCOUNT_NAME" width="383"/>-->
<!--</a:box>-->
<a:box column="1">
<a:textField name="description" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="备注"
<a:textArea name="description" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="备注"
width="849"/>
</a:box>
......@@ -223,38 +220,41 @@ var csh_return_atm_id = '${/model/csh_return_list_id/record/@return_list_id}';
function init() {
var record = $('csh_transaction_receipt_return_maintain_ds').getCurrentRecord();
record.getField('bp_bank_account_name').setReadOnly(true);
record.getField('bank_account_name').setReadOnly(true);
record.getField('bp_bank_account_num').setReadOnly(true);
record.getField('bp_bank_account_code').setReadOnly(true);
record.getField('bank_account_num').setReadOnly(true);
record.getField('bank_account_code').setReadOnly(true);
record.getField('transaction_amount').setReadOnly(true);
record.getField('transaction_functional_amount').setReadOnly(true);
record.getField('bank_slip_num').setReadOnly(true);
record.getField('exchange_rate').setReadOnly(true);
record.getField('transaction_date').setReadOnly(true);
record.getField('period_name').setReadOnly(true);
record.getField('transaction_num').setReadOnly(true);
record.getField('currency_name').setReadOnly(true);
record.getField('bp_name').setReadOnly(true);
record.getField('bp_category_display').setReadOnly(true);
record.getField('payment_method_display').setReadOnly(true);
record.getField('exchange_rate_type_display').setReadOnly(true);
record.getField('description').setReadOnly(true);
record.set('return_date', Leaf.formatDate(new Date()));
record.getField('return_date').setRequired(true);
record.getField('return_amount').setRequired(true);
// record.getField('bp_bank_account_name').setReadOnly(true);
// record.getField('bank_account_name').setReadOnly(true);
//
// record.getField('bp_bank_account_num').setReadOnly(true);
// record.getField('bp_bank_account_code').setReadOnly(true);
// record.getField('bank_account_num').setReadOnly(true);
// record.getField('bank_account_code').setReadOnly(true);
//
// record.getField('transaction_amount').setReadOnly(true);
// record.getField('transaction_functional_amount').setReadOnly(true);
// record.getField('bank_slip_num').setReadOnly(true);
// record.getField('exchange_rate').setReadOnly(true);
//
// record.getField('transaction_date').setReadOnly(true);
// record.getField('period_name').setReadOnly(true);
// record.getField('transaction_num').setReadOnly(true);
// record.getField('currency_name').setReadOnly(true);
//
//
// record.getField('bp_name').setReadOnly(true);
// record.getField('bp_category_display').setReadOnly(true);
// record.getField('payment_method_display').setReadOnly(true);
// record.getField('exchange_rate_type_display').setReadOnly(true);
//
// record.getField('description').setReadOnly(true);
//
// record.set('return_date', Leaf.formatDate(new Date()));
// record.getField('return_date').setRequired(true);
// record.getField('return_amount').setRequired(true);
var deposit_record = $('csh_transaction_deposit_return_maintain_ds').getCurrentRecord();
deposit_record.set('csh_return_bp_name',record.get('bp_name'));
deposit_record.set('csh_return_bp_id',record.get('bp_id'));
deposit_record.set('csh_return_bp_name', record.get('bp_name'));
deposit_record.set('csh_return_bp_id', record.get('bp_id'));
deposit_record.set('contract_number', record.get('contract_number'));
deposit_record.set('bp_id_telnet_code', record.get('bp_id_telnet_code'));
deposit_record.set('bp_id_telnet_n', record.get('bp_id_telnet_n'));
}
]]></script>
......
......@@ -6,16 +6,18 @@
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:init-procedure>
<a:model-query defaultWhereClause="t1.return_id = ${/parameter/@return_id}"
model="cus_deposit.CUS_DEPOSIT106.get_csh_return_status" rootPath="default_value_path"/>
</a:init-procedure>
<a:view>
<a:link id="cus_deposit1060_download_win_link" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="csh_deposit_return_history_print_link_id"
url="${/request/@context_path}/modules/cus_deposit/CUS_DEPOSIT106/csh_deposit_return_history_print.lsc"/>
<script type="text/javascript"><![CDATA[
function upload_attachment_win() {
var record = $('csh_transaction_return_wfl_ds').getCurrentRecord();
var csh_return_atm_id=record.get('csh_return_atm_id');
var record = $('csh_transaction_return_wfl_ds').getCurrentRecord();
var csh_return_atm_id = record.get('csh_return_atm_id');
var win = new Leaf.Window({
id: 'cus_deposit1060_download_win',
......@@ -30,38 +32,59 @@ var csh_return_atm_id=record.get('csh_return_atm_id');
}).on('close', function () {
//record.ds.query();
});
}
function csh515_return_print() {
var record = $('csh_transaction_return_wfl_ds').getCurrentRecord();
var return_id = record.get('return_id');
var file_name = "保证金退款-" + record.get('bp_agent_name') + "-" + record.get('return_amount') + "元";
var url_l = $('csh_deposit_return_history_print_link_id').getUrl() + '?document_id=' + return_id + '&file_name=' + file_name + '&document_table=CSH_DEPOSIT_TRANSACTION_RETURN&batch_flag=Y&source_type=common';
window.open(href = url_l, target = "_self");
}
]]></script>
<a:dataSets>
<a:dataSet id="csh_transaction_return_wfl_ds" autoPageSize="true" autoQuery="true" model="cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query" queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query/query?return_id=${/parameter/@return_id}" >
<a:dataSet id="csh_transaction_return_wfl_ds" autoPageSize="true" autoQuery="true"
model="cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query"
queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query/query?return_id=${/parameter/@return_id}">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton id="csh106_return_print_id" click="csh515_return_print" text="保证金退款审批记录打印"/>
</a:screenTopToolbar>
<a:form title="CSH515.CSH_REFUND">
<a:box column="3" labelWidth="115">
<a:datePicker name="return_date" bindTarget="csh_transaction_return_wfl_ds"
prompt="经济业务发生日" renderer="Leaf.formatDate" readOnly="true"/>
prompt="经济业务发生日" renderer="Leaf.formatDate" readOnly="true" width="180"/>
<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false"
bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH515.CSH_REFUND_AMOUNT" readOnly="true"/>
<a:textField name="csh_return_bp_name" bindTarget="csh_transaction_return_wfl_ds" prompt="退款商业伙伴" readOnly="true"/>
prompt="CSH515.CSH_REFUND_AMOUNT" readOnly="true" width="170"/>
<a:textField name="csh_return_bp_name" bindTarget="csh_transaction_return_wfl_ds" prompt="退款商业伙伴"
readOnly="true" width="185"/>
<!--<a:datePicker name="return_date" bindTarget="csh_transaction_return_wfl_ds" prompt="CSH515.CSH_REFUND_DATE" renderer="Leaf.formatDate" readOnly="true"/>-->
<!--<a:lov name="period_name" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.ACCOUNT_PERIOD_NAME" readOnly="true"/>-->
<!--<a:comboBox name="payment_method_display" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.PAYMENT_METHOD" readOnly="true"/>-->
<!--<a:numberField name="exchange_rate" allowNegative="false" bindTarget="csh_transaction_return_wfl_ds" decimalPrecision="-1" prompt="HLS.EXCHANGE_RATE" readOnly="true"/>-->
</a:box>
<a:box column="4" labelWidth="115">
<a:textField name="contract_number" bindTarget="csh_transaction_return_wfl_ds"
prompt="合同编号" readOnly="true" width="180"/>
<a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_return_wfl_ds"
prompt="承租人编码" readOnly="true"/>
<a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_return_wfl_ds"
prompt="承租人名称" readOnly="true" width="170"/>
<!-- <a:datePicker name="lasted_account_date" bindTarget="csh_transaction_return_wfl_ds"-->
<!-- prompt="最后一次入账时间" width="185" readOnly="true"/>-->
</a:box>
<a:box column="4" labelWidth="115">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true"/>
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true" width="180"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" readOnly="true"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true"/>
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true" width="170"/>
<a href="javascript:upload_attachment_win()" style="color:red">附件查看</a>
<!--<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_return_wfl_ds" prompt="CSH515.CSH_REFUND_AMOUNT" readOnly="true"/>-->
<!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_return_wfl_ds" prompt="银行流水号" readOnly="true"/>-->
......@@ -79,13 +102,22 @@ var csh_return_atm_id=record.get('csh_return_atm_id');
<!--<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_return_wfl_ds" prompt="CSH511.BANK_ACCOUNT_NAME" width="383" readOnly="true"/>-->
<!--</a:box>-->
<a:box column="1">
<a:textField name="description" bindTarget="csh_transaction_return_wfl_ds" prompt="备注"
<a:textArea name="description" bindTarget="csh_transaction_return_wfl_ds" prompt="备注"
width="849" readOnly="true"/>
<!--<a:textField name="description" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.NOTE" width="849" readOnly="true"/>-->
</a:box>
</a:form>
</a:screenBody>
<script type="text/javascript"><![CDATA[
Leaf.onReady(init);
function init() {
if ('${/model/default_value_path/record/@status}' != 'APPROVED') {
document.getElementById("csh106_return_print_id").style.display = "none";
}
}
]]></script>
</a:view>
</a:screen>
......@@ -20,14 +20,6 @@
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js"
type="text/javascript"/>
<a:link id="gh_nc_post_addcustomerinfo_link" model="hls.HLS213.hls_bp_master_nc_post" modelaction="execute"/>
<!-- <a:link id="hls213_sap_eai_create_customer_link"-->
<!-- url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>-->
<!-- <a:link id="hls213_sap_eai_create_vender_link"-->
<!-- url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>-->
<!-- <a:link id="Identity_ccx_link"
url="${/request/@context_path}/modules/interface/INTERFACE_CCX/hlcm_ccxIdentity_interface.lsc"/>-->
<!-- <script src="${/request/@context_path}/javascripts/identity_card_info_query.js" type="text/javascript"/>-->
<!-- <a:link id="identity_query_link" model="interface.CCX_INTERFACE.identity_query" modelaction="update"/>-->
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
var unit_id = '${/model/user_agent_description/record/@unit_id}';
......@@ -43,10 +35,10 @@
bp_record.set('owner_user_id', '${/session/@user_id}');
bp_record.set('unit_id', unit_id);
bp_record.set('unit_id_n', unit_id_n);
if(employee_type_id == '64'){
if (employee_type_id == '64') {
bp_record.getField('unit_id_n').setReadOnly(true);
bp_record.getField('unit_id_n').setRequired(false);
}else{
} else {
bp_record.getField('unit_id_n').setReadOnly(false);
bp_record.getField('unit_id_n').setRequired(true);
}
......@@ -137,16 +129,16 @@
record.getField('parent_id_n').setReadOnly(true);
}
if(record.get('taxpayer_type')){
if (record.get('taxpayer_type')) {
var value = record.get('taxpayer_type');
if(value == 'SMALL_SCALE_TAXPAYER'){
if (value == 'SMALL_SCALE_TAXPAYER') {
record.getField('invoice_bp_address').setRequired(false);
record.getField('invoice_bp_phone_num').setRequired(false);
record.getField('invoice_bp_bank').setRequired(false);
record.getField('invoice_bp_bank_account').setRequired(false);
record.getField('tax_registry_num').setRequired(false);
}
if(value == 'GENERAL_TAXPAYER'){
if (value == 'GENERAL_TAXPAYER') {
record.getField('invoice_bp_address').setRequired(true);
record.getField('invoice_bp_phone_num').setRequired(true);
record.getField('invoice_bp_bank').setRequired(true);
......@@ -154,6 +146,16 @@
record.getField('tax_registry_num').setRequired(true);
}
}
if (record.get('marital_status') && (record.get('marital_status') == '30' || record.get('marital_status') == '40')) {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
}
}
};
......@@ -176,81 +178,6 @@
card_identity_flag = 'N';
sp_identity_flag = 'N';
//由于中诚信测试环境只能测试张三,所以这里限定身份证号为张三的123456199001011233
//if(value=='123456199001011233'){
// var url1 = $('identity_query_link').getUrl();
// window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
/* Leaf.request({
url: url1,
para: {
id_card_no: value,//身份证号码
bp_name: bp_name
},
success: function (res) {
var resmsg_1 = res.result.resmsg_1;
if (resmsg_1 == '1') {
if (name == 'id_card_no') {
record.set('ccx_resmsg', '身份验证成功');
card_identity_flag = 'Y';
} else {
record.set('ccx_resmsg1', '身份验证成功');
sp_identity_flag = 'Y';
}
} else {
//个人身份验证
var url = $('Identity_ccx_link').getUrl();
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: url,
para: {
bp_name: bp_name,//姓名
id_card_no: value//身份证号码
},
success: function (res) {
var resmsg = res.result.resmsg;
if (name == 'id_card_no') {
record.set('ccx_resmsg', resmsg);
if (resmsg == '身份验证成功') {
card_identity_flag = 'Y';
}
} else {
record.set('ccx_resmsg1', resmsg);
if (resmsg == '身份验证成功') {
sp_identity_flag = 'Y';
}
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this,
sync: true
});
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this,
sync: true
});*/
}
} else {
card_identity_flag = 'N';
......@@ -284,31 +211,6 @@
return true;
}
//商业伙伴分类选择企业 且类型选择 制造商时 集团内外、企业个人、实体虚拟、品牌非品牌 给出只读默认值
// Leaf.onReady(function() {
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_role');
// if (ds_id && '${/parameter/@default_value_dsid}') {
// var head_record = $('${/parameter/@default_value_dsid}').getCurrentRecord();
// var bp_master_role_ds = $(ds_id);
// var record = new Leaf.Record({
// 'primary_flag': 'Y',
// 'bp_category': head_record.get('bp_category'),
// 'bp_category_n': head_record.get('bp_category_n'),
// 'bp_type': head_record.get('bp_type'),
// 'bp_type_n': head_record.get('bp_type_n'),
// 'bp_class': head_record.get('bp_class'),
// 'bp_class_n': head_record.get('bp_class_n'),
// 'enabled_flag': 'Y'
// });
// bp_master_role_ds.add(record);
// var current_record = bp_master_role_ds.getAt(0);
// current_record.getField('bp_type_n').setReadOnly(true);
// current_record.getField('enabled_flag').setReadOnly(true);
// }
// });
function CheckSocialCreditCode(Code) {
var patrn = /^[0-9A-Z]+$/;
......@@ -378,20 +280,87 @@
// }
// };
/*保存前调用,生成项目编号*/
// window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
//
// window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
// var head_record = $(ds_id).getCurrentRecord();
// var check_flag = false;
// if (head_record.get('bp_code')) {
// return true;
// }
// Leaf.request({
// url: $('get_special_fields_link_id').getUrl(),
// para: {
// bp_id: head_record.get('bp_id')
// },
// success: function (res) {
// var document_number = res.result.document_number;
// head_record.set('bp_code', document_number);
// if (head_record.get('marital_status') && (head_record.get('marital_status') !== '30' && head_record.get('marital_status') !== '40')) {
// head_record.set('bp_name_sp', null);
// head_record.set('card_type_sp', null);
// head_record.set('card_type_sp_n', null);
// head_record.set('id_no_sp', null);
// head_record.set('date_of_birth_sp', null);
// head_record.set('cell_phone_sp', null);
// head_record.set('work_unit_phone_sp', null);
// head_record.set('work_unit_name_sp', null);
// head_record.set('work_unit_address_sp', null);
// }
// check_flag = true;
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
//
// },
// error: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// failure: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// sync: true,
// scope: this
// });
// return check_flag;
//
// };
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var head_record = $(ds_id).getCurrentRecord();
var check_flag = false;
if (head_record.get('marital_status') && (head_record.get('marital_status') !== '30' && head_record.get('marital_status') !== '40')) {
head_record.set('bp_name_sp', null);
head_record.set('card_type_sp', null);
head_record.set('card_type_sp_n', null);
head_record.set('id_no_sp', null);
head_record.set('date_of_birth_sp', null);
head_record.set('cell_phone_sp', null);
head_record.set('work_unit_phone_sp', null);
head_record.set('work_unit_name_sp', null);
head_record.set('work_unit_address_sp', null);
}
check_flag = true;
return check_flag;
};
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var head_record = $(ds_id).getCurrentRecord();
if(!head_record.get('bp_code')){
if (!head_record.get('bp_code')) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_special_fields_link_id').getUrl(),
para: {
bp_id:head_record.get('bp_id')
bp_id: head_record.get('bp_id')
},
success: function (res) {
var document_number = res.result.document_number;
head_record.set('bp_code',document_number);
head_record.set('bp_code', document_number);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
......@@ -413,8 +382,6 @@
var gird_ds_id = 'BP_NP_CREATE_BP_ASSETS01_hls_bp_assets_ds';
var gird_ds_id2 = 'BP_NP_CREATE_BP_ASSETS04_hls_bp_assets_ds';
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
var gird_ds_id4 = 'BP_NP_CREATE_F_SPOUSE_1_hls_bp_master_ds';
var gird_ds_id5 = 'BP_NP_CREATE_F_SPOUSE_hls_bp_master_ds';
if (gird_ds_id == ds.id || gird_ds_id2 == ds.id) {
if (name == 'relationship_with_bp') {
if (value == 'A7501') {
......@@ -457,8 +424,11 @@
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('${l:HLS.PROMPT}', '个人身份证号错误!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
}else{
} else {
if (value.length == 18) {
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
......@@ -473,13 +443,11 @@
}
}
}
// ds.fields.id_card_no.pro.validator = id_card_no_validate;
//自动带出籍贯
// record.set('resident_addres', get_native_place(value))
}
if (name == 'id_no_sp') {
if (name == 'id_no_sp' && value) {
if (!value) {
record.set('ccx_resmsg1', '');
......@@ -488,8 +456,11 @@
if (record.get('card_type_sp') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('${l:HLS.PROMPT}', '配偶身份证号错误!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
}else{
} else {
if (value.length == 18) {
record.set('date_of_birth_sp', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
}
......@@ -509,69 +480,72 @@
var id_card_no_leg = record.get('id_card_no_leg');
if (!checkCard(id_card_no_leg)) {
Leaf.showMessage('${l:HLS.PROMPT}', '法人代表身份证号格式错误!');
setTimeout(function () {
record.set('id_card_no_leg', '');
}, 20);
return false;
}
}
if (name == 'social_code') {
if (name == 'social_code' && value) {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('social_code', '');
}, 20);
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
if (name == 'cell_phone' && value) {
if (!checkMobile(value)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的手机号码!');
setTimeout(function () {
record.set('cell_phone', '');
}, 20);
return false;
}
}
}
var test_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
var test_ds_id1 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE_1', 'hls_bp_master');
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
// var org_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BILLING_1', 'hls_bp_master');
if (ds.id==test_ds_id1||ds.id==test_ds_id2) {
if (ds.id == f_bp_create_ds_id) {
var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
record = $(hd_ds).getCurrentRecord();
if(record.get('marital_status')=='40'){
var bp2_record = $(test_ds_id1).getCurrentRecord();
if(bp2_record){
record.set('bp_name_sp',bp2_record.get('bp_name_sp'));
record.set('card_type_sp',bp2_record.get('card_type_sp'));
record.set('id_no_sp',bp2_record.get('id_no_sp'));
record.set('date_of_birth_sp',bp2_record.get('date_of_birth_sp'));
record.set('cell_phone_sp',bp2_record.get('cell_phone_sp'));
record.set('work_unit_phone_sp',bp2_record.get('work_unit_phone_sp'));
record.set('work_unit_name_sp',bp2_record.get('work_unit_name_sp'));
record.set('work_unit_address_sp',bp2_record.get('work_unit_address_sp'));
record.set('zipcode',bp2_record.get('zipcode'));
bp2_record.set('marital_status', '40');
}
}else if(record.get('marital_status')=='30'){
var bp2_record = $(test_ds_id2).getCurrentRecord();
if(bp2_record){
record.set('bp_name_sp',bp2_record.get('bp_name_sp'));
record.set('card_type_sp',bp2_record.get('card_type_sp'));
record.set('id_no_sp',bp2_record.get('id_no_sp'));
record.set('date_of_birth_sp',bp2_record.get('date_of_birth_sp'));
record.set('cell_phone_sp',bp2_record.get('cell_phone_sp'));
record.set('work_unit_phone_sp',bp2_record.get('work_unit_phone_sp'));
record.set('work_unit_name_sp',bp2_record.get('work_unit_name_sp'));
record.set('work_unit_address_sp',bp2_record.get('work_unit_address_sp'));
record.set('zipcode',bp2_record.get('zipcode'));
bp2_record.set('marital_status', '30');
}
}
}
if(ds.id == test_ds_id){
if(name == 'taxpayer_type' && value){
if(value == 'SMALL_SCALE_TAXPAYER'){
if (name == 'marital_status') {
if (value == '30' || value == '40') {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
if (!record.get('card_type_sp')) {
record.set('card_type_sp', 'ID_CARD');
record.set('card_type_sp_n', '身份证');
}
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
record.getField('bp_name_sp').setRequired(false);
record.getField('card_type_sp').setRequired(false);
record.getField('card_type_sp_n').setRequired(false);
record.getField('id_no_sp').setRequired(false);
// record.set('bp_name_sp', null);
// record.set('card_type_sp', null);
// record.set('card_type_sp_n', null);
// record.set('id_no_sp', null);
// record.set('date_of_birth_sp', null);
// record.set('cell_phone_sp', null);
// record.set('work_unit_phone_sp', null);
// record.set('work_unit_name_sp', null);
// record.set('work_unit_address_sp', null);
}
} else if (name == 'taxpayer_type' && value) {
if (value == 'SMALL_SCALE_TAXPAYER') {
record.getField('invoice_bp_address').setRequired(false);
record.getField('invoice_bp_phone_num').setRequired(false);
record.getField('invoice_bp_bank').setRequired(false);
record.getField('invoice_bp_bank_account').setRequired(false);
record.getField('tax_registry_num').setRequired(false);
}
if(value == 'GENERAL_TAXPAYER'){
if (value == 'GENERAL_TAXPAYER') {
record.getField('invoice_bp_address').setRequired(true);
record.getField('invoice_bp_phone_num').setRequired(true);
record.getField('invoice_bp_bank').setRequired(true);
......@@ -581,7 +555,6 @@
}
}
};
function upload_file(id, name, query_only) {
......@@ -653,5 +626,6 @@
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
......@@ -5,7 +5,8 @@
$Revision: 1.0
$Purpose: 商业伙伴维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
<a:model-query fetchAll="true" model="hls.HLS214N.hls_bp_master_modify_user" rootPath="modify_user"/>
......@@ -13,11 +14,13 @@
<a:view>
<a:link id="bank_account_num_link" model="hls.HLS214.hls_bp_bank_account_num" modelaction="update"/>
<a:link id="bp_agent_modify_link" url="${/request/@context_path}/modules/hls/HLS303/bp_agent_create.lview"/>
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js" type="text/javascript"/>
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js"
type="text/javascript"/>
<a:link id="${/parameter/@layout_code}_downloadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls214N_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls214N_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="hls214_bp_master_save_link_id" model="hls.HLS214.hls_bp_change_agent" modelaction="update"/>
<!-- <a:link id="hls214_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>-->
<!-- <a:link id="hls214_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>-->
......@@ -25,7 +28,7 @@
<!-- type="text/javascript"></script>-->
<script type="text/javascript"><![CDATA[
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
// window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
// var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
......@@ -43,28 +46,34 @@
// }
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var bp_record = $(ds_id).getCurrentRecord();
if(old_id_card != new_id_card){
bp_record.set('id_card_no_change_flag','Y');
}else{
bp_record.set('id_card_no_change_flag','N');
if (old_id_card != new_id_card) {
bp_record.set('id_card_no_change_flag', 'Y');
} else {
bp_record.set('id_card_no_change_flag', 'N');
}
if(old_bp_name != new_bp_name){
bp_record.set('bp_name_change_flag','Y');
}else{
record.set('bp_name_change_flag','N');
if (old_bp_name != new_bp_name) {
bp_record.set('bp_name_change_flag', 'Y');
} else {
record.set('bp_name_change_flag', 'N');
}
if (bp_record.get('marital_status') && (bp_record.get('marital_status') !== '30' && bp_record.get('marital_status') !== '40')) {
bp_record.set('bp_name_sp', null);
bp_record.set('card_type_sp', null);
bp_record.set('card_type_sp_n', null);
bp_record.set('id_no_sp', null);
bp_record.set('date_of_birth_sp', null);
bp_record.set('cell_phone_sp', null);
bp_record.set('work_unit_phone_sp', null);
bp_record.set('work_unit_name_sp', null);
bp_record.set('work_unit_address_sp', null);
return true;
}
var test_ds_id1 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE_1', 'hls_bp_master');
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
//var records = $(test_ds_id1);
//var record=$(records).getCurrentRecord();
//var records = $(test_ds_id2);
//var record=$(records).getAll();
return true;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
......@@ -105,7 +114,7 @@
}
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
......@@ -162,7 +171,6 @@
};
function prj_check_bp_id(record) {
var bp_id;
if (record) {
......@@ -176,7 +184,7 @@
}
//财务报表模板导入
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var record = $(ds_id).getCurrentRecord();
......@@ -198,7 +206,7 @@
};
//财务报表模板查看
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var record = $(ds_id).getCurrentRecord();
var bp_id = prj_check_bp_id(record);
......@@ -244,7 +252,8 @@
var new_bp_name;
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
debugger;
// if ((ds.id).indexOf('hls_bp_master_credit') != -1 && (ds.id).indexOf('F_ORG_CREDIT') != -1) {
// if (ds.fields.fin_institution_code) {
// ds.fields.fin_institution_code.pro.validator = fin_institution_code_validate;
......@@ -259,7 +268,7 @@
var employee_type_id = '${/model/modify_user/record/@employee_type_id}';
old_bp_name = record.get('bp_name');
new_bp_name = record.get('bp_name');
if(record.get('id_type') == 'ID_CARD'){
if (record.get('id_type') == 'ID_CARD') {
old_id_card = record.get('id_card_no');
new_id_card = record.get('id_card_no');
}
......@@ -267,21 +276,32 @@
if (record.get('bp_category') == 'VENDER') {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
}else{
if(employee_type_id == '64'){
} else {
if (employee_type_id == '64') {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
}else{
} else {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
}
}
if(record.get('bp_class')&&record.get('bp_class')=='NP'){
if (record.get('marital_status') && (record.get('marital_status') == '30' || record.get('marital_status') == '40')) {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
}
}
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, line_record) {
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, line_record) {
var dsId = ds.id;
var base_table_temp = 'hls_bp_master_role_ds';
if (dsId.substring(dsId.length - base_table_temp.length, dsId.length) == base_table_temp) {
......@@ -298,34 +318,30 @@
//更新时调用 add by liukang
//填写银行账号时 允许银行账号相同 但是给一个提示(提示一下而已)
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) {
var f_bp_create_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var gird_ds_id = 'BP_NP_MODIFY_N_BP_ASSETS01_hls_bp_assets_ds';
var gird_ds_id2 = 'BP_NP_MODIFY_N_BP_ASSETS04_hls_bp_assets_ds';
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
if(gird_ds_id==ds.id||gird_ds_id2==ds.id){
if(name=='relationship_with_bp'){
if(value=='A7501'){
record.set('owership',$(f_bp_create_ds_id).getAt(0).get('bp_name'));
}
else if(value=='A7502'){
record.set('owership',$(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
}
else {
record.set('owership','');
}
}
if (gird_ds_id == ds.id || gird_ds_id2 == ds.id) {
if (name == 'relationship_with_bp') {
if (value == 'A7501') {
record.set('owership', $(f_bp_create_ds_id).getAt(0).get('bp_name'));
} else if (value == 'A7502') {
record.set('owership', $(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
} else {
record.set('owership', '');
}
if(gird_ds_id3==ds.id){
if(name=='relationship_with_bp'){
if(value=='A7501'){
record.set('owner_name',$(f_bp_create_ds_id).getAt(0).get('bp_name'));
}
else if(value=='A7502'){
record.set('owner_name',$(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
}
else {
record.set('owner_name','');
if (gird_ds_id3 == ds.id) {
if (name == 'relationship_with_bp') {
if (value == 'A7501') {
record.set('owner_name', $(f_bp_create_ds_id).getAt(0).get('bp_name'));
} else if (value == 'A7502') {
record.set('owner_name', $(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
} else {
record.set('owner_name', '');
}
}
}
......@@ -350,7 +366,7 @@
var bp_record = $(hls_bp_master_ds_id).getCurrentRecord();
if ((ds.id).indexOf('hls_bp_master') != -1 && (ds.id).indexOf('F_BASIC') != -1) {
if(name == 'bp_name'){
if (name == 'bp_name') {
new_bp_name = record.get('bp_name');
}
......@@ -361,24 +377,16 @@
record.getField('parent_id_n').setReadOnly(true);
}
}
if(name == 'social_code') {
if (name == 'social_code') {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
setTimeout(function () {
record.set('social_code', '');
}, 20);
return false;
}
}
}
//if (ds.id == hls_bp_master_credit_ds_id){
// if (name == 'trade_type_code'){
// var trade_type_code = record.get('trade_type_code');
// if(trade_type_code != trade_type_code.toLowerCase()){
// record.set('trade_type_code',trade_type_code.toLowerCase());
// setTimeout(function() {Leaf.Masker.unmask(Ext.getBody());
// }, 500);
// }
// }
//}
if (ds.id == hls_bp_master_ds_id) {
if ($L.CmpManager.get(hls_bp_master_ds_id)) {
if (name == 'province_id') {
......@@ -386,9 +394,7 @@
record.set('city_sp_n', '');
}
}
}
if (ds.id == hls_bank_acc_ds_id) {
var bank_account_num = record.get('bank_account_num');
if (name == 'bank_account_num') {
......@@ -397,31 +403,23 @@
para: {
bank_account_num: bank_account_num
},
success: function(res) {
success: function (res) {
var number = res.result.num;
//alert(number);
if (number > 0) {
Leaf.showMessage('提示', '该银行账号在系统中已存在!');
}
},
failure: function(res) {},
error: function() {},
failure: function (res) {
},
error: function () {
},
scope: this
});
}
}
// if (ds.id == hls_bp_master_ds_id && hls_bp_master_ds_id) {
//
// if (name == 'id_card_no') {
// // record = $(hls_bp_master_ds_id).getCurrentRecord();
// // var id_num = record.get('id_card_no');
// // var bp_age = getAge(id_num);
// // record.set('age', bp_age);
// ds.fields.id_card_no.pro.validator = gur_id_card_no_validate;
// }
// }
if ((ds.id).indexOf('hls_bp_master') != -1) {
// //身份证验证
// if (ds.fields.id_card_no && bp_record.get('bp_class') == 'NP' && bp_record.get('id_type') == 'ID_CARD') {
......@@ -432,25 +430,32 @@
if (name == 'cell_phone') {
if (!checkMobile(value)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的手机号码!');
return '请输入正确格式的手机号码';
setTimeout(function () {
record.set('cell_phone', '');
}, 20);
return false;
}
}
if (name == 'leader_mobile_number') {
if (!checkMobile(value)) {
Leaf.showMessage('提示', '公司负责人中,请输入正确格式的手机号码!');
return '请输入正确格式的手机号码';
setTimeout(function () {
record.set('leader_mobile_number', '');
}, 20);
return false;
}
}
if (name == 'id_card_no') {
if(record.get('id_type') == 'ID_CARD') {
if (name == 'id_card_no' && value) {
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的身份证!');
return '请输入正确格式的身份证';
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
} else if (value.length == 18) {
new_id_card = record.get('id_card_no');
//自动带出籍贯
record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
......@@ -467,17 +472,20 @@
}
}
if (name == 'id_no_sp') {
if (name == 'id_no_sp' && value) {
//
if (record.get('card_type_sp') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('提示', '配偶信息中,请输入正确格式的身份证!');
return '请输入正确格式的身份证';
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
} else if (value.length == 18) {
new_id_card = record.get('id_card_no_leg');
record.set('resident_addres_sp',get_native_place(value));
record.set('resident_addres_sp', get_native_place(value));
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
......@@ -498,29 +506,43 @@
var test_ds_id1 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE_1', 'hls_bp_master');
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
if (ds.id==test_ds_id1||ds.id==test_ds_id2) {
record = $(test_ds_id).getCurrentRecord();
if(record.get('marital_status')=='40'){
var test_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE_1', 'hls_bp_master');
var bp2_record = $(test_ds_id).getCurrentRecord();
bp2_record.set('marital_status', '40');
}else if(record.get('marital_status')=='30'){
var test_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
var bp2_record = $(test_ds_id).getCurrentRecord();
bp2_record.set('marital_status', '30');
if (ds.id == f_bp_create_ds_id) {
var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
record = $(hd_ds).getCurrentRecord();
if(record.get('bp_class')=='NP'){
if (name == 'marital_status') {
debugger;
if (value == '30' || value == '40') {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
if (!record.get('card_type_sp')) {
record.set('card_type_sp', 'ID_CARD');
record.set('card_type_sp_n', '身份证');
}
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
record.getField('bp_name_sp').setRequired(false);
record.getField('card_type_sp').setRequired(false);
record.getField('card_type_sp_n').setRequired(false);
record.getField('id_no_sp').setRequired(false);
// record.set('bp_name_sp', null);
// record.set('card_type_sp', null);
// record.set('card_type_sp_n', null);
// record.set('id_no_sp', null);
// record.set('date_of_birth_sp', null);
// record.set('cell_phone_sp', null);
// record.set('work_unit_phone_sp', null);
// record.set('work_unit_name_sp', null);
// record.set('work_unit_address_sp', null);
}
if(name=='marital_status'&&ds.id==test_ds_id){
if ($L.CmpManager.get(test_ds_id1)||$L.CmpManager.get(test_ds_id2)) {
var bp2_record = $L.CmpManager.get(test_ds_id1).getCurrentRecord();
var bp3_record = $L.CmpManager.get(test_ds_id2).getCurrentRecord();
bp2_record.set('marital_status', value);
bp3_record.set('marital_status', value);
}
}
}
};
......@@ -543,7 +565,7 @@
height: 400
});
win.on('close', function() {
win.on('close', function () {
record.ds.query();
});
} else {
......@@ -554,7 +576,7 @@
//超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
//
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') {
......@@ -569,7 +591,7 @@
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
for (var i = 0;i < str.length;i++) {
for (var i = 0; i < str.length; i++) {
var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) {
var file_name = temp[0].toUpperCase();
......@@ -596,7 +618,7 @@
//经销商准入
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
var record = $(ds_id).getCurrentRecord();
......@@ -617,7 +639,7 @@
para: {
'bp_id': record.get('bp_id')
},
success: function(res) {
success: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var param = {};
param['function_code'] = 'HLS303';
......@@ -632,10 +654,10 @@
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, 'bp_agent_modify_link', ds_id, '${/parameter/@layout_code}');
},
failure: function(res) {
failure: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
......@@ -680,5 +702,6 @@
}
}*/
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
......@@ -15,10 +15,12 @@
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, line_record) {
if (ds.id.indexOf('hls_bp_master_role') != -1) {
var record = ds.getCurrentRecord();
if(record) {
record.getField('bp_type_n').setReadOnly(true);
record.getField('enabled_flag').setReadOnly(true);
}
}
}
function hls215n_upload_file(id, name, query_only) {
......
......@@ -197,8 +197,35 @@
}
}
if (price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') {
if (payment_deduction != 'TRADE_IN' && payment_deduction != 'TRI_AGREEMENT') {
var record = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
if (record[i].get('column_code') == 'H109') {
record[i].set('column_value', 0);
record[i].set('column_value_c', 0);
var a = document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id);
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id).innerHTML = 0;
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id).title = 0;
}
}
} else {
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
var H16;
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value');
}
if (temp_head_records[i].get('column_code') == 'H109') {
temp_head_records[i].set('column_value', H16);
// temp_head_records[i].set('column_value_c',0);
}
}
}
}
function hls_fin_cal_save_hd_submitsuccess(ds, res) {
if (typeof(nextStep) == 'function') {
if (typeof (nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
......@@ -207,29 +234,31 @@
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
},
failure: function() {
failure: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
error: function() {
error: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
scope: this
});
}else{
} else {
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
for (var i = 0; i < temp_head_records.length; i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
......@@ -241,7 +270,7 @@
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess(ds, res) {
if (typeof(nextStep) == 'function') {
if (typeof (nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
......@@ -250,10 +279,12 @@
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
......@@ -292,11 +323,12 @@
new Leaf.Window({
id: winId,
params: {
layout_code:'${/parameter/@layout_code}',
layout_code: '${/parameter/@layout_code}',
calc_session_id: '${/parameter/@calc_session_id}',
document_id: '${/parameter/@document_id}',
quotation_id: '${/parameter/@quotation_id}',
document_category: '${/parameter/@document_category}',
business_type:'${/parameter/@business_type}',
calc_type: '${/parameter/@calc_type}',
dsId: '${/parameter/@dsId}',
dsId1: '${/parameter/@dsId1}',
......@@ -329,7 +361,7 @@
Leaf.request({
url: '${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calculator_calc/update',
para: {
layout_code:'${/parameter/@layout_code}',
layout_code: '${/parameter/@layout_code}',
calc_session_id: '${/parameter/@calc_session_id}',
document_id: '${/parameter/@document_id}',
document_category: '${/parameter/@document_category}',
......@@ -337,17 +369,17 @@
recreate_L_formula: final_recreate_L_formula,
quotation_id: '${/parameter/@quotation_id}'
},
success: function(res) {
success: function (res) {
on_calc_success_query('${/parameter/@dsId}', '${/parameter/@document_category}');
get_warning_message(res.result.warning_message);
recreate_H_formula = 'N';
recreate_L_formula = 'N';
open_after_save_execute();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
......@@ -376,7 +408,7 @@
function setGridCellStyle(record, name, cls) {
var id = 'hls_fin_calculator_hd_grid_id_' + name + '_' + record.id,
intervalId = setInterval(function() {
intervalId = setInterval(function () {
var div = Ext.get(id);
if (div) {
if (!div.getBorderWidth('t r b l')) {
......@@ -486,7 +518,7 @@
set_field_input_mode(record, field, name, input_mode);
special_editor_function(ds, record, name);
if (record.get('alignment')) {
Ext.each($('hls_fin_calculator_hd_grid_id').columns, function(c) {
Ext.each($('hls_fin_calculator_hd_grid_id').columns, function (c) {
if (c.name == name) {
c.align = record.get('alignment');
}
......@@ -685,9 +717,9 @@
return;
}
if ('${/model/calc_config_hd_path/record/@show_column_code}' == 'Y') {
for (var i = 0;i < lineRecords.length;i++) {
for (var i = 0; i < lineRecords.length; i++) {
var ln_formula_record = $('ln_formula_ds').find('calc_line_id', lineRecords[i].get('calc_line_id'));
for (var j = 0;j < attribute_records.length;j++) {
for (var j = 0; j < attribute_records.length; j++) {
var column_name = attribute_records[j].get('column_name');
var tooltip_ln_formula = escapeHtml(appendBr(ln_formula_record.get(column_name), 60));
lineRecords[i].getField(column_name).setPropertity('tooltip', tooltip_ln_formula);
......@@ -704,8 +736,8 @@
if (Ext.isEmpty(ln_calc_orign_value[name])) {
ln_calc_orign_value[name] = old_value;
}
if(name=='principal_eq_pymt_adj'&&value){
if(value*1<0){
if (name == 'principal_eq_pymt_adj' && value) {
if (value * 1 < 0) {
Leaf.showMessage('${l:PROMPT}', '调整租金不能小于零!');
return false;
}
......@@ -786,10 +818,10 @@
return;
}
if (!formula_calc_line_id) {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS500.CHANGE_HD_FIELD}' + formula_prompt, function() {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS500.CHANGE_HD_FIELD}' + formula_prompt, function () {
openWindow();
}, function() {
return;
}, function () {
}, null, null);
} else {
Leaf.request({
......@@ -798,12 +830,12 @@
calc_session_id: '${/parameter/@calc_session_id}',
column_name: formula_column_name
},
success: function(res) {
success: function (res) {
formula_column_code = res.result.record.column_code;
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS500.CHANGE_LN_FIELD}' + formula_row + '${l:HLS500.LN_FIELD}' + formula_prompt, function() {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS500.CHANGE_LN_FIELD}' + formula_row + '${l:HLS500.LN_FIELD}' + formula_prompt, function () {
openWindow();
}, function() {
return;
}, function () {
}, null, null);
},
scope: this
......@@ -859,7 +891,7 @@
function appendBr(s, max) {
if (s) {
for (var i = max || 10;i < s.length;i += max + 5) {
for (var i = max || 10; i < s.length; i += max + 5) {
s = s.substr(0, i) + '<br/>' + s.substr(i);
}
return s;
......@@ -881,40 +913,40 @@
function onEditorHdload(ds) {
debugger;
var headRecords = ds.getAll();
if('${/parameter/@document_category}'=='CONTRACT'){
if ('${/parameter/@document_category}' == 'CONTRACT') {
Leaf.request({
url: $('con_check_con_record_link_id').getUrl(),
para: {
'contract_id': '${/parameter/@document_id}'
},
success: function(res) {
success: function (res) {
var contract_status = res.result.contract_status;
var sign_contract_status = res.result.sign_contract_status;
if(sign_contract_status=='SIGN'||sign_contract_status=='SIGNING'|| contract_status=='NEW' || contract_status=='INCEPT_RETURN'){
for (var i = 0;i < headRecords.length;i++) {
var column_name = headRecords[i].get('column_name')
if(column_name !="lease_start_date"&&column_name !="contract_inception_date"){
headRecords[i].set('input_mode','READONLY');
headRecords[i].set('readonly_input_mode','TRUE');
if (sign_contract_status == 'SIGN' || sign_contract_status == 'SIGNING' || contract_status == 'NEW' || contract_status == 'INCEPT_RETURN') {
for (var i = 0; i < headRecords.length; i++) {
var column_name = headRecords[i].get('column_name');
if (column_name != "lease_start_date" && column_name != "contract_inception_date") {
headRecords[i].set('input_mode', 'READONLY');
headRecords[i].set('readonly_input_mode', 'TRUE');
headRecords[i].getField('column_value').setReadOnly(true);
headRecords[i].getField('column_value_c').setReadOnly(true);
}
}
}else{
for (var i = 0;i < headRecords.length;i++) {
headRecords[i].set('input_mode','READONLY');
headRecords[i].set('readonly_input_mode','TRUE');
} else {
for (var i = 0; i < headRecords.length; i++) {
headRecords[i].set('input_mode', 'READONLY');
headRecords[i].set('readonly_input_mode', 'TRUE');
headRecords[i].getField('column_value').setReadOnly(true);
headRecords[i].getField('column_value_c').setReadOnly(true);
}
}
},
failure: function() {
failure: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
error: function() {
error: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
......@@ -923,44 +955,44 @@
}
if('${/parameter/@document_category}'=='PROJECT'){
if ('${/parameter/@document_category}' == 'PROJECT') {
Leaf.request({
url: $('prj_check_prj_record_link_id').getUrl(),
para: {
'project_id': '${/parameter/@document_id}'
},
success: function(res) {
success: function (res) {
var detention = res.result.detention;
for (var i = 0;i < headRecords.length;i++) {
var column_name = headRecords[i].get('column_name')
if(column_name =="residual_value"){
headRecords[i].set('column_value',detention);
headRecords[i].set('column_value_c',detention);
for (var i = 0; i < headRecords.length; i++) {
var column_name = headRecords[i].get('column_name');
if (column_name == "residual_value") {
headRecords[i].set('column_value', detention);
headRecords[i].set('column_value_c', detention);
}
}
},
failure: function() {
failure: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
error: function() {
error: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
scope: this,
sync:true
sync: true
});
}
if (headRecords.length>0&&headRecords[0].get('show_column_code') == 'N') {
if (headRecords.length > 0 && headRecords[0].get('show_column_code') == 'N') {
$('hls_fin_calculator_hd_grid_id').hideColumn('column_code');
$('hls_fin_calculator_export_grid_id').hideColumn('column_code');
} else {
var hd_formula_record = $('hd_formula_ds').getAt(0);
for (var i = 0;i < headRecords.length;i++) {
for (var i = 0; i < headRecords.length; i++) {
var column_name = headRecords[i].get('column_name');
var tooltip_hd_formula = escapeHtml(appendBr(hd_formula_record.get(column_name), 60));
headRecords[i].getField('column_code').setPropertity('tooltip', tooltip_hd_formula);
......@@ -968,16 +1000,16 @@
headRecords[i].getField('column_value').setPropertity('tooltip', tooltip_hd_formula);
}
}
Ext.each(ds.getAll(), function(each_record) {
Ext.each(ds.getAll(), function (each_record) {
each_record.isNew = true;
Ext.iterate(ds.fields, function(key) {
Ext.iterate(ds.fields, function (key) {
key == 'column_value' && parameter_function(each_record, key);
})
});
Ext.each(ds.getAll(), function(each_record) {
Ext.each(ds.getAll(), function (each_record) {
on_hd_load_last_deal(ds, each_record);
});
Ext.each($('temp_hd_attribute_ds').getAll(), function(each_record) {
Ext.each($('temp_hd_attribute_ds').getAll(), function (each_record) {
on_hd_load_last_deal($('temp_hd_attribute_ds'), each_record);
});
Leaf.Masker.unmask(document.documentElement);
......@@ -1032,7 +1064,7 @@
document_id: '${/parameter/@document_id}',
document_category: '${/parameter/@document_category}'
},
success: function(res) {
success: function (res) {
parent.Leaf.SideBar.show({
html: '<div style="background-color:#ccfbd5;position:absolute;padding:3px;border:1px solid #009900">' + res.result.return_value + '</div>',
duration: 5000
......@@ -1040,10 +1072,10 @@
unlock_calc_current_window();
hls500_action_after_button();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
......@@ -1051,7 +1083,7 @@
}
function hls500_hd_process(datas) {
for (var i = 0;i < datas.length;i++) {
for (var i = 0; i < datas.length; i++) {
var temp = datas[i];
if (temp.data['validation_type'] == 'NUMBERFIELD') {
temp.data['column_value'] = isNaN(temp.data['column_value']) == true ? temp.data['column_value'] : parseFloat(parseFloat(temp.data['column_value']).toFixed(temp.data['precision']));
......@@ -1061,7 +1093,7 @@
}
function hls500_hd_formula_process(datas) {
for (var i = 0;i < datas.length;i++) {
for (var i = 0; i < datas.length; i++) {
var temp = datas[i];
if (Ext.isDefined(temp.data)) {
temp = temp.data;
......@@ -1079,7 +1111,7 @@
}
function hls500_ln_process(datas) {
for (var i = 0;i < datas.length;i++) {
for (var i = 0; i < datas.length; i++) {
var temp = datas[i];
for (var name in temp.data) {
var temp_record = $('line_attribute_ds').find('column_name', name);
......@@ -1094,7 +1126,7 @@
}
function hls500_ln_formula_process(datas) {
for (var i = 0;i < datas.length;i++) {
for (var i = 0; i < datas.length; i++) {
var temp = datas[i];
if (Ext.isDefined(temp.data)) {
temp = temp.data;
......@@ -1120,7 +1152,7 @@
return;
}
var saveData = [];
for (var i = 0;i < records.length;i++) {
for (var i = 0; i < records.length; i++) {
records[i].set('_status', 'delete');
records[i].set('document_id', '${/parameter/@document_id}');
records[i].set('document_category', '${/parameter/@document_category}');
......@@ -1129,15 +1161,15 @@
Leaf.request({
url: '${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calc_delete_ln/batch_update',
para: saveData,
success: function() {
success: function () {
success_sidebar_show();
$('hls_fin_calculator_ln_grid_id').clear();
$('hls_hls500_delete_id').enable();
},
failure: function() {
failure: function () {
$('hls_hls500_delete_id').enable();
},
error: function() {
error: function () {
$('hls_hls500_delete_id').enable();
},
scope: this
......@@ -1158,7 +1190,7 @@
document_id: '${/parameter/@document_id}',
document_category: '${/parameter/@document_category}'
},
success: function() {
success: function () {
$('${/parameter/@dsId}').query();
if ('${/parameter/@quotation_id}') {
var win = new Leaf.Window({
......@@ -1177,7 +1209,7 @@
height: 200,
width: 400
});
win.on('close', function() {
win.on('close', function () {
unlock_calc_current_window();
});
} else {
......@@ -1188,10 +1220,10 @@
}
unlock_calc_current_window();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
......@@ -1206,6 +1238,7 @@
$('hls_fin_calculator_export_grid_id')._export();
$('hls_fin_calculator_export_ds').un('load', on_hls_fin_calculator_export_load);
}
$('hls_fin_calculator_export_ds').on('load', on_hls_fin_calculator_export_load);
}
......@@ -1220,12 +1253,12 @@
function hls_hls500_restructure() {
lock_calc_current_window('${l:HLS.CALCULATING}');
var win = Leaf.showConfirm('${l:PROMPT}', '${l:HLS.SAVE_FIRST}', function() {
var win = Leaf.showConfirm('${l:PROMPT}', '${l:HLS.SAVE_FIRST}', function () {
hls_hls500_save(hls_hls500_restructure_execute);
}, function() {
}, function () {
hls_hls500_restructure_execute()
}, null, null);
win.on('close', function() {
win.on('close', function () {
unlock_calc_current_window();
});
}
......@@ -1236,23 +1269,24 @@
para: {
calc_session_id: '${/parameter/@calc_session_id}'
},
success: function() {
success: function () {
open_after_save_execute();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
});
}
Leaf.onReady(function() {
Leaf.onReady(function () {
Ext.fly('hls_fin_calculator_export_grid_id_wrap').setStyle({
display: 'none'
});
if('${/parameter/@document_category}' == 'PROJECT' || '${/parameter/@document_category}' == 'CONTRACT' ){
if ('${/parameter/@document_category}' == 'PROJECT' || '${/parameter/@document_category}' == 'CONTRACT') {
Ext.fly('hls_hls500_user_button3_col_id').setStyle({
display: 'none'
});
......@@ -1283,7 +1317,7 @@
width: 420,
height: 275
});
win.on('close', function() {
win.on('close', function () {
$('hls_hls500_import_id').enable();
});
}
......@@ -1303,14 +1337,14 @@
width: 530,
height: 500
});
win.on('close', function() {
win.on('close', function () {
$('hls_hls500_show_col_id').enable();
});
}
function sum_name_in(name) {
var config = ['rental', 'principal', 'interest', 'vat_interest', 'ln_user_col_n03', 'btb_repayment', 'btb_principal', 'btb_interest', 'ln_user_col_n05', 'btb_vat_interest', 'btb_fee', 'btb_fee_pv', 'ln_user_col_n06', 'other_payment', 'other_payment2'];
for (var i = 0;i < config.length;i++) {
for (var i = 0; i < config.length; i++) {
if (config[i] == name) {
return true;
}
......@@ -1320,7 +1354,7 @@
function sum_zero_time_in(name) {
var config = ['ln_user_col_n03', 'ln_user_col_n06', 'other_payment', 'other_payment2'];
for (var i = 0;i < config.length;i++) {
for (var i = 0; i < config.length; i++) {
if (config[i] == name) {
return true;
}
......@@ -1331,7 +1365,7 @@
function calc_sumfunction(datas, name) {
if (sum_name_in(name)) {
var sum = 0;
for (var i = 0;i < datas.length;i++) {
for (var i = 0; i < datas.length; i++) {
var r = datas[i];
var d = r.get(name);
if (r.get('times') === 0 && !sum_zero_time_in(name)) {
......@@ -1342,7 +1376,7 @@
sum = plus(sum, n);
}
}
var total = (typeof(sum) == 'undefined' ? '' : parseFloat(sum));
var total = (typeof (sum) == 'undefined' ? '' : parseFloat(sum));
return '<font>' + Leaf.formatNumber(total) + '</font>';
} else {
return '';
......@@ -1359,26 +1393,27 @@
para: {
calc_session_id: '${/parameter/@calc_session_id}'
},
success: function(res) {
if('${/parameter/@document_category}'=='PROJECT'){
success: function (res) {
if ('${/parameter/@document_category}' == 'PROJECT') {
$('${/parameter/@layout_code}_F_QUOTATION_N_prj_quotation_ds').query();
$('${/parameter/@layout_code}_G_CASHFLOW_NS_prj_quotation_ds').query();
}else if('${/parameter/@document_category}'=='CONTRACT'){
} else if ('${/parameter/@document_category}' == 'CONTRACT') {
$('CONTRACT_CREATE_INC_G_CASHFLOW_1_con_contract_cashflow_ds').query();
}
// success_sidebar_show();
get_warning_message(res.result.msg);
open_after_save_execute();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
});
}
//均等计算合并计算按钮一起
function hls_hls500_JD() {
......@@ -1386,54 +1421,55 @@
hls_hls500_save_new(calc_execute_JD_new, 'CALC');
}
//不均等
function hls_hls500_NJD() {
debugger;
debugger;
var temp_head_records = $('hls_fin_calculator_ln_ds').getAll();
//一、报价器加校验:1.如果用户把所有租金都手填,则报校验“禁止手填所有期数租金!”;
// 2.如果用户手动修改租金以后,只有最后一期租金大于零,则报校验“目前不支持只有一期租金的报价!”
var count=temp_head_records.length-1;
var calc_temp=parseFloat(0);
var before_calc_count=parseFloat(0);
var last_calc_count=parseFloat(0);
var zero_calc_count=parseFloat(0);
var null_calc_count=parseFloat(0);
var last_null_calc_count=parseFloat(0);
var last_zero_calc_count=parseFloat(0);
for (var i = 0;i < temp_head_records.length;i++) {
if(temp_head_records[i].get('times')>0){
var count = temp_head_records.length - 1;
var calc_temp = parseFloat(0);
var before_calc_count = parseFloat(0);
var last_calc_count = parseFloat(0);
var zero_calc_count = parseFloat(0);
var null_calc_count = parseFloat(0);
var last_null_calc_count = parseFloat(0);
var last_zero_calc_count = parseFloat(0);
for (var i = 0; i < temp_head_records.length; i++) {
if (temp_head_records[i].get('times') > 0) {
if(temp_head_records[i].get('principal_eq_pymt_adj')!==''&&temp_head_records[i].get('principal_eq_pymt_adj')>=0){
calc_temp = plus(calc_temp,parseFloat(1));
if (temp_head_records[i].get('principal_eq_pymt_adj') !== '' && temp_head_records[i].get('principal_eq_pymt_adj') >= 0) {
calc_temp = plus(calc_temp, parseFloat(1));
}
if(temp_head_records[i].get('principal_eq_pymt_adj')!==''&&temp_head_records[i].get('principal_eq_pymt_adj')===0){
before_calc_count = plus(before_calc_count,parseFloat(1));
if (temp_head_records[i].get('principal_eq_pymt_adj') !== '' && temp_head_records[i].get('principal_eq_pymt_adj') === 0) {
before_calc_count = plus(before_calc_count, parseFloat(1));
}
if(temp_head_records[i].get('principal_eq_pymt_adj')!==''&&temp_head_records[i].get('principal_eq_pymt_adj')===0){
zero_calc_count = plus(zero_calc_count,parseFloat(1));
if (temp_head_records[i].get('principal_eq_pymt_adj') !== '' && temp_head_records[i].get('principal_eq_pymt_adj') === 0) {
zero_calc_count = plus(zero_calc_count, parseFloat(1));
}
if(typeof(temp_head_records[i].get('principal_eq_pymt_adj')) == 'undefined'||temp_head_records[i].get('principal_eq_pymt_adj')===''){
null_calc_count = plus(null_calc_count,parseFloat(1));
if (typeof (temp_head_records[i].get('principal_eq_pymt_adj')) == 'undefined' || temp_head_records[i].get('principal_eq_pymt_adj') === '') {
null_calc_count = plus(null_calc_count, parseFloat(1));
}
}
if(temp_head_records[i].get('times')===count){
if (temp_head_records[i].get('times') === count) {
if(!temp_head_records[i].get('principal_eq_pymt_adj')||temp_head_records[i].get('principal_eq_pymt_adj')===''){
last_calc_count = plus(last_calc_count,parseFloat(1));
if (!temp_head_records[i].get('principal_eq_pymt_adj') || temp_head_records[i].get('principal_eq_pymt_adj') === '') {
last_calc_count = plus(last_calc_count, parseFloat(1));
}
if(typeof(temp_head_records[i].get('principal_eq_pymt_adj')) == 'undefined'||temp_head_records[i].get('principal_eq_pymt_adj')===''){
last_null_calc_count = plus(last_null_calc_count,parseFloat(1));
if (typeof (temp_head_records[i].get('principal_eq_pymt_adj')) == 'undefined' || temp_head_records[i].get('principal_eq_pymt_adj') === '') {
last_null_calc_count = plus(last_null_calc_count, parseFloat(1));
}
if(temp_head_records[i].get('principal_eq_pymt_adj')!==''&&temp_head_records[i].get('principal_eq_pymt_adj')===0){
last_zero_calc_count = plus(last_zero_calc_count,parseFloat(1));
if (temp_head_records[i].get('principal_eq_pymt_adj') !== '' && temp_head_records[i].get('principal_eq_pymt_adj') === 0) {
last_zero_calc_count = plus(last_zero_calc_count, parseFloat(1));
}
}
}
if(calc_temp==count){
if (calc_temp == count) {
Leaf.showMessage('${l:PROMPT}', '请保证一期以上的的调整租金为空!');
return false;
}
......@@ -1445,7 +1481,7 @@ debugger;
// Leaf.showMessage('${l:PROMPT}', '目前不支持只有一期租金的报价!');
// return false;
// }
if(last_zero_calc_count==1){
if (last_zero_calc_count == 1) {
Leaf.showMessage('${l:PROMPT}', '系统不支持最后一期租金为0的情况!');
return false;
}
......@@ -1457,58 +1493,72 @@ debugger;
}
function hls_hls500_save_new(nextStep, source_procedure) {
debugger;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
var H1,H54,H159;
var H1, H54, H159, H16, H12,H99,H102;
for (var i = 0; i < temp_head_records.length; i++) {
if (temp_head_records[i].get('column_code') == 'H1') {
H1 = temp_head_records[i].get('column_value') || 0;
} else if (temp_head_records[i].get('column_code') == 'H54') {
H54 = temp_head_records[i].get('column_value') || 0;
H54=minus(H54,4.75);
}
else if (temp_head_records[i].get('column_code') == 'H159') {
H54 = minus(H54, 4.75);
} else if (temp_head_records[i].get('column_code') == 'H159') {
H159 = temp_head_records[i].get('column_value_c');
} else if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value') || 0;
} else if (temp_head_records[i].get('column_code') == 'H99') {
H99 = temp_head_records[i].get('column_value') || 0;
}
else if (temp_head_records[i].get('column_code') == 'H102') {
H102 = temp_head_records[i].get('column_value') || 0;
}
}
// if(H1<2){
// Leaf.showMessage('${l:PROMPT}', '系统暂时不支持还款期数小于2期的租金计划');
// return false;
// }
if(H1>51){
if (H1 > 51) {
Leaf.showMessage('${l:PROMPT}', '还款期数应小于51期');
unlock_calc_current_window();
return false;
}
if(H54<0){
if (H54 < 0) {
Leaf.showMessage('${l:PROMPT}', '利率最低值不能低于4.75');
unlock_calc_current_window();
return false;
}
if(H1==1&&(H159=='HL_PRICR_NTEST'||H159=='HL_PRICR_TEST')){
if (H1 == 1 && (H159 == 'HL_PRICR_NTEST' || H159 == 'HL_PRICR_TEST')) {
Leaf.showMessage('${l:PROMPT}', '均等还款期数应大于1期');
unlock_calc_current_window();
return false;
}
if ('${/parameter/@document_category}' == 'PROJECT' && '${/parameter/@business_type}'=='LEASEBACK') {
var dowm_payment = div(H16, plus(H99,H102)).toFixed(2) * 100;
if (dowm_payment < 15) {
Leaf.showMessage('${l:PROMPT}', '回租首付款比例不低于15%');
unlock_calc_current_window();
return false;
}
}
lock_calc_current_window('${l:HLS.CALCULATING}');
if (!$('hls_fin_calculator_hd_ds').validate() || !$('hls_fin_calculator_ln_ds').validate()) {
unlock_calc_current_window();
return;
}
if('${/parameter/@document_category}'=='PROJECT'){
if ('${/parameter/@document_category}' == 'PROJECT' && '${/parameter/@business_type}' == 'LEASE') {
Leaf.request({
url: $('prj_check_prj_record_link_id').getUrl(),
para: {
'project_id': '${/parameter/@document_id}'
},
success: function(res) {
success: function (res) {
var secondary_lease = res.result.secondary_lease;
var payment_deduction = res.result.payment_deduction;
var price_list = res.result.price_list;
var down_payment_rate_new=res.result.down_payment_rate_new;
if((price_list=='HL_PRICR_E'||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN') && secondary_lease=='NO') {
var down_payment_rate_new = res.result.down_payment_rate_new;
if ((price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') && secondary_lease == 'NO') {
//比例=(H16+H97)/(H99+H102-H16)
var H16, H97, H99, H102;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
......@@ -1536,7 +1586,7 @@ debugger;
}
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
for (var i = 0; i < temp_head_records.length; i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
......@@ -1547,27 +1597,27 @@ debugger;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
if(price_list=='HL_PRICR_E' ||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN'){
if(payment_deduction!='TRADE_IN' && payment_deduction!='TRI_AGREEMENT' ){
if (price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') {
if (payment_deduction != 'TRADE_IN' && payment_deduction != 'TRI_AGREEMENT') {
var record = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
if(record[i].get('column_code')=='H109') {
record[i].set('column_value',0);
record[i].set('column_value_c',0);
var a= document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id);
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).innerHTML=0;
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).title=0;
for (var i = 0; i < temp_head_records.length; i++) {
if (record[i].get('column_code') == 'H109') {
record[i].set('column_value', 0);
record[i].set('column_value_c', 0);
var a = document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id);
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id).innerHTML = 0;
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_' + record[i].id).title = 0;
}
}
}else{
} else {
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
for (var i = 0; i < temp_head_records.length; i++) {
var H16;
if(temp_head_records[i].get('column_code')=='H16'){
H16=temp_head_records[i].get('column_value');
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value');
}
if(temp_head_records[i].get('column_code')=='H109') {
temp_head_records[i].set('column_value',H16);
if (temp_head_records[i].get('column_code') == 'H109') {
temp_head_records[i].set('column_value', H16);
// temp_head_records[i].set('column_value_c',0);
}
}
......@@ -1575,7 +1625,7 @@ debugger;
}
function hls_fin_cal_save_hd_submitsuccess_new(ds, res) {
if (typeof(nextStep) == 'function') {
if (typeof (nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
......@@ -1584,29 +1634,32 @@ debugger;
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess_new);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
},
failure: function() {
failure: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
error: function() {
error: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
scope: this
});
}else{
} else {
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
for (var i = 0; i < temp_head_records.length; i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
......@@ -1618,7 +1671,7 @@ debugger;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess_new(ds, res) {
if (typeof(nextStep) == 'function') {
if (typeof (nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
......@@ -1627,10 +1680,12 @@ debugger;
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess_new);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
......@@ -1640,7 +1695,6 @@ debugger;
function calc_execute_JD_new(source_procedure) {
debugger;
var final_recreate_H_formula, final_recreate_L_formula;
if (source_procedure == 'RE_CALC') {
final_recreate_H_formula = 'Y';
......@@ -1659,7 +1713,7 @@ debugger;
recreate_L_formula: final_recreate_L_formula,
quotation_id: '${/parameter/@quotation_id}'
},
success: function(res) {
success: function (res) {
on_calc_success_query('${/parameter/@dsId}', '${/parameter/@document_category}');
//get_warning_message(res.result.warning_message);
recreate_H_formula = 'N';
......@@ -1667,15 +1721,16 @@ debugger;
//open_after_save_execute();
hls_hls500_user_button1();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
});
}
function calc_execute_NJD_new(source_procedure) {
var final_recreate_H_formula, final_recreate_L_formula;
......@@ -1696,7 +1751,7 @@ debugger;
recreate_L_formula: final_recreate_L_formula,
quotation_id: '${/parameter/@quotation_id}'
},
success: function(res) {
success: function (res) {
on_calc_success_query('${/parameter/@dsId}', '${/parameter/@document_category}');
//get_warning_message(res.result.warning_message);
recreate_H_formula = 'N';
......@@ -1705,10 +1760,10 @@ debugger;
hls_hls500_user_button2();
// unlock_calc_current_window();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
......@@ -1723,25 +1778,26 @@ debugger;
para: {
calc_session_id: '${/parameter/@calc_session_id}'
},
success: function() {
if('${/parameter/@document_category}'=='PROJECT'){
success: function () {
if ('${/parameter/@document_category}' == 'PROJECT') {
$('${/parameter/@layout_code}_F_QUOTATION_N_prj_quotation_ds').query();
$('${/parameter/@layout_code}_G_CASHFLOW_NS_prj_quotation_ds').query();
}else if('${/parameter/@document_category}'=='CONTRACT'){
} else if ('${/parameter/@document_category}' == 'CONTRACT') {
$('CONTRACT_CREATE_INC_G_CASHFLOW_1_con_contract_cashflow_ds').query();
}
open_after_save_execute();
},
failure: function() {
failure: function () {
unlock_calc_current_window();
},
error: function() {
error: function () {
unlock_calc_current_window();
},
scope: this
});
}
]]></script>
<a:dataSets>
<a:placeHolder id="dynamicDataSet_left_id"/>
......@@ -1771,21 +1827,27 @@ debugger;
<a:dataSet id="hd_attribute_ds">
<a:datas dataSource="/model/calc_config_hd_path"/>
</a:dataSet>
<a:dataSet id="hls_fin_cal_save_hd_ds" autoCreate="true" submitUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calc_save_n.lsc?base_table=HLS_FIN_CALCULATOR_HD&amp;calc_session_id=${/parameter/@calc_session_id}">
<a:dataSet id="hls_fin_cal_save_hd_ds" autoCreate="true"
submitUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calc_save_n.lsc?base_table=HLS_FIN_CALCULATOR_HD&amp;calc_session_id=${/parameter/@calc_session_id}">
<a:fields>
<a:field name="calc_session_id" defaultValue="${/parameter/@calc_session_id}"/>
</a:fields>
</a:dataSet>
<a:dataSet id="ln_formula_ds" bindName="ln_calc_formula_bind_name" bindTarget="hls_fin_cal_save_hd_ds" processfunction="hls500_ln_formula_process" queryUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_base_query.lsc?calc_session_id=${/parameter/@calc_session_id}&amp;ln_formula_table_flag=Y">
<a:dataSet id="ln_formula_ds" bindName="ln_calc_formula_bind_name" bindTarget="hls_fin_cal_save_hd_ds"
processfunction="hls500_ln_formula_process"
queryUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_base_query.lsc?calc_session_id=${/parameter/@calc_session_id}&amp;ln_formula_table_flag=Y">
<a:datas dataSource="/model/ln_formula_path"/>
</a:dataSet>
<a:dataSet id="hd_formula_ds" bindName="hd_calc_formula_bind_name" bindTarget="hls_fin_cal_save_hd_ds" processfunction="hls500_hd_formula_process">
<a:dataSet id="hd_formula_ds" bindName="hd_calc_formula_bind_name" bindTarget="hls_fin_cal_save_hd_ds"
processfunction="hls500_hd_formula_process">
<a:datas dataSource="/model/hd_formula_path"/>
</a:dataSet>
<a:dataSet id="calc_button_ds">
<a:datas dataSource="/model/calc_button_path"/>
</a:dataSet>
<a:dataSet id="hls_fin_calculator_hd_ds" autoQuery="true" fetchAll="true" model="hls.HLS500N.hls_fin_calc_config_hd_n" processfunction="hls500_hd_process" queryUrl="${/request/@context_path}/autocrud/hls.HLS500N.hls_fin_calc_config_hd_n/query?calc_session_id=${/parameter/@calc_session_id}&amp;enabled_flag=Y&amp;display_flag=Y">
<a:dataSet id="hls_fin_calculator_hd_ds" autoQuery="true" fetchAll="true"
model="hls.HLS500N.hls_fin_calc_config_hd_n" processfunction="hls500_hd_process"
queryUrl="${/request/@context_path}/autocrud/hls.HLS500N.hls_fin_calc_config_hd_n/query?calc_session_id=${/parameter/@calc_session_id}&amp;enabled_flag=Y&amp;display_flag=Y">
<a:fields>
<a:field name="column_value" lovGridHeight="350" lovHeight="500" lovWidth="500"/>
<a:field name="column_value_c"/>
......@@ -1795,14 +1857,18 @@ debugger;
<a:event name="load" handler="onEditorHdload"/>
</a:events>
</a:dataSet>
<a:dataSet id="hls_fin_calculator_ln_ds" autoQuery="true" bindName="ln_calc_bind_name" bindTarget="hls_fin_cal_save_hd_ds" fetchAll="true" processfunction="hls500_ln_process" queryUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_base_query.lsc?calc_session_id=${/parameter/@calc_session_id}&amp;ln_table_flag=Y" selectable="true">
<a:dataSet id="hls_fin_calculator_ln_ds" autoQuery="true" bindName="ln_calc_bind_name"
bindTarget="hls_fin_cal_save_hd_ds" fetchAll="true" processfunction="hls500_ln_process"
queryUrl="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_base_query.lsc?calc_session_id=${/parameter/@calc_session_id}&amp;ln_table_flag=Y"
selectable="true">
<a:events>
<a:event name="load" handler="do_hls500_line_load"/>
<a:event name="update" handler="do_hls500_line_update"/>
<a:event name="remove" handler="do_hls500_line_remove"/>
</a:events>
</a:dataSet>
<a:dataSet id="hls_fin_calculator_export_ds" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calculator_export/query?calc_session_id=${/parameter/@calc_session_id}"/>
<a:dataSet id="hls_fin_calculator_export_ds" fetchAll="true"
queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calculator_export/query?calc_session_id=${/parameter/@calc_session_id}"/>
</a:dataSets>
<a:screenBody padding="0" style="margin:3px">
<a:vBox padding="0" style="border:1px solid #ccc;">
......@@ -1811,11 +1877,18 @@ debugger;
<a:placeHolder id="hls500_button_ds"/>
</a:screenTopToolbar>
<a:hBox padding="0" style="padding:3px">
<a:grid id="hls_fin_calculator_hd_grid_id" bindTarget="hls_fin_calculator_hd_ds" marginHeight="140" rowRenderer="hd_grid_rowrenderer" style="margin-right:3px" width="${/model/calc_config_hd_path/record/@grid_left_width}">
<a:grid id="hls_fin_calculator_hd_grid_id" bindTarget="hls_fin_calculator_hd_ds" marginHeight="140"
rowRenderer="hd_grid_rowrenderer" style="margin-right:3px"
width="${/model/calc_config_hd_path/record/@grid_left_width}">
<a:columns>
<a:column name="column_code" align="left" autoAdjust="false" prompt="HLS050.HLS_FIN_CALC_CONFIG.COLUMN_CODE" width="40"/>
<a:column name="prompt" align="right" autoAdjust="false" prompt="HLS500.PROMPT" width="110"/>
<a:column name="column_value" autoAdjust="false" editorFunction="parameter_function" prompt="HLS500.PROMPT_VALUE" renderer="seedetail_column_hd" showtitle="${/model/calc_config_hd_path/record/@sys_grid_show_title}" width="110"/>
<a:column name="column_code" align="left" autoAdjust="false"
prompt="HLS050.HLS_FIN_CALC_CONFIG.COLUMN_CODE" width="40"/>
<a:column name="prompt" align="right" autoAdjust="false" prompt="HLS500.PROMPT"
width="110"/>
<a:column name="column_value" autoAdjust="false" editorFunction="parameter_function"
prompt="HLS500.PROMPT_VALUE" renderer="seedetail_column_hd"
showtitle="${/model/calc_config_hd_path/record/@sys_grid_show_title}"
width="110"/>
<a:column name="percent" autoAdjust="false" width="19"/>
</a:columns>
<a:editors>
......@@ -1839,7 +1912,8 @@ debugger;
<a:event name="cellclick" handler="hls500_hd_cellcick"/>
</a:events>
</a:grid>
<a:grid id="hls_fin_calculator_ln_grid_id" bindTarget="hls_fin_calculator_ln_ds" marginHeight="140" marginWidth="${/model/calc_config_hd_path/record/@grid_margin_width}">
<a:grid id="hls_fin_calculator_ln_grid_id" bindTarget="hls_fin_calculator_ln_ds" marginHeight="140"
marginWidth="${/model/calc_config_hd_path/record/@grid_margin_width}">
<a:columns>
<a:placeHolder id="dynamicLineColumn_id"/>
</a:columns>
......@@ -1860,12 +1934,12 @@ debugger;
</a:events>
</a:grid>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
var records=$('line_field_ds').getAll();
if(records.length){
for(var i=0;i<records.length;i++){
var record=records[i],column_name=record.get('column_name');
if(record.get('display_flag')=='C'){
Leaf.onReady(function () {
var records = $('line_field_ds').getAll();
if (records.length) {
for (var i = 0; i < records.length; i++) {
var record = records[i], column_name = record.get('column_name');
if (record.get('display_flag') == 'C') {
$('hls_fin_calculator_ln_grid_id').hideColumn(column_name);
$('hls_fin_calculator_export_grid_id').hideColumn(column_name);
}
......@@ -1875,10 +1949,13 @@ debugger;
]]></script>
</a:hBox>
</a:vBox>
<a:grid id="hls_fin_calculator_export_grid_id" bindTarget="hls_fin_calculator_export_ds" height="350" width="900">
<a:grid id="hls_fin_calculator_export_grid_id" bindTarget="hls_fin_calculator_export_ds" height="350"
width="900">
<a:columns>
<a:column name="prompt" align="right" autoAdjust="false" lock="true" prompt="HLS500.PROMPT" width="100"/>
<a:column name="column_value" autoAdjust="false" editorFunction="parameter_function" lock="true" prompt="HLS500.PROMPT_VALUE" renderer="seedetail_column_hd" showtitle="true"/>
<a:column name="prompt" align="right" autoAdjust="false" lock="true" prompt="HLS500.PROMPT"
width="100"/>
<a:column name="column_value" autoAdjust="false" editorFunction="parameter_function" lock="true"
prompt="HLS500.PROMPT_VALUE" renderer="seedetail_column_hd" showtitle="true"/>
<a:column name="percent" autoAdjust="false" lock="true" prompt=" " width="19"/>
<a:placeHolder id="dynamicLineColumn_export_id"/>
</a:columns>
......@@ -1891,7 +1968,8 @@ debugger;
<p:switch test="@validation_type">
<p:case value="COMBOBOX">
<c:process-config>
<a:dataSet id="${@layout_area_seq}_${@column_name}_combobox_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_parameters_lov/query"/>
<a:dataSet id="${@layout_area_seq}_${@column_name}_combobox_ds"
queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_parameters_lov/query"/>
</c:process-config>
</p:case>
</p:switch>
......@@ -1902,86 +1980,102 @@ debugger;
<p:switch test="@button_code">
<p:case value="EXIT">
<c:process-config>
<a:gridButton click="hls_hls500_return" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton click="hls_hls500_return" style="margin-top:10px;margin-left:5px"
text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="ADD_LN">
<c:process-config>
<a:gridButton id="hls_hls500_add_id" click="hls_hls500_add" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_add_id" click="hls_hls500_add"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="DEL_LN">
<c:process-config>
<a:gridButton id="hls_hls500_delete_id" click="hls_hls500_delete" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_delete_id" click="hls_hls500_delete"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="SAVE">
<c:process-config>
<!-- <a:gridButton id="hls_hls500_save_id" click="hls_hls500_save" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>-->
<a:gridButton id="hls_hls500_save_id" click="hls_hls500_save_new" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<!-- <a:gridButton id="hls_hls500_save_id" click="hls_hls500_save" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>-->
<a:gridButton id="hls_hls500_save_id" click="hls_hls500_save_new"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="MODF_FORMULA">
<c:process-config>
<a:gridButton id="hls_hls500_formula_id" click="hls_hls500_formula_change" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_formula_id" click="hls_hls500_formula_change"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="CALC">
<c:process-config>
<a:gridButton id="hls_hls500_calc_id" click="hls_hls500_calc" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_calc_id" click="hls_hls500_calc"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="RE_CALC">
<c:process-config>
<a:gridButton id="hls_hls500_re_calc_id" click="hls_hls500_re_calc" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_re_calc_id" click="hls_hls500_re_calc"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="SAVE_QUOTATION">
<c:process-config>
<a:gridButton id="hls_hls500_quotation_id" click="hls_hls500_quotation" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_quotation_id" click="hls_hls500_quotation"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="EXPORT">
<c:process-config>
<a:gridButton id="hls_hls500_export_id" click="hls_hls500_export" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_export_id" click="hls_hls500_export"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="IMPORT">
<c:process-config>
<a:gridButton id="hls_hls500_import_id" click="hls_hls500_import" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_import_id" click="hls_hls500_import"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="RESTRUCTURE">
<c:process-config>
<a:gridButton id="hls_hls500_restructure_id" click="hls_hls500_restructure" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_restructure_id" click="hls_hls500_restructure"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="SHOW_COL">
<c:process-config>
<a:gridButton id="hls_hls500_show_col_id" click="hls_hls500_show_col" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_show_col_id" click="hls_hls500_show_col"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="USER_BUTTON1">
<c:process-config>
<!--<a:gridButton id="hls_hls500_user_button1_col_id" click="hls_hls500_user_button1" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>-->
<!--<div style="margin-top:10px;margin-left:10px;color: red">请先点计算按钮,再执行均等计算(若改变参数值,请先点击公式重算!) </div>-->
<a:gridButton id="hls_hls500_user_button1_col_id" click="hls_hls500_JD" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_user_button1_col_id" click="hls_hls500_JD"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="USER_BUTTON2">
<c:process-config>
<a:gridButton id="hls_hls500_user_button2_col_id" click="hls_hls500_NJD" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_user_button2_col_id" click="hls_hls500_NJD"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="USER_BUTTON3">
<c:process-config>
<a:gridButton id="hls_hls500_user_button3_col_id" click="hls_hls500_3JD" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls_hls500_user_button3_col_id" click="hls_hls500_3JD"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="*">
<c:process-config>
<a:gridButton id="hls500_${@button_code}" click="hls500_define_button" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
<a:gridButton id="hls500_${@button_code}" click="hls500_define_button"
style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
</p:switch>
......@@ -1993,13 +2087,19 @@ debugger;
<p:case value="Y">
<c:process-config>
<a:column lock="${@lock_column}" prompt="${@column_code}" width="${@width}">
<a:column name="${@column_name}" align="${@alignment}" editorFunction="do_hls500_column_name" exportDatatype="${@data_type}" footerRenderer="calc_sumfunction" lock="${@lock_column}" prompt="${@prompt}" renderer="wrap_render" showtitle="${@sys_grid_show_title}" width="${@width}"/>
<a:column name="${@column_name}" align="${@alignment}"
editorFunction="do_hls500_column_name" exportDatatype="${@data_type}"
footerRenderer="calc_sumfunction" lock="${@lock_column}" prompt="${@prompt}"
renderer="wrap_render" showtitle="${@sys_grid_show_title}" width="${@width}"/>
</a:column>
</c:process-config>
</p:case>
<p:case value="N">
<c:process-config>
<a:column name="${@column_name}" align="${@alignment}" editorFunction="do_hls500_column_name" exportDatatype="${@data_type}" footerRenderer="calc_sumfunction" lock="${@lock_column}" prompt="${@prompt}" renderer="wrap_render" showtitle="${@sys_grid_show_title}" width="${@width}"/>
<a:column name="${@column_name}" align="${@alignment}"
editorFunction="do_hls500_column_name" exportDatatype="${@data_type}"
footerRenderer="calc_sumfunction" lock="${@lock_column}" prompt="${@prompt}"
renderer="wrap_render" showtitle="${@sys_grid_show_title}" width="${@width}"/>
</c:process-config>
</p:case>
</p:switch>
......@@ -2009,7 +2109,10 @@ debugger;
<p:loop source="/model/calc_config_ln_path">
<c:process-config>
<a:column lock="${@lock_column}" prompt="${@upper_column_name}" width="${@width}">
<a:column name="${@column_name}" align="${@alignment}" editorFunction="do_hls500_column_name" exportDatatype="${@data_type}" lock="${@lock_column}" prompt="${@prompt}" renderer="wrap_render" showtitle="${@sys_grid_show_title}" sortable="true" width="${@width}"/>
<a:column name="${@column_name}" align="${@alignment}" editorFunction="do_hls500_column_name"
exportDatatype="${@data_type}" lock="${@lock_column}" prompt="${@prompt}"
renderer="wrap_render" showtitle="${@sys_grid_show_title}" sortable="true"
width="${@width}"/>
</a:column>
</c:process-config>
</p:loop>
......@@ -2017,7 +2120,8 @@ debugger;
<c:create-config targetId="dynamicLineFields">
<p:loop source="/model/calc_config_ln_all_path">
<c:process-config>
<a:field name="${@column_name}" defaultValue="${@default_value}" lovGridHeight="350" lovHeight="500" lovWidth="500"/>
<a:field name="${@column_name}" defaultValue="${@default_value}" lovGridHeight="350" lovHeight="500"
lovWidth="500"/>
</c:process-config>
</p:loop>
</c:create-config>
......
......@@ -122,6 +122,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -164,6 +165,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: quotation_ds_id,
......@@ -210,6 +212,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -313,6 +316,7 @@
var bp_rate_flag;
/*保存前调用,生成项目编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
var check_flag = true;
var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_record = $(prj_project_ds_id).getAt(0);
......@@ -349,6 +353,7 @@
para: {
document_category: '${/parameter/@document_category}',
document_type: record.get('document_type'),
business_type: record.get('business_type'),
function_code: '${/parameter/@function_code}',
function_usage: '${/parameter/@function_usage}',
lease_channel: prj_record.get('lease_channel'),
......@@ -537,6 +542,48 @@
return returnAge;//返回周岁年龄  
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
if (ds_id == ds.id && ds_id) {
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
}else if(record.get('secondary_lease') == 'NO'){
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id',null);
record.set('repur_contract_id_n',null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
//业务类型回租时,默认只读“首付款抵扣”选项
if (record.get('business_type') == 'LEASEBACK') {
record.set('payment_deduction', 'DOWN_PAYMENT_DEDUCTION');
record.set('payment_deduction_n', "首付款抵扣");
record.getField('payment_deduction').setReadOnly(true);
record.getField('payment_deduction_n').setReadOnly(true);
record.set('pay_method', 'WIRE_TRANSFER');
record.set('pay_method_n', "电汇");
record.getField('pay_method').setReadOnly(true);
record.getField('pay_method_n').setReadOnly(true);
record.getField('bank_account_id').setReadOnly(true);
record.getField('bank_account_id_n').setReadOnly(true);
record.getField('bank_account_id').setRequired(false);
record.getField('bank_account_id_n').setRequired(false);
}
}
};
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
......@@ -545,6 +592,17 @@
//选择承租人带出开票信息
if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if (name == "payment_deduction" && value=="DOWN_PAYMENT_DEDUCTION") {
//业务类型回租时,默认只读“首付款抵扣”选项
if ($(prj_project_ds_id).getAt(0).get('business_type') == 'LEASE') {
Leaf.showInfoMessage("提示", "直租业务不能选择首付款抵扣");
setTimeout(function () {
$(prj_project_ds_id).getAt(0).set('payment_deduction', null);
$(prj_project_ds_id).getAt(0).set('payment_deduction_n', null);
}, 10);
}
}
if (name == "bp_id_tenant_n" && value) {
var bp_id_tenant = record.get('bp_id_tenant');
Leaf.Masker.mask(Ext.getBody());
......@@ -650,6 +708,28 @@
}
}
//add by niminmin
//当“二次租赁”字段选择‘是’时,“回购合同编号”字段为必填。当选择‘否’时,“回购合同编号”字段为只读。
if (name == 'secondary_lease') {
if (value=='YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
}else if(value=='NO'){
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id',null);
record.set('repur_contract_id_n',null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
}
......
......@@ -104,7 +104,7 @@
}
} else {
Leaf.showMessage('${l:PROMPT}', '报价有变动请重新计算!');
return;
}
});
};
......@@ -178,13 +178,14 @@
var win = new Leaf.Window({
id: 'hls_fin_calc_quotation_link_winid',
params: {
layout_code:'${/parameter/@layout_code}',
layout_code: '${/parameter/@layout_code}',
document_id: parent_pk_value,
price_list: price_list,
secondary_lease: secondary_lease,
payment_deduction: payment_deduction,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -223,13 +224,14 @@
var win = new Leaf.Window({
id: 'hls_fin_calc_quotation_update_link_winid',
params: {
layout_code:'${/parameter/@layout_code}',
layout_code: '${/parameter/@layout_code}',
document_id: parent_pk_value,
price_list: price_list,
secondary_lease: secondary_lease,
payment_deduction: payment_deduction,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: quotation_ds_id,
......@@ -274,13 +276,14 @@
var win = new Leaf.Window({
id: 'hls_fin_calc_quotation_link_winid',
params: {
layout_code:'${/parameter/@layout_code}',
layout_code: '${/parameter/@layout_code}',
document_id: parent_pk_value,
price_list: price_list,
secondary_lease: secondary_lease,
payment_deduction: payment_deduction,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -481,14 +484,20 @@
if (record.get('bp_category') == 'TENANT') {
//实际为不选中
Leaf.showMessage('${l:HLS.PROMPT}', '无法删除主承租人!');
//ds.unSelect(record);
//ds.select(record);
setTimeout(function () {
ds.unSelect(record);
ds.Select(record);
}, 1);
}
if (record.get('bp_category') == 'AGENT') {
//实际为不选中
Leaf.showMessage('${l:HLS.PROMPT}', '无法删除经销商!');
// ds.unSelect(record);
// ds.select(record);
setTimeout(function () {
ds.unSelect(record);
ds.Select(record);
}, 1);
}
}
};
......@@ -540,6 +549,17 @@
//选择承租人带出开票信息
if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if (name == "payment_deduction" && value == "DOWN_PAYMENT_DEDUCTION") {
//业务类型回租时,默认只读“首付款抵扣”选项
if ($(prj_project_ds_id).getAt(0).get('business_type') == 'LEASE') {
Leaf.showInfoMessage("提示", "直租业务不能选择首付款抵扣");
setTimeout(function () {
$(prj_project_ds_id).getAt(0).set('payment_deduction', null);
$(prj_project_ds_id).getAt(0).set('payment_deduction_n', null);
}, 10);
}
}
if (name == "bp_id_tenant_n" && value) {
var bp_id_tenant = record.get('bp_id_tenant');
Leaf.Masker.mask(Ext.getBody());
......@@ -677,6 +697,28 @@
}
record.getField('bank_account_id').setLovPara('bp_id_tenant', record.get('bp_id_tenant'));
}
//add by niminmin
//当“二次租赁”字段选择‘是’时,“回购合同编号”字段为必填。当选择‘否’时,“回购合同编号”字段为只读。
if (name == 'secondary_lease') {
if (value == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (value == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
}
if (score_ds_id == ds.id) {
......@@ -743,6 +785,51 @@
record.getField('bank_account_id').setRequired(false);
record.getField('bank_account_id_n').setRequired(false);
}
if ('${/parameter/@function_usage}' != 'QUERY') {
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (record.get('secondary_lease') == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
} else {
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
} else if (record.get('secondary_lease') == 'NO') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
//业务类型回租时,默认只读“首付款抵扣”选项
if (record.get('business_type') == 'LEASEBACK') {
record.set('payment_deduction', 'DOWN_PAYMENT_DEDUCTION');
record.set('payment_deduction_n', "首付款抵扣");
record.getField('payment_deduction').setReadOnly(true);
record.getField('payment_deduction_n').setReadOnly(true);
record.set('pay_method', 'WIRE_TRANSFER');
record.set('pay_method_n', "电汇");
record.getField('pay_method').setReadOnly(true);
record.getField('pay_method_n').setReadOnly(true);
record.getField('bank_account_id').setReadOnly(true);
record.getField('bank_account_id_n').setReadOnly(true);
record.getField('bank_account_id').setRequired(false);
record.getField('bank_account_id_n').setRequired(false);
}
}
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (score_ds_id == ds.id) {
......@@ -788,7 +875,7 @@
$(billing_ds_id).query();
})
});
//序号自增 add by lijingjing
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function (ds, record, config_records, bp_seq) {
//租赁物序号
......@@ -876,7 +963,7 @@
}
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存');
return;
}
}
......@@ -919,23 +1006,24 @@
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
if (current_record.get('business_type') == 'LEASE') {
Leaf.request({
url: $('prj_check_prj_record_link_n').getUrl(),
para: {
'project_id': project_id
},
success: function(res) {
success: function (res) {
var secondary_lease = res.result.secondary_lease;
var payment_deduction = res.result.payment_deduction;
var price_list = res.result.price_list;
var down_payment_rate_new=res.result.down_payment_rate_new;
var down_payment_rate_new = res.result.down_payment_rate_new;
var H16 = record.get('down_payment');
var H97 = record.get('third_party_deposit');
var H99 = record.get('other_fee');
var H102 = record.get('other_fee2');
var show = down_payment_rate_new * 100;
if((price_list=='HL_PRICR_E'||price_list=='HL_PRICR_TEST'||price_list=='HL_PRICR_NTEST'||price_list=='HL_PRICR_EN') && secondary_lease=='NO') {
if ((price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') && secondary_lease == 'NO') {
if ((div((H16 + H97), (H99 + H102 - H16)).toFixed(2) * 1) < down_payment_rate_new) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于' + down_payment_rate_new * 100 + '%');
......@@ -967,16 +1055,42 @@
}
},
failure: function() {
failure: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
error: function() {
error: function () {
unlock_calc_current_window('${l:HLS.SAVING}');
},
scope: this
});
} else {
if ($(ds_id).validate()) {
Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('prj_approval_link_id').getUrl(),
para: {
project_id: project_id
},
scope: this,
success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
}
}
};
......
......@@ -172,6 +172,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -213,6 +214,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: quotation_ds_id,
......@@ -260,6 +262,7 @@
document_id: parent_pk_value,
document_category: 'PROJECT',
maintain_type: 'MODIFY',
business_type: head_record.get('business_type'),
calc_session_id: res.result.record.calc_session_id,
quotation_id: quotation_id,
dsId: quotation_ds_id,
......@@ -704,6 +707,41 @@
record.getField('bank_branch_name_n').setRequired(false);
}
if('${/parameter/@function_usage}'!='QUERY'){
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (record.get('secondary_lease') == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
//业务类型回租时,默认只读“首付款抵扣”选项
if (record.get('business_type') == 'LEASEBACK') {
record.set('payment_deduction', 'DOWN_PAYMENT_DEDUCTION');
record.set('payment_deduction_n', "首付款抵扣");
record.getField('payment_deduction').setReadOnly(true);
record.getField('payment_deduction_n').setReadOnly(true);
record.set('pay_method', 'WIRE_TRANSFER');
record.set('pay_method_n', "电汇");
record.getField('pay_method').setReadOnly(true);
record.getField('pay_method_n').setReadOnly(true);
record.getField('bank_account_id').setReadOnly(true);
record.getField('bank_account_id_n').setReadOnly(true);
record.getField('bank_account_id').setRequired(false);
record.getField('bank_account_id_n').setRequired(false);
}
}
};
......@@ -716,6 +754,17 @@
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if (name == "payment_deduction" && value=="DOWN_PAYMENT_DEDUCTION") {
//业务类型回租时,默认只读“首付款抵扣”选项
if ($(prj_project_ds_id).getAt(0).get('business_type') == 'LEASE') {
Leaf.showInfoMessage("提示", "直租业务不能选择首付款抵扣");
setTimeout(function () {
$(prj_project_ds_id).getAt(0).set('payment_deduction', null);
$(prj_project_ds_id).getAt(0).set('payment_deduction_n', null);
}, 10);
}
}
if (name == "bp_id_tenant" && value) {
//根据承租人查找该承租人的历史合同信息
......@@ -829,6 +878,28 @@
});
}
//add by niminmin
//当“二次租赁”字段选择‘是’时,“回购合同编号”字段为必填。当选择‘否’时,“回购合同编号”字段为只读。
if (name == 'secondary_lease') {
if (value == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (value == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
if (score_ds_id == ds.id) {
if (name == 'bp_birth' && value) {
......
......@@ -29,7 +29,6 @@
<!-- <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>-->
<script type="text/javascript"><![CDATA[
function open_project_modify_win(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
var project_status = record.get('project_status');
......
......@@ -131,14 +131,14 @@
<a:field name="workflow_code"/>
</a:fields>
</a:dataSet>
<a:dataSet id="batch_workflow_ds" autoQuery="true" fetchAll="false" model="zjwfl.zj_wfl_workflow" queryDataSet="batch_workflow_query_ds" queryUrl="${/request/@context_path}/autocrud/zjwfl.zj_wfl_workflow/query?enabled_flag=Y" selectable="true" submitUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.wfl_workflow_deliver_batch/batch_update">
<a:dataSet id="batch_workflow_ds" autoQuery="true" pageSize="5" fetchAll="false" model="zjwfl.zj_wfl_workflow" queryDataSet="batch_workflow_query_ds" queryUrl="${/request/@context_path}/autocrud/zjwfl.zj_wfl_workflow/query?enabled_flag=Y" selectable="true" submitUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.wfl_workflow_deliver_batch/batch_update">
<a:events>
<a:event name="submitsuccess" handler="onSuccess"/>
</a:events>
</a:dataSet>
<a:dataSet id="workflow_ds" autoQuery="true" fetchAll="true" model="zjwfl.zj_wfl_workflow_dilever" queryUrl="${/request/@context_path}/autocrud/zjwfl.zj_wfl_workflow/query?ORDER_FIELD=w.workflow_code,t.date_from" selectable="true"/>
<a:dataSet id="wfl_workflow_deliver_create_query_ds" autoCreate="true" model="zjwfl.WFL2110.zj_wfl_workflow_deliver_query"/>
<a:dataSet id="wfl_workflow_deliver_create_ds" autoQuery="true" fetchAll="false" model="zjwfl.WFL2110.zj_wfl_workflow_deliver_query" queryDataSet="wfl_workflow_deliver_create_query_ds" queryUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.zj_wfl_workflow_deliver_query/query?ORDER_FIELD=z.workflow_desc,t.date_from" selectable="true" submitUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.wfl_workflow_deliver_modify/batch_update">
<a:dataSet id="wfl_workflow_deliver_create_ds" autoQuery="true" pageSize="5" fetchAll="false" model="zjwfl.WFL2110.zj_wfl_workflow_deliver_query" queryDataSet="wfl_workflow_deliver_create_query_ds" queryUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.zj_wfl_workflow_deliver_query/query?ORDER_FIELD=z.workflow_desc,t.date_from" selectable="true" submitUrl="${/request/@context_path}/autocrud/zjwfl.WFL2110.wfl_workflow_deliver_modify/batch_update">
<a:fields>
<a:field name="workflow_id" required="true"/>
<a:field name="workflow_desc" displayField="workflow_desc" options="workflow_ds" required="true" returnField="workflow_id" valueField="workflow_id"/>
......@@ -159,7 +159,7 @@
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:tabPanel id="tabpanel" marginHeight="50" marginWidth="30">
<a:tabPanel id="tabpanel" marginHeight="15" marginWidth="30">
<a:tabs>
<a:tab prompt="批量授权">
<a:screenBody>
......@@ -180,7 +180,7 @@
<a:button click="resetWorkFlow" text="HAP_RESET"/>
<a:button click="batchDeliver" text="转交"/>
</a:hBox>
<a:grid bindTarget="batch_workflow_ds" marginHeight="210" marginWidth="60" navBar="true">
<a:grid bindTarget="batch_workflow_ds" marginHeight="247" marginWidth="100" navBar="true">
<a:columns>
<a:column name="workflow_code" prompt="工作流代码" width="200"/>
<a:column name="workflow_desc" prompt="工作流描述" width="300"/>
......@@ -204,7 +204,7 @@
<a:button click="queryWorkCreateFlow" text="HAP_QUERY"/>
<a:button click="resetWorkCreateFlow" text="HAP_RESET"/>
</a:hBox>
<a:grid bindTarget="wfl_workflow_deliver_create_ds" marginHeight="210" marginWidth="60" navBar="true">
<a:grid bindTarget="wfl_workflow_deliver_create_ds" marginHeight="247" marginWidth="100" navBar="true">
<a:toolBar>
<a:button type="add"/>
<a:button type="delete"/>
......
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