Commit e76bfcb3 by 孙亚楠

d

parent b4662757
......@@ -426,6 +426,25 @@ class InvoiceCtl extends CtlBase {
}
}
/**
* 发票账单列表
* @param {*} params
* @param {*} pobj2
* @param {*} req
*/
async invoiceOrder(params, pobj2, req) {
if (!params.id) {
return system.getResult(null, `发票ID 不能为空`);
}
try {
return await this.saasinvoiceSve.invoiceOrder(params);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = InvoiceCtl;
......@@ -7,6 +7,7 @@ class SaasinvoiceService extends ServiceBase {
super();
this.DEFAULT_BUSINESSMEN_TYPE = "10"; //默认的 销售方类型 个体工商户
this.DEFAULT_CHANNEL_ID = "2"; //默认的 渠道类型
this.tradeSve = system.getObject("service.trade.tradeSve");
}
async platforminvoicePage(params) {
......@@ -168,6 +169,7 @@ class SaasinvoiceService extends ServiceBase {
if (invoiceOrderRes.status == 0) {
invoiceOrderRes = invoiceOrderRes.data.rows || [];
}
saasInvoice.service_tax=system.f2y(saasInvoice.service_tax);
saasInvoice.invoiceOrder = invoiceOrderRes;
return system.getResult(saasInvoice);
}catch (e) {
......@@ -206,5 +208,42 @@ class SaasinvoiceService extends ServiceBase {
return system.getResult(null, `系统错误`);
}
}
/**
* 发票详情
* @param {*} params
*/
async invoiceOrder(params) {
try {
let saasInvoiceApply = await this.callms("invoice", "saasInvoiceInfo", params);
if (saasInvoiceApply.status != 0 || !saasInvoiceApply.data) {
return system.getResult(null, `系统错误`);
}
saasInvoiceApply = saasInvoiceApply.data;
let tradOrder = [];
if (saasInvoiceApply.fee_type == "00") { //个体户注册订单
let invoiceOrderRes = await this.callms("order", "saasOrderPage", { saas_invoice_id: this.trim(params.id) ,currentPage:1,pageSize:99999});
if (invoiceOrderRes.status == 0) {
tradOrder = invoiceOrderRes.data.rows || [];
}
} else { //查询流水
let tradOrderRes = await this.tradeSve.invoiceTrade({
id: saasInvoiceApply.id,
order_type: saasInvoiceApply.fee_type
});
if (tradOrderRes.status == 0) {
tradOrder = tradOrderRes.data;
};
saasInvoiceApply.service_tax=system.f2y(saasInvoiceApply.service_tax);
}
saasInvoiceApply.tradOrder = tradOrder;
return system.getResult(saasInvoiceApply);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = SaasinvoiceService;
\ No newline at end of file
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