Commit d013037c authored by Darming's avatar Darming

[refactor] 核销改动

parent d632a0d2
......@@ -16,7 +16,15 @@
<bm:operation name="execute">
<bm:update-sql><![CDATA[
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;
]]></bm:update-sql>
</bm:operation>
......
......@@ -877,7 +877,7 @@
<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"-->
<!-- align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人"
<a:column name="acc_confirmed_by_desc" prompt="收款确认人"
align="center"/>
</a:columns>
</a:grid>
......
......@@ -761,7 +761,7 @@
</a:column>
<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" align="center"/>-->
<a:column name="acc_confirmed_by_desc" prompt="确认人" align="center"/>
<a:column name="acc_confirmed_by_desc" prompt="收款确认人" align="center"/>
</a:columns>
<a:editors>
<a:numberField id="number_editor" allowDecimals="true" decimalPrecision="2" editable="false"/>
......
......@@ -8,7 +8,7 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure>
<a:model-query model="csh.CSH531N.csh_batch_status_default" rootPath="batch_status_default"/>
<a:model-query model="csh.CSH531N.csh_query_position" rootPath="result_position" />
<a:model-query model="csh.CSH531N.csh_query_position" rootPath="result_position"/>
<a:model-query
defaultWhereClause="v.code=&apos;CSH511_TRANSACTION_TYPE&apos; and v.code_value in (&apos;RECEIPT&apos;,&apos;ADVANCE_RECEIPT&apos;)"
fetchAll="true" model="basic.sys_code_default_value" rootPath="sys_code_default_value_path"/>
......@@ -43,6 +43,12 @@
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
var approval_flag = '${/model/result_position/record/@approval_enbale}' || 'N';
if (approval_flag == 'N') {
$('csh531_new_write_off_btn_id').setVisible(true);
}
});
function csh531n_lock_current_window(msg) {
Leaf.Masker.mask(Ext.getBody(), msg);
......@@ -332,27 +338,47 @@
}
function csh531n_open_write_off_detail(id, readOnly) {
function csh531n_open_write_off_detail(id) {
var ds = $('csh531n_sap_bankflow_info_result_ds');
var record = ds.findById(id);
var status = record.get('confirmed_flag');
var write_off_flag = record.get('write_off_flag');
var readOnly = 'N';
var interfaceQueryFlag = 'Y';
var paid_byother_flag = record.get('paid_byother_flag');
var transaction_type = record.get('transaction_type');
var confirmed_flag = record.get('confirmed_flag');
var depositDisplayFlag = 'N';
var advanceDisplayFlag = 'N';
var interfaceQueryFlag = 'N';
var approval_flag = '${/model/result_position/record/@approval_enbale}' || 'N';
if (transaction_type != 'ADVANCE_RECEIPT'){
if (approval_flag == 'Y') {
readOnly = 'Y';
if (status == 'APPROVED') {
interfaceQueryFlag = 'N';
}
} else {
if (write_off_flag == 'FULL') {
readOnly = 'Y';
interfaceQueryFlag = 'N';
} else {
if(status == 'WF_APPROVING'){
readOnly = 'Y';
}
}
}
if (status != 'WF_APPROVING') {
approval_flag = 'N';
}
if (transaction_type != 'ADVANCE_RECEIPT' && transaction_type != 'DEPOSIT') {
advanceDisplayFlag = 'Y';
} else {
if(paid_byother_flag == 'Y'){
if (paid_byother_flag == 'Y') {
depositDisplayFlag = 'Y';
}
}
if (confirmed_flag == 'WF_APPROVING'){
interfaceQueryFlag = 'Y';
}
var approval_flag = '${/model/result_position/record/@approval_enbale}' || 'N';
var win = new Leaf.Window({
id: 'csh_write_off_window',
params: {
......@@ -383,17 +409,10 @@
}
function csh531n_detail_renderer(value, record, name) {
var text = '';
var status = record.get('confirmed_flag');
var write_off_flag = record.get('write_off_flag');
var readOnly = 'N';
if ((status == 'WF_APPROVING' || status == 'WF_APPROVED') && write_off_flag != 'FULL') {
readOnly = 'Y';
}
if (name == 'csh531n_detail') {
return '<a href="Javascript:csh531n_open_write_off_detail(' + record.id + ',\'' + readOnly + '\')">明细</a>';
return '<a href="Javascript:csh531n_open_write_off_detail(\'' + record.id + '\')">明细</a>';
} else if (name == 'transaction_num') {
return '<a href="Javascript:csh531n_open_write_off_detail(' + record.id + ',\'' + readOnly + '\')">' + value + '</a>';
return '<a href="Javascript:csh531n_open_write_off_detail(\'' + record.id + '\')">' + value + '</a>';
}
}
......@@ -456,13 +475,7 @@
function csh531_new_write_off() {
var record = $('csh531n_sap_bankflow_info_result_ds').getSelected()[0];
if (record) {
var write_off_flag = record.get('write_off_flag');
var status = record.get('confirmed_flag');
var readOnly = 'N';
if ((status == 'WF_APPROVING' || status == 'WF_APPROVED') && write_off_flag != 'FULL') {
readOnly = 'Y';
}
csh531n_open_write_off_detail(record.id, readOnly);
csh531n_open_write_off_detail(record.id);
} else {
Leaf.showErrorMessage('提示', '请先选择一条数据');
}
......@@ -531,7 +544,7 @@
<a:map from="bp_name" to="bp_name"/>
</a:mapping>
</a:field>
<a:field name="position_code" defaultValue="${/model/result_position/record/@position_code}" />
<a:field name="position_code" defaultValue="${/model/result_position/record/@position_code}"/>
<a:field name="receipt_type_desc" options="receipt_type_ds" valueField="code_value"
defaultValue="code_value_name" returnField="receipt_type"/>
</a:fields>
......@@ -563,9 +576,9 @@
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="csh531_query" text="HLS.QUERY"/>
<a:gridButton click="csh531_new_write_off" text="新增核销"/>
<!-- <a:gridButton click="csh531_new_reverse_write_off" text="新增反冲"/>-->
<a:gridButton click="csh531_reset" text="重置"/>
<a:gridButton id="csh531_new_write_off_btn_id" hidden="true" click="csh531_new_write_off" text="新增核销"/>
<!-- <a:gridButton click="csh531_new_reverse_write_off" text="新增反冲"/>-->
</a:screenTopToolbar>
<a:form bindTarget="csh_transaction_receipt_write_off_query_ds" style="background:#f7f7f8" labelWidth="250">
<a:fieldSet labelWidth="250" title="HLS.QUERY_TITLE">
......@@ -598,15 +611,16 @@
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="对方账户账号"/>-->
<!-- </a:box>-->
<a:box column="4">
<a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="现金事务编号"/>
<a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_query_ds"
prompt="现金事务编号"/>
<a:lov name="bp_name"
bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="商业伙伴"/>
<!-- <a:comboBox name="status" bindTarget="csh_transaction_receipt_write_off_query_ds"-->
<!-- prompt="单据状态"/>-->
<a:comboBox name="write_off_flag_desc" bindTarget="csh_transaction_receipt_write_off_query_ds"
prompt="核销状态"/>
<!-- <a:comboBox name="collection_classes_desc"-->
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="款项用途"/>-->
<!-- <a:comboBox name="collection_classes_desc"-->
<!-- bindTarget="csh_transaction_receipt_write_off_query_ds" prompt="款项用途"/>-->
</a:box>
</a:fieldSet>
</a:form>
......@@ -635,10 +649,11 @@
<a:column name="transaction_date" renderer="Leaf.formatDate" align="center" lock="true"
prompt="收款日期" width="120"/>
<a:column name="description" prompt="摘要" width="180"/>
<!-- <a:column name="collection_classes_desc" prompt="款项用途" lock="true" align="center"/>-->
<!-- <a:column name="collection_classes_desc" prompt="款项用途" lock="true" align="center"/>-->
<a:column name="bp_name" prompt="商业伙伴" align="left" width="200"/>
<!-- <a:column name="csh531n_detail" renderer="csh531n_detail_renderer" prompt="核销明细" align="center" width="80"/>-->
<a:column name="csh531n_detail" renderer="seedetail_write_off" prompt="核销明细" align="center" width="80"/>
<!-- <a:column name="csh531n_detail" renderer="csh531n_detail_renderer" prompt="核销明细" align="center" width="80"/>-->
<a:column name="csh531n_detail" renderer="seedetail_write_off" prompt="核销明细" align="center"
width="80"/>
<!-- <a:column name="bp_bank_account_name" prompt="对方账户"/>-->
<!-- <a:column name="bp_bank_account_num" prompt="对方账号"/>-->
<!-- <a:column name="description_p" prompt="摘要+用途"/>-->
......@@ -654,7 +669,7 @@
<!-- <a:column name="review_status_desc" prompt="分配状态" width="80"/>-->
<!-- <a:column name="ref_v05" prompt="备注" width="100"/>-->
<a:column name="created_user_name" prompt="制单人" width="120" align="center"/>
<a:column name="confirm_user_name" prompt="确认人" width="120" align="center"/>
<a:column name="confirm_user_name" prompt="核销确认人" width="120" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
......
......@@ -33,38 +33,25 @@
if ('${/parameter/@advanceDisplayFlag}' == 'Y') {
document.getElementById('write_off_advance').style.display = 'block';
}
if ('${/parameter/@readOnly}' == 'Y') {
$('csh_grid_add_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_principal');
$('csh_write_off_grid').hideColumn('left_interest');
$('csh_write_off_grid').hideColumn('unreceived_amount');
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').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/@interfaceQueryFlag}' == 'N') {
if ('${/parameter/@approval_flag}' == 'Y') {
$('csh531n_write_off_btn_id').setVisible(true);
} else {
$('csh531n_write_off_submit_btn_id').setVisible(true);
}
if ('${/parameter/@approval_flag}' == 'Y') {
$('csh531n_write_off_btn_id').setVisible(true);
$('csh531n_write_off_return_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 @@
}
}
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) {
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 compareDate(start, end) {
......@@ -431,10 +477,11 @@
function csh511_save_all() {
if (checkAmount()) {
$('csh_write_off_interface_ds').submit();
$('csh_transaction_deposit_ds').submit();
$('csh_transaction_advanced_ds').submit();
$('csh_write_off_interface_ds').submit();
}
$('csh531n_write_off_submit_btn_id').enable();
}
function checkAmount(type) {
......@@ -526,17 +573,16 @@
var interfaceRs = $('csh_write_off_interface_ds').getAll();
var depositRs = $('csh_transaction_deposit_ds').getAll();
var advancedRs = $('csh_transaction_advanced_ds').getAll();
debugger;
var allRs = [...interfaceRs, ...depositRs, ...advancedRs];
var sum = 0;
for (var i = 0; i < allRs.length; i++) {
if (allRs[i].dirty) {
Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行提交操作!");
return;
}
// if (allRs[i].dirty) {
// Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行提交操作!");
// return;
// }
sum += allRs[i].get('write_off_amount') || 0;
}
......@@ -546,33 +592,8 @@
}
Leaf.showConfirm('提示', '确认提交复核吗', function () {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
$('csh531n_write_off_submit_btn_id').disable();
Leaf.Masker.mask(Ext.getBody());
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
});
csh511_save_all();
});
}
......@@ -724,10 +745,13 @@
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton id="csh511_save_all_id" click="csh511_save_all" style="margin-left:20px;display:none"
text="暂存"/>
<a:screenTitle/>
<!-- <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"
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"
style="margin-left:10px;display:none" text="提交复核"/>
</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