Commit 8517d77f authored by 18083's avatar 18083

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

(cherry picked from commit ff335add)
parent 556c7610
......@@ -31,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>
......@@ -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,13 +101,26 @@
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;
// 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;
}
}
......@@ -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(),
......@@ -118,7 +195,14 @@
Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
}, null, null);
}else{
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(),
......
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