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
d3f19180
Commit
d3f19180
authored
Jan 26, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into didam
parents
515f5bb6
4f64f80c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
71 deletions
+118
-71
index.js
src/api/index.js
+5
-1
SubHolding.js
src/container/Laporan/SubHolding.js
+67
-37
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+46
-33
No files found.
src/api/index.js
View file @
d3f19180
...
...
@@ -244,6 +244,7 @@ const create = (type = "") => {
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
getReportTPMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/monthly_report/get_report_hierarki'
,
body
)
const
getReportTP
=
(
body
)
=>
api
.
post
(
'/transaction/db_tax_planning/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
getReportOIMR
=
(
body
)
=>
api
.
post
(
'/transaction/db_operating_indicator/monthly_report/get_report_hierarki'
,
body
)
...
...
@@ -254,6 +255,7 @@ const create = (type = "") => {
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
)
const
getReportBSSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary/balance_sheet/get_report_hierarki'
,
body
)
//CASH FLOW
...
...
@@ -605,6 +607,7 @@ const create = (type = "") => {
getReportPLMR
,
getReportTPMB
,
getReportTPMR
,
getReportTP
,
getReportOIMB
,
getReportOIMR
,
getReportCFSumaMB
,
...
...
@@ -617,7 +620,8 @@ const create = (type = "") => {
getAllReportOI
,
getReportFRMB
,
getReportFRMR
,
getReportFRLastMR
getReportFRLastMR
,
getReportBSSuma
}
}
...
...
src/container/Laporan/SubHolding.js
View file @
d3f19180
...
...
@@ -836,39 +836,55 @@ export default class SubHolding extends Component {
}
})
}
else
if
(
this
.
state
.
report
.
value
===
5
)
{
api
.
create
().
getReportTP
MB
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportTP
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
console
.
log
(
res
)
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_tax
.
value_tbc
.
type_report_id
,
item
.
type_report_tax
.
value_fc
.
type_report_id
,
item
.
type_report_tax
.
value_tbf
.
type_report_id
,
// item.type_report_tax.value_tbc.type_report_id,
// item.type_report_tax.value_fc.type_report_id,
// item.type_report_tax.value_tbf.type_report_id,
0
,
0
,
0
,
item
.
id
,
item
.
parent
,
{
tbc
:
item
.
formula_tax
.
value_tbc
,
fcp
:
item
.
formula_tax
.
value_fc
,
tbf
:
item
.
formula_tax
.
value_tbf
},
item
.
level
,
item
.
description
,
item
.
tax_planning
.
january
.
tbf
,
item
.
tax_planning
.
february
.
tbf
,
item
.
tax_planning
.
march
.
tbf
,
item
.
tax_planning
.
april
.
tbf
,
item
.
tax_planning
.
may
.
tbf
,
item
.
tax_planning
.
june
.
tbf
,
item
.
tax_planning
.
july
.
tbf
,
item
.
tax_planning
.
august
.
tbf
,
item
.
tax_planning
.
september
.
tbf
,
item
.
tax_planning
.
october
.
tbf
,
item
.
tax_planning
.
november
.
tbf
,
item
.
tax_planning
.
december
.
tbf
,
item
.
tax_planning
_report
.
january
,
item
.
tax_planning
_report
.
february
,
item
.
tax_planning
_report
.
march
,
item
.
tax_planning
_report
.
april
,
item
.
tax_planning
_report
.
may
,
item
.
tax_planning
_report
.
june
,
item
.
tax_planning
_report
.
july
,
item
.
tax_planning
_report
.
august
,
item
.
tax_planning
_report
.
september
,
item
.
tax_planning
_report
.
october
,
item
.
tax_planning
_report
.
november
,
item
.
tax_planning
_report
.
december
,
item
.
order
,
item
.
tax_planning_report
.
monthly_january
,
item
.
tax_planning_report
.
monthly_february
,
item
.
tax_planning_report
.
monthly_march
,
item
.
tax_planning_report
.
monthly_april
,
item
.
tax_planning_report
.
monthly_may
,
item
.
tax_planning_report
.
monthly_june
,
item
.
tax_planning_report
.
monthly_july
,
item
.
tax_planning_report
.
monthly_august
,
item
.
tax_planning_report
.
monthly_september
,
item
.
tax_planning_report
.
monthly_october
,
item
.
tax_planning_report
.
monthly_november
,
item
.
tax_planning_report
.
monthly_december
,
])
}
if
(
item
.
children
!==
null
)
{
...
...
@@ -882,27 +898,42 @@ export default class SubHolding extends Component {
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_tax
.
value_tbc
.
type_report_id
,
item
.
type_report_tax
.
value_fc
.
type_report_id
,
item
.
type_report_tax
.
value_tbf
.
type_report_id
,
// item.type_report_tax.value_tbc.type_report_id,
// item.type_report_tax.value_fc.type_report_id,
// item.type_report_tax.value_tbf.type_report_id,
0
,
0
,
0
,
item
.
id
,
item
.
parent
,
{
tbc
:
item
.
formula_tax
.
value_tbc
,
fcp
:
item
.
formula_tax
.
value_fc
,
tbf
:
item
.
formula_tax
.
value_tbf
},
item
.
level
,
item
.
description
,
item
.
tax_planning
.
january
.
tbf
,
item
.
tax_planning
.
february
.
tbf
,
item
.
tax_planning
.
march
.
tbf
,
item
.
tax_planning
.
april
.
tbf
,
item
.
tax_planning
.
may
.
tbf
,
item
.
tax_planning
.
june
.
tbf
,
item
.
tax_planning
.
july
.
tbf
,
item
.
tax_planning
.
august
.
tbf
,
item
.
tax_planning
.
september
.
tbf
,
item
.
tax_planning
.
october
.
tbf
,
item
.
tax_planning
.
november
.
tbf
,
item
.
tax_planning
.
december
.
tbf
,
item
.
tax_planning
_report
.
january
,
item
.
tax_planning
_report
.
february
,
item
.
tax_planning
_report
.
march
,
item
.
tax_planning
_report
.
april
,
item
.
tax_planning
_report
.
may
,
item
.
tax_planning
_report
.
june
,
item
.
tax_planning
_report
.
july
,
item
.
tax_planning
_report
.
august
,
item
.
tax_planning
_report
.
september
,
item
.
tax_planning
_report
.
october
,
item
.
tax_planning
_report
.
november
,
item
.
tax_planning
_report
.
december
,
item
.
order
,
item
.
tax_planning_report
.
monthly_january
,
item
.
tax_planning_report
.
monthly_february
,
item
.
tax_planning_report
.
monthly_march
,
item
.
tax_planning_report
.
monthly_april
,
item
.
tax_planning_report
.
monthly_may
,
item
.
tax_planning_report
.
monthly_june
,
item
.
tax_planning_report
.
monthly_july
,
item
.
tax_planning_report
.
monthly_august
,
item
.
tax_planning_report
.
monthly_september
,
item
.
tax_planning_report
.
monthly_october
,
item
.
tax_planning_report
.
monthly_november
,
item
.
tax_planning_report
.
monthly_december
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
...
...
@@ -913,10 +944,10 @@ export default class SubHolding extends Component {
}
})
console
.
log
(
dataTable
)
//
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
},
()
=>
{
this
.
getTaxPlanMR
(
payload
)
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
//
this.setState({ dataTable }, () => {
//
this.getTaxPlanMR(payload)
//
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
...
@@ -1308,7 +1339,7 @@ export default class SubHolding extends Component {
"report_id"
:
this
.
state
.
report
.
value
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"months"
:
"1"
"months"
:
this
.
state
.
month
.
month_id
}
api
.
create
().
getReportBSSuma
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
...
...
@@ -1804,7 +1835,6 @@ export default class SubHolding extends Component {
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
console
.
log
(
indexID
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
===
items
.
id
)
...
...
src/container/Laporan/TableSubHolding.js
View file @
d3f19180
...
...
@@ -1029,16 +1029,27 @@ export default class TableSubHolding extends Component {
return total
}
const handleMTDPercent = (tableMeta, dex, type) => {
let total = 0
// if (tableMeta.rowData[5] === "Cash and cash equivalent" ) {
// console.log(tableMeta);
// console.log(dataTable2);
// }
if (dex === 1) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
}
return total
}
let datas = [
["ABCD", "Testing", { 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" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", "Notes", { 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" }]
]
let dataSummaryBS = [
["ABCD", { 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", { 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" }]
]
let dataSummaryPL = [
["ABCD", { 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" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", { 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" }]
...
...
@@ -9442,7 +9453,8 @@ export default class TableSubHolding extends Component {
options: {
display: false
}
}, {
},
{
name: "",
options: {
display: false
...
...
@@ -9457,7 +9469,8 @@ export default class TableSubHolding extends Component {
options: {
display: false
}
}, {
},
{
name: "",
options: {
display: false
...
...
@@ -9567,9 +9580,9 @@ export default class TableSubHolding extends Component {
<div className="grid grid-3x content-center">
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9591,9 +9604,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-2">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9614,9 +9627,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-3">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9637,9 +9650,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-4">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9662,9 +9675,9 @@ export default class TableSubHolding extends Component {
</div>
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9685,9 +9698,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-2">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9708,9 +9721,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-3">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9731,9 +9744,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-4">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9756,9 +9769,9 @@ export default class TableSubHolding extends Component {
</div>
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9779,9 +9792,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-2">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9802,9 +9815,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-3">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -9825,9 +9838,9 @@ export default class TableSubHolding extends Component {
}
</div>
<div className="col-4">
{tableMeta.rowData[
3
] === 4 ?
{tableMeta.rowData[
0
] === 4 ?
null
: tableMeta.rowData[3] === 1 ?
: tableMeta.rowData[3] === 1
|| tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"
?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
...
...
@@ -15097,7 +15110,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(
tableMeta.rowData[9]
).toFixed(1)}
value={Number(
handleMTDPercent(tableMeta, 1, 3)
).toFixed(1)}
/>
}
/>
...
...
@@ -15145,7 +15158,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(
tableMeta.rowData[11]
).toFixed(1)}
value={Number(
handleMTDPercent(tableMeta, 2, 5)
).toFixed(1)}
/>
}
/>
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