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
30ed4bca
Commit
30ed4bca
authored
Aug 27, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update PL
parent
b5992264
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
26 deletions
+73
-26
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+72
-25
ReportItems.js
src/container/MasterData/ReportItems.js
+1
-1
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
30ed4bca
...
...
@@ -56,8 +56,11 @@ export default class ProfitLoss extends Component {
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
&&
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 ProfitLoss 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 ProfitLoss extends Component {
})
}
else
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
level
,
item
.
description
])
...
...
@@ -101,14 +119,34 @@ export default class ProfitLoss extends Component {
})
}
handleValue
(
data
)
{
let
total
=
0
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
6
]
==
undefined
?
(
total
+
0
)
:
(
total
+
item
[
6
])
}
})
let
indexParent
=
this
.
state
.
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
this
.
state
.
dataTable
[
data
.
rowIndex
][
2
])
let
a
=
this
.
state
.
dataTable
[
data
.
rowIndex
][
data
.
columnIndex
]
=
total
// console.log(indexParent);
return
a
}
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
this
.
setState
({
data
:
a
},
()
=>
console
.
log
(
this
.
state
.
dataTable
))
// let a = data[0].tableMeta.tableData[tableMeta.rowIndex] === value
// console.log(data)
let
indexParent
=
data
.
findIndex
((
val
)
=>
val
[
1
]
==
data
[
tableMeta
.
rowIndex
][
2
])
// console.log(indexParent);
if
(
indexParent
>
0
)
{
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
))
}
else
{
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
value
)
}
// this.setState({
// data: a,
// }, () => console.log(this.state.dataTable))
}
render
()
{
...
...
@@ -117,7 +155,22 @@ export default class ProfitLoss extends Component {
options
:
{
display
:
false
}
},
{
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -129,10 +182,10 @@ export default class ProfitLoss 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,25 +221,12 @@ export default class ProfitLoss 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
]
===
4
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
// <Input
// value={this.formatValue(value)}
// style={{}}
// inputProps={{
// style: {
// color: "#5198ea",
// fontSize: 12,
// textAlign: 'right'
// }
// }}
// disableUnderline={true}
// inputStyle={{ color: 'red' }}
// />
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
...
...
@@ -194,6 +234,7 @@ export default class ProfitLoss extends Component {
placeholder
=
""
value
=
{
value
}
onChange
=
{
event
=>
{
// console.log(event.target)
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
...
...
@@ -201,7 +242,13 @@ export default class ProfitLoss extends Component {
}
/
>
<
/div>
:
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
value
===
""
?
"-"
:
value
}
<
/span
>
tableMeta
.
rowData
[
0
]
===
2
?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
this
.
handleValue
(
tableMeta
)}
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
1
?
<
span
>-<
/span
>
:
<
span
>
validasi
<
/span
>
}
<
/div
>
)
...
...
src/container/MasterData/ReportItems.js
View file @
30ed4bca
...
...
@@ -666,7 +666,7 @@ export default class ReportItems extends Component {
}
},
{
name
:
"Company"
,
name
:
"Company
Name
"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
...
...
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