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
a09b2183
Commit
a09b2183
authored
Jan 26, 2021
by
faisalhamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into faisal
parents
4c693f5c
2026af0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
315 additions
and
121 deletions
+315
-121
index.js
src/api/index.js
+7
-2
SubHolding.js
src/container/Laporan/SubHolding.js
+228
-104
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+80
-15
No files found.
src/api/index.js
View file @
a09b2183
...
@@ -247,7 +247,10 @@ const create = (type = "") => {
...
@@ -247,7 +247,10 @@ const create = (type = "") => {
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
getReportBSSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary/balance_sheet/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 +607,9 @@ const create = (type = "") => {
...
@@ -604,7 +607,9 @@ const create = (type = "") => {
getReportCFSumaMR
,
getReportCFSumaMR
,
createReportCF
,
createReportCF
,
getReportCFSuma
,
getReportCFSuma
,
getReportBSSuma
getReportFRMB
,
getReportFRMR
,
getReportFRLastMR
}
}
}
}
...
...
src/container/Laporan/SubHolding.js
View file @
a09b2183
...
@@ -10,6 +10,7 @@ import ReactTooltip from 'react-tooltip'
...
@@ -10,6 +10,7 @@ import ReactTooltip from 'react-tooltip'
import
Images
from
'../../assets/Images'
import
Images
from
'../../assets/Images'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
import
{
format
}
from
'date-fns'
;
const
Alert
=
withStyles
({
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
@@ -41,7 +42,13 @@ export default class SubHolding extends Component {
...
@@ -41,7 +42,13 @@ export default class SubHolding extends Component {
report
:
null
,
report
:
null
,
loading
:
false
,
loading
:
false
,
previewTable
:
false
,
previewTable
:
false
,
OPID
:
null
OPID
:
null
,
listMonths
:
null
,
listUom
:
null
,
listQuarter
:
null
,
month
:
null
,
quarter
:
null
,
uom
:
null
}
}
}
}
...
@@ -133,6 +140,7 @@ export default class SubHolding extends Component {
...
@@ -133,6 +140,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
[]
let
data
=
[]
let
listMonths
=
[]
response
.
data
.
data
.
map
((
item
)
=>
{
response
.
data
.
data
.
map
((
item
)
=>
{
if
(
this
.
state
.
isApprover
)
{
if
(
this
.
state
.
isApprover
)
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
...
@@ -155,6 +163,7 @@ export default class SubHolding extends Component {
...
@@ -155,6 +163,7 @@ export default class SubHolding extends Component {
};
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
// console.log(data)
// console.log(data)
// console.log(this.state.latestPeriode)
// console.log(this.state.latestPeriode)
// console.log(periodeData)
// console.log(periodeData)
...
@@ -162,7 +171,7 @@ export default class SubHolding extends Component {
...
@@ -162,7 +171,7 @@ export default class SubHolding extends Component {
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
// this.getDataTable()
// this.getDataTable()
// this.getSubmission()
// this.getSubmission()
this
.
get
ReportType
()
this
.
get
Month
()
// if (this.state.isApprover === true) {
// if (this.state.isApprover === true) {
// this.getCompanySubmitted()
// this.getCompanySubmitted()
// } else {
// } else {
...
@@ -174,6 +183,78 @@ export default class SubHolding extends Component {
...
@@ -174,6 +183,78 @@ export default class SubHolding extends Component {
})
})
}
}
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
// console.log(response);
let
data
=
response
.
data
.
data
let
monthData
=
data
.
map
((
item
)
=>
{
return
{
month_id
:
item
.
id
,
month_value
:
String
(
item
.
month_name
).
substr
(
0
,
3
)
}
})
let
defaultProps
=
{
options
:
monthData
,
getOptionLabel
:
(
option
)
=>
option
.
month_value
,
};
let
index
=
data
.
findIndex
((
val
)
=>
val
.
month_name
==
month
)
let
listQuarter
=
[
{
name
:
'Q1'
,
value
:
'3'
},
{
name
:
'Q2'
,
value
:
'6'
},
{
name
:
'Q3'
,
value
:
'9'
},
{
name
:
'Q4'
,
value
:
'12'
},
]
let
listUom
=
[{
value
:
'Mio IDR'
}]
let
defaultPropsQuarter
=
{
options
:
listQuarter
,
getOptionLabel
:
(
option
)
=>
option
.
name
,
};
let
defaultPropsUom
=
{
options
:
listUom
,
getOptionLabel
:
(
option
)
=>
option
.
value
,
};
// console.log(month)
// console.log(index)
this
.
setState
({
listMonths
:
defaultProps
,
month
:
index
==
-
1
?
monthData
[
0
]
:
monthData
[
index
],
listQuarter
:
defaultPropsQuarter
,
quarter
:
listQuarter
[
0
],
listUom
:
defaultPropsUom
,
uom
:
listUom
[
0
]
},
()
=>
{
// if (this.state.isApprover === true) {
// if (this.state.submittedOnly) {
// console.log('masuk cuk')
// this.getPeriode()
// } else {
// this.getLastPeriod()
// }
// this.getPeriode()
this
.
getReportType
()
// } else {
// this.getLastPeriod()
// this.getPeriode()
// }
})
}
else
{
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// if (response.data.message.includes("Someone Logged In")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
}
}
else
{
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
})
}
getReportType
()
{
getReportType
()
{
let
payload
=
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
...
@@ -733,9 +814,10 @@ export default class SubHolding extends Component {
...
@@ -733,9 +814,10 @@ export default class SubHolding extends Component {
}
}
}
}
})
})
this
.
setState
({
dataTable
,
loading
:
false
,
previewTable
:
true
,
previewDownload
:
true
},
()
=>
{
console
.
log
(
dataTable
)
console
.
log
(
this
.
state
.
dataTable
)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.getTaxPlanMR(payload)
this
.
setState
({
dataTable
},
()
=>
{
this
.
getTaxPlanMR
(
payload
)
})
})
}
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
},
()
=>
{
...
@@ -874,7 +956,8 @@ export default class SubHolding extends Component {
...
@@ -874,7 +956,8 @@ export default class SubHolding extends Component {
})
})
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
let
dbSumaCF
=
[]
let
dbSumaCF
=
[]
api
.
create
().
getReportCFSuma
(
payload
).
then
(
response
=>
{
let
paylodCF
=
{...
payload
,
months
:
this
.
state
.
month
.
month_id
}
api
.
create
().
getReportCFSuma
(
paylodCF
).
then
(
response
=>
{
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
...
@@ -902,19 +985,22 @@ export default class SubHolding extends Component {
...
@@ -902,19 +985,22 @@ export default class SubHolding extends Component {
item
.
id
,
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
?
0
:
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
)?
0
:
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,
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
)?
0
:
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,
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
)?
0
:
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,
item
.
cash_flow
.
fy_last_year
,
item
.
cash_flow
.
fy_last_year
,
])
])
}
}
...
@@ -947,19 +1033,22 @@ export default class SubHolding extends Component {
...
@@ -947,19 +1033,22 @@ export default class SubHolding extends Component {
item
.
id
,
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
?
0
:
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
)?
0
:
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,
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
)?
0
:
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,
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
)?
0
:
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,
item
.
cash_flow
.
fy_last_year
,
item
.
cash_flow
.
fy_last_year
,
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
...
@@ -1059,7 +1148,7 @@ export default class SubHolding extends Component {
...
@@ -1059,7 +1148,7 @@ export default class SubHolding extends Component {
})
})
this
.
setState
({
dataTable
},
()
=>
{
this
.
setState
({
dataTable
},
()
=>
{
console
.
log
(
this
.
state
.
dataTable
)
console
.
log
(
this
.
state
.
dataTable
)
this
.
getCFSumaMR
(
paylo
ad
,
dbSumaCF
)
this
.
getCFSumaMR
(
paylo
dCF
,
dbSumaCF
)
})
})
}
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
},
()
=>
{
...
@@ -1264,9 +1353,10 @@ export default class SubHolding extends Component {
...
@@ -1264,9 +1353,10 @@ export default class SubHolding extends Component {
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
})
})
}
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') {
...
@@ -1388,21 +1478,22 @@ export default class SubHolding extends Component {
...
@@ -1388,21 +1478,22 @@ 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 payloadOI = {...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,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
,
// "periode": Number(this.state.periode.periode) -1,
"company_id"
:
this
.
state
.
company
.
company_id
,
// "months" : this.state.
"submission_id"
:
this
.
state
.
submissionID
// "company_id": this.state.company.company_id,
}
// "submission_id": this.state.submissionID
// }
api
.
create
().
getReportCFSumaMR
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportCFSumaMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -1631,86 +1722,83 @@ export default class SubHolding extends Component {
...
@@ -1631,86 +1722,83 @@ export default class SubHolding extends Component {
}
}
getTaxPlanMR
(
payload
)
{
getTaxPlanMR
(
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
().
getReportTPMR
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportTPMR
(
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 = []
console
.
log
(
dataTable
)
// if (response.data) {
let
dataTable2
=
[]
// let res = response.data.data
if
(
response
.
data
)
{
// res.map((item,index) => {
let
res
=
response
.
data
.
data
// let indexID = dataTable.findIndex((val) => val[1] == item.id)
res
.
map
((
item
,
index
)
=>
{
// if (indexID != -1) {
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
// const handlePushChild = (items) => {
console
.
log
(
indexID
)
// let indexIDzz = dataTable.findIndex((val) => val[1] === items.id)
if
(
indexID
!=
-
1
)
{
// // console.log(indexIDzz)
const
handlePushChild
=
(
items
)
=>
{
// if (indexIDzz != -1) {
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
===
items
.
id
)
// dataTable2.push([...dataTable[indexIDzz],
// console.log(indexIDzz)
// Number(items.balance_sheet.january).toFixed(1),
if
(
indexIDzz
!=
-
1
)
{
// Number(items.balance_sheet.february).toFixed(1),
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
// Number(items.balance_sheet.march).toFixed(1),
Number
(
items
.
tax_planning_report
.
january
).
toFixed
(
1
),
// Number(items.balance_sheet.april).toFixed(1),
Number
(
items
.
tax_planning_report
.
february
).
toFixed
(
1
),
// Number(items.balance_sheet.may).toFixed(1),
Number
(
items
.
tax_planning_report
.
march
).
toFixed
(
1
),
// Number(items.balance_sheet.june).toFixed(1),
Number
(
items
.
tax_planning_report
.
april
).
toFixed
(
1
),
// Number(items.balance_sheet.july).toFixed(1),
Number
(
items
.
tax_planning_report
.
may
).
toFixed
(
1
),
// Number(items.balance_sheet.august).toFixed(1),
Number
(
items
.
tax_planning_report
.
june
).
toFixed
(
1
),
// Number(items.balance_sheet.september).toFixed(1),
Number
(
items
.
tax_planning_report
.
july
).
toFixed
(
1
),
// Number(items.balance_sheet.october).toFixed(1),
Number
(
items
.
tax_planning_report
.
august
).
toFixed
(
1
),
// Number(items.balance_sheet.november).toFixed(1),
Number
(
items
.
tax_planning_report
.
september
).
toFixed
(
1
),
// Number(items.balance_sheet.december).toFixed(1),
Number
(
items
.
tax_planning_report
.
october
).
toFixed
(
1
),
// ])
Number
(
items
.
tax_planning_report
.
november
).
toFixed
(
1
),
// }
Number
(
items
.
tax_planning_report
.
december
).
toFixed
(
1
),
// if (items.children !== null) {
Number
(
items
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
// if (items.children.length > 0) {
])
// items.children.map((itemss, indexss) => {
}
// handlePushChild(itemss)
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),
dataTable2
.
push
([...
dataTable
[
indexID
],
// Number(item.balance_sheet.april).toFixed(1),
Number
(
item
.
tax_planning_report
.
january
).
toFixed
(
1
),
// Number(item.balance_sheet.may).toFixed(1),
Number
(
item
.
tax_planning_report
.
february
).
toFixed
(
1
),
// Number(item.balance_sheet.june).toFixed(1),
Number
(
item
.
tax_planning_report
.
march
).
toFixed
(
1
),
// Number(item.balance_sheet.july).toFixed(1),
Number
(
item
.
tax_planning_report
.
april
).
toFixed
(
1
),
// Number(item.balance_sheet.august).toFixed(1),
Number
(
item
.
tax_planning_report
.
may
).
toFixed
(
1
),
// Number(item.balance_sheet.september).toFixed(1),
Number
(
item
.
tax_planning_report
.
june
).
toFixed
(
1
),
// Number(item.balance_sheet.october).toFixed(1),
Number
(
item
.
tax_planning_report
.
july
).
toFixed
(
1
),
// Number(item.balance_sheet.november).toFixed(1),
Number
(
item
.
tax_planning_report
.
august
).
toFixed
(
1
),
// Number(item.balance_sheet.december).toFixed(1),
Number
(
item
.
tax_planning_report
.
september
).
toFixed
(
1
),
// ])
Number
(
item
.
tax_planning_report
.
october
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
november
).
toFixed
(
1
),
// if (item.children !== null) {
Number
(
item
.
tax_planning_report
.
december
).
toFixed
(
1
),
// if (item.children.length > 0) {
Number
(
item
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
// item.children.map((items, indexs) => {
])
// handlePushChild(items)
// })
if
(
item
.
children
!==
null
)
{
// }
if
(
item
.
children
.
length
>
0
)
{
// }
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
//
}
}
//
})
})
//
console.log(dataTable2)
console
.
log
(
dataTable2
)
// //
this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
:
dataTable2
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
//
this.setState({ dataTable2 }, () => {
//
this.setState({ dataTable2 }, () => {
//
// console.log(this.state.dataTable2)
//
// console.log(this.state.dataTable2)
//
this.getTaxPlanLastMR(payloadLast)
//
this.getTaxPlanLastMR(payloadLast)
//
})
//
})
//
} else {
}
else
{
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
//
}
}
})
})
}
}
...
@@ -2460,7 +2548,7 @@ export default class SubHolding extends Component {
...
@@ -2460,7 +2548,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
}}
>
<
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
)}
...
@@ -2473,8 +2561,20 @@ export default class SubHolding extends Component {
...
@@ -2473,8 +2561,20 @@ 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
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
...
@@ -2487,8 +2587,20 @@ export default class SubHolding extends Component {
...
@@ -2487,8 +2587,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
.
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
style
=
{{
marginTop
:
15
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listPeriode
}
{...
this
.
state
.
listPeriode
}
id
=
"periode"
id
=
"periode"
...
@@ -2503,6 +2615,18 @@ export default class SubHolding extends Component {
...
@@ -2503,6 +2615,18 @@ 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
.
listUom
}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"uom"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
uom
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
})}
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Uom"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
uom
}
/> : null : null
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
>
...
...
src/container/Laporan/TableSubHolding.js
View file @
a09b2183
...
@@ -9991,7 +9991,7 @@ export default class TableSubHolding extends Component {
...
@@ -9991,7 +9991,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
1
).toFixed(1)}
value={Number(
tableMeta.rowData[22]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10014,7 +10014,7 @@ export default class TableSubHolding extends Component {
...
@@ -10014,7 +10014,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
2
).toFixed(1)}
value={Number(
tableMeta.rowData[23]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10037,7 +10037,7 @@ export default class TableSubHolding extends Component {
...
@@ -10037,7 +10037,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
3
).toFixed(1)}
value={Number(
tableMeta.rowData[24]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10060,7 +10060,7 @@ export default class TableSubHolding extends Component {
...
@@ -10060,7 +10060,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
4
).toFixed(1)}
value={Number(
tableMeta.rowData[25]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10085,7 +10085,7 @@ export default class TableSubHolding extends Component {
...
@@ -10085,7 +10085,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[26]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10108,7 +10108,7 @@ export default class TableSubHolding extends Component {
...
@@ -10108,7 +10108,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[27]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10131,7 +10131,7 @@ export default class TableSubHolding extends Component {
...
@@ -10131,7 +10131,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[28]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10154,7 +10154,7 @@ export default class TableSubHolding extends Component {
...
@@ -10154,7 +10154,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
8
).toFixed(1)}
value={Number(
tableMeta.rowData[29]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10179,7 +10179,7 @@ export default class TableSubHolding extends Component {
...
@@ -10179,7 +10179,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
9
).toFixed(1)}
value={Number(
tableMeta.rowData[30]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10202,7 +10202,7 @@ export default class TableSubHolding extends Component {
...
@@ -10202,7 +10202,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
10
).toFixed(1)}
value={Number(
tableMeta.rowData[31]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10225,7 +10225,7 @@ export default class TableSubHolding extends Component {
...
@@ -10225,7 +10225,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
11
).toFixed(1)}
value={Number(
tableMeta.rowData[32]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10248,7 +10248,7 @@ export default class TableSubHolding extends Component {
...
@@ -10248,7 +10248,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
12
).toFixed(1)}
value={Number(
tableMeta.rowData[33]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10271,7 +10271,7 @@ export default class TableSubHolding extends Component {
...
@@ -10271,7 +10271,7 @@ export default class TableSubHolding extends Component {
type="text"
type="text"
placeholder=""
placeholder=""
disabled={true}
disabled={true}
value={Number(
13
).toFixed(1)}
value={Number(
tableMeta.rowData[34]
).toFixed(1)}
/>
/>
}
}
/>
/>
...
@@ -10284,7 +10284,72 @@ export default class TableSubHolding extends Component {
...
@@ -10284,7 +10284,72 @@ export default class TableSubHolding extends Component {
)
)
}
}
}
}
}
},{
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
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},
]
]
const columnDBOI = [
const columnDBOI = [
...
@@ -15809,7 +15874,7 @@ export default class TableSubHolding extends Component {
...
@@ -15809,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">
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