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
00f93652
Commit
00f93652
authored
Apr 05, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue
parent
8c02602f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
61 deletions
+66
-61
ProfitLossRO.js
src/container/RollingOutlook/ProfitLossRO.js
+66
-61
No files found.
src/container/RollingOutlook/ProfitLossRO.js
View file @
00f93652
...
@@ -678,15 +678,16 @@ export default class ProfitLossROO extends Component {
...
@@ -678,15 +678,16 @@ export default class ProfitLossROO extends Component {
dataTable2
.
map
((
item
,
index
)
=>
{
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
String
(
item
[
data
.
columnIndex
]).
includes
(
'-'
)
?
Number
(
String
(
item
[
data
.
columnIndex
]).
substr
(
1
,
String
(
item
[
data
.
columnIndex
]).
length
))
*
-
1
:
Number
(
item
[
data
.
columnIndex
])))
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
String
(
item
[
data
.
columnIndex
]).
includes
(
'-'
)
?
Number
(
String
(
item
[
data
.
columnIndex
]).
substr
(
1
,
String
(
item
[
data
.
columnIndex
]).
length
))
*
-
1
:
Number
(
item
[
data
.
columnIndex
])))
if
(
data
.
rowData
[
5
]
==
"Revenue"
)
{
console
.
log
(
total
);
// console.log(a);
}
}
}
})
})
// console.log(total);
// console.log(total);
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
Number
(
total
)
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
Number
(
total
)
// if (data.rowData[5] == "Unit Business/ Brand/ SubCo 1") {
// console.log(total);
// console.log(a);
// }
return
a
return
a
}
}
...
@@ -763,7 +764,7 @@ export default class ProfitLossROO extends Component {
...
@@ -763,7 +764,7 @@ export default class ProfitLossROO extends Component {
// console.log(arrayJumlah);
// console.log(arrayJumlah);
// }
// }
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === "" || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === undefined || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === null) {
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === "" || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === undefined || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === null) {
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
.
toFixed
(
1
)
// }
// }
return
Number
(
total
)
return
Number
(
total
)
...
@@ -776,7 +777,10 @@ export default class ProfitLossROO extends Component {
...
@@ -776,7 +777,10 @@ export default class ProfitLossROO extends Component {
total
+=
Number
(
item
)
total
+=
Number
(
item
)
}
}
})
})
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
total
// if (String(tableMeta.rowData[5]).toLocaleLowerCase === "sales volume") {
// console.log(total);
// }
return
total
return
total
}
}
...
@@ -2207,20 +2211,59 @@ export default class ProfitLossROO extends Component {
...
@@ -2207,20 +2211,59 @@ export default class ProfitLossROO extends Component {
value
=
{
Number
(
val
).
toFixed
(
1
)}
value
=
{
Number
(
val
).
toFixed
(
1
)}
/
>
/
>
:
:
tableMeta
.
rowData
[
0
]
===
2
?
// tableMeta.rowData[0] === 2 ?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
// <span style={{ fontSize: 12, textAlign: 'right' }}>
<
NumberFormat
// <NumberFormat
thousandSeparator
=
{
true
}
// thousandSeparator={true}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type
=
"text"
// type="text"
placeholder
=
""
// placeholder=""
disabled
=
{
true
}
// disabled={true}
// value={Number(val).toFixed(1)}
// // value={Number(val).toFixed(1)}
value
=
{
Number
(
handleValue
(
val
,
tableMeta
)).
toFixed
(
1
)}
// value={Number(handleValue(val, tableMeta)).toFixed(1)}
/
>
// />
<
/span
>
// </span>
:
// :
tableMeta
.
rowData
[
0
]
===
3
?
// tableMeta.rowData[0] === 3 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={val}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={true}
// value={Number(handleTotal(val, tableMeta)).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
// />
// }
// />
// </div>
// :
// tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={val}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
// />
// }
// />
// </div>
// :
<
div
style
=
{{
flex
:
1
}}
>
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
...
@@ -2231,47 +2274,9 @@ export default class ProfitLossROO extends Component {
...
@@ -2231,47 +2274,9 @@ export default class ProfitLossROO extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
handleTotal
(
val
,
tableMeta
)).
toFixed
(
1
)}
value
=
{
Number
(
handleTotal
(
val
,
tableMeta
)).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
// value={Number(val).toFixed(1)}
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
/
>
}
/
>
<
/div
>
:
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
val
,
tableMeta
,
1
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
val
).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -2449,7 +2454,7 @@ export default class ProfitLossROO extends Component {
...
@@ -2449,7 +2454,7 @@ export default class ProfitLossROO extends Component {
<
div
className
=
"col-2"
>
<
div
className
=
"col-2"
>
<
/div>
:
<
/div>
:
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
{
this
.
state
.
get_for
==
'view'
&&
this
.
state
.
viewOnly
&&
{
this
.
state
.
get_for
==
'view'
&&
<
button
<
button
className
=
"button"
className
=
"button"
type
=
"button"
type
=
"button"
...
...
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