Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
183097be
Commit
183097be
authored
Apr 09, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
e1265812
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+18
-8
No files found.
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
183097be
...
@@ -249,7 +249,8 @@ class InvoiceService extends ServiceBase {
...
@@ -249,7 +249,8 @@ class InvoiceService extends ServiceBase {
receiveTel
:
_invoicesummaryinfo
.
businessmen_mobile
,
receiveTel
:
_invoicesummaryinfo
.
businessmen_mobile
,
receiveAddress
:
_invoicesummaryinfo
.
businessmen_addr
,
receiveAddress
:
_invoicesummaryinfo
.
businessmen_addr
,
receiveTaxIdentificationNumber
:
_invoicesummaryinfo
.
businessmen_credit_code
,
receiveTaxIdentificationNumber
:
_invoicesummaryinfo
.
businessmen_credit_code
,
province
:
PROVINCE_CODE_MAP
[
_invoicesummaryinfo
.
province
],
// province: PROVINCE_CODE_MAP[_invoicesummaryinfo.province],
province
:
_invoicesummaryinfo
.
province
,
receiveAccountName
:
""
,
//xxxx
receiveAccountName
:
""
,
//xxxx
sourceClient
:
"0"
,
//票据来源
sourceClient
:
"0"
,
//票据来源
createDate
:
moment
(
_invoicesummaryinfo
.
created_at
).
format
(
"YYYY-MM-DD HH:ss:mm"
),
//创建时间
createDate
:
moment
(
_invoicesummaryinfo
.
created_at
).
format
(
"YYYY-MM-DD HH:ss:mm"
),
//创建时间
...
@@ -278,6 +279,7 @@ class InvoiceService extends ServiceBase {
...
@@ -278,6 +279,7 @@ class InvoiceService extends ServiceBase {
if
(
!
this
.
INVOICE_TYPE
.
includes
(
this
.
trim
(
params
.
invoice_type
))){
if
(
!
this
.
INVOICE_TYPE
.
includes
(
this
.
trim
(
params
.
invoice_type
))){
return
system
.
getResult
(
null
,
`参数错误,发票类型不存在`
);
return
system
.
getResult
(
null
,
`参数错误,发票类型不存在`
);
}
}
try
{
//取出个体工商户信息
//取出个体工商户信息
var
businessRes
=
await
this
.
businessmenSve
.
queryObusinessmenByCreditCode
({
var
businessRes
=
await
this
.
businessmenSve
.
queryObusinessmenByCreditCode
({
credit_code
:
this
.
trim
(
params
.
credit_code
)
credit_code
:
this
.
trim
(
params
.
credit_code
)
...
@@ -331,13 +333,21 @@ class InvoiceService extends ServiceBase {
...
@@ -331,13 +333,21 @@ class InvoiceService extends ServiceBase {
//累计不含税价(个税)
//累计不含税价(个税)
let
accumulatedPriceExcludingTax
=
Decimal
.
div
(
invoice_amount_total
,
apettemp
);
let
accumulatedPriceExcludingTax
=
Decimal
.
div
(
invoice_amount_total
,
apettemp
);
//计算梯度的增值税附加税个税 的税率 {rate,qcd,zengzhiRate,fujiaRate}
let
AVRateRes
=
this
.
findTaxAndQCD
(
accumulatedPriceExcludingTax
,
params
.
invoice_type
,
businessmenBean
);
//增值税税 = 累计不含税价*增值税-该月累计缴纳的增值税
console
.
log
(
invoiceRes
);
let
value_added_tax
=
new
Decimal
(
invoice_amount_total
).
mul
(
AVRateRes
.
zengzhiRate
).
sub
(
value_added_tax_total
).
toFixed
(
2
);
//附加税 =增值税*附加税
let
additional_tax
=
new
Decimal
(
invoice_amount_total
).
mul
(
AVRateRes
.
zengzhiRate
).
toFixed
(
2
);
return
system
.
getResultSuccess
();
//************************************************************一下是计算服务费************************************* */
let
service_rate
=
new
Decimal
(
businessmenBean
).
div
(
100
);
let
service_amount
=
new
Decimal
(
this
.
trim
(
params
.
invoice_amount
)).
mul
(
businessmenBean
.
service_rate
);
return
system
.
getResult
(
personal_invoice_tax
,
value_added_tax
,
additional_tax
,
service_amount
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment