Commit c00910d5 by 王昆

Merge branch 'xgg-saas-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-merchant

parents 4db5aee2 e7d8bba8
...@@ -175,6 +175,24 @@ class InvoiceCtl extends CtlBase { ...@@ -175,6 +175,24 @@ class InvoiceCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
/**
* 发票账单列表
* @param {*} params
* @param {*} pobj2
* @param {*} req
*/
async invoiceOrder(params, pobj2, req){
if(!params.id){
return system.getResult(null,`发票ID 不能为空`);
}
try {
return await this.invoiceSve.invoiceOrder(params);
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误`);
}
}
} }
module.exports = InvoiceCtl; module.exports = InvoiceCtl;
...@@ -4,9 +4,10 @@ const settings = require("../../../../config/settings") ...@@ -4,9 +4,10 @@ const settings = require("../../../../config/settings")
class InvoiceService extends ServiceBase { class InvoiceService extends ServiceBase {
constructor() { constructor() {
super(); super();
this.tradeSve = system.getObject("service.trade.tradeSve");
} }
async merchantinvoicePage(params){ async merchantinvoicePage(params) {
var rs = await this.callms("invoice", "merchantinvoicePage", params); var rs = await this.callms("invoice", "merchantinvoicePage", params);
if (rs && rs.data && rs.data.rows) { if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows); this.transOrderField(rs.data.rows);
...@@ -14,7 +15,7 @@ class InvoiceService extends ServiceBase { ...@@ -14,7 +15,7 @@ class InvoiceService extends ServiceBase {
return rs; return rs;
} }
async merchantinvoiceapplyPage(params){ async merchantinvoiceapplyPage(params) {
var rs = await this.callms("invoice", "merchantinvoiceapplyPage", params); var rs = await this.callms("invoice", "merchantinvoiceapplyPage", params);
if (rs && rs.data && rs.data.rows) { if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows); this.transOrderField(rs.data.rows);
...@@ -22,7 +23,7 @@ class InvoiceService extends ServiceBase { ...@@ -22,7 +23,7 @@ class InvoiceService extends ServiceBase {
return rs; return rs;
} }
async applySave(params){ async applySave(params) {
var rs = await this.callms("invoice", "invoiceapplySave", params); var rs = await this.callms("invoice", "invoiceapplySave", params);
if (rs && rs.data && rs.data.rows) { if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows); this.transOrderField(rs.data.rows);
...@@ -41,5 +42,38 @@ class InvoiceService extends ServiceBase { ...@@ -41,5 +42,38 @@ class InvoiceService extends ServiceBase {
} }
} }
/**
* 发票详情
* @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") { //个体户注册订单
tradOrder = [];
} else { //查询流水
let tradOrderRes = await this.tradeSve.invoiceTrade({
id: saasInvoiceApply.id,
order_type: saasInvoiceApply.fee_type
});
if (tradOrderRes.status == 0) {
tradOrder = tradOrderRes.data;
}
}
saasInvoiceApply.tradOrder = tradOrder;
return system.getResult(saasInvoiceApply);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
} }
module.exports = InvoiceService; module.exports = InvoiceService;
\ No newline at end of file
...@@ -305,6 +305,10 @@ class TradeService extends ServiceBase { ...@@ -305,6 +305,10 @@ class TradeService extends ServiceBase {
row.service_rate = system.f2y(row.service_rate); row.service_rate = system.f2y(row.service_rate);
} }
} }
async invoiceTrade(params) {
let rs = await this.callms("trade", "invoiceTrade", params) || {};
return rs;
}
} }
module.exports = TradeService; module.exports = TradeService;
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
1. [商户地址编辑](#merchantAddrSave) 1. [商户地址编辑](#merchantAddrSave)
1. [发票申请列表](#merchantinvoiceapplyPage) 1. [发票申请列表](#merchantinvoiceapplyPage)
1. [发票列表](#invoicePage) 1. [发票列表](#invoicePage)
1. [平台查询发票详情](#invoiceOrder)
## **<a name="orderPage"> 发票申请-功能1-交易列表</a>** ## **<a name="orderPage"> 发票申请-功能1-交易列表</a>**
[返回到目录](#menu) [返回到目录](#menu)
...@@ -398,4 +399,153 @@ ...@@ -398,4 +399,153 @@
"requestid": "2d9c4d82543f49b197e9bc38e1bdc499" "requestid": "2d9c4d82543f49b197e9bc38e1bdc499"
} }
```
## **<a name="invoiceOrder"> 平台查询发票详情 </a>**     
[返回到目录](#menu)     
##### URL
[/web/saas/invoiceCtl/invoiceOrder]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求参数 `POST`
```javascript
{
"id": "11091789235001142",
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": {
"id": "11091789235001142",
"saas_id": "10000",
"saas_merchant_id": "11248111258000991",
"parent_id": "11091769149000453",
"batch_no": "13295393796003361",
"owner_type": "10",
"fee_type": "10",
"invoice_type": "30",
"invoice_amount": 200000, //价税合计总额
"status": "1050",
"audit_remark": null,
"sve_invoice_id": "",
"apply_no": "11874538320003399", //发票申请编号
"from_name": "name4",
"from_credit_code": "TMAH78917902114178",
"from_addr": "好的好的和",
"from_mobile": "18833836395",
"from_bank": "张哈哈哈",
"from_account": "1377373",
"to_name": "name", //抬头名称
"to_credit_code": "credit_code-1", //社会统一信用代码
"to_addr": "addr-1", //地址
"to_mobile": "mobile-1", //联系电话
"to_bank": "bank_name", //银行
"to_account": "bank_account", //账号
"mail_to": "10", //邮寄人
"mail_mobile": "10", //邮寄电话
"mail_addr": "10", //邮寄地址
"personal_invoice_tax": null, //个税
"additional_tax": null, //附加税
"value_added_tax": null, //增值税
"service_tax": null, //服务费
"unit": null,
"quantity": null,
"price": null,
"remark": null,
"created_at": "2020-04-12 18:32:50", //申请时间
"updated_at": "2020-04-12 18:32:50",
"deleted_at": null,
"version": 0,
"fee_type_name": "平台转账费用", //服务类型
"saasInvoice": null,
"invoice_type_name":"普通发票", //发票类型
"saasInvoice": {
"id": "11091789235001142",
"saas_id": "saas_id",
"saas_merchant_id": "11248111258000991",
"batch_no": "batch_no",
"owner_type": "10",
"fee_type": "10",
"invoice_type": "10",
"province": "province",
"invoice_join": "10",
"invoice_no": "invoice_no",
"invoice_number": "invoice_number",
"invoice_time": "2020-04-09T13:32:06.000Z",
"invoice_amount": 1,
"invoice_img": null, //发票图片
"sve_invoice_id": "sve_invoice_id",
"apply_no": "apply_no",
"from_name": "from_name",
"from_credit_code": "from_credit_code",
"from_addr": "from_addr",
"from_mobile": "from_mobile",
"from_bank": "from_bank",
"from_account": "from_account",
"to_name": "to_name",
"to_credit_code": "to_credit_code",
"to_addr": "to_addr",
"to_mobile": "to_mobile",
"to_bank": "to_bank",
"to_account": "to_account",
"mail_to": "mail_to",
"mail_mobile": "mail_mobile",
"mail_addr": "mail_addr",
"mail_no": null, //快递单号
"personal_invoice_tax": 10,
"additional_tax": 1,
"value_added_tax": 1,
"service_tax": 1,
"summary": "summary",
"created_at": "2020-04-09T13:31:40.000Z",
"updated_at": "2020-04-09T13:31:42.000Z",
"deleted_at": null,
"version": 0
},
"tradOrder": [ //账单列表
{
"id": 1001004,
"trade_no": "T10010048046185",
"saas_merchant_id": "11248111258000991",
"order_id": "1298386418003804",
"order_type": "10",
"out_trade_no": "13695998839234974",
"acc_name": "张王李兆",
"credit_code": "92321311MA205KN09Y",
"acc_no": "12314213",
"open_bank": "12312",
"amt": 12344500,
"actual_amt": 12344500,
"deduct_amt": 12591390,
"service_tax": 246890,
"trade_status": "01",
"trade_time": null,
"trade_desc": "",
"trade_receipt": "",
"remark": "15",
"saas_id": "10000",
"saas_invoice_id": "11091789235001142",
"created_at": "2020-04-03 11:33:21",
"updated_at": "2020-04-03 11:33:21",
"deleted_at": null,
"version": 0
}
]
},
"bizmsg": "empty"
}
``` ```
\ 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