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
46ef9b54
Commit
46ef9b54
authored
Mar 18, 2021
by
faisalhamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into faisal
parents
1bed2201
ac1c2f8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
89 deletions
+53
-89
OutlookPA.js
src/container/OutlookPA.js
+5
-5
ProfitLossOLPA.js
src/container/OutlookPA/ProfitLossOLPA.js
+48
-84
No files found.
src/container/OutlookPA.js
View file @
46ef9b54
...
...
@@ -310,11 +310,11 @@ export default class OutlookPA extends Component {
let
data
=
[]
response
.
data
.
data
.
map
((
item
)
=>
{
if
(
this
.
state
.
isApprover
)
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
0
))
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
data
.
push
(
item
)
}
}
else
{
if
((
item
>=
2000
)
&&
(
item
==
this
.
state
.
lastPeriod
||
item
<
this
.
state
.
lastPeriod
))
{
if
((
item
>=
2000
)
&&
(
item
==
Number
(
this
.
state
.
lastPeriod
)
+
1
||
item
<
Number
(
this
.
state
.
lastPeriod
)
+
1
))
{
data
.
push
(
item
)
}
}
...
...
@@ -328,11 +328,11 @@ export default class OutlookPA extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
0
)
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
=
periode
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
Number
(
this
.
state
.
lastPeriod
)
+
1
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
periode
)
// console.log(data)
// console.log(this.state.lastPeriod)
// console.log(periode
Data
)
// console.log(periode)
// console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
...
...
src/container/OutlookPA/ProfitLossOLPA.js
View file @
46ef9b54
...
...
@@ -188,9 +188,9 @@ export default class ProfitLossOLPA extends Component {
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
ytd_october
,
item
.
profit_loss
.
nov_dec
,
Number
(
item
.
profit_loss
.
total_current_year
).
toFixed
(
1
)
,
Number
(
item
.
profit_loss
.
ytd_october
).
toFixed
(
1
)
,
Number
(
item
.
profit_loss
.
nov_dec
).
toFixed
(
1
)
,
item
.
order
])
}
...
...
@@ -224,9 +224,9 @@ export default class ProfitLossOLPA extends Component {
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
ytd_october
,
item
.
profit_loss
.
nov_dec
,
Number
(
item
.
profit_loss
.
total_current_year
).
toFixed
(
1
)
,
Number
(
item
.
profit_loss
.
ytd_october
).
toFixed
(
1
)
,
Number
(
item
.
profit_loss
.
nov_dec
).
toFixed
(
1
)
,
item
.
order
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -564,6 +564,36 @@ export default class ProfitLossOLPA extends Component {
// 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
)
=>
{
let
total
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
18
])
+
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
19
])
dataTable2
[
tableMeta
.
rowIndex
][
22
]
=
total
...
...
@@ -1498,26 +1528,6 @@ export default class ProfitLossOLPA extends Component {
value
=
{
Number
(
handleValue
(
value
,
tableMeta
)).
toFixed
(
1
)}
/
>
<
/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
?
<
NumberFormat
...
...
@@ -1528,26 +1538,6 @@ export default class ProfitLossOLPA extends Component {
disabled
=
{
true
}
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
?
<
NumberFormat
...
...
@@ -1558,26 +1548,6 @@ export default class ProfitLossOLPA extends Component {
disabled
=
{
true
}
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
}
...
...
@@ -1609,23 +1579,17 @@ export default class ProfitLossOLPA extends Component {
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
decimalScale
=
{
1
}
value
=
{
Number
(
handleTotalFY
(
tableMeta
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
<
/span
>
}
<
/div
>
)
...
...
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