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
57d1dd64
Commit
57d1dd64
authored
Nov 14, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加算法编码
parent
766b3054
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
33 deletions
+8
-33
xggsve-invoice/app/base/service/impl/invoice/applySve.js
+1
-1
xggsve-invoice/app/base/utils/invoiceRule/algorithm/calInvoice10.js
+0
-28
xggsve-invoice/app/base/utils/invoiceRule/invoiceConfig.js
+5
-2
xggsve-invoice/app/base/utils/invoiceRule/rule.js
+2
-2
No files found.
xggsve-invoice/app/base/service/impl/invoice/applySve.js
View file @
57d1dd64
...
@@ -186,7 +186,7 @@ class ApplyService extends ServiceBase {
...
@@ -186,7 +186,7 @@ class ApplyService extends ServiceBase {
params
.
status
=
"1000"
;
params
.
status
=
"1000"
;
params
.
customerStatus
=
"1000"
;
params
.
customerStatus
=
"1000"
;
params
.
ruleCode
=
this
.
trim
(
params
.
ruleCode
);
params
.
ruleCode
=
this
.
trim
(
params
.
ruleCode
);
params
.
ruleParams
=
JSON
.
stringify
(
params
.
ruleParams
);
params
.
ruleParams
=
JSON
.
stringify
(
params
);
await
this
.
db
.
transaction
(
async
(
t
)
=>
{
await
this
.
db
.
transaction
(
async
(
t
)
=>
{
//插入发票申请单
//插入发票申请单
...
...
xggsve-invoice/app/base/utils/invoiceRule/algorithm/calInvoice10.js
View file @
57d1dd64
...
@@ -124,34 +124,6 @@ let calTaxPersonal=(x2, taxPer, quiCalDed, cumulativeProfit)=>{
...
@@ -124,34 +124,6 @@ let calTaxPersonal=(x2, taxPer, quiCalDed, cumulativeProfit)=>{
return
(
new
Decimal
(
x2
).
mul
(
taxPer
).
div
(
100
).
sub
(
quiCalDed
).
sub
(
cumulativeProfit
)).
toFixed
(
2
);
return
(
new
Decimal
(
x2
).
mul
(
taxPer
).
div
(
100
).
sub
(
quiCalDed
).
sub
(
cumulativeProfit
)).
toFixed
(
2
);
}
}
/**
* 计算税率值
* @param {*} amount 金额
* @param {*} taxRange 税率范围
* @param {*} type 类型 1:个税 2 增值税
*/
// let calRateRange=(amount, taxRange, type)=>{
// let res = {};
// if (type === PER_TAX) {
// for (let item of taxRange) {
// if (item.minValue <= amount && amount <= item.maxValue) {
// res.taxPer = item.rate;
// res.quiCalDed = item.quiCalDed;
// break;
// }
// }
// } else {
// for (let item of taxRange) {
// if (item.minValue <= amount && amount <= item.maxValue) {
// res.valAddTaxRat = item.zengzhiRate;
// res.addTaxRat = item.fujiaRate;
// break;
// }
// }
// }
// return res;
// }
/**
/**
* 计算增值税
* 计算增值税
...
...
xggsve-invoice/app/base/utils/invoiceRule/invoiceConfig.js
View file @
57d1dd64
...
@@ -11,10 +11,12 @@ module.exports={
...
@@ -11,10 +11,12 @@ module.exports={
*/
*/
"10"
:{
"10"
:{
MAX_AMOUNT
:
500000000
,
MAX_AMOUNT
:
500000000
,
WARNING_AMOUNT
:
400000000
WARNING_AMOUNT
:
400000000
,
algorithmCode
:
"10"
},
},
"20"
:{
"20"
:{
MAX_AMOUNT
:
400000000
,
MAX_AMOUNT
:
400000000
,
WARNING_AMOUNT
:
300000000
WARNING_AMOUNT
:
300000000
,
algorithmCode
:
"10"
}
}
}
}
\ No newline at end of file
xggsve-invoice/app/base/utils/invoiceRule/rule.js
View file @
57d1dd64
...
@@ -14,8 +14,8 @@ module.exports.dispatcher=async (params)=>{
...
@@ -14,8 +14,8 @@ module.exports.dispatcher=async (params)=>{
return
system
.
getResult
(
-
1
,
`参数错误 销售方类型不能为空`
);
return
system
.
getResult
(
-
1
,
`参数错误 销售方类型不能为空`
);
}
}
//加载算法类
//加载算法类
let
businessmenType
=
common
.
trim
(
params
.
businessmenTyp
e
);
let
ruleCode
=
common
.
trim
(
params
.
ruleCod
e
);
let
filePath
=
`./algorithm/calInvoice
${
businessmenTyp
e
}
`
;
let
filePath
=
`./algorithm/calInvoice
${
ruleCod
e
}
`
;
console
.
log
(
filePath
);
console
.
log
(
filePath
);
let
calInvApi
=
require
(
filePath
);
let
calInvApi
=
require
(
filePath
);
if
(
!
calInvApi
){
if
(
!
calInvApi
){
...
...
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