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
02e5bcba
Commit
02e5bcba
authored
Jan 26, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
3209b81a
c1d323dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
666 additions
and
827 deletions
+666
-827
index.js
src/api/index.js
+14
-1
CatPQ.js
src/container/Laporan/CatPQ.js
+20
-18
SubHolding.js
src/container/Laporan/SubHolding.js
+514
-790
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+118
-18
No files found.
src/api/index.js
View file @
02e5bcba
...
@@ -234,20 +234,27 @@ const create = (type = "") => {
...
@@ -234,20 +234,27 @@ const create = (type = "") => {
const
getLastestUpdateMROI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/monthly_report/get_latest_update'
,
body
)
const
getLastestUpdateMROI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/monthly_report/get_latest_update'
,
body
)
//REPORT NEW
//REPORT NEW
const
getAllReportBS
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/get_report_hierarki'
,
body
)
const
getReportBSMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/master_budget/get_report_hierarki'
,
body
)
const
getReportBSMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/master_budget/get_report_hierarki'
,
body
)
const
getReportBSMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/monthly_report/get_report_hierarki'
,
body
)
const
getReportBSMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/monthly_report/get_report_hierarki'
,
body
)
const
getAllReportPLDetail
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss_detail/get_report_hierarki'
,
body
)
const
getReportPLDetailMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss_detail/master_budget/get_report_hierarki'
,
body
)
const
getReportPLDetailMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss_detail/master_budget/get_report_hierarki'
,
body
)
const
getReportPLDetailMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss_detail/monthly_report/get_report_hierarki'
,
body
)
const
getReportPLDetailMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss_detail/monthly_report/get_report_hierarki'
,
body
)
const
getReportPLMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss/master_budget/get_report_hierarki'
,
body
)
const
getReportPLMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss/master_budget/get_report_hierarki'
,
body
)
const
getReportPLMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss/monthly_report/get_report_hierarki'
,
body
)
const
getReportPLMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_profit_loss/monthly_report/get_report_hierarki'
,
body
)
const
getReportTPMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/master_budget/get_report_hierarki'
,
body
)
const
getReportTPMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/master_budget/get_report_hierarki'
,
body
)
const
getReportTPMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/monthly_report/get_report_hierarki'
,
body
)
const
getReportTPMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/monthly_report/get_report_hierarki'
,
body
)
const
getAllReportOI
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/get_report_hierarki'
,
body
)
const
getReportOIMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/master_budget/get_report_hierarki'
,
body
)
const
getReportOIMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/master_budget/get_report_hierarki'
,
body
)
const
getReportOIMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/monthly_report/get_report_hierarki'
,
body
)
const
getReportOIMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/monthly_report/get_report_hierarki'
,
body
)
const
getReportCFSumaMB
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/master_budget/get_report_hierarki'
,
body
)
const
getReportCFSumaMB
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/master_budget/get_report_hierarki'
,
body
)
const
getReportCFSumaMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/monthly_report/get_report_hierarki'
,
body
)
const
getReportCFSumaMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/monthly_report/get_report_hierarki'
,
body
)
const
getReportCFSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/summary/get_report_hierarki'
,
body
)
const
getReportCFSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cash_flow/summary/get_report_hierarki'
,
body
)
const
getReportPLSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary_profit_loss/summary/get_report_hierarki'
,
body
)
const
getReportPLSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary_profit_loss/summary/get_report_hierarki'
,
body
)
const
getReportFRMB
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ratio/master_budget/get_report_hierarki'
,
body
)
const
getReportFRMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ratio/monthly_report/get_report_hierarki'
,
body
)
const
getReportFRLastMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ratio/monthly_report_last_year/get_report_hierarki'
,
body
)
//CASH FLOW
//CASH FLOW
const
getDetailReportCF
=
(
body
)
=>
api
.
post
(
'/transaction/cash_flow/master_budget/get_report_hierarki'
,
body
)
const
getDetailReportCF
=
(
body
)
=>
api
.
post
(
'/transaction/cash_flow/master_budget/get_report_hierarki'
,
body
)
...
@@ -604,7 +611,13 @@ const create = (type = "") => {
...
@@ -604,7 +611,13 @@ const create = (type = "") => {
getReportCFSumaMR
,
getReportCFSumaMR
,
createReportCF
,
createReportCF
,
getReportCFSuma
,
getReportCFSuma
,
getReportPLSuma
getReportPLSuma
,
getAllReportBS
,
getAllReportPLDetail
,
getAllReportOI
,
getReportFRMB
,
getReportFRMR
,
getReportFRLastMR
}
}
}
}
...
...
src/container/Laporan/CatPQ.js
View file @
02e5bcba
...
@@ -127,7 +127,7 @@ export default class SummaryFR extends Component {
...
@@ -127,7 +127,7 @@ export default class SummaryFR extends Component {
}
}
}
}
},{
},{
name
:
`
${
Number
(
this
.
props
.
periode
)
-
1
}
`
,
name
:
"2020"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
top
:
0
,
zIndex
:
102
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
top
:
0
,
zIndex
:
102
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
...
@@ -149,6 +149,7 @@ export default class SummaryFR extends Component {
...
@@ -149,6 +149,7 @@ export default class SummaryFR extends Component {
),
),
setCellProps
:
()
=>
({
style2
}),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
{
console
.
log
(
tableMeta
);
}
return
(
return
(
<
div
>
<
div
>
<
div
className
=
"grid grid-3x content-center"
>
<
div
className
=
"grid grid-3x content-center"
>
...
@@ -168,7 +169,7 @@ export default class SummaryFR extends Component {
...
@@ -168,7 +169,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -191,7 +192,7 @@ export default class SummaryFR extends Component {
...
@@ -191,7 +192,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
2
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
4
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -214,7 +215,7 @@ export default class SummaryFR extends Component {
...
@@ -214,7 +215,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
5
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -292,7 +293,7 @@ export default class SummaryFR extends Component {
...
@@ -292,7 +293,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
6
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -315,7 +316,7 @@ export default class SummaryFR extends Component {
...
@@ -315,7 +316,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
2
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
7
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -338,7 +339,7 @@ export default class SummaryFR extends Component {
...
@@ -338,7 +339,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
8
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -361,7 +362,7 @@ export default class SummaryFR extends Component {
...
@@ -361,7 +362,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -384,7 +385,7 @@ export default class SummaryFR extends Component {
...
@@ -384,7 +385,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -409,7 +410,7 @@ export default class SummaryFR extends Component {
...
@@ -409,7 +410,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
1
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -432,7 +433,7 @@ export default class SummaryFR extends Component {
...
@@ -432,7 +433,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
2
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
2
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -455,7 +456,7 @@ export default class SummaryFR extends Component {
...
@@ -455,7 +456,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
3
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -478,7 +479,7 @@ export default class SummaryFR extends Component {
...
@@ -478,7 +479,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
14
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -501,7 +502,7 @@ export default class SummaryFR extends Component {
...
@@ -501,7 +502,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
3
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
15
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -541,7 +542,7 @@ export default class SummaryFR extends Component {
...
@@ -541,7 +542,7 @@ export default class SummaryFR 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
6
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -578,7 +579,7 @@ export default class SummaryFR extends Component {
...
@@ -578,7 +579,7 @@ export default class SummaryFR 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
7
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -615,7 +616,7 @@ export default class SummaryFR extends Component {
...
@@ -615,7 +616,7 @@ export default class SummaryFR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
1
6
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
1
8
]).
toFixed
(
1
)}
/
>
/
>
}
}
/
>
/
>
...
@@ -629,9 +630,10 @@ export default class SummaryFR extends Component {
...
@@ -629,9 +630,10 @@ export default class SummaryFR extends Component {
]
]
let
datas
=
[
let
datas
=
[
[
"ABCD"
,
"%"
,
"Rp Bio"
,
{
a
:
"0"
,
b
:
"0"
,
c
:
"0"
,
d
:
"0"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
}],
[
"ABCD"
,
"%"
,
"Rp Bio"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
{
a
:
"0"
,
b
:
"0"
,
c
:
"0"
,
d
:
"0"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
}],
// ["Total Assets", "unit try", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
// ["Total Assets", "unit try", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
]
]
console
.
log
(
datas
);
const
loadingComponent
=
(
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
<
PropagateLoader
...
...
src/container/Laporan/SubHolding.js
View file @
02e5bcba
...
@@ -205,13 +205,13 @@ export default class SubHolding extends Component {
...
@@ -205,13 +205,13 @@ export default class SubHolding extends Component {
let
index
=
data
.
findIndex
((
val
)
=>
val
.
month_name
==
month
)
let
index
=
data
.
findIndex
((
val
)
=>
val
.
month_name
==
month
)
let
listQuarter
=
[
let
listQuarter
=
[
{
name
:
'Q1'
,
value
:
'3'
},
{
name
:
'Q1'
,
value
:
'3'
},
{
name
:
'Q2'
,
value
:
'6'
},
{
name
:
'Q2'
,
value
:
'6'
},
{
name
:
'Q3'
,
value
:
'9'
},
{
name
:
'Q3'
,
value
:
'9'
},
{
name
:
'Q4'
,
value
:
'12'
},
{
name
:
'Q4'
,
value
:
'12'
},
]
]
let
listUom
=
[{
value
:
'Mio IDR'
}]
let
listUom
=
[{
value
:
'Mio IDR'
}]
let
defaultPropsQuarter
=
{
let
defaultPropsQuarter
=
{
options
:
listQuarter
,
options
:
listQuarter
,
...
@@ -268,7 +268,7 @@ export default class SubHolding extends Component {
...
@@ -268,7 +268,7 @@ export default class SubHolding extends Component {
if
(
this
.
state
.
report
.
value
===
2
)
{
if
(
this
.
state
.
report
.
value
===
2
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Balance Sheet'
)
{
if
(
item
.
report_name
===
'Balance Sheet'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
this
.
getSubmission
()
})
})
}
}
...
@@ -276,7 +276,7 @@ export default class SubHolding extends Component {
...
@@ -276,7 +276,7 @@ export default class SubHolding extends Component {
}
else
if
(
this
.
state
.
report
.
value
===
1
)
{
}
else
if
(
this
.
state
.
report
.
value
===
1
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Profit Loss'
)
{
if
(
item
.
report_name
===
'Profit Loss'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
this
.
getSubmission
()
})
})
}
}
...
@@ -284,13 +284,13 @@ export default class SubHolding extends Component {
...
@@ -284,13 +284,13 @@ export default class SubHolding extends Component {
}
else
if
(
this
.
state
.
report
.
value
===
5
)
{
}
else
if
(
this
.
state
.
report
.
value
===
5
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Tax Planning'
)
{
if
(
item
.
report_name
===
'Tax Planning'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
this
.
getSubmission
()
})
})
}
}
})
})
}
else
{
}
else
{
this
.
setState
({
revisionType
:
0
},
()
=>
{
this
.
setState
({
revisionType
:
0
},
()
=>
{
this
.
getSubmission
()
this
.
getSubmission
()
})
})
}
}
...
@@ -343,7 +343,7 @@ export default class SubHolding extends Component {
...
@@ -343,7 +343,7 @@ export default class SubHolding extends Component {
"submission_id"
:
this
.
state
.
submissionID
"submission_id"
:
this
.
state
.
submissionID
}
}
if
(
this
.
state
.
report
.
value
===
1
)
{
if
(
this
.
state
.
report
.
value
===
1
)
{
api
.
create
().
get
ReportPLDetailMB
(
payload
).
then
(
response
=>
{
api
.
create
().
get
AllReportPLDetail
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -374,7 +374,31 @@ export default class SubHolding extends Component {
...
@@ -374,7 +374,31 @@ export default class SubHolding extends Component {
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_more_year
,
item
.
order
item
.
order
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
monthly_last_year_december
])
])
}
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
...
@@ -409,7 +433,31 @@ export default class SubHolding extends Component {
...
@@ -409,7 +433,31 @@ export default class SubHolding extends Component {
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_more_year
,
item
.
order
item
.
order
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
monthly_last_year_december
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
...
@@ -421,16 +469,18 @@ export default class SubHolding extends Component {
...
@@ -421,16 +469,18 @@ export default class SubHolding extends Component {
})
})
// console.log(dataTable)
// console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
},
()
=>
{
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
console
.
log
(
this
.
state
.
dataTable
)
this
.
getPLDetailMR
(
payload
)
// this.setState({ dataTable }, () => {
})
// console.log(this.state.dataTable)
// this.getPLDetailMR(payload)
// })
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
}
})
})
}
else
if
(
this
.
state
.
report
.
value
===
2
)
{
}
else
if
(
this
.
state
.
report
.
value
===
2
)
{
api
.
create
().
get
ReportBSMB
(
payload
).
then
(
response
=>
{
api
.
create
().
get
AllReportBS
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
...
@@ -464,7 +514,31 @@ export default class SubHolding extends Component {
...
@@ -464,7 +514,31 @@ export default class SubHolding extends Component {
Number
(
item
.
balance_sheet
.
total_more_year
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
total_more_year
).
toFixed
(
1
),
item
.
order
,
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
item
.
condition_if_wrong
,
item
.
balance_sheet
.
monthly_january
,
item
.
balance_sheet
.
monthly_february
,
item
.
balance_sheet
.
monthly_march
,
item
.
balance_sheet
.
monthly_april
,
item
.
balance_sheet
.
monthly_may
,
item
.
balance_sheet
.
monthly_june
,
item
.
balance_sheet
.
monthly_july
,
item
.
balance_sheet
.
monthly_august
,
item
.
balance_sheet
.
monthly_september
,
item
.
balance_sheet
.
monthly_october
,
item
.
balance_sheet
.
monthly_november
,
item
.
balance_sheet
.
monthly_december
,
item
.
balance_sheet
.
monthly_last_year_january
,
item
.
balance_sheet
.
monthly_last_year_february
,
item
.
balance_sheet
.
monthly_last_year_march
,
item
.
balance_sheet
.
monthly_last_year_april
,
item
.
balance_sheet
.
monthly_last_year_may
,
item
.
balance_sheet
.
monthly_last_year_june
,
item
.
balance_sheet
.
monthly_last_year_july
,
item
.
balance_sheet
.
monthly_last_year_august
,
item
.
balance_sheet
.
monthly_last_year_september
,
item
.
balance_sheet
.
monthly_last_year_october
,
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_december
])
])
}
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
...
@@ -501,7 +575,31 @@ export default class SubHolding extends Component {
...
@@ -501,7 +575,31 @@ export default class SubHolding extends Component {
Number
(
item
.
balance_sheet
.
total_more_year
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
total_more_year
).
toFixed
(
1
),
item
.
order
,
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
item
.
condition_if_wrong
,
item
.
balance_sheet
.
monthly_january
,
item
.
balance_sheet
.
monthly_february
,
item
.
balance_sheet
.
monthly_march
,
item
.
balance_sheet
.
monthly_april
,
item
.
balance_sheet
.
monthly_may
,
item
.
balance_sheet
.
monthly_june
,
item
.
balance_sheet
.
monthly_july
,
item
.
balance_sheet
.
monthly_august
,
item
.
balance_sheet
.
monthly_september
,
item
.
balance_sheet
.
monthly_october
,
item
.
balance_sheet
.
monthly_november
,
item
.
balance_sheet
.
monthly_december
,
item
.
balance_sheet
.
monthly_last_year_january
,
item
.
balance_sheet
.
monthly_last_year_february
,
item
.
balance_sheet
.
monthly_last_year_march
,
item
.
balance_sheet
.
monthly_last_year_april
,
item
.
balance_sheet
.
monthly_last_year_may
,
item
.
balance_sheet
.
monthly_last_year_june
,
item
.
balance_sheet
.
monthly_last_year_july
,
item
.
balance_sheet
.
monthly_last_year_august
,
item
.
balance_sheet
.
monthly_last_year_september
,
item
.
balance_sheet
.
monthly_last_year_october
,
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_december
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
...
@@ -511,11 +609,11 @@ export default class SubHolding extends Component {
...
@@ -511,11 +609,11 @@ export default class SubHolding extends Component {
}
}
}
}
})
})
//
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
this
.
setState
({
dataTable
},
()
=>
{
//
this.setState({ dataTable }, () => {
console
.
log
(
this
.
state
.
dataTable
)
//
console.log(this.state.dataTable)
this
.
getBalanceSheetMR
(
payload
)
//
this.getBalanceSheetMR(payload)
})
//
})
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
}
...
@@ -848,7 +946,7 @@ export default class SubHolding extends Component {
...
@@ -848,7 +946,7 @@ export default class SubHolding extends Component {
}
else
{
}
else
{
OPID
=
null
OPID
=
null
}
}
this
.
setState
({
OPID
},
()
=>
{
this
.
setState
({
OPID
},
()
=>
{
let
payloadOI
=
{
let
payloadOI
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"operating_indicator_id"
:
this
.
state
.
OPID
,
"operating_indicator_id"
:
this
.
state
.
OPID
,
...
@@ -856,7 +954,7 @@ export default class SubHolding extends Component {
...
@@ -856,7 +954,7 @@ export default class SubHolding extends Component {
"report_id"
:
21
"report_id"
:
21
}
}
api
.
create
().
get
ReportOIMB
(
payloadOI
).
then
(
response
=>
{
api
.
create
().
get
AllReportOI
(
payloadOI
).
then
(
response
=>
{
// console.log(payload);
// console.log(payload);
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
...
@@ -889,7 +987,19 @@ export default class SubHolding extends Component {
...
@@ -889,7 +987,19 @@ export default class SubHolding extends Component {
item
.
master_budget
.
november
==
""
?
item
.
master_budget
.
november
:
String
(
item
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
november
)
:
Number
(
item
.
master_budget
.
november
).
toFixed
(
1
),
item
.
master_budget
.
november
==
""
?
item
.
master_budget
.
november
:
String
(
item
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
november
)
:
Number
(
item
.
master_budget
.
november
).
toFixed
(
1
),
item
.
master_budget
.
december
==
""
?
item
.
master_budget
.
december
:
String
(
item
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
december
)
:
Number
(
item
.
master_budget
.
december
).
toFixed
(
1
),
item
.
master_budget
.
december
==
""
?
item
.
master_budget
.
december
:
String
(
item
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
december
)
:
Number
(
item
.
master_budget
.
december
).
toFixed
(
1
),
item
.
master_budget
.
total_current_year
==
""
?
item
.
master_budget
.
total_current_year
:
String
(
item
.
master_budget
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
total_current_year
)
:
Number
(
item
.
master_budget
.
total_current_year
).
toFixed
(
1
),
item
.
master_budget
.
total_current_year
==
""
?
item
.
master_budget
.
total_current_year
:
String
(
item
.
master_budget
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
total_current_year
)
:
Number
(
item
.
master_budget
.
total_current_year
).
toFixed
(
1
),
item
.
order
item
.
order
,
item
.
master_budget
.
monthly_january
==
""
?
item
.
master_budget
.
monthly_january
:
String
(
item
.
master_budget
.
monthly_january
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_january
)
:
Number
(
item
.
master_budget
.
monthly_january
).
toFixed
(
1
),
item
.
master_budget
.
monthly_february
==
""
?
item
.
master_budget
.
monthly_february
:
String
(
item
.
master_budget
.
monthly_february
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_february
)
:
Number
(
item
.
master_budget
.
monthly_february
).
toFixed
(
1
),
item
.
master_budget
.
monthly_march
==
""
?
item
.
master_budget
.
monthly_march
:
String
(
item
.
master_budget
.
monthly_march
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_march
)
:
Number
(
item
.
master_budget
.
monthly_march
).
toFixed
(
1
),
item
.
master_budget
.
monthly_april
==
""
?
item
.
master_budget
.
monthly_april
:
String
(
item
.
master_budget
.
monthly_april
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_april
)
:
Number
(
item
.
master_budget
.
monthly_april
).
toFixed
(
1
),
item
.
master_budget
.
monthly_may
==
""
?
item
.
master_budget
.
monthly_may
:
String
(
item
.
master_budget
.
monthly_may
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_may
)
:
Number
(
item
.
master_budget
.
monthly_may
).
toFixed
(
1
),
item
.
master_budget
.
monthly_june
==
""
?
item
.
master_budget
.
monthly_june
:
String
(
item
.
master_budget
.
monthly_june
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_june
)
:
Number
(
item
.
master_budget
.
monthly_june
).
toFixed
(
1
),
item
.
master_budget
.
monthly_july
==
""
?
item
.
master_budget
.
monthly_july
:
String
(
item
.
master_budget
.
monthly_july
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_july
)
:
Number
(
item
.
master_budget
.
monthly_july
).
toFixed
(
1
),
item
.
master_budget
.
monthly_august
==
""
?
item
.
master_budget
.
monthly_august
:
String
(
item
.
master_budget
.
monthly_august
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_august
)
:
Number
(
item
.
master_budget
.
monthly_august
).
toFixed
(
1
),
item
.
master_budget
.
monthly_september
==
""
?
item
.
master_budget
.
monthly_september
:
String
(
item
.
master_budget
.
monthly_september
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_september
)
:
Number
(
item
.
master_budget
.
monthly_september
).
toFixed
(
1
),
item
.
master_budget
.
monthly_october
==
""
?
item
.
master_budget
.
monthly_october
:
String
(
item
.
master_budget
.
monthly_october
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_october
)
:
Number
(
item
.
master_budget
.
monthly_october
).
toFixed
(
1
),
item
.
master_budget
.
monthly_november
==
""
?
item
.
master_budget
.
monthly_november
:
String
(
item
.
master_budget
.
monthly_november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_november
)
:
Number
(
item
.
master_budget
.
monthly_november
).
toFixed
(
1
),
item
.
master_budget
.
monthly_december
==
""
?
item
.
master_budget
.
monthly_december
:
String
(
item
.
master_budget
.
monthly_december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_december
)
:
Number
(
item
.
master_budget
.
monthly_december
).
toFixed
(
1
),
])
])
}
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
...
@@ -923,7 +1033,19 @@ export default class SubHolding extends Component {
...
@@ -923,7 +1033,19 @@ export default class SubHolding extends Component {
item
.
master_budget
.
november
==
""
?
item
.
master_budget
.
november
:
String
(
item
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
november
)
:
Number
(
item
.
master_budget
.
november
).
toFixed
(
1
),
item
.
master_budget
.
november
==
""
?
item
.
master_budget
.
november
:
String
(
item
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
november
)
:
Number
(
item
.
master_budget
.
november
).
toFixed
(
1
),
item
.
master_budget
.
december
==
""
?
item
.
master_budget
.
december
:
String
(
item
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
december
)
:
Number
(
item
.
master_budget
.
december
).
toFixed
(
1
),
item
.
master_budget
.
december
==
""
?
item
.
master_budget
.
december
:
String
(
item
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
december
)
:
Number
(
item
.
master_budget
.
december
).
toFixed
(
1
),
item
.
master_budget
.
total_current_year
==
""
?
item
.
master_budget
.
total_current_year
:
String
(
item
.
master_budget
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
total_current_year
)
:
Number
(
item
.
master_budget
.
total_current_year
).
toFixed
(
1
),
item
.
master_budget
.
total_current_year
==
""
?
item
.
master_budget
.
total_current_year
:
String
(
item
.
master_budget
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
total_current_year
)
:
Number
(
item
.
master_budget
.
total_current_year
).
toFixed
(
1
),
item
.
order
item
.
order
,
item
.
master_budget
.
monthly_january
==
""
?
item
.
master_budget
.
monthly_january
:
String
(
item
.
master_budget
.
monthly_january
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_january
)
:
Number
(
item
.
master_budget
.
monthly_january
).
toFixed
(
1
),
item
.
master_budget
.
monthly_february
==
""
?
item
.
master_budget
.
monthly_february
:
String
(
item
.
master_budget
.
monthly_february
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_february
)
:
Number
(
item
.
master_budget
.
monthly_february
).
toFixed
(
1
),
item
.
master_budget
.
monthly_march
==
""
?
item
.
master_budget
.
monthly_march
:
String
(
item
.
master_budget
.
monthly_march
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_march
)
:
Number
(
item
.
master_budget
.
monthly_march
).
toFixed
(
1
),
item
.
master_budget
.
monthly_april
==
""
?
item
.
master_budget
.
monthly_april
:
String
(
item
.
master_budget
.
monthly_april
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_april
)
:
Number
(
item
.
master_budget
.
monthly_april
).
toFixed
(
1
),
item
.
master_budget
.
monthly_may
==
""
?
item
.
master_budget
.
monthly_may
:
String
(
item
.
master_budget
.
monthly_may
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_may
)
:
Number
(
item
.
master_budget
.
monthly_may
).
toFixed
(
1
),
item
.
master_budget
.
monthly_june
==
""
?
item
.
master_budget
.
monthly_june
:
String
(
item
.
master_budget
.
monthly_june
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_june
)
:
Number
(
item
.
master_budget
.
monthly_june
).
toFixed
(
1
),
item
.
master_budget
.
monthly_july
==
""
?
item
.
master_budget
.
monthly_july
:
String
(
item
.
master_budget
.
monthly_july
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_july
)
:
Number
(
item
.
master_budget
.
monthly_july
).
toFixed
(
1
),
item
.
master_budget
.
monthly_august
==
""
?
item
.
master_budget
.
monthly_august
:
String
(
item
.
master_budget
.
monthly_august
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_august
)
:
Number
(
item
.
master_budget
.
monthly_august
).
toFixed
(
1
),
item
.
master_budget
.
monthly_september
==
""
?
item
.
master_budget
.
monthly_september
:
String
(
item
.
master_budget
.
monthly_september
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_september
)
:
Number
(
item
.
master_budget
.
monthly_september
).
toFixed
(
1
),
item
.
master_budget
.
monthly_october
==
""
?
item
.
master_budget
.
monthly_october
:
String
(
item
.
master_budget
.
monthly_october
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_october
)
:
Number
(
item
.
master_budget
.
monthly_october
).
toFixed
(
1
),
item
.
master_budget
.
monthly_november
==
""
?
item
.
master_budget
.
monthly_november
:
String
(
item
.
master_budget
.
monthly_november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_november
)
:
Number
(
item
.
master_budget
.
monthly_november
).
toFixed
(
1
),
item
.
master_budget
.
monthly_december
==
""
?
item
.
master_budget
.
monthly_december
:
String
(
item
.
master_budget
.
monthly_december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
monthly_december
)
:
Number
(
item
.
master_budget
.
monthly_december
).
toFixed
(
1
),
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
...
@@ -933,10 +1055,12 @@ export default class SubHolding extends Component {
...
@@ -933,10 +1055,12 @@ export default class SubHolding extends Component {
}
}
}
}
})
})
this
.
setState
({
dataTable
},
()
=>
{
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
console
.
log
(
this
.
state
.
dataTable
)
this
.
getOIMR
(
payloadOI
)
// this.setState({ dataTable }, () => {
})
// console.log(this.state.dataTable)
// this.getOIMR(payloadOI)
// })
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
@@ -956,7 +1080,7 @@ export default class SubHolding extends Component {
...
@@ -956,7 +1080,7 @@ export default class SubHolding extends Component {
})
})
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
let
dbSumaCF
=
[]
let
dbSumaCF
=
[]
let
paylodCF
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
let
paylodCF
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
api
.
create
().
getReportCFSuma
(
paylodCF
).
then
(
response
=>
{
api
.
create
().
getReportCFSuma
(
paylodCF
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
...
@@ -965,41 +1089,41 @@ export default class SubHolding extends Component {
...
@@ -965,41 +1089,41 @@ export default class SubHolding extends Component {
const
handlePushChild
=
(
item
)
=>
{
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
indexIDzz
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
if
(
indexIDzz
===
-
1
)
{
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
let
persenFy
=
Number
(
fy_actual
/
fy
)
dbSumaCF
.
push
([
dbSumaCF
.
push
([
item
.
id
,
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd
,
item
.
cash_flow
.
ytd
,
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
// isNaN(persenYtd)? 0 : persenYtd * 100,
// isNaN(persenYtd)? 0 : persenYtd * 100,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter
,
item
.
cash_flow
.
quarter
,
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy
,
item
.
cash_flow
.
fy
,
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
// isNaN(persenFy)? 0 : persenFy * 100,
// isNaN(persenFy)? 0 : persenFy * 100,
item
.
cash_flow
.
fy_last_year
,
item
.
cash_flow
.
fy_last_year
,
])
])
...
@@ -1012,42 +1136,42 @@ export default class SubHolding extends Component {
...
@@ -1012,42 +1136,42 @@ export default class SubHolding extends Component {
}
}
}
}
}
}
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
console
.
log
(
persenMtd
)
console
.
log
(
persenMtd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
let
persenFy
=
Number
(
fy_actual
/
fy
)
dbSumaCF
.
push
([
dbSumaCF
.
push
([
item
.
id
,
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd
,
item
.
cash_flow
.
ytd
,
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
// isNaN(persenYtd)? 0 : persenYtd * 100,
// isNaN(persenYtd)? 0 : persenYtd * 100,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter
,
item
.
cash_flow
.
quarter
,
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy
,
item
.
cash_flow
.
fy
,
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
// isNaN(persenFy)? 0 : persenFy * 100,
// isNaN(persenFy)? 0 : persenFy * 100,
item
.
cash_flow
.
fy_last_year
,
item
.
cash_flow
.
fy_last_year
,
])
])
...
@@ -1060,7 +1184,7 @@ export default class SubHolding extends Component {
...
@@ -1060,7 +1184,7 @@ export default class SubHolding extends Component {
}
}
})
})
console
.
log
(
dbSumaCF
)
console
.
log
(
dbSumaCF
)
this
.
setState
({
dbSumaCF
},
()
=>
{
this
.
setState
({
dbSumaCF
},
()
=>
{
api
.
create
().
getReportCFSumaMB
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportCFSumaMB
(
payload
).
then
(
response
=>
{
// console.log(payload);
// console.log(payload);
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -1180,95 +1304,83 @@ export default class SubHolding extends Component {
...
@@ -1180,95 +1304,83 @@ export default class SubHolding extends Component {
}
}
})
})
}
else
if
(
this
.
state
.
report
.
value
===
7
)
{
}
else
if
(
this
.
state
.
report
.
value
===
7
)
{
api
.
create
().
getReportBSMB
(
payload
).
then
(
response
=>
{
let
payload
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"months"
:
"1"
}
api
.
create
().
getReportBSSuma
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
console
.
log
(
response
);
console
.
log
(
response
);
// let dataTable = []
let
dataTable
=
[]
// if (response.data) {
if
(
response
.
data
)
{
// let res = response.data.data
let
res
=
response
.
data
.
data
// const handlePushChild = (item) => {
const
handlePushChild
=
(
item
)
=>
{
// let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
// if (indexIDzz === -1) {
if
(
indexIDzz
===
-
1
)
{
// dataTable.push([
dataTable
.
push
([
// item.type_report_id,
item
.
type_report_id
,
// item.id,
item
.
id
,
// item.parent,
item
.
parent
,
// item.formula,
item
.
formula
,
// item.level,
item
.
level
,
// item.description,
item
.
description
,
// item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before,
item
.
balance_sheet
.
last_month
,
// Number(item.balance_sheet.january).toFixed(1),
item
.
balance_sheet
.
actual
,
// Number(item.balance_sheet.february).toFixed(1),
item
.
balance_sheet
.
mb
,
// Number(item.balance_sheet.march).toFixed(1),
item
.
balance_sheet
.
percent_of_mb
,
// Number(item.balance_sheet.april).toFixed(1),
item
.
balance_sheet
.
ol
,
// Number(item.balance_sheet.may).toFixed(1),
item
.
balance_sheet
.
percent_of_ol
,
// Number(item.balance_sheet.june).toFixed(1),
item
.
balance_sheet
.
last_year
,
// Number(item.balance_sheet.july).toFixed(1),
item
.
balance_sheet
.
forecast_next_year
,
// Number(item.balance_sheet.august).toFixed(1),
item
.
balance_sheet
.
forecast_next_two_year
,
// Number(item.balance_sheet.september).toFixed(1),
item
.
order
// Number(item.balance_sheet.october).toFixed(1),
])
// Number(item.balance_sheet.november).toFixed(1),
}
// Number(item.balance_sheet.december).toFixed(1),
if
(
item
.
children
!==
null
)
{
// Number(item.balance_sheet.total_current_year).toFixed(1),
if
(
item
.
children
.
length
>
0
)
{
// Number(item.balance_sheet.total_next_year).toFixed(1),
item
.
children
.
map
((
items
,
indexs
)
=>
{
// Number(item.balance_sheet.total_more_year).toFixed(1),
handlePushChild
(
items
)
// item.order,
})
// item.condition_it_should_be,
}
// item.condition_if_wrong
}
// ])
}
// }
res
.
map
((
item
,
index
)
=>
{
// if (item.children !== null) {
dataTable
.
push
([
// if (item.children.length > 0) {
item
.
type_report_id
,
// item.children.map((items, indexs) => {
item
.
id
,
// handlePushChild(items)
item
.
parent
,
// })
item
.
formula
,
// }
item
.
level
,
// }
item
.
description
,
// }
item
.
balance_sheet
.
last_month
,
// res.map((item, index) => {
item
.
balance_sheet
.
actual
,
// dataTable.push([
item
.
balance_sheet
.
mb
,
// item.type_report_id,
item
.
balance_sheet
.
percent_of_mb
,
// item.id,
item
.
balance_sheet
.
ol
,
// item.parent,
item
.
balance_sheet
.
percent_of_ol
,
// item.formula,
item
.
balance_sheet
.
last_year
,
// item.level,
item
.
balance_sheet
.
forecast_next_year
,
// item.description,
item
.
balance_sheet
.
forecast_next_two_year
,
// item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before,
item
.
order
// Number(item.balance_sheet.january).toFixed(1),
])
// Number(item.balance_sheet.february).toFixed(1),
if
(
item
.
children
!==
null
)
{
// Number(item.balance_sheet.march).toFixed(1),
if
(
item
.
children
.
length
>
0
)
{
// Number(item.balance_sheet.april).toFixed(1),
item
.
children
.
map
((
items
,
indexs
)
=>
{
// Number(item.balance_sheet.may).toFixed(1),
handlePushChild
(
items
)
// Number(item.balance_sheet.june).toFixed(1),
})
// Number(item.balance_sheet.july).toFixed(1),
}
// Number(item.balance_sheet.august).toFixed(1),
}
// Number(item.balance_sheet.september).toFixed(1),
})
// Number(item.balance_sheet.october).toFixed(1),
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// Number(item.balance_sheet.november).toFixed(1),
this
.
setState
({
dataTable
},
()
=>
{
// Number(item.balance_sheet.december).toFixed(1),
console
.
log
(
this
.
state
.
dataTable
)
// Number(item.balance_sheet.total_current_year).toFixed(1),
// Number(item.balance_sheet.total_next_year).toFixed(1),
// Number(item.balance_sheet.total_more_year).toFixed(1),
// item.order,
// item.condition_it_should_be,
// item.condition_if_wrong
// ])
// if (item.children !== null) {
// if (item.children.length > 0) {
// item.children.map((items, indexs) => {
// handlePushChild(items)
// })
// }
// }
// })
// // this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getBalanceSheetMR(payload)
// this.getBalanceSheetMR(payload)
//
})
})
//
} else {
}
else
{
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
//
}
}
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
})
})
...
@@ -1388,9 +1500,10 @@ export default class SubHolding extends Component {
...
@@ -1388,9 +1500,10 @@ export default class SubHolding extends Component {
}
}
})
})
}
else
if
(
this
.
state
.
report
.
value
===
9
)
{
}
else
if
(
this
.
state
.
report
.
value
===
9
)
{
api
.
create
().
getReportHierarkiFRMB
(
payload
).
then
(
response
=>
{
let
paylodFR
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
// console.log(payload);
api
.
create
().
getReportFRMB
(
paylodFR
).
then
(
response
=>
{
// console.log(response);
console
.
log
(
payload
);
console
.
log
(
response
);
// let dataTable = []
// let dataTable = []
// if (response.data) {
// if (response.data) {
// if (response.data.status === 'success') {
// if (response.data.status === 'success') {
...
@@ -1512,14 +1625,14 @@ export default class SubHolding extends Component {
...
@@ -1512,14 +1625,14 @@ export default class SubHolding extends Component {
// } else {
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// }
// }
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
fals
e
})
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
tru
e
})
})
})
}
}
}
}
getCFSumaMR
(
payload
,
dbSumaCF
)
{
getCFSumaMR
(
payload
,
dbSumaCF
)
{
let
payloadLast
=
{
...
payload
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
}
let
payloadLast
=
{
...
payload
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
}
// let payloadLast = {
// let payloadLast = {
// "report_id": this.state.report.value,
// "report_id": this.state.report.value,
// "revision": this.state.revisionType,
// "revision": this.state.revisionType,
...
@@ -1535,7 +1648,7 @@ export default class SubHolding extends Component {
...
@@ -1535,7 +1648,7 @@ export default class SubHolding extends Component {
let
dataTable2
=
[]
let
dataTable2
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
const
handlePushChild
=
(
items
)
=>
{
...
@@ -1612,7 +1725,7 @@ export default class SubHolding extends Component {
...
@@ -1612,7 +1725,7 @@ export default class SubHolding extends Component {
let
dataTable3
=
[]
let
dataTable3
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexIDSuma
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
0
]
==
item
.
id
)
let
indexIDSuma
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
0
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
...
@@ -1680,81 +1793,6 @@ export default class SubHolding extends Component {
...
@@ -1680,81 +1793,6 @@ export default class SubHolding extends Component {
})
})
}
}
getOIMR
(
payload
)
{
// let payloadOI = {...payload, "periode": Number(this.state.periode.periode) - 1}
api
.
create
().
getReportOIMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
items
.
master_budget
.
january
==
""
?
items
.
master_budget
.
january
:
String
(
items
.
master_budget
.
january
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
january
)
:
Number
(
items
.
master_budget
.
january
).
toFixed
(
1
),
items
.
master_budget
.
february
==
""
?
items
.
master_budget
.
february
:
String
(
items
.
master_budget
.
february
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
february
)
:
Number
(
items
.
master_budget
.
february
).
toFixed
(
1
),
items
.
master_budget
.
march
==
""
?
items
.
master_budget
.
march
:
String
(
items
.
master_budget
.
march
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
march
)
:
Number
(
items
.
master_budget
.
march
).
toFixed
(
1
),
items
.
master_budget
.
april
==
""
?
items
.
master_budget
.
april
:
String
(
items
.
master_budget
.
april
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
april
)
:
Number
(
items
.
master_budget
.
april
).
toFixed
(
1
),
items
.
master_budget
.
may
==
""
?
items
.
master_budget
.
may
:
String
(
items
.
master_budget
.
may
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
may
)
:
Number
(
items
.
master_budget
.
may
).
toFixed
(
1
),
items
.
master_budget
.
june
==
""
?
items
.
master_budget
.
june
:
String
(
items
.
master_budget
.
june
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
june
)
:
Number
(
items
.
master_budget
.
june
).
toFixed
(
1
),
items
.
master_budget
.
july
==
""
?
items
.
master_budget
.
july
:
String
(
items
.
master_budget
.
july
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
july
)
:
Number
(
items
.
master_budget
.
july
).
toFixed
(
1
),
items
.
master_budget
.
august
==
""
?
items
.
master_budget
.
august
:
String
(
items
.
master_budget
.
august
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
august
)
:
Number
(
items
.
master_budget
.
august
).
toFixed
(
1
),
items
.
master_budget
.
september
==
""
?
items
.
master_budget
.
september
:
String
(
items
.
master_budget
.
september
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
september
)
:
Number
(
items
.
master_budget
.
september
).
toFixed
(
1
),
items
.
master_budget
.
october
==
""
?
items
.
master_budget
.
october
:
String
(
items
.
master_budget
.
october
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
october
)
:
Number
(
items
.
master_budget
.
october
).
toFixed
(
1
),
items
.
master_budget
.
november
==
""
?
items
.
master_budget
.
november
:
String
(
items
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
november
)
:
Number
(
items
.
master_budget
.
november
).
toFixed
(
1
),
items
.
master_budget
.
december
==
""
?
items
.
master_budget
.
december
:
String
(
items
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
items
.
master_budget
.
december
)
:
Number
(
items
.
master_budget
.
december
).
toFixed
(
1
),
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable2
.
push
([...
dataTable
[
indexID
],
item
.
master_budget
.
january
==
""
?
item
.
master_budget
.
january
:
String
(
item
.
master_budget
.
january
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
january
)
:
Number
(
item
.
master_budget
.
january
).
toFixed
(
1
),
item
.
master_budget
.
february
==
""
?
item
.
master_budget
.
february
:
String
(
item
.
master_budget
.
february
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
february
)
:
Number
(
item
.
master_budget
.
february
).
toFixed
(
1
),
item
.
master_budget
.
march
==
""
?
item
.
master_budget
.
march
:
String
(
item
.
master_budget
.
march
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
march
)
:
Number
(
item
.
master_budget
.
march
).
toFixed
(
1
),
item
.
master_budget
.
april
==
""
?
item
.
master_budget
.
april
:
String
(
item
.
master_budget
.
april
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
april
)
:
Number
(
item
.
master_budget
.
april
).
toFixed
(
1
),
item
.
master_budget
.
may
==
""
?
item
.
master_budget
.
may
:
String
(
item
.
master_budget
.
may
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
may
)
:
Number
(
item
.
master_budget
.
may
).
toFixed
(
1
),
item
.
master_budget
.
june
==
""
?
item
.
master_budget
.
june
:
String
(
item
.
master_budget
.
june
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
june
)
:
Number
(
item
.
master_budget
.
june
).
toFixed
(
1
),
item
.
master_budget
.
july
==
""
?
item
.
master_budget
.
july
:
String
(
item
.
master_budget
.
july
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
july
)
:
Number
(
item
.
master_budget
.
july
).
toFixed
(
1
),
item
.
master_budget
.
august
==
""
?
item
.
master_budget
.
august
:
String
(
item
.
master_budget
.
august
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
august
)
:
Number
(
item
.
master_budget
.
august
).
toFixed
(
1
),
item
.
master_budget
.
september
==
""
?
item
.
master_budget
.
september
:
String
(
item
.
master_budget
.
september
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
september
)
:
Number
(
item
.
master_budget
.
september
).
toFixed
(
1
),
item
.
master_budget
.
october
==
""
?
item
.
master_budget
.
october
:
String
(
item
.
master_budget
.
october
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
october
)
:
Number
(
item
.
master_budget
.
october
).
toFixed
(
1
),
item
.
master_budget
.
november
==
""
?
item
.
master_budget
.
november
:
String
(
item
.
master_budget
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
november
)
:
Number
(
item
.
master_budget
.
november
).
toFixed
(
1
),
item
.
master_budget
.
december
==
""
?
item
.
master_budget
.
december
:
String
(
item
.
master_budget
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
master_budget
.
december
)
:
Number
(
item
.
master_budget
.
december
).
toFixed
(
1
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable2
)
this
.
setState
({
dataTable
:
dataTable2
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getTaxPlanMR
(
payload
)
{
getTaxPlanMR
(
payload
)
{
api
.
create
().
getReportTPMR
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportTPMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
...
@@ -1764,7 +1802,7 @@ export default class SubHolding extends Component {
...
@@ -1764,7 +1802,7 @@ export default class SubHolding extends Component {
let
dataTable2
=
[]
let
dataTable2
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
console
.
log
(
indexID
)
console
.
log
(
indexID
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
...
@@ -1836,7 +1874,7 @@ export default class SubHolding extends Component {
...
@@ -1836,7 +1874,7 @@ export default class SubHolding extends Component {
})
})
}
}
get
BalanceSheet
MR
(
payload
)
{
get
ReportPL
MR
(
payload
)
{
let
payloadLast
=
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"report_id"
:
this
.
state
.
report
.
value
,
"revision"
:
this
.
state
.
revisionType
,
"revision"
:
this
.
state
.
revisionType
,
...
@@ -1844,14 +1882,14 @@ export default class SubHolding extends Component {
...
@@ -1844,14 +1882,14 @@ export default class SubHolding extends Component {
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"submission_id"
:
this
.
state
.
submissionID
"submission_id"
:
this
.
state
.
submissionID
}
}
api
.
create
().
getReport
BS
MR
(
payload
).
then
(
response
=>
{
api
.
create
().
getReport
PL
MR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
let
dataTable
=
this
.
state
.
dataTable
let
dataTable2
=
[]
let
dataTable2
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
const
handlePushChild
=
(
items
)
=>
{
...
@@ -1859,176 +1897,19 @@ export default class SubHolding extends Component {
...
@@ -1859,176 +1897,19 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
Number
(
items
.
balance_sheet
.
january
).
toFixed
(
1
),
items
.
formula
,
Number
(
items
.
balance_sheet
.
february
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
Number
(
items
.
balance_sheet
.
march
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
Number
(
items
.
balance_sheet
.
april
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
Number
(
items
.
balance_sheet
.
may
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
Number
(
items
.
balance_sheet
.
june
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
Number
(
items
.
balance_sheet
.
july
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
Number
(
items
.
balance_sheet
.
august
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
Number
(
items
.
balance_sheet
.
september
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
Number
(
items
.
balance_sheet
.
october
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
Number
(
items
.
balance_sheet
.
november
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
Number
(
items
.
balance_sheet
.
december
).
toFixed
(
1
),
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
])
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable2
.
push
([...
dataTable
[
indexID
],
Number
(
item
.
balance_sheet
.
january
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
february
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
march
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
april
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
may
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
june
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
july
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
august
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
september
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
october
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
november
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
december
).
toFixed
(
1
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable2
)
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable2
},
()
=>
{
// console.log(this.state.dataTable2)
this
.
getBalanceSheetLastMR
(
payloadLast
)
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getBalanceSheetLastMR
(
payload
)
{
api
.
create
().
getReportBSMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable2
=
this
.
state
.
dataTable2
let
dataTable3
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
Number
(
items
.
balance_sheet
.
january
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
february
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
march
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
april
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
may
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
june
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
july
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
august
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
september
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
october
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
november
).
toFixed
(
1
),
Number
(
items
.
balance_sheet
.
december
).
toFixed
(
1
),
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
Number
(
item
.
balance_sheet
.
january
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
february
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
march
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
april
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
may
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
june
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
july
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
august
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
september
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
october
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
november
).
toFixed
(
1
),
Number
(
item
.
balance_sheet
.
december
).
toFixed
(
1
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getReportPLMR
(
payload
)
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"revision"
:
this
.
state
.
revisionType
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"submission_id"
:
this
.
state
.
submissionID
}
api
.
create
().
getReportPLMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
items
.
formula
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
])
])
}
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
!==
null
)
{
...
@@ -2087,7 +1968,7 @@ export default class SubHolding extends Component {
...
@@ -2087,7 +1968,7 @@ export default class SubHolding extends Component {
let
dataTable3
=
[]
let
dataTable3
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
const
handlePushChild
=
(
items
)
=>
{
...
@@ -2152,163 +2033,6 @@ export default class SubHolding extends Component {
...
@@ -2152,163 +2033,6 @@ export default class SubHolding extends Component {
})
})
}
}
getPLDetailMR
(
payload
)
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"revision"
:
this
.
state
.
revisionType
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"submission_id"
:
this
.
state
.
submissionID
}
api
.
create
().
getReportPLDetailMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
items
.
profit_loss
.
january
,
items
.
profit_loss
.
february
,
items
.
profit_loss
.
march
,
items
.
profit_loss
.
april
,
items
.
profit_loss
.
may
,
items
.
profit_loss
.
june
,
items
.
profit_loss
.
july
,
items
.
profit_loss
.
august
,
items
.
profit_loss
.
september
,
items
.
profit_loss
.
october
,
items
.
profit_loss
.
november
,
items
.
profit_loss
.
december
,
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable2
.
push
([...
dataTable
[
indexID
],
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable2
)
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable2
},
()
=>
{
// console.log(this.state.dataTable2)
this
.
getPLDetailLastMR
(
payloadLast
)
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getPLDetailLastMR
(
payload
)
{
api
.
create
().
getReportPLDetailMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable2
=
this
.
state
.
dataTable2
let
dataTable3
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
items
.
profit_loss
.
january
,
items
.
profit_loss
.
february
,
items
.
profit_loss
.
march
,
items
.
profit_loss
.
april
,
items
.
profit_loss
.
may
,
items
.
profit_loss
.
june
,
items
.
profit_loss
.
july
,
items
.
profit_loss
.
august
,
items
.
profit_loss
.
september
,
items
.
profit_loss
.
october
,
items
.
profit_loss
.
november
,
items
.
profit_loss
.
december
,
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getRatioMR
(
payload
)
{
getRatioMR
(
payload
)
{
let
payloadLast
=
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"report_id"
:
this
.
state
.
report
.
value
,
...
@@ -2325,7 +2049,7 @@ export default class SubHolding extends Component {
...
@@ -2325,7 +2049,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
const
handlePushChild
=
(
items
)
=>
{
...
@@ -2413,7 +2137,7 @@ export default class SubHolding extends Component {
...
@@ -2413,7 +2137,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
const
handlePushChild
=
(
items
)
=>
{
...
@@ -2582,7 +2306,7 @@ export default class SubHolding extends Component {
...
@@ -2582,7 +2306,7 @@ export default class SubHolding extends Component {
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Sub
Holding
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Sub
Holding
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
minWidth
:
'max-content'
,
padding
:
'20px 20px 0px 20px'
}}
>
<
div
style
=
{{
minWidth
:
'max-content'
,
padding
:
'20px 20px 0px 20px'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
<
Autocomplete
options
=
{
this
.
state
.
reportType
}
options
=
{
this
.
state
.
reportType
}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
...
@@ -2595,18 +2319,6 @@ export default class SubHolding extends Component {
...
@@ -2595,18 +2319,6 @@ export default class SubHolding extends Component {
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
report
}
value
=
{
this
.
state
.
report
}
/
>
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
listMonths
}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"months"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
month
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
})}
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Months"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
month
}
/> : null : null
}
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -2621,20 +2333,20 @@ export default class SubHolding extends Component {
...
@@ -2621,20 +2333,20 @@ export default class SubHolding extends Component {
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
company
}
value
=
{
this
.
state
.
company
}
/
>
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
list
Quarter
}
{...
this
.
state
.
list
Uom
}
// getOptionLabel={(option) => titleCase(option.label)}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"
quarter
"
id
=
"
uom
"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
quarter
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
uom
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
this
.
getReportType
()
})}
})}
disableClearable
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
style
=
{{
width
:
250
,
marginLeft
:
10
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"
Quarter
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"
Uom
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
quarter
}
value
=
{
this
.
state
.
uom
}
/> : null : null
}
/> : null : null
}
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listPeriode
}
{...
this
.
state
.
listPeriode
}
id
=
"periode"
id
=
"periode"
...
@@ -2649,18 +2361,30 @@ export default class SubHolding extends Component {
...
@@ -2649,18 +2361,30 @@ export default class SubHolding extends Component {
/>
}
/>
}
value
=
{
this
.
state
.
periode
}
value
=
{
this
.
state
.
periode
}
/
>
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
list
Uom
}
{...
this
.
state
.
list
Months
}
// getOptionLabel={(option) => titleCase(option.label)}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"
uom
"
id
=
"
months
"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
uom
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
month
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
this
.
getReportType
()
})}
})}
disableClearable
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
style
=
{{
width
:
250
,
marginLeft
:
10
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"
Uom
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"
Months
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
uom
}
value
=
{
this
.
state
.
month
}
/> : null : null
}
/> : null : null
}
{
/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listQuarter}
// getOptionLabel={(option) => titleCase(option.label)}
id="quarter"
onChange={(event, newInputValue) => this.setState({ quarter: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
})}
disableClearable
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Quarter" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.quarter}
/> : null : null} */
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
>
...
...
src/container/Laporan/TableSubHolding.js
View file @
02e5bcba
...
@@ -14919,6 +14919,31 @@ export default class TableSubHolding extends Component {
...
@@ -14919,6 +14919,31 @@ export default class TableSubHolding extends Component {
const columnSummaryBS = [
const columnSummaryBS = [
{
{
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
},{
name: "Account",
name: "Account",
options: {
options: {
customHeadRender: (columnMeta) => (
customHeadRender: (columnMeta) => (
...
@@ -14982,7 +15007,7 @@ export default class TableSubHolding extends Component {
...
@@ -14982,7 +15007,7 @@ export default class TableSubHolding extends Component {
),
),
setCellProps: () => ({ style2 }),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
//
console.log(tableMeta)
return (
return (
<div>
<div>
<div className="grid grid-2x content-center">
<div className="grid grid-2x content-center">
...
@@ -14999,11 +15024,11 @@ export default class TableSubHolding extends Component {
...
@@ -14999,11 +15024,11 @@ export default class TableSubHolding extends Component {
control={
control={
<NumberFormat
<NumberFormat
thousandSeparator={true}
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
96
, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
70
, backgroundColor: 'transparent' }}
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
1
).toFixed(1)}
value={Number(
tableMeta.rowData[6]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15022,11 +15047,11 @@ export default class TableSubHolding extends Component {
...
@@ -15022,11 +15047,11 @@ export default class TableSubHolding extends Component {
control={
control={
<NumberFormat
<NumberFormat
thousandSeparator={true}
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
96
, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
70
, backgroundColor: 'transparent' }}
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
2
).toFixed(1)}
value={Number(
tableMeta.rowData[7]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15045,11 +15070,11 @@ export default class TableSubHolding extends Component {
...
@@ -15045,11 +15070,11 @@ export default class TableSubHolding extends Component {
control={
control={
<NumberFormat
<NumberFormat
thousandSeparator={true}
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
96
, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
70
, backgroundColor: 'transparent' }}
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
3
).toFixed(1)}
value={Number(
tableMeta.rowData[8]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15068,11 +15093,11 @@ export default class TableSubHolding extends Component {
...
@@ -15068,11 +15093,11 @@ export default class TableSubHolding extends Component {
control={
control={
<NumberFormat
<NumberFormat
thousandSeparator={true}
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
96
, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width:
70
, backgroundColor: 'transparent' }}
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
4
).toFixed(1)}
value={Number(
tableMeta.rowData[9]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15097,7 +15122,7 @@ export default class TableSubHolding extends Component {
...
@@ -15097,7 +15122,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
5
).toFixed(1)}
value={Number(
tableMeta.rowData[10]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15120,7 +15145,7 @@ export default class TableSubHolding extends Component {
...
@@ -15120,7 +15145,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
6
).toFixed(1)}
value={Number(
tableMeta.rowData[11]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15143,7 +15168,7 @@ export default class TableSubHolding extends Component {
...
@@ -15143,7 +15168,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
7
).toFixed(1)}
value={Number(
tableMeta.rowData[12]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -15166,7 +15191,7 @@ export default class TableSubHolding extends Component {
...
@@ -15166,7 +15191,7 @@ export default class TableSubHolding extends Component {
</TableCell> */}
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8'
, width: 96
}}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8' }}>
<span>{"ForeCast"}</span>
<span>{"ForeCast"}</span>
</div>
</div>
</div>
</div>
...
@@ -15176,7 +15201,27 @@ export default class TableSubHolding extends Component {
...
@@ -15176,7 +15201,27 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => {
return (
return (
<div style={{textAlign: 'right' }}>
<div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(tableMeta.rowData[12]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
)
)
}
}
...
@@ -15191,7 +15236,7 @@ export default class TableSubHolding extends Component {
...
@@ -15191,7 +15236,7 @@ export default class TableSubHolding extends Component {
</TableCell> */}
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8'
, width: 96
}}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8' }}>
<span>{"ForeCast"}</span>
<span>{"ForeCast"}</span>
</div>
</div>
</div>
</div>
...
@@ -15201,11 +15246,66 @@ export default class TableSubHolding extends Component {
...
@@ -15201,11 +15246,66 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => {
return (
return (
<div style={{textAlign: 'right' }}>
<div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(tableMeta.rowData[12]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
)
)
}
}
}
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}
}
]
]
...
@@ -15774,7 +15874,7 @@ export default class TableSubHolding extends Component {
...
@@ -15774,7 +15874,7 @@ export default class TableSubHolding extends Component {
),
),
setCellProps: () => ({ style2 }),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
//
console.log(tableMeta)
return (
return (
<div>
<div>
<div className="grid grid-2x content-center">
<div className="grid grid-2x content-center">
...
@@ -16048,7 +16148,7 @@ export default class TableSubHolding extends Component {
...
@@ -16048,7 +16148,7 @@ export default class TableSubHolding extends Component {
<div style={{ padding: '0px 20px 20px 20px', width: this.props.width - (this.props.open === true ? 350 : 100) }}>
<div style={{ padding: '0px 20px 20px 20px', width: this.props.width - (this.props.open === true ? 350 : 100) }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
<MUIDataTable
data={this.props.type ===
7 ? dataSummaryBS : this.props.type ===
8 ? dataSummaryPL : this.props.type === 9 ? dataSummaryFR : dataTable2}
data={this.props.type === 8 ? dataSummaryPL : this.props.type === 9 ? dataSummaryFR : dataTable2}
columns={this.props.type === 2 ? columnDBBS : this.props.type === 1 ? columnDBPLDetail : this.props.type === 3 ? columnDBPL : this.props.type === 4 ? columnDBFR : this.props.type === 5 ? columnDBTP : this.props.type === 7 ? columnSummaryBS : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : this.props.type === 8 ? columnSummaryPL : this.props.type === 9 ? columnSummaryFR : columns}
columns={this.props.type === 2 ? columnDBBS : this.props.type === 1 ? columnDBPLDetail : this.props.type === 3 ? columnDBPL : this.props.type === 4 ? columnDBFR : this.props.type === 5 ? columnDBTP : this.props.type === 7 ? columnSummaryBS : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : this.props.type === 8 ? columnSummaryPL : this.props.type === 9 ? columnSummaryFR : columns}
options={options}
options={options}
/>
/>
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