Authored by yyq

fix

@@ -22,7 +22,16 @@ const detail = (req, res, next) => { @@ -22,7 +22,16 @@ const detail = (req, res, next) => {
22 }; 22 };
23 23
24 const supply = (req, res, next) => { 24 const supply = (req, res, next) => {
25 - return req.ctx(invoiceModel).submitInvoiceSupply(req.body, req.user.uid).then(result => { 25 + let params = req.body;
  26 +
  27 + // 5.8.1 发票优化需求
  28 + // 只接受电子发票(1 纸质 2 电子),发票内容为明细(id 12:明细)
  29 + Object.assign(params, {
  30 + invoicesType: 2,
  31 + contentId: 12
  32 + });
  33 +
  34 + return req.ctx(invoiceModel).submitInvoiceSupply(params, req.user.uid).then(result => {
26 res.send(result); 35 res.send(result);
27 }).catch(next); 36 }).catch(next);
28 }; 37 };
@@ -31,8 +31,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -31,8 +31,8 @@ module.exports = class extends global.yoho.BaseModel {
31 let param = { 31 let param = {
32 order_code: info.orderCode, 32 order_code: info.orderCode,
33 invoices_type: info.invoicesType, 33 invoices_type: info.invoicesType,
34 - invoices_title: info.invoicesTitle,  
35 - invoice_content: info.invoicesContent, 34 + invoices_title: info.titleName,
  35 + invoice_content: info.contentId,
36 receiverMobile: info.receiver, 36 receiverMobile: info.receiver,
37 buyerTaxNumber: info.taxNumber, 37 buyerTaxNumber: info.taxNumber,
38 invoice_payable_type: info.taxNumber ? 2 : 1 38 invoice_payable_type: info.taxNumber ? 2 : 1