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
39d9c7d9
Commit
39d9c7d9
authored
Dec 01, 2020
by
r.kurnia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
213b78e4
05e03f42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
47 deletions
+56
-47
FixedAssetsMovementMR.js
src/container/MonthlyReport/FixedAssetsMovementMR.js
+56
-47
No files found.
src/container/MonthlyReport/FixedAssetsMovementMR.js
View file @
39d9c7d9
...
...
@@ -196,7 +196,16 @@ export default class FixedAssetsMovementMR extends Component {
orders
:
i
[
0
]
===
undefined
?
""
:
String
(
i
[
0
]).
trim
(),
item_report_id
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]).
trim
(),
actual
:
i
[
3
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
2
]))
===
false
?
"0"
:
String
(
i
[
3
]).
trim
(),
mtd_actual
:
i
[
3
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
2
]))
===
false
?
"0"
:
String
(
i
[
3
]).
trim
(),
mtd_mb
:
""
,
mtd_rb
:
""
,
act_previous_month
:
""
,
act_vs_prev_month_amount
:
""
,
act_vs_prev_month_percent
:
""
,
act_vs_mb_amount
:
""
,
act_vs_mb_percent
:
""
,
act_vs_rb_amount
:
""
,
act_vs_rb_percent
:
""
})
}
})
...
...
@@ -233,13 +242,13 @@ export default class FixedAssetsMovementMR extends Component {
item
.
mtd_mb
,
item
.
mtd_rb
,
item
.
mtd_actual
,
item
.
act_previous_month
,
item
.
act_vs_prev_month_amount
,
item
.
act_vs_prev_month_percent
,
item
.
act_vs_mb_amount
,
item
.
act_vs_mb_percent
,
item
.
act_vs_rb_amount
,
item
.
act_vs_rb_percent
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
item
.
order
,
item
.
error
]
...
...
@@ -265,16 +274,16 @@ export default class FixedAssetsMovementMR extends Component {
data
.
push
({
item_report_id
:
i
[
1
],
item_report
:
String
(
i
[
5
]).
trim
(),
master_budget
:
String
(
Number
(
i
[
6
]).
toFixed
(
1
)),
rolling_budget
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
)),
actual
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
)),
actual_previous_month
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
)),
amount_act_vs_previous_month
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
)),
percent_act_vs_previous_month
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
)),
amount_act_vs_mb
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
)),
percent_act_vs_mb
:
String
(
Number
(
i
[
13
]).
toFixed
(
1
)),
amount_act_vs_rb
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
)),
percent_act_vs_rb
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
)),
master_budget
:
String
(
Number
(
i
[
6
]).
toFixed
(
3
)),
rolling_budget
:
String
(
Number
(
i
[
7
]).
toFixed
(
3
)),
actual
:
String
(
Number
(
i
[
8
]).
toFixed
(
3
)),
actual_previous_month
:
String
(
Number
(
i
[
9
]).
toFixed
(
3
)),
amount_act_vs_previous_month
:
String
(
Number
(
i
[
10
]).
toFixed
(
3
)),
percent_act_vs_previous_month
:
String
(
Number
(
i
[
11
]).
toFixed
(
3
)),
amount_act_vs_mb
:
String
(
Number
(
i
[
12
]).
toFixed
(
3
)),
percent_act_vs_mb
:
String
(
Number
(
i
[
13
]).
toFixed
(
3
)),
amount_act_vs_rb
:
String
(
Number
(
i
[
14
]).
toFixed
(
3
)),
percent_act_vs_rb
:
String
(
Number
(
i
[
15
]).
toFixed
(
3
)),
})
})
let
body
=
{
...
...
@@ -372,16 +381,16 @@ export default class FixedAssetsMovementMR extends Component {
console
.
log
(
tableMeta
);
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
if
(
type
===
"actual"
)
{
dataTable2
[
tableMeta
.
rowIndex
][
8
]
=
Number
(
val
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
8
]
=
Number
(
val
).
toFixed
(
3
)
}
else
{
console
.
log
(
val
);
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
dataTable2
[
tableMeta
.
rowIndex
][
2
])
console
.
log
(
indexParent
);
if
(
indexParent
>
0
)
{
// console.log(indexParent)
dataTable2
[
tableMeta
.
rowIndex
][
9
]
=
Number
(
val
).
toFixed
(
1
)
let
jagain
=
Number
(
dataTable2
[
indexParent
][
8
]).
toFixed
(
1
)
dataTable2
[
indexParent
][
9
]
=
jagain
===
undefined
?
(
0
+
Number
(
val
)).
toFixed
(
1
)
:
Number
(
Number
(
jagain
)
+
Number
(
val
)).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
9
]
=
Number
(
val
).
toFixed
(
3
)
let
jagain
=
Number
(
dataTable2
[
indexParent
][
8
]).
toFixed
(
3
)
dataTable2
[
indexParent
][
9
]
=
jagain
===
undefined
?
(
0
+
Number
(
val
)).
toFixed
(
3
)
:
Number
(
Number
(
jagain
)
+
Number
(
val
)).
toFixed
(
3
)
// if (tableMeta.rowData[5] === 'Cash & Bank Balance') {
// console.log(value);
// console.log(a);
...
...
@@ -389,7 +398,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(dataTable2[indexParent]);
// }
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
8
]
=
Number
(
val
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
8
]
=
Number
(
val
).
toFixed
(
3
)
}
}
}
...
...
@@ -404,7 +413,7 @@ export default class FixedAssetsMovementMR extends Component {
}
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
3
)
// console.log(indexParent);
return
a
}
...
...
@@ -483,13 +492,13 @@ export default class FixedAssetsMovementMR extends Component {
let
total
=
0
if
(
dex
===
1
)
{
total
=
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
(
3
)
}
else
if
(
dex
===
2
)
{
total
=
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
(
3
)
}
else
if
(
dex
===
3
)
{
total
=
Number
(
tableMeta
.
rowData
[
8
])
-
Number
(
tableMeta
.
rowData
[
7
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
3
)
}
return
total
}
...
...
@@ -499,15 +508,15 @@ export default class FixedAssetsMovementMR extends Component {
if
(
dex
===
1
)
{
// total = Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
13
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
13
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])),
Infinity
)
?
'0'
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
13
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
12
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
3
)
}
else
if
(
dex
===
2
)
{
// total = Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
15
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
8
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
15
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
8
])),
Infinity
)
?
'0'
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
15
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
8
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
3
)
}
else
if
(
dex
===
3
)
{
// total = Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])
total
=
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
17
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])),
NaN
)
?
'0'
:
R
.
equals
((
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
17
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])),
Infinity
)
?
'0'
:
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
17
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
][
9
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
1
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
Number
(
total
).
toFixed
(
3
)
}
return
total
}
...
...
@@ -625,7 +634,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
6
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
6
]).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -638,7 +647,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
0
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
0
)).
toFixed
(
3
)}
/
>
<
/span>
:
tableMeta
.
rowData
[
0
]
===
6
?
...
...
@@ -649,7 +658,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
0
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
0
)).
toFixed
(
3
)}
/
>
<
/span>
:
null
...
...
@@ -669,7 +678,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
1
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
1
)).
toFixed
(
3
)}
/
>
<
/span>
:
tableMeta
.
rowData
[
0
]
===
3
?
...
...
@@ -684,7 +693,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
7
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
7
]).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -710,7 +719,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
false
}
value
=
{
Number
(
tableMeta
.
rowData
[
8
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
8
]).
toFixed
(
3
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
...
...
@@ -726,8 +735,8 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
// value={Number(handleValue(tableMeta, 2)).toFixed(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
1
)}
// value={Number(handleValue(tableMeta, 2)).toFixed(
3
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
3
)}
/
>
<
/span>
:
tableMeta
.
rowData
[
0
]
===
6
?
...
...
@@ -738,7 +747,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
3
)}
/
>
<
/span>
:
null
...
...
@@ -773,7 +782,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleValue
(
tableMeta
,
0
)).
toFixed
(
1
)}
value
=
{
Number
(
handleValue
(
tableMeta
,
0
)).
toFixed
(
3
)}
/
>
<
/span>
:
tableMeta
.
rowData
[
0
]
===
3
?
...
...
@@ -788,7 +797,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -872,7 +881,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -896,7 +905,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -924,7 +933,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -948,7 +957,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -976,7 +985,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
@@ -1000,7 +1009,7 @@ export default class FixedAssetsMovementMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleVariance
(
tableMeta
,
1
,
2
)).
toFixed
(
3
)}
/
>
}
/
>
...
...
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