Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
eb23bd59
Commit
eb23bd59
authored
Oct 16, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
dd6887b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
50 deletions
+47
-50
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+47
-50
No files found.
src/container/BudgetTahunan/TaxPlanning.js
View file @
eb23bd59
...
...
@@ -590,7 +590,7 @@ export default class TaxPlanning extends Component {
let data = []
console.log(this.state.dataTable)
this.state.dataTable.map(i => {
console
.
log
(
i
[
0
])
//
console.log(i[0])
data.push({
item_report_id: i[4],
january: {
...
...
@@ -1018,16 +1018,30 @@ export default class TaxPlanning extends Component {
}
}
}
const
handleTotal
=
(
tableMeta
)
=>
{
const handleTotal = (tableMeta
, dex
) => {
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
// console.log(item);
let
valItem
=
item
.
fcp
==
undefined
||
item
.
fcp
==
""
||
item
.
fcp
==
"undefined"
?
0
:
item
.
fcp
if ( tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ) {
let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
total += Number(valItem)
} else {
if (dataTable2[tableMeta.rowIndex][8] === "Fiscal Correction positive / (negative) Year To Date"){
let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
total += Number(valItem)
} else {
let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
total += Number(valItem)
}
}
}
})
dataTable2[tableMeta.rowIndex][21] = total
if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){
console.log("masuk")
console.log(total)
}
return total
}
const handleValue = (data) => {
...
...
@@ -6421,36 +6435,24 @@ export default class TaxPlanning extends Component {
<div className="grid grid-3x content-center">
{/* <div className="col-1"> */}
<div style={{ textAlign: 'right' }}>
{
tableMeta
.
rowData
[
2
]
===
3
?
{tableMeta.rowData[
3
] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
// <NumberFormat
// thousandSeparator={true}
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={value.tbc}
// onBlur={(event) => {
// // updateValue(event.target.value)
// // handleChange(event.target.value, tableMeta)
// console.log(event.target.value)
// }}
// />
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value
=
{
Number
(
handleTotal
(
tableMeta
)).
toFixed
(
1
)}
value={Number(handleTotal(tableMeta
, 3
)).toFixed(1)}
/>
}
/>
</div> :
tableMeta
.
rowData
[
1
]
===
2
?
tableMeta.rowData[
3
] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
...
...
@@ -6458,7 +6460,7 @@ export default class TaxPlanning extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(handleValue(tableMeta
)).toFixed(1)}
value={Number(handleTotal(tableMeta, 2
)).toFixed(1)}
/>
</span>
:
...
...
@@ -6466,39 +6468,34 @@ export default class TaxPlanning extends Component {
null
:
tableMeta.rowData[1] === 6 ?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta)).toFixed(1)}
// />
null
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 6)).toFixed(1)}
/>
:
tableMeta.rowData[1] === 5 ?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta)).toFixed(1)}
// />
null
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 5)).toFixed(1)}
/>
:
tableMeta.rowData[1] === 1 ?
// value[0] === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value[0])}
// />
null
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 1)).toFixed(1)}
/>
:
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