Commit a781c844 by 王昆

dd

parent a116d058
......@@ -21,7 +21,7 @@ class InvoiceCtl extends CtlBase {
}
/**
* 发票申请列表-平台
* 发票申请列表-平台(管理员)
* @param {*} pobj
*/
async invoicePage(pobj, pobj2, req) {
......@@ -105,6 +105,20 @@ class InvoiceCtl extends CtlBase {
}
}
/**
* 发票推送
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
*/
async uploadDetailSve(pobj, pobj2, req){
if(!pobj.invoice_id){
return system.getResult(null,`参数错误 发票ID 不能为空`);
}
let res = await this.invoiceSve.uploadDetailSve(pobj.invoice_id);
return res;
}
// /**
// * 申请发票校验
// * @param {*} pobj
......
......@@ -45,22 +45,7 @@ class InvoiceService extends ServiceBase {
}
async handleStatus(params) {
var rs = await this.callms("invoice", "handleStatus", params);
if(params.stataus=="1120"){
try {
if(res.status===0){
await uploadDetailSve(params.invoice_id);
return rs;
}else{
return system.getResult(null,`提交发票失败 非法的发票ID`);
}
} catch (error) {
console.log(error);
return system.getResult("提交财税系统失败,请联系管理员");
}
}else{
return rs;
}
return await this.callms("invoice", "handleStatus", params);
}
async invoice(params) {
......@@ -185,6 +170,12 @@ class InvoiceService extends ServiceBase {
return system.getResult(`交付商不存在`);
}
var deliver = await this.callms("common", "deliverInfo", {id: invoice.data.invoicedeliver[0].deliver_id});
if(!deliver.data ){
return system.getResult(null,`交付商不存在`);
}
if(!deliver.data.nt_company_id){
return system.getResult(null,`个体户还未建账,请先建账`);
}
let _params=await this.buildParams(businessmen.data,invoice.data,deliver.data) || {};
try {
if(!_params){
......@@ -197,6 +188,8 @@ class InvoiceService extends ServiceBase {
if(!res || !res.data) {
return system.getResult(null, "提交发票失败");
}
//更新发票建账
await this.callms("invoice", "updateAccountCreation", {id:invoice_id});
return system.getResultSuccess();
} catch (error) {
console.log(error);
......
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