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
22f772c9
Commit
22f772c9
authored
Jan 07, 2021
by
Faisal Hamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'faisal' into 'master'
handelFormula See merge request
!911
parents
40cd343a
5ec8ca13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
221 deletions
+47
-221
FixedAssetsMovementMR.js
src/container/MonthlyReport/FixedAssetsMovementMR.js
+47
-221
No files found.
src/container/MonthlyReport/FixedAssetsMovementMR.js
View file @
22f772c9
...
@@ -127,9 +127,9 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -127,9 +127,9 @@ export default class FixedAssetsMovementMR extends Component {
item
.
fixed_asset_movement
.
mtd_mb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_mb
,
item
.
fixed_asset_movement
.
mtd_mb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_mb
,
item
.
fixed_asset_movement
.
mtd_rb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_rb
,
item
.
fixed_asset_movement
.
mtd_rb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_rb
,
item
.
fixed_asset_movement
.
mtd_actual
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_actual
,
item
.
fixed_asset_movement
.
mtd_actual
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_actual
,
item
.
fixed_asset_movement
.
act_previous_month
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_previous_month
,
//
item.fixed_asset_movement.act_previous_month === "" ? "0.0" : item.fixed_asset_movement.act_previous_month,
item
.
fixed_asset_movement
.
act_vs_prev_month_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_prev_month_amount
,
//
item.fixed_asset_movement.act_vs_prev_month_amount === "" ? "0.0" : item.fixed_asset_movement.act_vs_prev_month_amount,
item
.
fixed_asset_movement
.
act_vs_prev_month_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_prev_month_percent
,
//
item.fixed_asset_movement.act_vs_prev_month_percent === "" ? "0.0" : item.fixed_asset_movement.act_vs_prev_month_percent,
item
.
fixed_asset_movement
.
act_vs_mb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_amount
,
item
.
fixed_asset_movement
.
act_vs_mb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_amount
,
item
.
fixed_asset_movement
.
act_vs_mb_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_percent
,
item
.
fixed_asset_movement
.
act_vs_mb_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_percent
,
item
.
fixed_asset_movement
.
act_vs_rb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_rb_amount
,
item
.
fixed_asset_movement
.
act_vs_rb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_rb_amount
,
...
@@ -157,9 +157,9 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -157,9 +157,9 @@ export default class FixedAssetsMovementMR extends Component {
item
.
fixed_asset_movement
.
mtd_mb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_mb
,
item
.
fixed_asset_movement
.
mtd_mb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_mb
,
item
.
fixed_asset_movement
.
mtd_rb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_rb
,
item
.
fixed_asset_movement
.
mtd_rb
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_rb
,
item
.
fixed_asset_movement
.
mtd_actual
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_actual
,
item
.
fixed_asset_movement
.
mtd_actual
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
mtd_actual
,
item
.
fixed_asset_movement
.
act_previous_month
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_previous_month
,
//
item.fixed_asset_movement.act_previous_month === "" ? "0.0" : item.fixed_asset_movement.act_previous_month,
item
.
fixed_asset_movement
.
act_vs_prev_month_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_prev_month_amount
,
//
item.fixed_asset_movement.act_vs_prev_month_amount === "" ? "0.0" : item.fixed_asset_movement.act_vs_prev_month_amount,
item
.
fixed_asset_movement
.
act_vs_prev_month_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_prev_month_percent
,
//
item.fixed_asset_movement.act_vs_prev_month_percent === "" ? "0.0" : item.fixed_asset_movement.act_vs_prev_month_percent,
item
.
fixed_asset_movement
.
act_vs_mb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_amount
,
item
.
fixed_asset_movement
.
act_vs_mb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_amount
,
item
.
fixed_asset_movement
.
act_vs_mb_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_percent
,
item
.
fixed_asset_movement
.
act_vs_mb_percent
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_mb_percent
,
item
.
fixed_asset_movement
.
act_vs_rb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_rb_amount
,
item
.
fixed_asset_movement
.
act_vs_rb_amount
===
""
?
"0.0"
:
item
.
fixed_asset_movement
.
act_vs_rb_amount
,
...
@@ -277,9 +277,9 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -277,9 +277,9 @@ export default class FixedAssetsMovementMR extends Component {
item
.
mtd_mb
,
item
.
mtd_mb
,
item
.
mtd_rb
,
item
.
mtd_rb
,
item
.
mtd_actual
,
item
.
mtd_actual
,
item
.
act_previous_month
,
//
item.act_previous_month,
item
.
act_vs_prev_month_amount
,
//
item.act_vs_prev_month_amount,
item
.
act_vs_prev_month_percent
,
//
item.act_vs_prev_month_percent,
item
.
act_vs_mb_amount
,
item
.
act_vs_mb_amount
,
item
.
act_vs_mb_percent
,
item
.
act_vs_mb_percent
,
item
.
act_vs_rb_amount
,
item
.
act_vs_rb_amount
,
...
@@ -313,13 +313,13 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -313,13 +313,13 @@ export default class FixedAssetsMovementMR extends Component {
mtd_mb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
6
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
6
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
6
]).
toFixed
(
1
)),
mtd_mb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
6
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
6
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
6
]).
toFixed
(
1
)),
mtd_rb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
7
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
7
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
)),
mtd_rb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
7
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
7
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
)),
mtd_actual
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
8
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
8
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
)),
mtd_actual
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
8
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
8
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
)),
act_previous_month
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
9
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
9
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
)),
//
act_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[9]).toFixed(1)) : i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
act_vs_prev_month_amount
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
10
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
10
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
)),
//
act_vs_prev_month_amount: i[0] === 5 || i[0] === 6 ? String(Number(i[10]).toFixed(1)) : i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
act_vs_prev_month_percent
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
11
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
11
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
)),
//
act_vs_prev_month_percent: i[0] === 5 || i[0] === 6 ? String(Number(i[11]).toFixed(1)) : i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
act_vs_mb_amount
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
12
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
12
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
)),
act_vs_mb_amount
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
9
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
9
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
)),
act_vs_mb_percent
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
3
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
13
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
13
]).
toFixed
(
1
)),
act_vs_mb_percent
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
0
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
10
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
)),
act_vs_rb_amount
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
4
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
14
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
)),
act_vs_rb_amount
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
1
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
11
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
)),
act_vs_rb_percent
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
5
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
15
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
)),
act_vs_rb_percent
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
1
2
]).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
12
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
)),
})
})
})
})
let
body
=
{
let
body
=
{
...
@@ -364,13 +364,13 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -364,13 +364,13 @@ export default class FixedAssetsMovementMR extends Component {
"mtd_mb"
:
i
[
6
],
"mtd_mb"
:
i
[
6
],
"mtd_rb"
:
i
[
7
],
"mtd_rb"
:
i
[
7
],
"mtd_actual"
:
i
[
8
],
"mtd_actual"
:
i
[
8
],
"act_previous_month"
:
i
[
9
],
//
"act_previous_month": i[9],
"act_vs_prev_month_amount"
:
String
(
i
[
10
])
===
'NaN'
||
String
(
i
[
10
])
===
'Infinity'
||
String
(
i
[
10
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
10
])
,
//
"act_vs_prev_month_amount": String(i[10]) === 'NaN' || String(i[10]) === 'Infinity' || String(i[10]) === '-Infinity' ? '0.0' : String(i[10]) ,
"act_vs_prev_month_percent"
:
String
(
i
[
11
])
===
'NaN'
||
String
(
i
[
11
])
===
'Infinity'
||
String
(
i
[
11
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
11
]),
//
"act_vs_prev_month_percent": String(i[11]) === 'NaN' || String(i[11]) === 'Infinity' || String(i[11]) === '-Infinity' ? '0.0' : String(i[11]),
"act_vs_mb_amount"
:
String
(
i
[
12
])
===
'NaN'
||
String
(
i
[
12
])
===
'Infinity'
||
String
(
i
[
12
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
12
]),
"act_vs_mb_amount"
:
String
(
i
[
9
])
===
'NaN'
||
String
(
i
[
9
])
===
'Infinity'
||
String
(
i
[
9
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
9
]),
"act_vs_mb_percent"
:
String
(
i
[
1
3
])
===
'NaN'
||
String
(
i
[
13
])
===
'Infinity'
||
String
(
i
[
13
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
13
]),
"act_vs_mb_percent"
:
String
(
i
[
1
0
])
===
'NaN'
||
String
(
i
[
10
])
===
'Infinity'
||
String
(
i
[
10
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
10
]),
"act_vs_rb_amount"
:
String
(
i
[
1
4
])
===
'NaN'
||
String
(
i
[
14
])
===
'Infinity'
||
String
(
i
[
14
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
14
]),
"act_vs_rb_amount"
:
String
(
i
[
1
1
])
===
'NaN'
||
String
(
i
[
11
])
===
'Infinity'
||
String
(
i
[
11
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
11
]),
"act_vs_rb_percent"
:
String
(
i
[
1
5
])
===
'NaN'
||
String
(
i
[
15
])
===
'Infinity'
||
String
(
i
[
15
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
15
])
"act_vs_rb_percent"
:
String
(
i
[
1
2
])
===
'NaN'
||
String
(
i
[
12
])
===
'Infinity'
||
String
(
i
[
12
])
===
'-Infinity'
?
'0.0'
:
String
(
i
[
12
])
})
})
})
})
let
payload
=
{
let
payload
=
{
...
@@ -453,16 +453,16 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -453,16 +453,16 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(tableMeta);
// console.log(tableMeta);
console
.
log
(
tst
);
console
.
log
(
tst
);
let
indexID
=
dataTable2
[
tableMeta
.
rowIndex
][
1
6
].
findIndex
((
val
)
=>
val
.
item_formula
==
tst
)
let
indexID
=
dataTable2
[
tableMeta
.
rowIndex
][
1
3
].
findIndex
((
val
)
=>
val
.
item_formula
==
tst
)
// console.log(indexID);
// console.log(indexID);
if
(
indexID
!==
-
1
)
{
if
(
indexID
!==
-
1
)
{
let
valuezz
=
dataTable2
[
tableMeta
.
rowIndex
][
1
6
][
indexID
].
value
let
valuezz
=
dataTable2
[
tableMeta
.
rowIndex
][
1
3
][
indexID
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
// console.log(valuezz);
// console.log(valuezz);
}
}
}
else
{
}
else
{
let
data
=
tableMeta
.
rowData
[
1
6
]
==
null
?
[]
:
tableMeta
.
rowData
[
16
]
let
data
=
tableMeta
.
rowData
[
1
3
]
==
null
?
[]
:
tableMeta
.
rowData
[
13
]
let
indexID
=
data
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
item
}
`
))
let
indexID
=
data
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
item
}
`
))
if
(
indexID
!==
-
1
)
{
if
(
indexID
!==
-
1
)
{
let
valuezz
=
data
[
indexID
].
value
let
valuezz
=
data
[
indexID
].
value
...
@@ -472,13 +472,13 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -472,13 +472,13 @@ export default class FixedAssetsMovementMR extends Component {
}
else
{
}
else
{
if
(
String
(
item
).
includes
(
'[M-1]'
))
{
if
(
String
(
item
).
includes
(
'[M-1]'
))
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
7
]
==
tst
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
4
]
==
tst
)
if
(
indexID
!==
-
1
)
{
if
(
indexID
!==
-
1
)
{
let
valuezz
=
dataTable2
[
indexID
][
8
]
let
valuezz
=
dataTable2
[
indexID
][
8
]
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
else
{
}
else
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
7
]
==
item
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
4
]
==
item
)
if
(
item
==
'X-1'
)
{
if
(
item
==
'X-1'
)
{
anjay
.
push
(
-
1
)
anjay
.
push
(
-
1
)
}
else
if
(
tambahan
)
{
}
else
if
(
tambahan
)
{
...
@@ -651,13 +651,13 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -651,13 +651,13 @@ export default class FixedAssetsMovementMR extends Component {
const
handleVariance
=
(
tableMeta
,
dex
,
type
)
=>
{
const
handleVariance
=
(
tableMeta
,
dex
,
type
)
=>
{
let
total
=
0
let
total
=
0
if
(
dex
===
1
)
{
//
if (dex === 1) {
total
=
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
9
])
==
NaN
?
"0.0"
:
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
9
])
//
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
//
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[9]);
// console.log(tableMeta.rowData[9]);
// console.log(total)
// console.log(total)
}
else
if
(
dex
===
2
)
{
if
(
dex
===
2
)
{
total
=
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
6
])
==
NaN
?
"0.0"
:
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
6
])
total
=
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
6
])
==
NaN
?
"0.0"
:
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
6
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[8]);
...
@@ -681,19 +681,19 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -681,19 +681,19 @@ export default class FixedAssetsMovementMR extends Component {
// }
// }
// value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)}
// value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)}
// dataTable2[5][11]
// dataTable2[5][11]
if
(
dex
===
1
)
{
//
if (dex === 1) {
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
10
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
10
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])),
Infinity
)
?
"0"
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
10
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])),
-
Infinity
)
?
"0"
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
10
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
//
total = R.equals((Number(dataTable2[tableMeta.rowIndex][10]) / Number(dataTable2[tableMeta.rowIndex][9])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][10]) / Number(dataTable2[tableMeta.rowIndex][9])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][10]) / Number(dataTable2[tableMeta.rowIndex][9])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][10]) / Number(dataTable2[tableMeta.rowIndex][9])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
//
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// if (tableMeta.rowData[5] === "Cash and cash equivalent") {
// if (tableMeta.rowData[5] === "Cash and cash equivalent") {
// console.log(total);
// console.log(total);
// console.log(Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][10]));
// console.log(Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][10]));
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(dataTable2[tableMeta.rowIndex]);
// }
// }
}
else
if
(
dex
===
2
)
{
if
(
dex
===
2
)
{
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
Infinity
)
?
"0"
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
-
Infinity
)
?
"0"
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
Infinity
)
?
"0"
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])),
-
Infinity
)
?
"0"
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
6
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
}
else
if
(
dex
===
3
)
{
}
else
if
(
dex
===
3
)
{
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
1
4
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
14
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
Infinity
)
?
"0"
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
14
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
-
Infinity
)
?
"0"
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
14
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
1
1
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
11
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
Infinity
)
?
"0"
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
11
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])),
-
Infinity
)
?
"0"
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
11
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
7
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
// console.log(total);
// console.log(total);
}
}
...
@@ -921,90 +921,14 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -921,90 +921,14 @@ export default class FixedAssetsMovementMR extends Component {
)
)
}
}
}
}
},
{
name
:
"Actual Previous Month"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#37b5e6'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
this
.
state
.
get_for
==
'view'
?
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
90
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
1
)}
/
>
}
/
>
:
// tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
// <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(handleValueFormula(tableMeta, 9)).toFixed(1)}
// />
// </span> :
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
)
}
}
},
{
},
{
name
:
`Variance`
,
name
:
`Variance`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderLeft
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
45
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
style
=
{{
borderLeft
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
45
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-3x"
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
border
:
'1px #fff solid'
,
backgroundColor
:
'#37b5e6'
,
borderBottom
:
'1px solid #37b5e6'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
border
:
'1px #fff solid'
,
backgroundColor
:
'#07a7d0'
,
borderBottom
:
'1px solid #37b5e6'
}}
>
<
div
style
=
{{
borderBottom
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
span
>
{
"Act vs Previous Month"
}
<
/span
>
<
/div
>
<
div
className
=
"grid grid-2x"
>
<
div
className
=
"column-1"
style
=
{{
borderRight
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
span
>
{
"Amount"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
span
>
{
"%"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
border
:
'1px #fff solid'
,
backgroundColor
:
'#07a7d0'
,
borderBottom
:
'1px solid #37b5e6'
}}
>
<
div
style
=
{{
borderBottom
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
div
style
=
{{
borderBottom
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
span
>
{
"Act vs MB"
}
<
/span
>
<
span
>
{
"Act vs MB"
}
<
/span
>
<
/div
>
<
/div
>
...
@@ -1017,7 +941,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1017,7 +941,7 @@ export default class FixedAssetsMovementMR extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"column-
3
"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
border
:
'1px #fff solid'
,
backgroundColor
:
'#07a7d0'
,
borderBottom
:
'1px solid #37b5e6'
}}
>
<
div
className
=
"column-
2
"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
border
:
'1px #fff solid'
,
backgroundColor
:
'#07a7d0'
,
borderBottom
:
'1px solid #37b5e6'
}}
>
<
div
style
=
{{
borderBottom
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
div
style
=
{{
borderBottom
:
'1px #fff solid'
,
padding
:
2.5
,
backgroundColor
:
'#37b5e6'
}}
>
<
span
>
{
"Act vs RB"
}
<
/span
>
<
span
>
{
"Act vs RB"
}
<
/span
>
<
/div
>
<
/div
>
...
@@ -1043,91 +967,8 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1043,91 +967,8 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(tableMeta);
// console.log(tableMeta);
return
(
return
(
<
div
>
<
div
>
<
div
className
=
"grid grid-
3
x content-center"
>
<
div
className
=
"grid grid-
2
x content-center"
>
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
?
null
:
this
.
state
.
get_for
==
'view'
?
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
90
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
/
>
}
/
>
:
<
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
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
this
.
state
.
get_for
==
'view'
?
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
90
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
Number
(
tableMeta
.
rowData
[
11
])
*
100
).
toFixed
(
1
)}
/
>
}
/
>
:
<
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
=
""
suffix
=
{
'%'
}
disabled
=
{
true
}
value
=
{
Number
(
handleVariancePercent
(
tableMeta
,
1
,
3
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
...
@@ -1144,7 +985,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1144,7 +985,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
Number
(
tableMeta
.
rowData
[
12
])
*
100
).
toFixed
(
1
)}
value
=
{
Number
(
Number
(
tableMeta
.
rowData
[
9
])
*
100
).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -1183,7 +1024,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1183,7 +1024,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
Number
(
tableMeta
.
rowData
[
1
3
])
*
100
).
toFixed
(
1
)}
value
=
{
Number
(
Number
(
tableMeta
.
rowData
[
1
0
])
*
100
).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -1210,7 +1051,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1210,7 +1051,7 @@ export default class FixedAssetsMovementMR extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"column-
3
"
>
<
div
className
=
"column-
2
"
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
<
div
style
=
{{
textAlign
:
'right'
,
width
:
120
}}
>
...
@@ -1227,7 +1068,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1227,7 +1068,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
4
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
1
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -1266,7 +1107,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1266,7 +1107,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
5
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
2
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -1333,21 +1174,6 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1333,21 +1174,6 @@ export default class FixedAssetsMovementMR extends Component {
options
:
{
options
:
{
display
:
false
display
:
false
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
}]
}]
const
loadingComponent
=
(
const
loadingComponent
=
(
...
...
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