Commit 0dfcad73 authored by 38823's avatar 38823

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

parent 822519a6
......@@ -101,8 +101,8 @@
(select i.description
from hls_cashflow_item i
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.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,
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,
cf.cf_status cf_status,
t.invoice_kind_type,
......
......@@ -98,7 +98,7 @@
t.cf_item,
t.tax_amount,
'违约金' 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_unit,
con.business_type,
......
......@@ -179,7 +179,6 @@
<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="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:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_apply_id = ${@invoice_apply_id}"/>
......
......@@ -74,7 +74,7 @@
//add by gzj 售后回租只能开普票
var business_type= selectedDs[i].get('business_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("提示","售后回租只能开普通发票!");
return;
}
......@@ -122,8 +122,7 @@
Leaf.Masker.unmask(Ext.getBody());
},
scope: this,
sync: true
scope: this
});
},function (){
Leaf.Masker.unmask(Ext.getBody());
......@@ -186,7 +185,6 @@
<a:dataSet id="invoiceKindDs">
<a:datas dataSource="/model/acr512_invoice_kind_type"/>
</a:dataSet>
<a:dataSet id="product_name_ds" lookupCode="ACR510_PRODUCT_NAME"/>
<a:dataSet id="headDs" autoCreate="true">
<a:fields>
<a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
......@@ -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:fields>
<a:field name="billing_amount" 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="product_name" required="true"/>
<!--<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_type"/>
......@@ -264,7 +260,6 @@
<a:textField id="selectedDs_grid_model_tf"/>
<a:textField id="selectedDs_grid_unit_tf"/>
<a:comboBox id="selectedDs_grid_editor_tf_box"/>
<a:numberField id="selectedDs_grid_editor_nf"/>
</a:editors>
</a:grid>
</a:tab>
......
......@@ -54,8 +54,7 @@
}
function contractDs_grid_add() {
$('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds')
.create());
$('contractDs_grid').showEditorByRecord($('ar510n_cashflow_ds').create());
}
function invoiceHd_close() {
......@@ -287,7 +286,7 @@
<a:dataSet id="acr510n_invoice_type_ds">
<a:datas>
<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:dataSet>
<a:dataSet id="acr510n_division_ds">
......@@ -297,9 +296,12 @@
<a:record code_value="30" code_value_name="高空作业车"/>
<a:record code_value="40" 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="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:datas>
</a:dataSet>
......
......@@ -301,100 +301,25 @@
}
function acr512_invoice_insert() {
var records = $('acr512_invoice_result_ds').getSelected();
if (records.length < 1) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
var fl_ds = $('acr512_invoice_result_ds');
var fl_records = $('acr512_invoice_result_ds').getSelected();
var op_ds = $('acr512_invoice_op_result_ds');
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 = {};
var saveData = [];
var invoice_hd_ids = '';
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);
if(fl_records!='' && op_records!=''){
$L.showErrorMessage("提示",'请勾选同一业务类型的单据进行新建申请操作!');
return;
}
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '请选择需要审批的发票!');
return;
}
if(description > 230){
Leaf.showMessage('${l:HLS.PROMPT}', '单据编号为'+records[0].data.document_number+'的发票说明字段超出230个字符,请调整!');
return;
}
var datas = {};
var saveData = [];
var invoice_hd_ids = '';
......@@ -409,8 +334,14 @@
return;
}
if(invoice_kind != records[i].get('invoice_kind')){
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
if(invoice_kind=='RECEIPT' || records[i].get('invoice_kind')=='RECEIPT'){
$L.showErrorMessage("提示", '收据和其它发票不能同时勾选!');
return;
}else{
$L.showErrorMessage("提示", '普票和专票不能同时勾选!');
return;
}
}
if(invoice_kind_type != records[i].get('invoice_kind_type')){
$L.showErrorMessage("提示", '纸质发票与电子发票不能同时勾选!');
......@@ -420,6 +351,7 @@
$L.showErrorMessage("提示", '全电发票与非全电发票不能同时勾选!');
return;
}
if (invoice_hd_ids == '') {
invoice_hd_ids = records[i].get('invoice_hd_id');
} else {
......@@ -458,7 +390,7 @@
fullScreen: true
});
win.on('close',function(){
$('acr512_invoice_op_result_ds').query();
result_ds.query();
});
},
failure: function () {
......@@ -471,7 +403,6 @@
});
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -574,8 +505,7 @@
<a:toolbarButton click="acr512_invoice_reset" text="HLS.RESET"/>
<a:toolbarButton click="acr512_invoice_delete" text="HLS.REMOVE"/>
<!--<a:toolbarButton click="acr512_invoice_submit_selected" text="提交复核"/>-->
<a:toolbarButton click="acr512_invoice_insert" text="融租新建申请"/>
<a:toolbarButton click="acr512_op_invoice_insert" text="经租新建申请"/>
<a:toolbarButton click="acr512_invoice_insert" text="新建申请"/>
<!--
<a:toolbarButton click="acr512_invoice_submit" text="HLS.SUBMIT"/>
-->
......
......@@ -231,11 +231,11 @@
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return;
}
if ('TRANSFERED' == records[i].get('vat_interface_status')) {
$L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return;
}
// if ('TRANSFERED' == records[i].get('vat_interface_status')) {
// $L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
// Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
// return;
// }
//不同批次的发票不能同时勾选
if (invoice_apply_num0 != records[i].get('invoice_apply_num')) {
$L.showInfoMessage("提示", '不同批次的发票不能同时勾选!');
......@@ -297,11 +297,11 @@
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return;
}
if ('TRANSFERED' == records[i].get('vat_interface_status')) {
$L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
return;
}
// if ('TRANSFERED' == records[i].get('vat_interface_status')) {
// $L.showInfoMessage("提示", '所选择的单据中存在已传金税状态,请检查后重试!');
// Leaf.Masker.unmask(detail_mask, '${l:HLS.EXECUTING}');
// return;
// }
//不同批次的发票不能同时勾选
if (invoice_apply_num0 != records[i].get('invoice_apply_num')) {
$L.showInfoMessage("提示", '不同批次的发票不能同时勾选!');
......
......@@ -96,8 +96,13 @@
}
//add by lihh 202104262 电子发票发送
function acr516_invoice_send(){
//debugger;
var ds = $('acr516_invoice_result_ds');
var ds1 = $('acr516_invoice_result_ds');
var ds2 = $('acr516_invoice_op_result_ds');
if(ds1.getSelected() == ''){
var ds = ds2;
}else {
ds = ds1;
}
var records = ds.getSelected();
if (records.length == 0) {
Leaf.showMessage('提示', '请至少勾选一条记录!', null, 350);
......@@ -109,19 +114,22 @@
Leaf.showMessage('提示','请勾选认领状态为已确认的单据');
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('提示','请勾选电子发票进行发送');
return;
}
if(records[i].get('division') == '70'){
if(!r_map.has(records[i].get('bp_id_agent_level1'))){
var arr = new Array();
arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('bp_id_agent_level1'),arr);
}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'))){
//去掉铁甲业务特殊处理 18083 2022/12/8
//if(records[i].get('division') == '70'){
//if(!r_map.has(records[i].get('bp_id_agent_level1'))){
//var arr = new Array();
//arr.add(records[i].get('invoice_hd_id'));
//r_map.set(records[i].get('bp_id_agent_level1'),arr);
//}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'))){
var arr = new Array();
arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('invoice_bp_id'),arr);
......
......@@ -61,15 +61,17 @@
'invoice_hd_id':records[i].get('invoice_hd_id'),
'_status': 'update'
})
if(records[i].get('division') == '70'){
if(!r_map.has(records[i].get('bp_id_agent_level1'))){
var arr = new Array();
arr.add(records[i].get('invoice_hd_id'));
r_map.set(records[i].get('bp_id_agent_level1'),arr);
}else{
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'){
//if(records[i].get('division') == '70'){
//if(!r_map.has(records[i].get('bp_id_agent_level1'))){
//var arr = new Array();
//arr.add(records[i].get('invoice_hd_id'));
//r_map.set(records[i].get('bp_id_agent_level1'),arr);
//}else{
//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'){
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'))){
var arr = new Array();
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