Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
毕凯
8 years ago
Commit
3eb5b476d18c85c19dc8c88aae63e77f93bc0aa2
2 parents
8a2b77b2
98d04ddc
Merge branch 'hotfix/invoice' into 'master'
Hotfix/invoice See merge request
!853
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
13 deletions
apps/cart/controllers/buy-now-controller.js
apps/cart/controllers/order.js
apps/cart/models/buy-now-model.js
apps/cart/models/shopping.js
package.json
public/js/cart/buynow-order-ensure.page.js
public/js/cart/buynow-select-invoice.page.js
public/js/cart/buynow/order-info.js
public/js/cart/select-invoice.page.js
apps/cart/controllers/buy-now-controller.js
View file @
3eb5b47
...
...
@@ -176,10 +176,22 @@ class BuyNowController {
// 是否开发票
if
(
req
.
body
.
invoice
&&
req
.
body
.
invoice
===
'true'
)
{
let
invoicePayableType
=
_
.
parseInt
(
req
.
body
.
invoice_payable_type
);
let
invoicesTitlePersonal
=
req
.
body
.
invoices_title_personal
?
req
.
body
.
invoices_title_personal
:
'个人'
;
params
.
invoice
=
true
;
params
.
invoices_type
=
req
.
body
.
invoices_type
;
// 发票类型:纸质 1,电子 2
params
.
invoices_title
=
req
.
body
.
invoices_title
||
'个人'
;
// 发票抬头,个人前端不传此值
params
.
receiverMobile
=
req
.
body
.
receiverMobile
;
// 接收人电话
params
.
invoice_payable_type
=
req
.
body
.
invoice_payable_type
;
// 区分个人或企业发票
if
(
invoicePayableType
===
1
)
{
// 开个人发票
params
.
invoices_title
=
invoicesTitlePersonal
;
}
else
{
// 开公司发票
params
.
invoices_title
=
req
.
body
.
invoices_title
;
params
.
buyerTaxNumber
=
req
.
body
.
buyerTaxNumber
;
}
// 购买方纳税人识别号
if
(
req
.
body
.
buyerTaxNumber
)
{
...
...
apps/cart/controllers/order.js
View file @
3eb5b47
...
...
@@ -202,18 +202,24 @@ exports.orderSub = (req, res, next) => {
// 电子发票信息数组
let
invoices
=
{};
// 是否有发票数据
if
(
orderInfo
&&
orderInfo
.
invoice
)
{
let
invoices_title_personal
=
orderInfo
.
invoices_title_personal
?
orderInfo
.
invoices_title_personal
:
'个人'
;
let
invoicePayableType
=
_
.
parseInt
(
orderInfo
.
invoice_payable_type
);
let
invoicesTitlePersonal
=
orderInfo
.
invoices_title_personal
?
orderInfo
.
invoices_title_personal
:
'个人'
;
invoices
=
{
invoices_type_id
:
12
,
// 发票类型写死【明细】
invoices_type
:
orderInfo
.
invoices_type
,
// 区分电子发票还是纸质发票
receiverMobile
:
orderInfo
.
receiverMobile
,
// 电话
invoice
s_title
:
orderInfo
.
invoices_title
?
orderInfo
.
invoices_title
:
invoices_title_personal
invoice
_payable_type
:
orderInfo
.
invoice_payable_type
// 区分个人或企业发票
};
// 购买方纳税人识别号
if
(
orderInfo
.
buyerTaxNumber
)
{
if
(
invoicePayableType
===
1
)
{
// 开个人发票
invoices
.
invoices_title
=
invoicesTitlePersonal
;
}
else
{
// 开公司发票
invoices
.
invoices_title
=
orderInfo
.
invoices_title
;
invoices
.
buyerTaxNumber
=
orderInfo
.
buyerTaxNumber
;
}
}
...
...
apps/cart/models/buy-now-model.js
View file @
3eb5b47
...
...
@@ -137,6 +137,11 @@ class BuyNowModel extends global.yoho.BaseModel {
finalParams
.
invoices_type
=
params
.
invoices_type
;
}
// 发票类型:个人 1, 企业 2
if
(
params
.
invoice_payable_type
)
{
finalParams
.
invoice_payable_type
=
params
.
invoice_payable_type
;
}
// 发票抬头
if
(
params
.
invoices_title
)
{
finalParams
.
invoices_title
=
params
.
invoices_title
;
...
...
apps/cart/models/shopping.js
View file @
3eb5b47
...
...
@@ -185,6 +185,11 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
params
.
invoices_type
=
invoices
.
invoices_type
;
}
// 发票类型:个人 1, 企业 2
if
(
invoices
.
invoice_payable_type
)
{
params
.
invoice_payable_type
=
invoices
.
invoice_payable_type
;
}
// 收票人手机号码
if
(
invoices
.
receiverMobile
)
{
params
.
receiverMobile
=
invoices
.
receiverMobile
;
...
...
package.json
View file @
3eb5b47
{
"name"
:
"m-yohobuy-node"
,
"version"
:
"6.0.1
2
"
,
"version"
:
"6.0.1
3
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/cart/buynow-order-ensure.page.js
View file @
3eb5b47
...
...
@@ -275,9 +275,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
({
...
...
public/js/cart/buynow-select-invoice.page.js
View file @
3eb5b47
...
...
@@ -127,10 +127,18 @@ function confirmAction() {
}
},
function
()
{
orderInfo
(
'invoices_type'
,
eInvoiceType
);
orderInfo
(
'invoices_title'
,
title
===
'单位'
?
company
:
''
);
orderInfo
(
'invoices_title_personal'
,
title
===
'个人'
?
company
:
''
);
orderInfo
(
'receiverMobile'
,
tel
);
orderInfo
(
'buyerTaxNumber'
,
title
===
'单位'
?
buyerTaxNumber
:
''
);
if
(
title
===
'单位'
)
{
orderInfo
(
'invoice_payable_type'
,
2
);
orderInfo
(
'invoices_title'
,
company
);
orderInfo
(
'invoices_title_personal'
,
null
);
orderInfo
(
'buyerTaxNumber'
,
buyerTaxNumber
);
}
else
{
orderInfo
(
'invoice_payable_type'
,
1
);
orderInfo
(
'invoices_title'
,
null
);
orderInfo
(
'invoices_title_personal'
,
company
);
}
if
(
isModifyTel
&&
$copyTel
!==
tel
)
{
orderInfo
(
'isModifyTel'
,
true
);
...
...
public/js/cart/buynow/order-info.js
View file @
3eb5b47
...
...
@@ -2,7 +2,6 @@
* @Author: Targaryen
* @Date: 2017-06-22 13:51:16
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-26 17:47:49
*/
require
(
'common'
);
let
info
=
window
.
cookie
(
'buynow_info'
);
...
...
public/js/cart/select-invoice.page.js
View file @
3eb5b47
...
...
@@ -127,10 +127,18 @@ function confirmAction() {
}
},
function
()
{
orderInfo
(
'invoices_type'
,
eInvoiceType
);
orderInfo
(
'invoices_title'
,
title
===
'单位'
?
company
:
''
);
orderInfo
(
'invoices_title_personal'
,
title
===
'个人'
?
company
:
''
);
orderInfo
(
'receiverMobile'
,
tel
);
orderInfo
(
'buyerTaxNumber'
,
title
===
'单位'
?
buyerTaxNumber
:
''
);
if
(
title
===
'单位'
)
{
orderInfo
(
'invoice_payable_type'
,
2
);
orderInfo
(
'invoices_title'
,
company
);
orderInfo
(
'invoices_title_personal'
,
null
);
orderInfo
(
'buyerTaxNumber'
,
buyerTaxNumber
);
}
else
{
orderInfo
(
'invoice_payable_type'
,
1
);
orderInfo
(
'invoices_title'
,
null
);
orderInfo
(
'invoices_title_personal'
,
company
);
}
if
(
isModifyTel
&&
$copyTel
!==
tel
)
{
orderInfo
(
'isModifyTel'
,
true
);
...
...
Please
register
or
login
to post a comment