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
f6259b23
Commit
f6259b23
authored
Sep 22, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update fam 220920 siang
parent
9aa2cbd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
67 deletions
+30
-67
FixedAssetsMovement.js
src/container/BudgetTahunan/FixedAssetsMovement.js
+30
-67
No files found.
src/container/BudgetTahunan/FixedAssetsMovement.js
View file @
f6259b23
...
...
@@ -81,7 +81,7 @@ export default class FixedAssetsMovement extends Component {
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
fixed_asset_movement
.
total_actual_before
,
item
.
fixed_asset_movement
.
total_actual_before
===
null
?
"0"
:
item
.
fixed_asset_movement
.
total_actual_before
===
""
?
"0"
:
item
.
fixed_asset_movement
.
total_actual_before
,
item
.
fixed_asset_movement
.
january
,
item
.
fixed_asset_movement
.
february
,
item
.
fixed_asset_movement
.
march
,
...
...
@@ -115,7 +115,7 @@ export default class FixedAssetsMovement extends Component {
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
fixed_asset_movement
.
total_actual_before
,
item
.
fixed_asset_movement
.
total_actual_before
===
null
?
"0"
:
item
.
fixed_asset_movement
.
total_actual_before
===
""
?
"0"
:
item
.
fixed_asset_movement
.
total_actual_before
,
item
.
fixed_asset_movement
.
january
,
item
.
fixed_asset_movement
.
february
,
item
.
fixed_asset_movement
.
march
,
...
...
@@ -402,6 +402,18 @@ export default class FixedAssetsMovement extends Component {
}
}
}
const
handleTotal
=
(
tableMeta
)
=>
{
let
total
=
0
dataTable2
[
tableMeta
.
rowIndex
].
map
((
item
,
index
)
=>
{
if
(
index
>=
7
&&
index
<=
18
)
{
let
valItem
=
item
==
undefined
||
item
==
""
?
0
:
item
total
+=
Number
(
valItem
)
}
})
dataTable2
[
tableMeta
.
rowIndex
][
19
]
=
total
return
total
// console.log(total);
}
const
handleValue
=
(
data
)
=>
{
let
total
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
...
...
@@ -535,6 +547,8 @@ export default class FixedAssetsMovement extends Component {
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
console
.
log
(
tableMeta
)}
{
console
.
log
(
value
)}
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
...
...
@@ -1637,29 +1651,9 @@ export default class FixedAssetsMovement extends Component {
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
3
?
<
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
=
""
value
=
{
value
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
div
style
=
{{
width
:
96
,
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
2
?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -1669,48 +1663,17 @@ export default class FixedAssetsMovement extends Component {
disabled
=
{
true
}
value
=
{
handleValue
(
tableMeta
)}
/
>
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
6
?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={handleFormula(value, tableMeta)}
// />
null
:
tableMeta
.
rowData
[
0
]
===
5
?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={handleFormula(value, tableMeta)}
// />
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value)}
// />
null
:
null
}
<
/span>
:
<
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
=
{
handleTotal
(
tableMeta
)}
/
>
<
/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