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
bea4a209
Commit
bea4a209
authored
Dec 14, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bs
parent
34609fcd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
46 deletions
+53
-46
index.js
src/api/index.js
+1
-1
BalanceSheetMR.js
src/container/MonthlyReport/BalanceSheetMR.js
+52
-45
No files found.
src/api/index.js
View file @
bea4a209
...
@@ -285,7 +285,7 @@ const create = (type = "") => {
...
@@ -285,7 +285,7 @@ const create = (type = "") => {
const
uploadMonthlyReportTP
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_tp/import_monthly_report'
,
body
)
const
uploadMonthlyReportTP
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_tp/import_monthly_report'
,
body
)
const
uploadMonthlyReportOI
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_oi/import_monthly_report'
,
body
)
const
uploadMonthlyReportOI
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_oi/import_monthly_report'
,
body
)
const
uploadMonthlyReportCAT
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/cat/import_monthly_report'
,
body
)
const
uploadMonthlyReportCAT
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/cat/import_monthly_report'
,
body
)
const
validateSubmitReportMR
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/validate_save'
,
body
)
const
validateSubmitReportMR
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report
_bs
/validate_save'
,
body
)
// MonthlyPL
// MonthlyPL
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
...
...
src/container/MonthlyReport/BalanceSheetMR.js
View file @
bea4a209
...
@@ -49,7 +49,8 @@ export default class BalanceSheetMR extends Component {
...
@@ -49,7 +49,8 @@ export default class BalanceSheetMR extends Component {
valueThreshold
:
0
,
valueThreshold
:
0
,
minValue
:
0
,
minValue
:
0
,
maxValue
:
0
,
maxValue
:
0
,
updateBy
:
'-'
updateBy
:
'-'
,
notes
:
""
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -73,7 +74,8 @@ export default class BalanceSheetMR extends Component {
...
@@ -73,7 +74,8 @@ export default class BalanceSheetMR extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
this
.
setState
({
updateBy
:
response
.
data
.
data
.
latest_update
===
null
?
'-'
:
response
.
data
.
data
.
latest_update
updateBy
:
response
.
data
.
data
.
latest_update
===
null
?
'-'
:
response
.
data
.
data
.
latest_update
,
notes
:
response
.
data
.
data
.
notes_update
===
null
?
""
:
response
.
data
.
data
.
notes_update
})
})
}
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
},
()
=>
{
...
@@ -460,59 +462,63 @@ export default class BalanceSheetMR extends Component {
...
@@ -460,59 +462,63 @@ export default class BalanceSheetMR extends Component {
"mtd_vs_mb"
:
i
[
18
],
"mtd_vs_mb"
:
i
[
18
],
"mtd_vs_rb"
:
i
[
19
]
"mtd_vs_rb"
:
i
[
19
]
})
})
if
(
i
[
17
]
===
""
&&
(
Number
(
i
[
12
])
<
this
.
state
.
minValue
||
Number
(
i
[
12
])
>
this
.
state
.
maxValue
))
{
})
console
.
log
(
JSON
.
stringify
(
data
));
data
.
map
(
i
=>
{
if
(
i
.
mtd_vs_previous_month
===
""
&&
(
Number
(
i
.
percent_act_vs_previous_month
)
<
this
.
state
.
minValue
||
Number
(
i
.
percent_act_vs_previous_month
)
>
this
.
state
.
maxValue
))
{
console
.
log
(
'msk 1'
);
console
.
log
(
'msk 1'
);
console
.
log
(
i
);
err
=
true
err
=
true
}
else
if
(
i
[
18
]
===
""
&&
(
Number
(
i
[
14
])
<
this
.
state
.
minValue
||
Number
(
i
[
14
]
)
>
this
.
state
.
maxValue
))
{
}
else
if
(
i
.
mtd_vs_mb
===
""
&&
(
Number
(
i
.
percent_act_vs_mb
)
<
this
.
state
.
minValue
||
Number
(
i
.
percent_act_vs_mb
)
>
this
.
state
.
maxValue
))
{
console
.
log
(
'msk 2'
);
console
.
log
(
'msk 2'
);
err
=
true
err
=
true
}
else
if
(
i
[
19
]
===
""
&&
(
Number
(
i
[
16
])
<
this
.
state
.
minValue
||
Number
(
i
[
16
]
)
>
this
.
state
.
maxValue
))
{
}
else
if
(
i
.
mtd_vs_rb
===
""
&&
(
Number
(
i
.
percent_act_vs_rb
)
<
this
.
state
.
minValue
||
Number
(
i
.
percent_act_vs_rb
)
>
this
.
state
.
maxValue
))
{
console
.
log
(
'msk 3'
);
console
.
log
(
'msk 3'
);
err
=
true
err
=
true
}
}
})
})
console
.
log
(
JSON
.
stringify
(
data
));
// if (err === true) {
if
(
err
===
true
)
{
// console.log('error');
console
.
log
(
'error'
);
// this.setState({ loading: false, buttonError: true, saveDraft: false })
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
saveDraft
:
false
})
}
else
{
console
.
log
(
'g error'
);
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
saveDraft
:
false
})
}
// console.log(JSON.stringify(data))
// 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().validateSubmitReportMR(payload).then((response) => {
// console.log(response)
// if (response.data) {
// if (response.data.status === "success") {
// if (response.data.data.result) {
// this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
// } else {
// } else {
// this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
// console.log('g error');
// }
// this.setState({ loading: false, buttonError: false, saveDraft: false })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// console.log(JSON.stringify(data))
// }
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
}
console
.
log
(
JSON
.
stringify
(
payload
));
api
.
create
().
validateSubmitReportMR
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
data
.
result
&&
err
===
false
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
false
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
}
render
()
{
render
()
{
...
@@ -1792,6 +1798,7 @@ export default class BalanceSheetMR extends Component {
...
@@ -1792,6 +1798,7 @@ export default class BalanceSheetMR extends Component {
<
/div
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Notes
:
{
this
.
state
.
notes
}
<
/Typography
>
<
/div
>
<
/div
>
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
...
...
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