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
455b18eb
Commit
455b18eb
authored
Mar 18, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pl olpa
parent
344c5b7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
84 deletions
+48
-84
ProfitLossOLPA.js
src/container/OutlookPA/ProfitLossOLPA.js
+48
-84
No files found.
src/container/OutlookPA/ProfitLossOLPA.js
View file @
455b18eb
...
@@ -188,9 +188,9 @@ export default class ProfitLossOLPA extends Component {
...
@@ -188,9 +188,9 @@ export default class ProfitLossOLPA extends Component {
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
Number
(
item
.
profit_loss
.
total_current_year
).
toFixed
(
1
)
,
item
.
profit_loss
.
ytd_october
,
Number
(
item
.
profit_loss
.
ytd_october
).
toFixed
(
1
)
,
item
.
profit_loss
.
nov_dec
,
Number
(
item
.
profit_loss
.
nov_dec
).
toFixed
(
1
)
,
item
.
order
item
.
order
])
])
}
}
...
@@ -224,9 +224,9 @@ export default class ProfitLossOLPA extends Component {
...
@@ -224,9 +224,9 @@ export default class ProfitLossOLPA extends Component {
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
Number
(
item
.
profit_loss
.
total_current_year
).
toFixed
(
1
)
,
item
.
profit_loss
.
ytd_october
,
Number
(
item
.
profit_loss
.
ytd_october
).
toFixed
(
1
)
,
item
.
profit_loss
.
nov_dec
,
Number
(
item
.
profit_loss
.
nov_dec
).
toFixed
(
1
)
,
item
.
order
item
.
order
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
...
@@ -564,6 +564,36 @@ export default class ProfitLossOLPA extends Component {
...
@@ -564,6 +564,36 @@ export default class ProfitLossOLPA extends Component {
// console.log(total);
// console.log(total);
}
}
const
handleTotalFY
=
(
tableMeta
)
=>
{
let
total
=
0
dataTable2
[
tableMeta
.
rowIndex
].
map
((
item
,
index
)
=>
{
if
(
index
>=
8
&&
index
<=
19
)
{
let
valItem
=
item
==
undefined
||
item
==
""
?
0
:
item
total
+=
Number
(
valItem
)
}
})
if
(
tableMeta
.
rowData
[
1
]
===
19865
)
{
console
.
log
(
total
);
console
.
log
(
dataTable2
[
tableMeta
.
rowIndex
]);
}
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
tableMeta
.
rowData
[
2
])
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"sales price"
)
{
let
value
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
2
][
20
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
1
][
20
])
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
(
R
.
equals
(
value
,
Infinity
)
?
"0.0"
:
(
value
==
"-Infinity"
?
"0.0"
:
value
))
return
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
(
R
.
equals
(
value
,
Infinity
)
?
"0.0"
:
(
value
==
"-Infinity"
?
"0.0"
:
value
))
}
else
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"total man power"
)
{
let
totalTMP
=
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
dataTable2
[
tableMeta
.
rowIndex
][
19
]
return
totalTMP
}
else
if
(
indexParent
!==
-
1
&&
String
(
dataTable2
[
indexParent
][
5
]).
toLocaleUpperCase
()
==
"GROSS PROFIT MARGIN (% OF REVENUE)"
)
{
return
handleFormula
(
0
,
tableMeta
,
0
)
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
total
return
total
}
}
const
handleTotal
=
(
tableMeta
)
=>
{
const
handleTotal
=
(
tableMeta
)
=>
{
let
total
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
18
])
+
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
19
])
let
total
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
18
])
+
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
19
])
dataTable2
[
tableMeta
.
rowIndex
][
22
]
=
total
dataTable2
[
tableMeta
.
rowIndex
][
22
]
=
total
...
@@ -1498,26 +1528,6 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1498,26 +1528,6 @@ export default class ProfitLossOLPA extends Component {
value
=
{
Number
(
handleValue
(
value
,
tableMeta
)).
toFixed
(
1
)}
value
=
{
Number
(
handleValue
(
value
,
tableMeta
)).
toFixed
(
1
)}
/
>
/
>
<
/span
>
<
/span
>
// <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=""
// disabled={this.props.isApprover ? 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(value).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// // console.log(dataTable2)
// }}
// />
// }
// />
// </div>
:
:
tableMeta
.
rowData
[
0
]
===
6
?
tableMeta
.
rowData
[
0
]
===
6
?
<
NumberFormat
<
NumberFormat
...
@@ -1528,26 +1538,6 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1528,26 +1538,6 @@ export default class ProfitLossOLPA extends Component {
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
/
>
/
>
// <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=""
// disabled={this.props.isApprover ? 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(value).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// // console.log(dataTable2)
// }}
// />
// }
// />
// </div>
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
<
NumberFormat
<
NumberFormat
...
@@ -1558,26 +1548,6 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1558,26 +1548,6 @@ export default class ProfitLossOLPA extends Component {
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
/
>
/
>
// <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=""
// disabled={this.props.isApprover ? 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(value).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// // console.log(dataTable2)
// }}
// />
// }
// />
// </div>
:
:
null
null
}
}
...
@@ -1609,23 +1579,17 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1609,23 +1579,17 @@ export default class ProfitLossOLPA extends Component {
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
/
>
:
:
<
div
style
=
{{
flex
:
1
}}
>
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
FormControlLabel
<
NumberFormat
style
=
{{
margin
:
0
}}
thousandSeparator
=
{
true
}
value
=
{
value
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
control
=
{
type
=
"text"
<
NumberFormat
placeholder
=
""
thousandSeparator
=
{
true
}
disabled
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
decimalScale
=
{
1
}
type
=
"text"
value
=
{
Number
(
handleTotalFY
(
tableMeta
)).
toFixed
(
1
)}
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
decimalScale
=
{
1
}
/
>
}
/
>
/
>
<
/
div
>
<
/
span
>
}
}
<
/div
>
<
/div
>
)
)
...
@@ -1726,12 +1690,12 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1726,12 +1690,12 @@ export default class ProfitLossOLPA extends Component {
options
:
{
options
:
{
display
:
false
display
:
false
}
}
},
{
},
{
name
:
""
,
name
:
""
,
options
:
{
options
:
{
display
:
false
display
:
false
}
}
},
{
},
{
name
:
""
,
name
:
""
,
options
:
{
options
:
{
display
:
false
display
:
false
...
...
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