Commit d7911121 authored by rifkaki's avatar rifkaki

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 448cf80a 1fe95ff0
...@@ -257,8 +257,17 @@ const create = (type = "") => { ...@@ -257,8 +257,17 @@ 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)
const getRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_operating_indicator_id', body)
const getHierarkiRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_report_hierarki', body)
const createRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/create_rolling_outlook', body)
const getLastestUpdateROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_latest_update', body)
//REPORT NEW //REPORT NEW
...@@ -733,7 +742,15 @@ const create = (type = "") => { ...@@ -733,7 +742,15 @@ const create = (type = "") => {
uploadAttachmentRO, uploadAttachmentRO,
deleteAttachmentRO, deleteAttachmentRO,
checkImportRollingOutlookBS, checkImportRollingOutlookBS,
importRollingOutlookBS importRollingOutlookBS,
createRollingOutlookPL,
checkImportRollingOutlookPL,
importRollingOutlookPL,
getSubmitRollingOutlook,
getRollingOI,
getHierarkiRollingOI,
createRollingOI,
getLastestUpdateROOI
} }
} }
......
...@@ -190,7 +190,7 @@ export default class OperatingIndicator extends Component { ...@@ -190,7 +190,7 @@ export default class OperatingIndicator extends Component {
}) })
if (arrayBaru.length > 0) { if (arrayBaru.length > 0) {
arrayBaru = arrayBaru.sort((a,b) => a.company_name.localeCompare(b.company_name)) arrayBaru = arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name))
} }
let defaultProps = { let defaultProps = {
...@@ -343,13 +343,17 @@ export default class OperatingIndicator extends Component { ...@@ -343,13 +343,17 @@ export default class OperatingIndicator extends Component {
}) })
} else if (String(item[1]).toLocaleLowerCase().includes("rolling outlook")) { } else if (String(item[1]).toLocaleLowerCase().includes("rolling outlook")) {
let quarter =String(item[1]).toLocaleLowerCase().includes('q1') ? "q1" :
String(item[1]).toLocaleLowerCase().includes('q2') ? "q2" :
String(item[1]).toLocaleLowerCase().includes('q3') ? "q3" : null
this.setState({ this.setState({
statusDetail: String(item[2]).toLocaleLowerCase(), statusDetail: String(item[2]).toLocaleLowerCase(),
dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company }, dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company },
visibleOperatingIndicator: false, visibleOperatingIndicator: false,
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: false, visibleDetailMonthly: false,
visibleDetailRolling: true visibleDetailRolling: true,
quartal: quarter
}) })
} else { } else {
...@@ -421,7 +425,7 @@ export default class OperatingIndicator extends Component { ...@@ -421,7 +425,7 @@ export default class OperatingIndicator extends Component {
} }
saveRollingOI(payload) { saveRollingOI(payload) {
api.create().createMonthlyReportOI(payload).then((response) => { api.create().createRollingOI(payload).then((response) => {
console.log(response); console.log(response);
this.getReport() this.getReport()
this.getOperatingID() this.getOperatingID()
...@@ -504,10 +508,10 @@ export default class OperatingIndicator extends Component { ...@@ -504,10 +508,10 @@ export default class OperatingIndicator extends Component {
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
tableMeta.rowData[4] ? // tableMeta.rowData[4] ?
this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2]) this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2])
: // :
null // null
} }
> >
<Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography> <Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
...@@ -640,7 +644,7 @@ export default class OperatingIndicator extends Component { ...@@ -640,7 +644,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveOperatingInd={this.saveOperatingInd.bind(this)} saveOperatingInd={this.saveOperatingInd.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
...@@ -658,7 +662,7 @@ export default class OperatingIndicator extends Component { ...@@ -658,7 +662,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveMonthlyOI={this.saveMonthlyOI.bind(this)} saveMonthlyOI={this.saveMonthlyOI.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
...@@ -669,7 +673,7 @@ export default class OperatingIndicator extends Component { ...@@ -669,7 +673,7 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail} data={this.state.dataDetail}
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
months={this.state.months} quartal={this.state.quartal}
company={this.state.company} company={this.state.company}
onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
...@@ -677,7 +681,7 @@ export default class OperatingIndicator extends Component { ...@@ -677,7 +681,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveRollingOI={this.saveRollingOI.bind(this)} saveRollingOI={this.saveRollingOI.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
......
This diff is collapsed.
...@@ -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()
}) })
...@@ -771,9 +773,9 @@ export default class RollingOutlook extends Component { ...@@ -771,9 +773,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 ?
...@@ -1262,8 +1264,9 @@ export default class RollingOutlook extends Component { ...@@ -1262,8 +1264,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}
/> />
)} )}
...@@ -1280,7 +1283,8 @@ export default class RollingOutlook extends Component { ...@@ -1280,7 +1283,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}
/> />
)} )}
...@@ -1299,7 +1303,8 @@ export default class RollingOutlook extends Component { ...@@ -1299,7 +1303,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');
...@@ -1481,7 +1515,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1481,7 +1515,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1612,7 +1646,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1612,7 +1646,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1743,7 +1777,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1743,7 +1777,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1874,7 +1908,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1874,7 +1908,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2005,7 +2039,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2005,7 +2039,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2136,7 +2170,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2136,7 +2170,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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