Commit ff335add authored by 18083's avatar 18083

营业月结跨月核销及划转提示

parent fad61571
......@@ -4,8 +4,9 @@
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_transaction_interface_pkg.post_interface(p_transaction_id =>${@transaction_id},
p_user_id =>${/session/@user_id},
p_user_id =>${/session/@user_id},
p_err_count =>${@err_count});
end;
]]></bm:update-sql>
......@@ -15,8 +16,11 @@
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
declare
v_transaction_num varchar2(400);
begin
if ${@flag} = 'SUBMIT' then
csh_transaction_interface_pkg.check_operat_flag(p_transaction_id =>${@transaction_id} );
update CSH_TRANSACTION
set confirmed_flag = 'WF_APPROVING'
where transaction_id = ${@transaction_id};
......@@ -27,6 +31,25 @@
end if;
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
Select decode(Count(t1.transaction_id), Count(t1.csh_confirm), 'Y', 'N') As csh_confirm_flag
From (Select t.transaction_date,
t.transaction_id,
(Select c2.transaction_id
From csh_transaction c2
Where c2.transaction_id = t.transaction_id
And nvl(c2.business_monthly_flag, 'N') = 'Y') As csh_confirm
From csh_transaction t
Where t.confirmed_flag in
('ACCAUDITED', 'APPROVED', 'WF_REJECTED', 'WF_APPROVING')
And t.transaction_type not in ('DEPOSIT', 'PAYMENT')
And t.returned_flag not in ('RETURN', 'FULL')
And nvl(t.reversed_flag, 'N') = 'N') t1
Where to_char(t1.transaction_date, 'yyyymm') =
to_char(to_date(${@transaction_date},'yyyy/mm/dd'), 'yyyymm')
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-5-14 下午01:23:36
$Revision: 1.0
$Purpose:
$Author: gaoyang
$Date: 2013-5-14 下午01:23:36
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1"
baseTable="CSH_TRANSACTION">
......@@ -217,6 +217,8 @@
expression="(select nvl(sum(ctr.this_return_amount),0) from csh_transaction_return ctr where ctr.transaction_id = t1.transaction_id and ctr.status = 'APPROVING')"
forInsert="false" forUpdate="false" prompt="审批中退款金额"/>
<!--end-->
<bm:field name="guarantor_name_duty"/>
</bm:fields>
<bm:features>
<f:standard-who/>
......
......@@ -17,6 +17,63 @@
$('${/parameter/@winId}').close();
}
//获取当前日期的上一个月
function getPreMonth(date) {
var arr = date.split('-');
var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份
var day = arr[2]; //获取当前日期的日
var days = new Date(year, month, 0);
days = days.getDate(); //获取当前日期中月的天数
var year2 = year;
var month2 = parseInt(month) - 1;
if (month2 == 0) {
year2 = parseInt(year2) - 1;
month2 = 12;
}
var day2 = day;
var days2 = new Date(year2, month2, 0);
days2 = days2.getDate();
if (day2 > days2) {
day2 = days2;
}
if (month2 < 10) {
month2 = '0' + month2;
}
var t2 = year2 + '-' + month2 + '-' + day2;
return t2;
}
//校验保证金划转是否存在跨月:经济业务发生日与经济业务发生日的前一个月比较 18083 2024/7/15
function check_extend_month(){
var csh_confirm_flag;
var deposit_records = $('deposit_transfer_detail_result_ds').getAll();
var je_date = deposit_records[0].get('je_date');
var last_je_date = getPreMonth(je_date.format('yyyy-mm-dd'));
$L.request({
url: '${/request/@context_path}/autocrud/csh.CSH531N.csh_data_confirm/query',
para: {
transaction_date: last_je_date
},
sync: true,
success: function (res) {
csh_confirm_flag=res.result.record.csh_confirm_flag;
},
error: function () {
},
failure: function () {
},
scope: this,
sync: true,
});
if(csh_confirm_flag =='N'){
return false;
}
return true;
}
function cshdeposit102_transfer_submit() {
if ($('deposit_transfer_detail_result_ds').validate()) {
if($('deposit_transfer_detail_result_ds').isModified()){
......@@ -44,17 +101,30 @@
var trans_record;
trans_record = deposit_records[i];
//划出代理店与划入代理店一致且划出代理店为经租代理店时,提交经租营业本部长审批
var check_flag= false;
if(head_record.get('agent_bp_code')!='D00010027'){
check_flag= true
}else if(head_record.get('agent_bp_code')=='D00010027'){
for (var j = 0; j < deposit_records.length; j++) {
if(head_record.get('agent_bp_code') !=deposit_records[j].get('agent_bp_code')){
var check_flag= true;
break;
}
}
}
var check_flag= true;
// if(head_record.get('agent_bp_code')!='D00010027'){
// check_flag= true
// }else if(head_record.get('agent_bp_code')=='D00010027'){
// for (var j = 0; j < deposit_records.length; j++) {
// if(head_record.get('agent_bp_code') !=deposit_records[j].get('agent_bp_code')){
// var check_flag= true;
// break;
// }
// }
// }
//经营性租赁划转到其他,提交经租副部长审批
if(head_record.get('business_type') == 'LEASEOPERAT'){
check_flag == false;
}
//融租划转到经租,提交经租副部长审批
if(head_record.get('business_type') != 'LEASEOPERAT'){
for(var j= 0; j<deposit_records.length; j++){
if(deposit_records[j].get('business_type') == 'Y' || deposit_records[j].get('business_type') == 'LEASEOPERAT'){
check_flag = false;
break;
}
}
}
if(check_flag){
trans_record.set('review_type', 'REVIEWING');
}else{
......@@ -93,7 +163,14 @@
}
}
if (flag){
Leaf.showConfirm('${l:PROMPT}', '确定提交保证金划转?', function () {
if(!check_extend_month()){
var je_date_year = getPreMonth(deposit_records[0].get('je_date').format('yyyy-mm-dd')).split('-')[0];
var je_date_month = getPreMonth(deposit_records[0].get('je_date').format('yyyy-mm-dd')).split('-')[1];
var promt =je_date_year+'-'+je_date_month+'月营业月结未确认,与当前选择的经济业务发生<br/>日存在跨月,会影响会计凭证日期,确认要提交吗?';
}else{
var promt ='确定提交保证金划转?'
}
Leaf.showConfirm('${l:PROMPT}',promt, function () {
Leaf.Masker.mask($('${/parameter/@winId}').wrap, "正在执行划转。。。");
Leaf.request({
url: $('csh_review_transfer_link_id').getUrl(),
......@@ -117,8 +194,15 @@
}, function () {
Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
}, null, null);
}else{
Leaf.showConfirm('${l:PROMPT}', '是否确认在不同代理店之间进行划转?', function () {
}else{
if(!check_extend_month()){
var je_date_year = getPreMonth(deposit_records[0].get('je_date').format('yyyy-mm-dd')).split('-')[0];
var je_date_month = getPreMonth(deposit_records[0].get('je_date').format('yyyy-mm-dd')).split('-')[1];
var promt =je_date_year+'-'+je_date_month+'月营业月结未确认,与当前选择的经济业务发生<br/>日存在跨月,会影响会计凭证日期,确认要提交吗?';
}else{
var promt ='是否确认在不同代理店之间进行划转?'
}
Leaf.showConfirm('${l:PROMPT}',promt, function () {
Leaf.Masker.mask($('${/parameter/@winId}').wrap, "正在执行划转。。。");
Leaf.request({
url: $('csh_review_transfer_link_id').getUrl(),
......
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