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

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

parents c73f22af 3134b6cf
......@@ -260,8 +260,8 @@ const create = (type = "") => {
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 createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body)
const getRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/create_rolling_outlook', body)
const getRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/get_report_hierarki', 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)
......
......@@ -81,8 +81,13 @@ export default class OperatingIndicatorMR extends Component {
handleViewOnly() {
let checkCreate = this.props.permission.create
let checkEdit = this.props.permission.edit
let checkStatus = true
this.setState({viewOnly: checkCreate && checkEdit})
if (String(this.props.data.status).toLocaleUpperCase() === 'CLOSED') {
checkStatus = false
}
this.setState({viewOnly: checkCreate && checkEdit && checkStatus})
}
handleGetFor(type) {
......
......@@ -333,7 +333,7 @@ export default class OperatingIndicator extends Component {
String(item[1]).toLocaleLowerCase().includes('dec') ? 12 : null
this.setState({
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, status: item[2] },
visibleOperatingIndicator: false,
visibleDetailOpt: false,
visibleDetailMonthly: true,
......@@ -348,7 +348,7 @@ export default class OperatingIndicator extends Component {
String(item[1]).toLocaleLowerCase().includes('q3') ? "q3" : null
this.setState({
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, status: item[2] },
visibleOperatingIndicator: false,
visibleDetailOpt: false,
visibleDetailMonthly: false,
......@@ -508,10 +508,10 @@ export default class OperatingIndicator extends Component {
borderColor: 'transparent'
}}
onClick={() =>
// tableMeta.rowData[4] ?
tableMeta.rowData[4] ?
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>
......
......@@ -69,8 +69,15 @@ export default class OperatingIndicatorRO extends Component {
handleViewOnly() {
let checkCreate = this.props.permission.create
let checkEdit = this.props.permission.edit
let checkStatus = true
this.setState({ viewOnly: checkCreate && checkEdit })
console.log(this.props.data.status);
if (String(this.props.data.status).toLocaleUpperCase() === 'CLOSED') {
checkStatus = false
}
console.log(checkStatus);
this.setState({ viewOnly: checkCreate && checkEdit && checkStatus})
}
handleGetFor(type) {
......@@ -803,47 +810,47 @@ export default class OperatingIndicatorRO extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[0] == 2 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div>
:
// tableMeta.rowData[0] == 2 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleParent(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// />
// }
// />
// </div>
// :
// (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleFormula(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -854,7 +861,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
// value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
......@@ -864,7 +872,8 @@ export default class OperatingIndicatorRO extends Component {
/>
}
/>
</div>)
</div>
// )
}
</div>
)
......@@ -897,47 +906,47 @@ export default class OperatingIndicatorRO extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[0] == 2 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div>
:
// tableMeta.rowData[0] == 2 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleParent(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// />
// }
// />
// </div>
// :
// (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleFormula(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -948,7 +957,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
// value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
......@@ -958,7 +968,8 @@ export default class OperatingIndicatorRO extends Component {
/>
}
/>
</div>)
</div>
// )
}
</div>
)
......@@ -990,47 +1001,47 @@ export default class OperatingIndicatorRO extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[0] == 2 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div>
:
// tableMeta.rowData[0] == 2 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleParent(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// />
// }
// />
// </div>
// :
// (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleFormula(tableMeta)).toFixed(1)}
// disabled={true}
// decimalScale={1}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1041,7 +1052,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)}
// value={Number(value).toFixed(1)}
decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
......@@ -1051,7 +1063,8 @@ export default class OperatingIndicatorRO extends Component {
/>
}
/>
</div>)
</div>
// )
}
</div>
)
......@@ -2045,7 +2058,11 @@ export default class OperatingIndicatorRO extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.downloadTemplate()}
onClick={() => {
// this.setState({loading: true}, () => {
this.downloadTemplate()
// })
}}
>
<img src={Images.template} />
</button>
......@@ -2354,7 +2371,7 @@ export default class OperatingIndicatorRO extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ?
String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes(String(this.props.quartal).toLocaleUpperCase()) && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
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