Commit 0dfcad73 authored by 38823's avatar 38823

经租销项发票层面解决冲突

parent 822519a6
...@@ -101,8 +101,8 @@ ...@@ -101,8 +101,8 @@
(select i.description (select i.description
from hls_cashflow_item i from hls_cashflow_item i
where i.cf_item = cf.cf_item) as cf_item_desc, where i.cf_item = cf.cf_item) as cf_item_desc,
decode(con.division,95,'*经营租赁*'||'租赁费'||'('||to_char(cf.due_date,'MM')||'月'||')',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费')) as product_name, decode(con.contract_number,'HLL23120001','租赁费',decode(con.division,95,'*经营租赁*'||'租赁费'||'('||to_char(cf.due_date,'MM')||'月'||')',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费'))) as product_name,
decode(con.division,95,'*经营租赁*'||'租赁费'||'('||to_char(cf.due_date,'MM')||'月'||')',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费')) as product_name_desc, decode(con.contract_number,'HLL23120001','租赁费',decode(con.division,95,'*经营租赁*'||'租赁费'||'('||to_char(cf.due_date,'MM')||'月'||')',decode(t.cf_item,250,'融资租赁挖掘机','融资租赁费'))) as product_name_desc,
con.contract_status contract_status, con.contract_status contract_status,
cf.cf_status cf_status, cf.cf_status cf_status,
t.invoice_kind_type, t.invoice_kind_type,
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
t.cf_item, t.cf_item,
t.tax_amount, t.tax_amount,
'违约金' cf_item_desc, '违约金' cf_item_desc,
decode(con.division,95,'*经营租赁*'||t.due_amount||'('||to_char((SELECT cf.transaction_date FROM hls_journal_detail cf WHERE cf.journal_line_id = t.journal_line_id),'MM')||')','融资租赁费') as product_name, decode(con.division,95,'*经营租赁*'||'租赁费'||'('||to_char((SELECT cf.transaction_date FROM hls_journal_detail cf WHERE cf.journal_line_id = t.journal_line_id),'MM')||'月'||')','融资租赁费') as product_name,
decode(con.division,95,'高空作业平台','') as pur_model, decode(con.division,95,'高空作业平台','') as pur_model,
decode(con.division,95,'台','') as pur_unit, decode(con.division,95,'台','') as pur_unit,
con.business_type, con.business_type,
......
...@@ -179,7 +179,6 @@ ...@@ -179,7 +179,6 @@
<bm:query-field name="bp_code" queryExpression="t1.bp_code = ${@bp_code}"/> <bm:query-field name="bp_code" queryExpression="t1.bp_code = ${@bp_code}"/>
<bm:query-field name="journal_month" queryExpression="t1.journal_month = ${@journal_month}"/> <bm:query-field name="journal_month" queryExpression="t1.journal_month = ${@journal_month}"/>
<bm:query-field name="paid_byother_flag_n" queryExpression="t1.paid_byother_flag = ${@paid_byother_flag}"/> <bm:query-field name="paid_byother_flag_n" queryExpression="t1.paid_byother_flag = ${@paid_byother_flag}"/>
<bm:query-field name="product_name_n" queryExpression="t1.product_name_n = ${@product_name_n}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/> <bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
//add by gzj 售后回租只能开普票 //add by gzj 售后回租只能开普票
var business_type= selectedDs[i].get('business_type'); var business_type= selectedDs[i].get('business_type');
var kind_type=selectedDs[i].get('invoice_kind_type'); var kind_type=selectedDs[i].get('invoice_kind_type');
if(business_type=='LEASEBACK'&&(kind_type!='PAPER_GENERAL'&&kind_type!='ELECTRONIC_GENERAL')){ if(business_type=='LEASEBACK'&&(kind_type!='PAPER_GENERAL'&&kind_type!='ELECTRONIC_GENERAL'&&kind_type!='RECEIPT')){
Leaf.showMessage("提示","售后回租只能开普通发票!"); Leaf.showMessage("提示","售后回租只能开普通发票!");
return; return;
} }
...@@ -122,8 +122,7 @@ ...@@ -122,8 +122,7 @@
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
}, },
scope: this, scope: this
sync: true
}); });
},function (){ },function (){
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
...@@ -186,7 +185,6 @@ ...@@ -186,7 +185,6 @@
<a:dataSet id="invoiceKindDs"> <a:dataSet id="invoiceKindDs">
<a:datas dataSource="/model/acr512_invoice_kind_type"/> <a:datas dataSource="/model/acr512_invoice_kind_type"/>
</a:dataSet> </a:dataSet>
<a:dataSet id="product_name_ds" lookupCode="ACR510_PRODUCT_NAME"/>
<a:dataSet id="headDs" autoCreate="true"> <a:dataSet id="headDs" autoCreate="true">
<a:fields> <a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/> <a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
...@@ -199,9 +197,7 @@ ...@@ -199,9 +197,7 @@
<a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true" model="acr.ACR510.acr_invoice_create" selectable="true"> <a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true" model="acr.ACR510.acr_invoice_create" selectable="true">
<a:fields> <a:fields>
<a:field name="billing_amount" required="true"/> <a:field name="billing_amount" required="true"/>
<!-- <a:field name="product_name" required="true"/>--> <a:field name="product_name" required="true"/>
<a:field name="product_name" displayField="code_value_name" options="product_name_ds" returnField="p_name" valueField="code_value"/>
<!--<a:field name="invoice_kind"/> <!--<a:field name="invoice_kind"/>
<a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs" required="true" returnField="invoice_kind" valueField="code_value"/>--> <a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs" required="true" returnField="invoice_kind" valueField="code_value"/>-->
<a:field name="invoice_kind_type"/> <a:field name="invoice_kind_type"/>
...@@ -264,7 +260,6 @@ ...@@ -264,7 +260,6 @@
<a:textField id="selectedDs_grid_model_tf"/> <a:textField id="selectedDs_grid_model_tf"/>
<a:textField id="selectedDs_grid_unit_tf"/> <a:textField id="selectedDs_grid_unit_tf"/>
<a:comboBox id="selectedDs_grid_editor_tf_box"/> <a:comboBox id="selectedDs_grid_editor_tf_box"/>
<a:numberField id="selectedDs_grid_editor_nf"/>
</a:editors> </a:editors>
</a:grid> </a:grid>
</a:tab> </a:tab>
......
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
} }
function contractDs_grid_add() { function contractDs_grid_add() {
$('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds') $('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds').create());
.create());
} }
function invoiceHd_close() { function invoiceHd_close() {
...@@ -287,7 +286,7 @@ ...@@ -287,7 +286,7 @@
<a:dataSet id="acr510n_invoice_type_ds"> <a:dataSet id="acr510n_invoice_type_ds">
<a:datas> <a:datas>
<a:record code_value="ECT" code_value_name="电子发票"/> <a:record code_value="ECT" code_value_name="电子发票"/>
<a:record code_value="PAPER" code_value_name="纸质发票"/> <a:record code_value="PAPER" code_value_name="数电纸质发票"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
<a:dataSet id="acr510n_division_ds"> <a:dataSet id="acr510n_division_ds">
...@@ -297,9 +296,12 @@ ...@@ -297,9 +296,12 @@
<a:record code_value="30" code_value_name="高空作业车"/> <a:record code_value="30" code_value_name="高空作业车"/>
<a:record code_value="40" code_value_name="其它"/> <a:record code_value="40" code_value_name="其它"/>
<a:record code_value="50" code_value_name="星邦高空作业车"/> <a:record code_value="50" code_value_name="星邦高空作业车"/>
<a:record code_value="90" code_value_name="租赁二手机"/> <a:record code_value="90" code_value_name="租赁二手机(日立)"/>
<a:record code_value="91" code_value_name="神钢建机"/> <a:record code_value="91" code_value_name="神钢建机"/>
<a:record code_value="92" code_value_name="北京心诚"/> <a:record code_value="92" code_value_name="北京心诚"/>
<a:record code_value="99" code_value_name="工程机械"/>
<a:record code_value="80" code_value_name="叉车"/>
<a:record code_value="70" code_value_name="二手机业务"/>
<a:record code_value="95" code_value_name="经租设备"/> <a:record code_value="95" code_value_name="经租设备"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
......
...@@ -301,100 +301,25 @@ ...@@ -301,100 +301,25 @@
} }
function acr512_invoice_insert() { function acr512_invoice_insert() {
var records = $('acr512_invoice_result_ds').getSelected(); var fl_ds = $('acr512_invoice_result_ds');
if (records.length < 1) { var fl_records = $('acr512_invoice_result_ds').getSelected();
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!'); var op_ds = $('acr512_invoice_op_result_ds');
return; var op_records = $('acr512_invoice_op_result_ds').getSelected();
if(fl_records == ''){
var records = op_records;
var result_ds = op_ds;
}else {
records = fl_records;
result_ds = fl_ds;
} }
var datas = {}; if(fl_records!='' && op_records!=''){
var saveData = []; $L.showErrorMessage("提示",'请勾选同一业务类型的单据进行新建申请操作!');
var invoice_hd_ids = ''; return;
var invoice_kind = records[0].get('invoice_kind');
var invoice_type = records[0].get('invoice_type');
var invoice_kind_type = records[0].get('invoice_kind_type');
var full_elec_invoice_flag = records[0].get('full_elec_invoice_flag');
for (var i = 0; i < records.length; i++) {
var invoice_status = records[i].get('invoice_status');
if (invoice_status != 'NEW' && invoice_status != 'REJECT') {
$L.showErrorMessage("提示", '发票状态有误!');
return;
}
if(invoice_kind != records[i].get('invoice_kind')){
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
if(invoice_kind_type != records[i].get('invoice_kind_type')){
$L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!');
return;
}
if(full_elec_invoice_flag != records[i].get('full_elec_invoice_flag')){
$L.showErrorMessage("提示", '全电发票与非全电发票不能同时勾选!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
invoice_hd_ids = invoice_hd_ids + ',' + records[i].get('invoice_hd_id');
}
records[i].set('_status', 'update');
saveData.push(records[i].data);
} }
saveData.sort(function (a, b) {
return a.invoice_hd_id - b.invoice_hd_id;
});
datas['invoice_hd_ids'] = invoice_hd_ids;
datas['apply_mode'] = 'APPLY';
datas['details'] = saveData;
Leaf.showConfirm('提示', '<span style="color: #ff0000; ">发票在申请期间将无法进行修改操作!如需要取消发票申请,请点击取消申请!</span>', function () {
lock_current_window();
Leaf.request({
url: $('acr512_update_for_submit_id').getUrl(),
para: datas,
success: function (res) {
Leaf.SideBar.show({
msg: '申请成功',
duration: 3000
});
unlock_current_window();
//$('acr512_invoice_result_ds').query();
var win = new Leaf.Window({
id: 'acr_invoice_apply_detail_link_winid',
params: {
invoice_apply_id: res.result.invoice_apply_id,
winId: 'acr_invoice_apply_detail_link_winid'
},
url: $('acr_invoice_apply_detail_link').getUrl(),
title: '申请明细',
fullScreen: true
});
win.on('close',function(){
$('acr512_invoice_result_ds').query();
});
},
failure: function () {
unlock_current_window();
},
error: function () {
unlock_current_window();
},
scope: this
});
});
}
function acr512_op_invoice_insert() {
debugger;
var records = $('acr512_invoice_op_result_ds').getSelected();
var description = records[0].data.description.length;
if (records.length < 1) { if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!'); Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return; return;
} }
if(description > 230){
Leaf.showMessage('${l:HLS.PROMPT}', '单据编号为'+records[0].data.document_number+'的发票说明字段超出230个字符,请调整!');
return;
}
var datas = {}; var datas = {};
var saveData = []; var saveData = [];
var invoice_hd_ids = ''; var invoice_hd_ids = '';
...@@ -409,8 +334,14 @@ ...@@ -409,8 +334,14 @@
return; return;
} }
if(invoice_kind != records[i].get('invoice_kind')){ if(invoice_kind != records[i].get('invoice_kind')){
$L.showErrorMessage("提示", '普票和专票不能同时勾选!'); if(invoice_kind=='RECEIPT' || records[i].get('invoice_kind')=='RECEIPT'){
return; $L.showErrorMessage("提示", '收据和其它发票不能同时勾选!');
return;
}else{
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
} }
if(invoice_kind_type != records[i].get('invoice_kind_type')){ if(invoice_kind_type != records[i].get('invoice_kind_type')){
$L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!'); $L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!');
...@@ -420,6 +351,7 @@ ...@@ -420,6 +351,7 @@
$L.showErrorMessage("提示", '全电发票与非全电发票不能同时勾选!'); $L.showErrorMessage("提示", '全电发票与非全电发票不能同时勾选!');
return; return;
} }
if (invoice_hd_ids == '') { if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id'); invoice_hd_ids = records[i].get('invoice_hd_id');
} else { } else {
...@@ -458,7 +390,7 @@ ...@@ -458,7 +390,7 @@
fullScreen: true fullScreen: true
}); });
win.on('close',function(){ win.on('close',function(){
$('acr512_invoice_op_result_ds').query(); result_ds.query();
}); });
}, },
failure: function () { failure: function () {
...@@ -471,7 +403,6 @@ ...@@ -471,7 +403,6 @@
}); });
}); });
} }
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets> <a:dataSets>
...@@ -574,8 +505,7 @@ ...@@ -574,8 +505,7 @@
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/> <a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/> <a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>--> <!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="融租新建申请"/> <a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<a:toolbarButton click="acr512_op_invoice_insert" text="经租新建申请"/>
<!-- <!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/> <a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
--> -->
......
...@@ -231,11 +231,11 @@ ...@@ -231,11 +231,11 @@
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}'); Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return; return;
} }
if ('TRANSFERED' == records[i].get('vat_interface_status')) { // if ('TRANSFERED' == records[i].get('vat_interface_status')) {
$L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!'); // $L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}'); // Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return; // return;
} // }
//不同批次的发票不能同时勾选 //不同批次的发票不能同时勾选
if (invoice_apply_num0 != records[i].get('invoice_apply_num')) { if (invoice_apply_num0 != records[i].get('invoice_apply_num')) {
$L.showInfoMessage("提示", '不同批次的发票不能同时勾选!'); $L.showInfoMessage("提示", '不同批次的发票不能同时勾选!');
...@@ -297,11 +297,11 @@ ...@@ -297,11 +297,11 @@
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}'); Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return; return;
} }
if ('TRANSFERED' == records[i].get('vat_interface_status')) { // if ('TRANSFERED' == records[i].get('vat_interface_status')) {
$L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!'); // $L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}'); // Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return; // return;
} // }
//不同批次的发票不能同时勾选 //不同批次的发票不能同时勾选
if (invoice_apply_num0 != records[i].get('invoice_apply_num')) { if (invoice_apply_num0 != records[i].get('invoice_apply_num')) {
$L.showInfoMessage("提示", '不同批次的发票不能同时勾选!'); $L.showInfoMessage("提示", '不同批次的发票不能同时勾选!');
......
...@@ -96,8 +96,13 @@ ...@@ -96,8 +96,13 @@
} }
//add by lihh 202104262 电子发票发送 //add by lihh 202104262 电子发票发送
function acr516_invoice_send(){ function acr516_invoice_send(){
//debugger; var ds1 = $('acr516_invoice_result_ds');
var ds = $('acr516_invoice_result_ds'); var ds2 = $('acr516_invoice_op_result_ds');
if(ds1.getSelected() == ''){
var ds = ds2;
}else {
ds = ds1;
}
var records = ds.getSelected(); var records = ds.getSelected();
if (records.length == 0) { if (records.length == 0) {
Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350); Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350);
...@@ -109,19 +114,22 @@ ...@@ -109,19 +114,22 @@
Leaf.showMessage('提示','请勾选认领状态为已确认的单据'); Leaf.showMessage('提示','请勾选认领状态为已确认的单据');
return; return;
} }
if(records[i].get('invoice_type') != 'ECT'){ //if(records[i].get('invoice_type') != 'ECT'){
if(records[i].get('invoice_kind_type') != 'ELECTRONIC_GENERAL' && records[i].get('invoice_kind_type') != 'ELECTRONIC_SPECIAL'){
Leaf.showMessage('提示','请勾选电子发票进行发送'); Leaf.showMessage('提示','请勾选电子发票进行发送');
return; return;
} }
if(records[i].get('division') == '70'){ //去掉铁甲业务特殊处理 18083 2022/12/8
if(!r_map.has(records[i].get('bp_id_agent_level1'))){ //if(records[i].get('division') == '70'){
var arr = new Array(); //if(!r_map.has(records[i].get('bp_id_agent_level1'))){
arr.add(records[i].get('invoice_hd_id')); //var arr = new Array();
r_map.set(records[i].get('bp_id_agent_level1'),arr); //arr.add(records[i].get('invoice_hd_id'));
}else{ //r_map.set(records[i].get('bp_id_agent_level1'),arr);
r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id')); //}else{
} //r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id'));
} else if(!r_map.has(records[i].get('invoice_bp_id'))){ //}
//} else
if(!r_map.has(records[i].get('invoice_bp_id'))){
var arr = new Array(); var arr = new Array();
arr.add(records[i].get('invoice_hd_id')); arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('invoice_bp_id'),arr); r_map.set(records[i].get('invoice_bp_id'),arr);
......
...@@ -61,15 +61,17 @@ ...@@ -61,15 +61,17 @@
'invoice_hd_id':records[i].get('invoice_hd_id'), 'invoice_hd_id':records[i].get('invoice_hd_id'),
'_status': 'update' '_status': 'update'
}) })
if(records[i].get('division') == '70'){ //if(records[i].get('division') == '70'){
if(!r_map.has(records[i].get('bp_id_agent_level1'))){ //if(!r_map.has(records[i].get('bp_id_agent_level1'))){
var arr = new Array(); //var arr = new Array();
arr.add(records[i].get('invoice_hd_id')); //arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('bp_id_agent_level1'),arr); //r_map.set(records[i].get('bp_id_agent_level1'),arr);
}else{ //}else{
r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id')); //r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id'));
} //}
} else if(records[i].get('invoice_type') == 'ECT'){ //} else if(records[i].get('invoice_type') == 'ECT'){
if(records[i].get('invoice_kind_type') == 'ELECTRONIC_GENERAL' || records[i].get('invoice_kind_type') == 'ELECTRONIC_SPECIAL'){
if(!r_map.has(records[i].get('invoice_bp_id'))){ if(!r_map.has(records[i].get('invoice_bp_id'))){
var arr = new Array(); var arr = new Array();
arr.add(records[i].get('invoice_hd_id')); arr.add(records[i].get('invoice_hd_id'));
......
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