Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
5ace3d48
Commit
5ace3d48
authored
Jul 16, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code for jxfpmx, not finish yet
parent
e1f76cee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
JXFPMX.java
...axtech/atms/vat/service/impl/report/functions/JXFPMX.java
+30
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFPMX.java
View file @
5ace3d48
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.constant.Constant
;
import
java.math.BigDecimal
;
/// <summary>
/// <summary>
...
@@ -35,6 +39,32 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
...
@@ -35,6 +39,32 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
+
amountType
+
","
+
period
+
")"
;
+
amountType
+
","
+
period
+
")"
;
logger
.
debug
(
formulaExpression
);
logger
.
debug
(
formulaExpression
);
int
curYear
=
formulaContext
.
getYear
();
int
[]
yearOffSet
=
{};
period
=
getPeriod
(
period
,
yearOffSet
);
curYear
=
curYear
+
yearOffSet
[
0
];
BigDecimal
taxRateVal
;
if
(
taxRate
.
equals
(
Constant
.
Other
))
{
taxRateVal
=
new
BigDecimal
(
"-1"
);
}
else
if
(!
taxRate
.
endsWith
(
"%"
))
{
if
(
taxRate
.
equals
(
"99"
))
{
taxRateVal
=
new
BigDecimal
(
"99"
);
}
else
{
return
NumberEval
.
ZERO
;
}
}
else
{
taxRate
=
StringUtils
.
removeEnd
(
taxRate
,
"%"
);
try
{
taxRateVal
=
new
BigDecimal
(
Double
.
parseDouble
(
taxRate
));
}
catch
(
NumberFormatException
ex
)
{
return
NumberEval
.
ZERO
;
}
taxRateVal
=
taxRateVal
.
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
return
NumberEval
.
ZERO
;
return
NumberEval
.
ZERO
;
...
...
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