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
143ad8d0
Commit
143ad8d0
authored
May 06, 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
9ea4d65d
523d6da8
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
199 additions
and
199 deletions
+199
-199
index.js
src/api/index.js
+3
-2
CashFlowMR.js
src/container/MonthlyReport/CashFlowMR.js
+46
-8
BalanceSheetOLPA.js
src/container/OutlookPA/BalanceSheetOLPA.js
+8
-5
CorporateAnnualTargetOLPA.js
src/container/OutlookPA/CorporateAnnualTargetOLPA.js
+87
-76
RollingOutlook.js
src/container/RollingOutlook.js
+5
-4
BalanceSheetRO.js
src/container/RollingOutlook/BalanceSheetRO.js
+49
-103
TaxPlanningRO.js
src/container/RollingOutlook/TaxPlanningRO.js
+1
-1
No files found.
src/api/index.js
View file @
143ad8d0
...
...
@@ -366,8 +366,9 @@ const create = (type = "") => {
const
createDBPLOLPA
=
(
body
)
=>
api
.
post
(
'transaction/db_profit_loss/outlook_pa/create_outlook_report'
,
body
)
const
getHierarkiDBPLRO
=
(
body
)
=>
api
.
post
(
'transaction/db_profit_loss/rolling_outlook/get_report_hierarki'
,
body
)
const
createDBPLRO
=
(
body
)
=>
api
.
post
(
'transaction/db_profit_loss/rolling_outlook/create_rolling_outlook'
,
body
)
const
getDetailReportOLPACAT
=
(
body
)
=>
api
.
post
(
'transaction/cat/outlook_pa/get_report_hierarki'
,
body
)
const
createCATOLPA
=
(
body
)
=>
api
.
post
(
'transaction/cat/outlook_pa/create_outlook_pa'
,
body
)
// const getDetailReportOLPACAT = (body) => api.post('transaction/cat/outlook_pa/get_report_hierarki', body)
const
getDetailReportOLPACAT
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/get_report_hierarki'
,
body
)
const
createCATOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/create_outlook_pa'
,
body
)
// Monthly
const
getMonthlyReport
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/get_all_report'
,
body
)
...
...
src/container/MonthlyReport/CashFlowMR.js
View file @
143ad8d0
...
...
@@ -88,6 +88,7 @@ export default class CashFlowMR extends Component {
// console.log(checkApprover)
// console.log(checkPrevRev)
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
// this.setState({viewOnly: true})
}
componentDidMount
()
{
...
...
@@ -346,10 +347,7 @@ export default class CashFlowMR extends Component {
}
})
// console.log(tableMeta.rowData[5])
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
let
anjay2
=
[]
let
kurung
=
false
...
...
@@ -402,24 +400,52 @@ export default class CashFlowMR extends Component {
}
})
if
(
index
==
anjay2
.
length
-
1
)
{
// if (index == anjay2.length - 1) {
// if (opt == "tambah") {
// total = Number(total) + Number(totalPrio)
// } else if (opt == "kurang") {
// total = Number(total) - Number(totalPrio)
// } else if (opt == "kali") {
// total = Number(total) * Number(totalPrio)
// } else if (opt == "bagi") {
// total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
// } else {
// total += Number(totalPrio)
// }
// }
// if (opt == "") {
// total = Number(Number(total) + Number(totalPrio))
// } else {
if
(
opt
==
"tambah"
)
{
total
=
Number
(
total
)
+
Number
(
totalPrio
)
totalPrio
=
0
}
else
if
(
opt
==
"kurang"
)
{
total
=
Number
(
total
)
-
Number
(
totalPrio
)
totalPrio
=
0
}
else
if
(
opt
==
"kali"
)
{
total
=
Number
(
total
)
*
Number
(
totalPrio
)
totalPrio
=
0
}
else
if
(
opt
==
"bagi"
)
{
total
=
Number
(
total
)
/
Number
(
totalPrio
)
==
NaN
?
0
:
Number
(
total
)
/
Number
(
totalPrio
)
}
else
{
total
+=
Number
(
totalPrio
)
totalPrio
=
0
}
}
// }
// if (tableMeta.rowData[5] == '3.2 Movement of SHL and intercompany loan (nett)') {
// console.log(totalPrio)
// console.log(opt)
// console.log(total)
// }
}
else
{
// const handleReturn = (x,y) => {
// return Number(totalXYZ)
// }
if
(
item
==
"+"
)
{
opt
=
"tambah"
if
(
prio
)
{
total
=
Number
(
Number
(
totalPrio
)
+
Number
(
total
))
// total = handleReturn()
prio
=
false
totalPrio
=
0
optPrio
=
""
...
...
@@ -428,6 +454,7 @@ export default class CashFlowMR extends Component {
opt
=
"kurang"
if
(
prio
)
{
total
=
Number
(
Number
(
totalPrio
)
+
Number
(
total
))
// total = handleReturn()
prio
=
false
totalPrio
=
0
optPrio
=
""
...
...
@@ -436,6 +463,7 @@ export default class CashFlowMR extends Component {
opt
=
"kali"
if
(
prio
)
{
total
=
Number
(
Number
(
totalPrio
)
+
Number
(
total
))
// total = handleReturn()
prio
=
false
totalPrio
=
0
optPrio
=
""
...
...
@@ -444,6 +472,7 @@ export default class CashFlowMR extends Component {
opt
=
"bagi"
if
(
prio
)
{
total
=
Number
(
Number
(
totalPrio
)
+
Number
(
total
))
// total = handleReturn()
prio
=
false
totalPrio
=
0
optPrio
=
""
...
...
@@ -464,6 +493,15 @@ export default class CashFlowMR extends Component {
}
})
// if (tableMeta.rowData[5] == '3.2 Movement of SHL and intercompany loan (nett)' || tableMeta.rowData[5] == '3.6 Other') {
// console.log(tableMeta.rowData[5])
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// }
dataTable2
[
tableMeta
.
rowIndex
][
6
].
value
=
total
return
total
...
...
src/container/OutlookPA/BalanceSheetOLPA.js
View file @
143ad8d0
...
...
@@ -1381,7 +1381,7 @@ export default class BalanceSheetOLPA extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
Number
(
value
.
value
).
toFixed
(
1
)
:
Number
(
value
).
toFixed
(
1
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
3
?
...
...
@@ -1395,7 +1395,8 @@ export default class BalanceSheetOLPA extends Component {
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
this
.
props
.
isApprover
==
true
?
true
:
((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
false
:
true
)}
// disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled
=
{
this
.
props
.
isApprover
?
true
:
false
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
)
...
...
@@ -1507,7 +1508,7 @@ export default class BalanceSheetOLPA extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
Number
(
value
.
value
).
toFixed
(
1
)
:
Number
(
value
).
toFixed
(
1
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
3
?
...
...
@@ -1521,7 +1522,8 @@ export default class BalanceSheetOLPA extends Component {
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
this
.
props
.
isApprover
==
true
?
true
:
((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
false
:
true
)}
// disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled
=
{
this
.
props
.
isApprover
?
true
:
false
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
)
...
...
@@ -1647,7 +1649,8 @@ export default class BalanceSheetOLPA extends Component {
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
this
.
props
.
isApprover
==
true
?
true
:
((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
false
:
true
)}
// disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled
=
{
this
.
props
.
isApprover
?
true
:
false
}
value
=
{
Number
(
value
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
)
...
...
src/container/OutlookPA/CorporateAnnualTargetOLPA.js
View file @
143ad8d0
This diff is collapsed.
Click to expand it.
src/container/RollingOutlook.js
View file @
143ad8d0
...
...
@@ -555,15 +555,16 @@ export default class RollingOutlook extends Component {
}
else
{
this
.
setState
({
loading
:
false
})
}
// api.create().checkApprover().then(response => {
api
.
create
().
getRollingOutlookIsApprover
().
then
(
response
=>
{
// console.log(response);
if
(
this
.
state
.
isApprover
)
{
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
}
else
{
this
.
setState
({
isApprover
:
this
.
state
.
lastStatus
==
=
"SUBMITTED"
?
true
:
false
,
checkApprover
:
false
})
this
.
setState
({
isApprover
:
this
.
state
.
lastStatus
==
'SUBMITTED'
?
true
:
false
,
checkApprover
:
false
})
}
//
})
})
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
src/container/RollingOutlook/BalanceSheetRO.js
View file @
143ad8d0
...
...
@@ -57,7 +57,8 @@ export default class BalanceSheetRO extends Component {
tipeAlert
:
''
,
messageAlert
:
''
,
visibleUpload
:
false
,
visibleBSRO
:
true
visibleBSRO
:
true
,
kansas
:
0
}
}
...
...
@@ -398,98 +399,42 @@ export default class BalanceSheetRO extends Component {
}
})
}
handleValidate
()
{
let
data
=
[]
let
err
=
false
let
errorContrl
=
false
let
editAble
=
this
.
state
.
editAble
let
dataTable
=
this
.
state
.
dataTable
let
kansas
=
this
.
state
.
kansas
console
.
log
(
dataTable
[
dataTable
.
length
-
1
])
// dataTable.map((i, index) => {
// if(i[0] === 3) {
// if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
// console.log('msk 2');
// err = true
// }
// }
// if (String(i[5]) == "Control (should be nil)") {
// if (Number(i[9]) < this.state.minValue || Number(i[9]) > this.state.maxValue ) {
// errorContrl = true
// editAble = true
// }
// }
// data.push({
// "item_report_id": i[1],
// "rolling_outlook": i[6],
// "master_budget": i[7],
// "rolling_budget": i[8],
// "actual": i[9],
// "actual_previous_month": i[10],
// "amount_act_vs_previous_month": i[11],
// "percent_act_vs_previous_month": i[12],
// "amount_act_vs_mb": i[13],
// "percent_act_vs_mb": i[14],
// "amount_act_vs_rb": i[15],
// "percent_act_vs_rb": i[16],
// "mtd_vs_previous_month": i[17],
// "mtd_vs_mb": i[18],
// "mtd_vs_rb": i[19]
// })
// })
// let payload = {
// "monthly_report_id": this.props.monthlyReportId,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "status": "submitted",
// "months": this.props.month.month_id,
// "balance_sheet": data
// }
// api.create().validateSubmitReportBS(payload).then((response) => {
// console.log(response.data.data.result)
// console.log(err);
// console.log(errorContrl);
// if (response.data) {
// if (response.data.status === "success") {
// if (response.data.data.result && err === false && errorContrl === false ) {
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
// if (kansas == 0) {
// this.setState({kansas: 1, loading: true}, () => {
// this.handleValidate()
// })
// } else {
// this.setState({kansas: 0})
// }
// } else {
// this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
// if (kansas == 0) {
// this.setState({kansas: 1, loading: true}, () => {
// this.handleValidate()
// })
// } else {
// this.setState({kansas: 0})
// }
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// }
// })
let
dataTable
=
this
.
state
.
dataTable
// console.log(this.state.dataTable)
dataTable
.
map
((
i
,
index
)
=>
{
if
(
String
(
i
[
5
])
==
"Control (should be nil)"
)
{
this
.
setState
({
loading
:
true
})
let
n
=
0
for
(
n
=
(
this
.
props
.
quarter
==
'q1'
?
10
:
(
this
.
props
.
quarter
==
'q2'
?
13
:
16
));
n
<=
18
;
n
++
)
{
if
((
Number
(
i
[
n
])
<
Number
(
this
.
state
.
minValue
)
||
Number
(
i
[
n
])
>
Number
(
this
.
state
.
maxValue
)))
{
err
=
true
}
}
}
})
console
.
log
(
err
)
if
(
err
===
false
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
true
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
}
closeAlert
()
{
...
...
@@ -710,16 +655,17 @@ export default class BalanceSheetRO extends Component {
}
const
handleTotal
=
(
tableMeta
)
=>
{
let
total
=
0
let
total
=
0
tableMeta
.
rowData
.
map
((
item
,
index
)
=>
{
if
(
index
==
18
)
{
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"r/e (cummulative)"
)
{
total
=
String
(
Number
(
tableMeta
.
rowData
[
7
]).
toFixed
(
1
))
dataTable2
[
tableMeta
.
rowIndex
][
19
]
=
total
}
else
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"profit (loss) mtd"
)
{
if
(
index
>=
7
&&
index
<=
18
)
{
total
+=
Number
(
item
.
value
)
}
}
else
if
(
index
==
18
)
{
total
=
isNaN
(
item
)
?
Number
(
item
.
value
)
:
Number
(
item
)
// if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd") {
// total = Number(item.value)
// } else {
// total = Number(item)
// }
}
})
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
total
...
...
@@ -810,7 +756,7 @@ export default class BalanceSheetRO extends Component {
let
data
=
tableMeta
.
columnIndex
-
1
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
20
]
==
tst
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
dataTable2
[
indexID
][
data
].
value
!==
undefined
?
dataTable2
[
indexID
][
data
].
formula
[
0
].
value
:
dataTable2
[
indexID
][
data
]
let
valuezz
=
dataTable2
[
indexID
][
data
].
value
!==
undefined
?
dataTable2
[
indexID
][
data
].
value
:
dataTable2
[
indexID
][
data
]
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
// console.log(tst, data, tableMeta.rowData[data]);
...
...
@@ -862,10 +808,10 @@ export default class BalanceSheetRO extends Component {
total
=
R
.
equals
(
total
,
NaN
)
?
"0.0"
:
total
// console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == '
Beginning Balance'
) {
// console.log(baru)
// console.log(anjay)
// console.log(total)
// if (tableMeta.rowData[5] == '
R/E (Cummulative)' && tableMeta.columnIndex == 10
) {
//
console.log(baru)
//
console.log(anjay)
//
console.log(total)
// }
if
(
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
value
==
undefined
)
{
...
...
src/container/RollingOutlook/TaxPlanningRO.js
View file @
143ad8d0
...
...
@@ -6205,7 +6205,7 @@ export default class TaxPlanning extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data incomplete !'
,
tipeAlert
:
'error'
})
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
this
.
backToRollingOutlook
(
'submitted'
)
})}
style
=
{{
...
...
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