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
53a0c738
Commit
53a0c738
authored
Aug 25, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
engga cop engga See merge request
!182
parents
0ee4456d
a9dddc68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
7 deletions
+56
-7
BudgetTahunan.js
src/container/BudgetTahunan.js
+1
-1
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+55
-6
No files found.
src/container/BudgetTahunan.js
View file @
53a0c738
...
...
@@ -35,7 +35,7 @@ export default class BudgetTahunan extends Component {
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
,
"re
visi"
:
this
.
state
.
periode
"re
port_type"
:
"Master Budget"
,
}
api
.
create
().
getReportTypeBody
(
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
53a0c738
...
...
@@ -58,6 +58,9 @@ export default class BalanceSheet extends Component {
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
.
length
>
0
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
level
,
item
.
description
])
...
...
@@ -65,23 +68,35 @@ export default class BalanceSheet extends Component {
if
(
i
.
children
)
{
if
(
i
.
children
.
length
>
0
)
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
i
.
children
.
map
(
val
=>
{
dataTable
.
push
([
val
.
type_report_id
,
val
.
id
,
val
.
parent
,
val
.
level
,
val
.
description
])
})
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
}
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
...
...
@@ -89,6 +104,9 @@ export default class BalanceSheet extends Component {
})
}
else
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
level
,
item
.
description
])
...
...
@@ -101,9 +119,24 @@ export default class BalanceSheet extends Component {
})
}
handleValue
(
data
)
{
let
total
=
0
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
if
(
data
[
1
]
==
item
[
2
])
{
total
=
item
[
6
]
==
undefined
?
(
total
+
0
)
:
(
total
+
item
[
6
])
}
// console.log(data[2])
})
return
total
}
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
let
indexParent
=
data
.
findIndex
((
val
)
=>
val
[
1
]
==
data
[
tableMeta
.
rowIndex
][
2
])
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
value
)
let
jagain
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
a
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
value
))
:
(
jagain
+
Number
(
value
))
this
.
setState
({
data
:
a
},
()
=>
console
.
log
(
this
.
state
.
dataTable
))
...
...
@@ -117,7 +150,22 @@ export default class BalanceSheet extends Component {
options
:
{
display
:
false
}
},
{
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -129,10 +177,10 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
388
}}
>
{
tableMeta
.
rowData
[
0
]
==
0
?
{
tableMeta
.
rowData
[
3
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
val
).
toUpperCase
()}
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
3
]
===
1
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
20
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
40
}}
>
{
val
}
<
/span
>
}
...
...
@@ -168,7 +216,7 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
row
Index
===
3
||
tableMeta
.
rowIndex
===
4
||
tableMeta
.
rowIndex
===
9
?
{
tableMeta
.
row
Data
[
0
]
!==
2
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -194,6 +242,7 @@ export default class BalanceSheet extends Component {
placeholder
=
""
value
=
{
value
}
onChange
=
{
event
=>
{
// console.log(event.target)
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
...
...
@@ -201,7 +250,7 @@ export default class BalanceSheet extends Component {
}
/
>
<
/div>
:
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
value
===
""
?
"-"
:
value
}
<
/span
>
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
this
.
handleValue
(
tableMeta
.
rowData
)
}
<
/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