Commit b6c1695b authored by Darming's avatar Darming

Merge branch 'feature/write_off_ref' into develop

parents d6a94bea ead7c2b8
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</bm:primary-key> </bm:primary-key>
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id} and t1.posted_flag=&apos;Y&apos; and t1.reversed_flag=&apos;N&apos; and write_off_flag&lt;&gt; &apos;FULL&apos; and returned_flag not in ( &apos;FULL&apos;,&apos;RETURN&apos;) and t1.transaction_type in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;) and (nvl(t1.returned_amount, 0)+nvl(t1.write_off_amount, 0)&lt;t1.transaction_amount)) "/> <bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id} and t1.posted_flag=&apos;Y&apos; and t1.reversed_flag=&apos;N&apos; and write_off_flag&lt;&gt; &apos;FULL&apos; and returned_flag not in ( &apos;FULL&apos;,&apos;RETURN&apos;) and t1.transaction_type in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;) and (nvl(t1.returned_amount, 0)+nvl(t1.write_off_amount, 0)&lt;t1.transaction_amount)) "/>
<bm:data-filter name="query" expression="(t1.confirmed_flag=&apos;APPROVED&apos; and t1.write_off_flag in(&apos;NOT&apos;,&apos;PARTIAL&apos;))"/> <bm:data-filter name="query" expression="(t1.confirmed_flag=&apos;ACCAUDITED&apos; and t1.write_off_flag in(&apos;NOT&apos;,&apos;PARTIAL&apos;))"/>
</bm:data-filters> </bm:data-filters>
<bm:query-fields> <bm:query-fields>
<bm:query-field field="confirmed_flag" queryExpression="t1.confirmed_flag =${@confirmed_flag}"/> <bm:query-field field="confirmed_flag" queryExpression="t1.confirmed_flag =${@confirmed_flag}"/>
......
...@@ -16,7 +16,15 @@ ...@@ -16,7 +16,15 @@
<bm:operation name="execute"> <bm:operation name="execute">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
update CSH_TRANSACTION set confirmed_flag = 'WF_APPROVING' where transaction_id = ${@transaction_id}; if ${@flag} = 'SUBMIT' then
update CSH_TRANSACTION
set confirmed_flag = 'WF_APPROVING'
where transaction_id = ${@transaction_id};
elsif ${@flag} = 'RETURN' then
update CSH_TRANSACTION
set confirmed_flag = 'WF_REJECTED'
where transaction_id = ${@transaction_id};
end if;
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
......
...@@ -877,7 +877,7 @@ ...@@ -877,7 +877,7 @@
<a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/> <a:column name="user_desc" prompt="HLS.DOCUMENT_CREATED_BY" align="center"/>
<!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER"--> <!-- <a:column name="debt_confirmed_by_desc" prompt="CSH510.CSH_TRANSACTION.DEPT_CONFIRMER"-->
<!-- align="center"/>--> <!-- align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" <a:column name="acc_confirmed_by_desc" prompt="收款确认人"
align="center"/> align="center"/>
</a:columns> </a:columns>
</a:grid> </a:grid>
......
...@@ -33,38 +33,25 @@ ...@@ -33,38 +33,25 @@
if ('${/parameter/@advanceDisplayFlag}' == 'Y') { if ('${/parameter/@advanceDisplayFlag}' == 'Y') {
document.getElementById('write_off_advance').style.display = 'block'; document.getElementById('write_off_advance').style.display = 'block';
} }
if ('${/parameter/@readOnly}' == 'Y') { if ('${/parameter/@readOnly}' == 'Y') {
$('csh_grid_add_bt').setVisible(false); $('csh_grid_add_bt').setVisible(false);
$('csh_grid_delete_bt').setVisible(false); $('csh_grid_delete_bt').setVisible(false);
// $('csh_grid_deposit_add_bt').setVisible(false);
// $('csh_grid_deposit_delete_bt').setVisible(false);
// $('csh_grid_advanced_add_bt').setVisible(false);
// $('csh_grid_advanced_delete_bt').setVisible(false);
$('csh_write_off_grid').hideColumn('left_amount'); $('csh_write_off_grid').hideColumn('left_amount');
$('csh_write_off_grid').hideColumn('left_principal'); $('csh_write_off_grid').hideColumn('left_principal');
$('csh_write_off_grid').hideColumn('left_interest'); $('csh_write_off_grid').hideColumn('left_interest');
$('csh_write_off_grid').hideColumn('unreceived_amount'); $('csh_write_off_grid').hideColumn('unreceived_amount');
if ('${/parameter/@interfaceQueryFlag}' == 'N') { if ('${/parameter/@interfaceQueryFlag}' == 'N') {
$('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}'); $('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}');
$('csh_write_off_interface_ds').query(); $('csh_write_off_interface_ds').query();
}else{
if ('${/parameter/@approval_flag}' == 'Y') {
$('csh531n_write_off_btn_id').setVisible(true);
} else {
$('csh531n_write_off_submit_btn_id').setVisible(true);
}
} }
} else { if ('${/parameter/@approval_flag}' == 'Y') {
if ('${/parameter/@interfaceQueryFlag}' == 'N') { $('csh531n_write_off_btn_id').setVisible(true);
if ('${/parameter/@approval_flag}' == 'Y') { $('csh531n_write_off_return_btn_id').setVisible(true);
$('csh531n_write_off_btn_id').setVisible(true);
} else {
$('csh531n_write_off_submit_btn_id').setVisible(true);
}
} }
$('csh511_save_all_id').setVisible(true); } else {
// $('csh511_save_all_id').setVisible(true);
$('csh531n_write_off_submit_btn_id').setVisible(true);
} }
} }
...@@ -363,11 +350,70 @@ ...@@ -363,11 +350,70 @@
} }
} }
function csh531n_write_off_return() {
$('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
$('csh531n_write_off_return_btn_id').disable();
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('csh531n_submit_link_id').getUrl(),
para: {
transaction_id: record.get('transaction_id'),
flag: 'RETURN'
},
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_return_btn_id').enable();
$('${/parameter/@winid}').close();
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_return_btn_id').enable();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_return_btn_id').enable();
},
scope: this
});
}
function csh531_submitsuccess(ds) { function csh531_submitsuccess(ds) {
ds.query(); $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('csh531n_submit_link_id').getUrl(),
para: {
transaction_id: record.get('transaction_id'),
flag: 'SUBMIT'
},
success: function () {
// Leaf.SideBar.show({
// msg: '操作成功',
// duration: 2000
// });
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
$('${/parameter/@winid}').close();
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
},
scope: this
});
// ds.query();
} }
function csh531_submitfailed(ds) { function csh531_submitfailed(ds) {
} }
function compareDate(start, end) { function compareDate(start, end) {
...@@ -431,10 +477,11 @@ ...@@ -431,10 +477,11 @@
function csh511_save_all() { function csh511_save_all() {
if (checkAmount()) { if (checkAmount()) {
$('csh_write_off_interface_ds').submit();
$('csh_transaction_deposit_ds').submit(); $('csh_transaction_deposit_ds').submit();
$('csh_transaction_advanced_ds').submit(); $('csh_transaction_advanced_ds').submit();
$('csh_write_off_interface_ds').submit();
} }
$('csh531n_write_off_submit_btn_id').enable();
} }
function checkAmount(type) { function checkAmount(type) {
...@@ -526,17 +573,16 @@ ...@@ -526,17 +573,16 @@
var interfaceRs = $('csh_write_off_interface_ds').getAll(); var interfaceRs = $('csh_write_off_interface_ds').getAll();
var depositRs = $('csh_transaction_deposit_ds').getAll(); var depositRs = $('csh_transaction_deposit_ds').getAll();
var advancedRs = $('csh_transaction_advanced_ds').getAll(); var advancedRs = $('csh_transaction_advanced_ds').getAll();
debugger;
var allRs = [...interfaceRs, ...depositRs, ...advancedRs]; var allRs = [...interfaceRs, ...depositRs, ...advancedRs];
var sum = 0; var sum = 0;
for (var i = 0; i < allRs.length; i++) { for (var i = 0; i < allRs.length; i++) {
if (allRs[i].dirty) { // if (allRs[i].dirty) {
Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行提交操作!"); // Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行提交操作!");
return; // return;
} // }
sum += allRs[i].get('write_off_amount') || 0; sum += allRs[i].get('write_off_amount') || 0;
} }
...@@ -546,33 +592,8 @@ ...@@ -546,33 +592,8 @@
} }
Leaf.showConfirm('提示', '确认提交复核吗', function () { Leaf.showConfirm('提示', '确认提交复核吗', function () {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
$('csh531n_write_off_submit_btn_id').disable(); $('csh531n_write_off_submit_btn_id').disable();
Leaf.Masker.mask(Ext.getBody()); csh511_save_all();
Leaf.request({
url: $('csh531n_submit_link_id').getUrl(),
para: {
transaction_id: record.get('transaction_id')
},
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
$('${/parameter/@winid}').close();
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
$('csh531n_write_off_submit_btn_id').enable();
},
scope: this
});
}); });
} }
...@@ -724,10 +745,13 @@ ...@@ -724,10 +745,13 @@
</a:dataSets> </a:dataSets>
<a:screenBody> <a:screenBody>
<a:screenTopToolbar> <a:screenTopToolbar>
<a:gridButton id="csh511_save_all_id" click="csh511_save_all" style="margin-left:20px;display:none" <a:screenTitle/>
text="暂存"/> <!-- <a:gridButton id="csh511_save_all_id" click="csh511_save_all" style="margin-left:20px;display:none"-->
<!-- text="暂存"/>-->
<a:gridButton id="csh531n_write_off_btn_id" click="csh531n_write_off" <a:gridButton id="csh531n_write_off_btn_id" click="csh531n_write_off"
style="margin-left:10px;display:none" text="确认核销"/> style="margin-left:10px;display:none" text="确认核销"/>
<a:gridButton id="csh531n_write_off_return_btn_id" click="csh531n_write_off_return"
style="margin-left:10px;display:none" text="核销退回"/>
<a:gridButton id="csh531n_write_off_submit_btn_id" click="csh531n_write_off_submit" <a:gridButton id="csh531n_write_off_submit_btn_id" click="csh531n_write_off_submit"
style="margin-left:10px;display:none" text="提交复核"/> style="margin-left:10px;display:none" text="提交复核"/>
</a:screenTopToolbar> </a:screenTopToolbar>
......
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