Commit 45bca7e6 authored by xiaochao's avatar xiaochao

【销项发票创建主页面增加核销标记字段及查询条件】

parent edd96704
......@@ -118,7 +118,6 @@
t2.exchange_rate_type,
t2.exchange_rate_quotation,
t2.overdue_status,
t2.write_off_flag,
t2.overdue_max_days,
t1.bp_id_agent_level1,
t1.bp_id_agent_level1_n,
......@@ -128,7 +127,13 @@
t2.billing_status,
t2.cf_status,
t1.business_type,
t1.business_type_desc
t1.business_type_desc,
t2.write_off_flag,
case t2.write_off_flag when 'NOT' then
'未核销'
when 'PARTIAL' then '部分核销'
when 'FULL' then '全部核销'
end as write_off_flag_desc
from cus_acr_invoice_contract_v t1,
con_contract_cashflow t2
where t1.contract_id = t2.contract_id
......@@ -288,7 +293,6 @@
NULL exchange_rate_type,
NULL exchange_rate_quotation,
NULL overdue_status,
NULL write_off_flag,
NULL overdue_max_days,
t1.bp_id_agent_level1,
t1.bp_id_agent_level1_n,
......@@ -298,11 +302,18 @@
NULL billing_status,
NULL cf_status,
t1.business_type,
t1.business_type_desc
from cus_acr_invoice_contract_v t1, acr_invoice_penalty_v t2
t1.business_type_desc,
t3.write_off_flag,
case t3.write_off_flag when 'NOT' then
'未核销'
when 'PARTIAL' then '部分核销'
when 'FULL' then '全部核销'
end as write_off_flag_desc
from cus_acr_invoice_contract_v t1, acr_invoice_penalty_v t2,con_contract_cashflow t3
where t2.contract_id = t1.contract_id
and t1.bp_wfl_status = 'APPROVED'
and t1.invoice_wfl_status = 'APPROVED'
and t3.contract_id = t1.contract_id
and (t1.invoice_method = 'BILLING' or
(t1.invoice_method = 'NO_BILLING' and
t1.contract_status in ('TERMINATE', 'ET', 'REPUR')))
......@@ -396,6 +407,8 @@
<bm:field name="lease_channel"/>
<bm:field name="business_type_desc"/>
<bm:field name="business_type"/>
<bm:field name="write_off_flag"/>
<bm:field name="write_off_flag_desc"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="billing_object_code" queryExpression="vv.billing_object_code = ${@billing_object_code}"/>
......@@ -429,6 +442,7 @@
<bm:query-field name="contract_name" queryExpression="vv.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
<bm:query-field name="document_type" queryExpression="vv.document_type=${@document_type}"/>
<bm:query-field name="business_type" queryExpression="vv.business_type=${@business_type}"/>
<bm:query-field name="write_off_flag" queryExpression="vv.write_off_flag=${@write_off_flag}"/>
<bm:query-field name="contract_status" queryExpression="vv.contract_status = ${@contract_status}"/>
<bm:query-field name="bp_id_agent_level1_n" queryExpression="vv.bp_id_agent_level1 = ${@bp_id_agent_level1}"/>
<!-- <bm:query-field name="bp_id_agent_level1_n" queryExpression="vv.bp_id_agent_level1_n like &apos;%&apos;||${@bp_id_agent_level1_n}||&apos;%&apos;"/>-->
......
......@@ -94,11 +94,13 @@
cf.cf_status cf_status
from acr_invoice_create_tmp t,
con_contract_v con,
con_contract_cashflow_all_v cf
con_contract_cashflow_all_v cf,
cus_acr_invoice_contract_v t1
where t.session_id = ${/session/@session_id}
and t.contract_id = con.contract_id
and t.cashflow_id = cf.cashflow_id
order by con.contract_id,cf.times,t.cf_item
and t1.contract_id = t.contract_id
order by t1.bp_id_agent_level1_n,t1.billing_object_name,con.contract_number,cf.times
]]></bm:query-sql>
</bm:operation>
......
......@@ -87,10 +87,11 @@
t.tax_amount,
'违约金' cf_item_desc,
'融资租赁费' AS product_name
FROM acr_invoice_create_tmp t, con_contract_v con
FROM acr_invoice_create_tmp t, con_contract_v con,cus_acr_invoice_contract_v t1
WHERE t.session_id = ${/session/@session_id}
AND t.contract_id = con.contract_id
ORDER BY con.contract_id, t.cf_item
and t1.contract_id = t.contract_id
ORDER BY t1.bp_id_agent_level1_n,t1.billing_object_name,con.contract_number,t.times
]]></bm:query-sql>
</bm:operation>
......
......@@ -79,7 +79,28 @@
Where v1.code = 'YES_OR_NO'
And v1.code_enabled_flag = 'Y'
And v1.code_value_enabled_flag = 'Y'
and v1.CODE_VALUE = t.is_buyout) is_buyout_n
and v1.CODE_VALUE = t.is_buyout) is_buyout_n,
-- 应收违约金
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id => ccc.cashflow_id,
p_calc_date => decode(${@period_name},to_char(sysdate,'yyyy-mm'),sysdate,to_date(${@last_month_date}, 'yyyy-mm-dd')),
p_user_id => -1,
p_penalty_flag => 'N') as net_penalty_amount,
--已收违约金
case ccc.cf_item
when 1 then
NVL((select sum(csh.write_off_due_amount)
from csh_write_off csh
where csh.cf_item = 9
and csh.cf_type = 9
AND csh.reversed_flag = 'N'
and csh.contract_id = t.contract_id
and csh.times = ccc.times
and csh.period_name = ${@period_name}
),
0)
else
0
end as write_of_penalty_amount
FROM con_contract_cashflow ccc,
con_contract t,
con_contract_lease_item ccli
......@@ -104,7 +125,25 @@
AND trunc(t.transaction_date) <
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd'))),
0)
]]>
AND exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize
a2 WHERE a1.trx_category = 'CONTRACT'
and a1.trx_id = t.contract_id AND trunc(sysdate)
between a1.start_date AND nvl(a1.end_date, trunc(sysdate))
and a1.user_id = a2.owner_user_id AND a1.trx_category = a2.trx_category
AND a2.authorized_user_id = ${/session/@user_id}
AND trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate)))
and not exists (select 1
from exp_emp_assign_e_v ee, hls_bp_master h
where ee.user_id = ${/session/@user_id}
and ee.unit_id = h.unit_id
and h.bp_category = 'AGENT'
AND h.bp_code in('D00000028', 'D00000035', 'D00000016',
'D00000021', 'D00000039', 'D00000025',
'D00000034', 'D00000017', 'D00000018',
'D00000024', 'D00000032', 'D00000009',
'D00000012', 'D00000014', 'D00000015', 'D00000023'))
]]>
</bm:query-sql>
</bm:operation>
......@@ -114,4 +153,7 @@
<!-- <bm:query-field name="journal_date_to" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &lt;= ${@journal_date_to}"/>-->
<!-- <bm:query-field name="bp_id_agent_level1" queryExpression="t.bp_id_agent_level1=${@bp_id_agent_level1}"/>-->
</bm:query-fields>
<!-- <bm:data-filters>-->
<!-- <bm:data-filter enforceOperations="query" expression="exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 WHERE a1.trx_category = 'CONTRACT' and a1.trx_id = t.contract_id AND trunc(sysdate) between a1.start_date AND nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id AND a1.trx_category = a2.trx_category AND a2.authorized_user_id = ${/session/@user_id} AND trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate)))"/>-->
<!-- </bm:data-filters>-->
</bm:model>
......@@ -19,8 +19,9 @@
cus_con_et_pkg.calc_et_date_amount(p_change_req_id =>${@change_req_id},
p_contract_id => ${@contract_id},
p_et_date => TO_DATE(${@termination_date},'yyyy-mm-dd'),
p_ET_FEE => ${@et_fee},
p_ET_FEE => ${@et_fee},
p_et_interest_rate => ${@et_interest_rate},
p_et_total_amount => ${@et_total_amount},
p_et_due_amount => ${@et_due_amount},
p_overdue_amount => ${@overdue_amount},
......@@ -30,7 +31,9 @@
p_sum_unreceived_principal => ${@sum_unreceived_principal},
p_fund_possession_rate=>${@fund_possession_rate},
p_last_rent_due_date=>${@last_rent_due_date},
p_residual_value=>${@residual_value},
p_user_id => ${/session/@user_id});
END;
]]>
......
......@@ -169,7 +169,19 @@
t.bp_id_tenant = b.bp_id(+) AND
dt.document_type(+) = t.document_type
and nvl(r.simulation_flag,'N')='N'
order by r.change_req_number
order by DECODE(r.req_status,
'NEW',
'1',
'APPROVING',
'2',
'APPROVED',
'3',
'REJECT',
'4',
'CANCEL',
'5'),
r.creation_date desc,
r.change_req_number
) t1 #WHERE_CLAUSE# #ORDER_BY_CLAUSE#
]]></bm:query-sql>
......
......@@ -264,12 +264,23 @@
<a:record code_value="LEASEBACK" code_value_name="售后回租"/>
</a:datas>
</a:dataSet>
<a:dataSet id="write_off_flag_ds">
<a:datas>
<a:record code_value="NOT" code_value_name="未核销"/>
<a:record code_value="PARTIAL" code_value_name="部分核销"/>
<a:record code_value="FULL" code_value_name="全部核销"/>
</a:datas>
</a:dataSet>
<a:dataSet id="allConditionDs" autoCreate="true">
<a:fields>
<a:field name="business_type"/>
<a:field name="bill_object_bp_class"/>
<a:field name="business_type_desc" displayField="code_value_name" options="business_type_desc_ds"
returnField="business_type" valueField="code_value"/>
<a:field name="write_off_flag_desc" displayField="code_value_name" options="write_off_flag_ds"
returnField="write_off_flag" valueField="code_value"/>
<a:field name="object_taxpayer_type_desc" displayField="code_value_name" options="taxpayer_type_ds"
returnField="object_taxpayer_type" valueField="code_value"/>
<a:field name="bill_object_bp_class_desc" displayField="code_value_name" options="acr510_bp_class"
......@@ -367,6 +378,7 @@
<a:field name="con_search_term_1"/>
<a:field name="prj_search_term_2"/>
<a:field name="con_search_term_2"/>
<a:field name="document_type_desc" displayField="description" options="acr510_document_type_name_ds"
returnField="document_type" valueField="document_type"/>
<!--
......@@ -451,7 +463,9 @@
<a:datePicker name="last_received_date_to" bindTarget="allConditionDs" prompt="收款日期到"/>
<a:lov name="bp_id_agent_level1_n" bindTarget="allConditionDs" prompt="代理店"/>
<a:comboBox name="bill_object_bp_class_desc" bindTarget="allConditionDs" prompt="商业伙伴分类"/>
</a:hBox>
<a:hBox>
<a:comboBox name="write_off_flag_desc" bindTarget="allConditionDs" prompt="核销标识"/>
</a:hBox>
<!-- <a:formBody column="4" labelWidth="400">
<a:lov name="contract_number_from" bindTarget="allConditionDs" prompt="HLS.CONTRACT_NUMBER_FROM"/>
......@@ -516,6 +530,7 @@
<a:column name="exchange_rate" align="right" width="80"/>
<a:column name="exchange_rate_type_desc" width="100"/> -->
<a:column name="bill_object_bp_class_desc" width="100" align="center" prompt="商业伙伴分类" />
<a:column name="write_off_flag_desc" width="100" align="center" prompt="核销标记" />
</a:columns>
</a:grid>
......
......@@ -97,7 +97,7 @@
}
if (name == 'attachment') {
if (record.get('paid_byother_flag') == 'T') {
if (record.get('guarantor_name_duty') != 'Y' || record.get('guarantor_name_duty') != 'NULL'){
if (record.get('guarantor_name_duty') != 'Y' || record.get('guarantor_name_duty') == 'NULL'){
return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>';
}
}
......
......@@ -97,7 +97,7 @@
}
if (name == 'attachment') {
if (record.get('paid_byother_flag') == 'T') {
if (record.get('guarantor_name_duty') != 'Y' || record.get('guarantor_name_duty') != 'NULL'){
if (record.get('guarantor_name_duty') != 'Y' || record.get('guarantor_name_duty') == 'NULL'){
return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>';
}
}
......
......@@ -110,11 +110,17 @@
Leaf.request({
url: $('con_et001_calc_et_date_amount_link').getUrl(),
para: {
/****/
change_req_id: record.get('change_req_id'),
/**合同id**/
contract_id: record.get('contract_id'),
/**提前结清日**/
termination_date: value,
/**提前结清手续费**/
et_fee: record.get('et_fee') || 0,
/**提前结清利率**/
et_interest_rate: record.get('et_interest_rate'),
/**留购价**/
residual_value: record.get('residual_value')
},
success: function (res) {
......
......@@ -625,7 +625,13 @@
}
}
}
if (name == 'bp_name'){
// alert(record.get('bp_name')+'2222');
record.set('invoice_title',record.get('bp_name'));
}else if (name == 'social_code'){
// alert(record.get('social_code')+'2222');
record.set('tax_registry_num',record.get('social_code'));
}
}
......
......@@ -482,6 +482,11 @@
if (name == 'bp_name' && value) {
new_bp_name = record.get('bp_name');
record.set('invoice_title',record.get('bp_name'));
}
if (name == 'social_code'){
record.set('tax_registry_num',record.get('social_code'));
}
if (name == 'agent_type') {
......
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