Authored by 郭成尧

Merge branch 'featrue/invoice' into release/6.0.2

... ... @@ -210,14 +210,24 @@ exports.submit = (req, res, next) => {
};
if (req.body.invoice === 'true') {
let invoicesTitlePersonal = req.body.invoices_title_personal ? req.body.invoices_title_personal : '个人';
let invoicePayableType = _.parseInt(req.body.invoice_payable_type);
_.assign(options, {
invoices_title: req.body.invoices_title || '个人',
invoices_type: 2,
invoices_type_id: 12,
invoice_payable_type: req.body.invoice_payable_type || 1,
invoice_payable_type: invoicePayableType,
receiverMobile: req.body.receiverMobile || '',
buyerTaxNumber: req.body.buyerTaxNumber || ''
});
if (invoicePayableType === 1) {
// 开个人发票
options.invoices_title = invoicesTitlePersonal;
} else {
// 开公司发票
options.invoices_title = req.body.invoices_title;
options.buyerTaxNumber = req.body.buyerTaxNumber;
}
}
return seckillModel.submit(options)
... ...
... ... @@ -231,9 +231,16 @@ function submitOrder() {
invoice: orderInfo('invoice'),
invoices_title: orderInfo('invoices_title'), // 发票抬头
invoices_type: orderInfo('invoices_type'), // 发票类型 1 纸质 2 电子
invoice_payable_type: orderInfo('invoice_payable_type'), // 发票抬头类型 1:个人,2:企业
receiverMobile: orderInfo('receiverMobile'), // 接收人电话
buyerTaxNumber: orderInfo('buyerTaxNumber') // 购买方纳税人识别号,需要开具
});
if (orderInfo('invoices_title_personal')) {
Object.assign(postData, {
invoices_title_personal: orderInfo('invoices_title_personal')
});
}
}
$.ajax({
... ...