|
@@ -367,15 +367,24 @@ module.exports = class extends global.yoho.BaseModel { |
|
@@ -367,15 +367,24 @@ module.exports = class extends global.yoho.BaseModel { |
367
|
newOrder.time = _.get(order, 'create_time');
|
367
|
newOrder.time = _.get(order, 'create_time');
|
368
|
newOrder.payType = _.get(order, 'payment_type');
|
368
|
newOrder.payType = _.get(order, 'payment_type');
|
369
|
newOrder.title = _.get(order, 'order_title');
|
369
|
newOrder.title = _.get(order, 'order_title');
|
370
|
- newOrder.invoiceType = '';
|
|
|
371
|
|
370
|
|
372
|
- let issueType = +_.get(order, 'invoice.issueType');
|
371
|
+ // 补开发票订单
|
|
|
372
|
+ if (type === 8) {
|
|
|
373
|
+ let iop = _.get(order, 'links', []);
|
|
|
374
|
+ let issueType = +_.get(order, 'invoice.issueType');
|
373
|
|
375
|
|
374
|
- newOrder.issueType = issueType === 2;
|
|
|
375
|
- newOrder.invoiceSupplying = issueType === 1;
|
376
|
+ newOrder.invoiceType = '';
|
|
|
377
|
+ newOrder.issueType = issueType === 2;
|
|
|
378
|
+ newOrder.invoiceOperation = _.zipObject(iop, iop);
|
376
|
|
379
|
|
377
|
- if (newOrder.issueType) {
|
|
|
378
|
- newOrder.invoiceType = _.get(order, 'invoice.type', 0) === 2 ? '电子发票' : '纸质发票';
|
380
|
+ if (!newOrder.invoiceOperation || (!newOrder.invoiceOperation.invoiceDetail &&
|
|
|
381
|
+ !newOrder.invoiceOperation.supplyInvoice)) {
|
|
|
382
|
+ _.set(newOrder, 'invoiceOperation.invoiceSupplying', issueType === 1);
|
|
|
383
|
+ }
|
|
|
384
|
+
|
|
|
385
|
+ if (newOrder.issueType) {
|
|
|
386
|
+ newOrder.invoiceType = _.get(order, 'invoice.type', 0) === 2 ? '电子发票' : '纸质发票';
|
|
|
387
|
+ }
|
379
|
}
|
388
|
}
|
380
|
|
389
|
|
381
|
if (order.is_cancel === 'Y' || order.status === 6) {
|
390
|
if (order.is_cancel === 'Y' || order.status === 6) {
|