Commit fdd589a3 authored by d.arizona's avatar d.arizona

update banyak

parent 3531f4d8
...@@ -254,9 +254,12 @@ const create = (type = "") => { ...@@ -254,9 +254,12 @@ const create = (type = "") => {
const importRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/import_rolling_outlook', body) const importRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/import_rolling_outlook', body)
const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body) const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body)
const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body) const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/create_rolling_outlook', body)
const checkImportRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/check_import', body)
const importRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/import_rolling_outlook', body)
const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body) const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body)
const createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body) const createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body)
const getSubmitRollingOutlook = (body) => api.post('transaction/rolling_outlook/get_latest_periode_submit', body)
//REPORT NEW //REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body) const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
...@@ -728,7 +731,11 @@ const create = (type = "") => { ...@@ -728,7 +731,11 @@ const create = (type = "") => {
getRollingOutlookRevision, getRollingOutlookRevision,
getRollingOutlookIsApprover, getRollingOutlookIsApprover,
checkImportRollingOutlookBS, checkImportRollingOutlookBS,
importRollingOutlookBS importRollingOutlookBS,
createRollingOutlookPL,
checkImportRollingOutlookPL,
importRollingOutlookPL,
getSubmitRollingOutlook
} }
} }
......
...@@ -212,13 +212,15 @@ export default class RollingOutlook extends Component { ...@@ -212,13 +212,15 @@ export default class RollingOutlook extends Component {
getLatestPeriodSubmit() { getLatestPeriodSubmit() {
let body = { let body = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode,
"is_approver": this.state.isApprover,
"quartal": this.state.quarter.value
} }
api.create().getSubmitMasterBudget(body).then(response => { api.create().getSubmitRollingOutlook(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: true }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
this.getReport() this.getReport()
this.getReportAttachment() this.getReportAttachment()
}) })
...@@ -751,9 +753,9 @@ export default class RollingOutlook extends Component { ...@@ -751,9 +753,9 @@ export default class RollingOutlook extends Component {
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
// tableMeta.rowData[5] == true ? tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
// : null : null
} }
> >
{/* {this.state.isApprover == true ? {/* {this.state.isApprover == true ?
...@@ -1242,8 +1244,9 @@ export default class RollingOutlook extends Component { ...@@ -1242,8 +1244,9 @@ export default class RollingOutlook extends Component {
rollingOutlookID={this.state.rollingOutlookID} rollingOutlookID={this.state.rollingOutlookID}
refresh={this.getRollingOutlookID.bind(this)} refresh={this.getRollingOutlookID.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })}
isApprover={'false'} isApprover={this.state.isApprover}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -1260,7 +1263,8 @@ export default class RollingOutlook extends Component { ...@@ -1260,7 +1263,8 @@ export default class RollingOutlook extends Component {
onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })}
refresh={this.getRollingOutlookID.bind(this)} refresh={this.getRollingOutlookID.bind(this)}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={'false'} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -1279,7 +1283,8 @@ export default class RollingOutlook extends Component { ...@@ -1279,7 +1283,8 @@ export default class RollingOutlook extends Component {
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={'false'} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
......
...@@ -64,6 +64,40 @@ export default class BalanceSheetRO extends Component { ...@@ -64,6 +64,40 @@ export default class BalanceSheetRO extends Component {
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
this.getSettingControl() this.getSettingControl()
this.handleViewOnly()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
} else {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
} }
getSettingControl() { getSettingControl() {
...@@ -212,7 +246,7 @@ export default class BalanceSheetRO extends Component { ...@@ -212,7 +246,7 @@ export default class BalanceSheetRO extends Component {
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`
) )
res = await res.blob() res = await res.blob()
// console.log(res) console.log(`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment