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
958ac199
Commit
958ac199
authored
Jan 28, 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
dc2cbc4b
fdf781c9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
179 additions
and
259 deletions
+179
-259
SubHolding.js
src/container/Laporan/SubHolding.js
+2
-82
MonthlyReport.js
src/container/MonthlyReport.js
+3
-3
BalanceSheetMR.js
src/container/MonthlyReport/BalanceSheetMR.js
+1
-1
FixedAssetsMovementMR.js
src/container/MonthlyReport/FixedAssetsMovementMR.js
+1
-1
SummaryOfTriputra.js
src/container/SummaryTriputra/SummaryOfTriputra.js
+166
-166
TableSummaryTriputra.js
src/container/SummaryTriputra/TableSummaryTriputra.js
+6
-6
No files found.
src/container/Laporan/SubHolding.js
View file @
958ac199
...
...
@@ -34,7 +34,7 @@ export default class SubHolding extends Component {
{
value
:
4
,
label
:
'DB Ratio'
},
{
value
:
5
,
label
:
'DB Tax Planning'
},
{
value
:
21
,
label
:
'DB Operating Indicator'
},
{
value
:
6
,
label
:
'Cash F
L
ow - Summary'
},
{
value
:
6
,
label
:
'Cash F
l
ow - Summary'
},
{
value
:
7
,
label
:
'Balance Sheet - Summary'
},
{
value
:
8
,
label
:
'Profit Loss - Summary'
},
{
value
:
9
,
label
:
'financial Ratio - Summary'
},
...
...
@@ -1866,86 +1866,6 @@ export default class SubHolding extends Component {
})
}
getTaxPlanMR
(
payload
)
{
api
.
create
().
getReportTPMR
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
console
.
log
(
dataTable
)
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
Number
(
items
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
august
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
september
).
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
),
Number
(
items
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable2
.
push
([...
dataTable
[
indexID
],
Number
(
item
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
august
).
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
),
Number
(
item
.
tax_planning_report
.
december
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
total_actual_before
).
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.getTaxPlanLastMR(payloadLast)
// })
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
getReportPLMR
(
payload
)
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
...
...
@@ -2484,7 +2404,7 @@ export default class SubHolding extends Component {
this
.
getReportType
()
})}
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Months"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
month
}
/
>
...
...
src/container/MonthlyReport.js
View file @
958ac199
...
...
@@ -1079,7 +1079,7 @@ export default class MonthlyReport extends Component {
}
})
console
.
log
(
dataTable
)
this
.
setState
({
dbCF
:
dataTable
,
loading
:
false
},
()
=>
{
this
.
setState
({
dbCF
:
dataTable
},
()
=>
{
this
.
olahDataCashFlow
(
this
.
state
.
dbCF
,
type
)
})
}
...
...
@@ -1797,7 +1797,7 @@ export default class MonthlyReport extends Component {
getOptionLabel
=
{(
option
)
=>
option
.
name
}
style
=
{{
width
:
250
}}
onChange
=
{(
event
,
newInputValue
)
=>
{
this
.
setState
({
selectedStatus
:
newInputValue
},
()
=>
{
this
.
setState
({
selectedStatus
:
newInputValue
,
loading
:
true
},
()
=>
{
console
.
log
(
newInputValue
);
this
.
getCompanySubmitted
()
})
...
...
@@ -1823,7 +1823,7 @@ export default class MonthlyReport extends Component {
{...
this
.
state
.
listCompany
}
id
=
"company"
disabled
=
{
this
.
state
.
listCompany
===
null
?
true
:
false
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
,
loading
:
true
},
()
=>
{
this
.
getMonthlyReportID
()
})}
disableClearable
...
...
src/container/MonthlyReport/BalanceSheetMR.js
View file @
958ac199
...
...
@@ -289,7 +289,7 @@ export default class BalanceSheetMR extends Component {
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/balance_sheet/monthly_report/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/balance_sheet/monthly_report/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
)
res
=
await
res
.
blob
()
// console.log(res)
...
...
src/container/MonthlyReport/FixedAssetsMovementMR.js
View file @
958ac199
...
...
@@ -232,7 +232,7 @@ export default class FixedAssetsMovementMR extends Component {
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/fam/monthly_report/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/fam/monthly_report/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
)
res
=
await
res
.
blob
()
console
.
log
(
res
);
...
...
src/container/SummaryTriputra/SummaryOfTriputra.js
View file @
958ac199
...
...
@@ -401,179 +401,179 @@ export default class SummaryOfTriputra extends Component {
}
})
}
else
if
(
this
.
state
.
report
.
value
===
3
)
{
api
.
create
().
getReportHierarkiPL
(
payload
).
then
(
response
=>
{
// console.log(response);
if
(
response
.
data
)
{
//
api.create().getReportHierarkiPL(payload).then(response => {
//
// console.log(response);
//
if (response.data) {
let
dataTable
=
[]
console
.
log
(
response
)
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_detail
.
total_actual_before
===
null
?
"0"
:
item
.
profit_detail
.
total_actual_before
===
""
?
"0"
:
item
.
profit_detail
.
total_actual_before
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
january
,
formula
:
item
.
profit_detail
.
january_formula
}
:
item
.
profit_detail
.
january
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
february
,
formula
:
item
.
profit_detail
.
february_formula
}
:
item
.
profit_detail
.
february
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
march
,
formula
:
item
.
profit_detail
.
march_formula
}
:
item
.
profit_detail
.
march
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
april
,
formula
:
item
.
profit_detail
.
april_formula
}
:
item
.
profit_detail
.
april
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
may
,
formula
:
item
.
profit_detail
.
may_formula
}
:
item
.
profit_detail
.
may
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
june
,
formula
:
item
.
profit_detail
.
june_formula
}
:
item
.
profit_detail
.
june
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
july
,
formula
:
item
.
profit_detail
.
july_formula
}
:
item
.
profit_detail
.
july
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
august
,
formula
:
item
.
profit_detail
.
august_formula
}
:
item
.
profit_detail
.
august
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
september
,
formula
:
item
.
profit_detail
.
september_formula
}
:
item
.
profit_detail
.
september
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
october
,
formula
:
item
.
profit_detail
.
october_formula
}
:
item
.
profit_detail
.
october
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
november
,
formula
:
item
.
profit_detail
.
november_formula
}
:
item
.
profit_detail
.
november
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
december
,
formula
:
item
.
profit_detail
.
december_formula
}
:
item
.
profit_detail
.
december
,
item
.
profit_detail
.
total_current_year
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
0
:
item
.
profit_detail
.
total_next_year
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
0
:
item
.
profit_detail
.
total_more_year
,
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
item
.
profit_detail
.
forecast_formula
==
null
?
[]
:
item
.
profit_detail
.
forecast_formula
])
//
console.log(response)
//
let res = response.data.data
//
const handlePushChild = (item) => {
//
dataTable.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
item.description,
//
item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
//
item.profit_detail.total_current_year,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
//
item.order,
//
item.condition_it_should_be,
//
item.condition_if_wrong,
//
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
//
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_detail
.
total_actual_before
===
null
?
"0"
:
item
.
profit_detail
.
total_actual_before
===
""
?
"0"
:
item
.
profit_detail
.
total_actual_before
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
january
,
formula
:
item
.
profit_detail
.
january_formula
}
:
item
.
profit_detail
.
january
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
february
,
formula
:
item
.
profit_detail
.
february_formula
}
:
item
.
profit_detail
.
february
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
march
,
formula
:
item
.
profit_detail
.
march_formula
}
:
item
.
profit_detail
.
march
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
april
,
formula
:
item
.
profit_detail
.
april_formula
}
:
item
.
profit_detail
.
april
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
may
,
formula
:
item
.
profit_detail
.
may_formula
}
:
item
.
profit_detail
.
may
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
june
,
formula
:
item
.
profit_detail
.
june_formula
}
:
item
.
profit_detail
.
june
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
july
,
formula
:
item
.
profit_detail
.
july_formula
}
:
item
.
profit_detail
.
july
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
august
,
formula
:
item
.
profit_detail
.
august_formula
}
:
item
.
profit_detail
.
august
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
september
,
formula
:
item
.
profit_detail
.
september_formula
}
:
item
.
profit_detail
.
september
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
october
,
formula
:
item
.
profit_detail
.
october_formula
}
:
item
.
profit_detail
.
october
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
november
,
formula
:
item
.
profit_detail
.
november_formula
}
:
item
.
profit_detail
.
november
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
{
value
:
item
.
profit_detail
.
december
,
formula
:
item
.
profit_detail
.
december_formula
}
:
item
.
profit_detail
.
december
,
item
.
profit_detail
.
total_current_year
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
0
:
item
.
profit_detail
.
total_next_year
,
item
.
type_report_id
==
5
||
item
.
type_report_id
==
6
||
item
.
type_report_id
==
7
?
0
:
item
.
profit_detail
.
total_more_year
,
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
item
.
profit_detail
.
forecast_formula
==
null
?
[]
:
item
.
profit_detail
.
forecast_formula
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
//
if (item.children !== null) {
//
if (item.children.length > 0) {
//
item.children.map((items, indexs) => {
//
handlePushChild(items)
//
})
//
}
//
}
//
}
//
res.map((item, index) => {
//
dataTable.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
item.description,
//
item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
//
item.profit_detail.total_current_year,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
//
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
//
item.order,
//
item.condition_it_should_be,
//
item.condition_if_wrong,
//
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
//
])
//
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
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
//
} else {
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
//
}
//
})
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
api
.
create
().
getReportHierarkiFR
(
payload
).
then
(
response
=>
{
//
api.create().getReportHierarkiFR(payload).then(response => {
// console.log(payload);
console
.
log
(
response
);
//
console.log(response);
let
dataTable
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
ratio
.
total_actual_before
===
null
?
"0.0"
:
item
.
ratio
.
total_actual_before
===
""
?
"0.0"
:
item
.
ratio
.
total_actual_before
,
Number
(
item
.
ratio
.
january
).
toFixed
(
1
),
Number
(
item
.
ratio
.
february
).
toFixed
(
1
),
Number
(
item
.
ratio
.
march
).
toFixed
(
1
),
Number
(
item
.
ratio
.
april
).
toFixed
(
1
),
Number
(
item
.
ratio
.
may
).
toFixed
(
1
),
Number
(
item
.
ratio
.
june
).
toFixed
(
1
),
Number
(
item
.
ratio
.
july
).
toFixed
(
1
),
Number
(
item
.
ratio
.
august
).
toFixed
(
1
),
Number
(
item
.
ratio
.
september
).
toFixed
(
1
),
Number
(
item
.
ratio
.
october
).
toFixed
(
1
),
Number
(
item
.
ratio
.
november
).
toFixed
(
1
),
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_current_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
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
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
ratio
.
total_actual_before
===
null
?
"0.0"
:
item
.
ratio
.
total_actual_before
===
""
?
"0.0"
:
item
.
ratio
.
total_actual_before
,
Number
(
item
.
ratio
.
january
).
toFixed
(
1
),
Number
(
item
.
ratio
.
february
).
toFixed
(
1
),
Number
(
item
.
ratio
.
march
).
toFixed
(
1
),
Number
(
item
.
ratio
.
april
).
toFixed
(
1
),
Number
(
item
.
ratio
.
may
).
toFixed
(
1
),
Number
(
item
.
ratio
.
june
).
toFixed
(
1
),
Number
(
item
.
ratio
.
july
).
toFixed
(
1
),
Number
(
item
.
ratio
.
august
).
toFixed
(
1
),
Number
(
item
.
ratio
.
september
).
toFixed
(
1
),
Number
(
item
.
ratio
.
october
).
toFixed
(
1
),
Number
(
item
.
ratio
.
november
).
toFixed
(
1
),
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_current_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
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
)
})
}
}
})
//
if (response.data) {
//
let res = response.data.data
//
const handlePushChild = (item) => {
//
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
//
if (indexIDzz === -1) {
//
dataTable.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
item.description,
//
item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
//
Number(item.ratio.january).toFixed(1),
//
Number(item.ratio.february).toFixed(1),
//
Number(item.ratio.march).toFixed(1),
//
Number(item.ratio.april).toFixed(1),
//
Number(item.ratio.may).toFixed(1),
//
Number(item.ratio.june).toFixed(1),
//
Number(item.ratio.july).toFixed(1),
//
Number(item.ratio.august).toFixed(1),
//
Number(item.ratio.september).toFixed(1),
//
Number(item.ratio.october).toFixed(1),
//
Number(item.ratio.november).toFixed(1),
//
Number(item.ratio.december).toFixed(1),
//
Number(item.ratio.total_current_year).toFixed(1),
//
Number(item.ratio.total_next_year).toFixed(1),
//
Number(item.ratio.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)
//
})
//
}
//
}
//
}
//
res.map((item, index) => {
//
dataTable.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
item.description,
//
item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
//
Number(item.ratio.january).toFixed(1),
//
Number(item.ratio.february).toFixed(1),
//
Number(item.ratio.march).toFixed(1),
//
Number(item.ratio.april).toFixed(1),
//
Number(item.ratio.may).toFixed(1),
//
Number(item.ratio.june).toFixed(1),
//
Number(item.ratio.july).toFixed(1),
//
Number(item.ratio.august).toFixed(1),
//
Number(item.ratio.september).toFixed(1),
//
Number(item.ratio.october).toFixed(1),
//
Number(item.ratio.november).toFixed(1),
//
Number(item.ratio.december).toFixed(1),
//
Number(item.ratio.total_current_year).toFixed(1),
//
Number(item.ratio.total_next_year).toFixed(1),
//
Number(item.ratio.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
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
//
} else {
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
//
}
//
})
}
}
...
...
src/container/SummaryTriputra/TableSummaryTriputra.js
View file @
958ac199
...
...
@@ -920,7 +920,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
@@ -1049,7 +1049,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
@@ -1178,7 +1178,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
@@ -1307,7 +1307,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
@@ -1436,7 +1436,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
@@ -1565,7 +1565,7 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
span
>
{
"2019"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
}}
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"2020"
}
<
/span
>
<
/div
>
{
/* <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...
...
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