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

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

parents 563934f8 8a6f4593
...@@ -254,6 +254,7 @@ const create = (type = "") => { ...@@ -254,6 +254,7 @@ const create = (type = "") => {
// Monthly // Monthly
const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body) const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body)
const getMonthlyOI = (body) => api.post('transaction/monthly_report_oi/get_operating_indicator_id', body)
const getMonthlyReportID = (body) => api.post('transaction/monthly_report/get_monthly_report_id', body) const getMonthlyReportID = (body) => api.post('transaction/monthly_report/get_monthly_report_id', body)
const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body) const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body)
const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body) const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body)
...@@ -530,7 +531,8 @@ const create = (type = "") => { ...@@ -530,7 +531,8 @@ const create = (type = "") => {
getPerBSiMontlyReportLOCF, getPerBSiMontlyReportLOCF,
checkUploadMonthlyReportLOCF, checkUploadMonthlyReportLOCF,
uploadMonthlyReportLOCF, uploadMonthlyReportLOCF,
validateSubmitReportOI validateSubmitReportOI,
getMonthlyOI
} }
} }
......
...@@ -182,7 +182,9 @@ export default class BalanceSheetMR extends Component { ...@@ -182,7 +182,9 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb, item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb, item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula, item.balance_sheet.actual_formula,
item.order item.order,
item.condition_it_should_be,
item.condition_if_wrong
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -227,7 +229,9 @@ export default class BalanceSheetMR extends Component { ...@@ -227,7 +229,9 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb, item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb, item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula, item.balance_sheet.actual_formula,
item.order item.order,
item.condition_it_should_be,
item.condition_if_wrong
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -360,13 +364,15 @@ export default class BalanceSheetMR extends Component { ...@@ -360,13 +364,15 @@ export default class BalanceSheetMR extends Component {
item.mtd_vs_rb, item.mtd_vs_rb,
item.actual_formula, item.actual_formula,
item.order, item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.error item.error
] ]
}) })
console.log(dataTable) console.log(dataTable)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: true, isUpload: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: true, isUpload: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[22].length > 0) { if (item[24].length > 0) {
// console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true }) this.setState({ buttonError: true, errorPreview: true })
} }
...@@ -726,7 +732,7 @@ export default class BalanceSheetMR extends Component { ...@@ -726,7 +732,7 @@ export default class BalanceSheetMR extends Component {
let indexID = dataTable2.findIndex((val) => val[21] == item) let indexID = dataTable2.findIndex((val) => val[21] == item)
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx] let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][22]) { if (item == dataTable2[tableMeta.rowIndex][24]) {
anjay.push(0) anjay.push(0)
} else { } else {
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
...@@ -1077,22 +1083,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1077,22 +1083,58 @@ export default class BalanceSheetMR extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 7)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1128,22 +1170,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1128,22 +1170,58 @@ export default class BalanceSheetMR extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 8)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 8)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1199,22 +1277,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1199,22 +1277,58 @@ export default class BalanceSheetMR extends Component {
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1253,22 +1367,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1253,22 +1367,58 @@ export default class BalanceSheetMR extends Component {
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 10)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 10)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 10)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 10)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
) )
...@@ -1341,22 +1491,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1341,22 +1491,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 11)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 11)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1364,23 +1550,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1364,23 +1550,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 12)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
suffix={'%'}
disabled={true} disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 12)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1392,22 +1614,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1392,22 +1614,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 13)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 2, 4)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 13)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 2, 4)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1415,23 +1673,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1415,23 +1673,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 14)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} value={Number(handleValueFormula(tableMeta, 14)).toFixed(1)}
value={Number(handleVariancePercent(tableMeta, 2, 5)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 2, 5)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1443,22 +1737,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1443,22 +1737,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 15)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 3, 6)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 15)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 3, 6)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1466,23 +1796,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1466,23 +1796,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 16)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 16)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 16)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} value={Number(handleValueFormula(tableMeta, 16)).toFixed(1)}
value={Number(handleVariancePercent(tableMeta, 3, 7)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 3, 7)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1557,24 +1923,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1557,24 +1923,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 17)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 17)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[17]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 17) // value={Number(handleValueFormula(tableMeta, 17)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 17)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[17]}
inputProps={{
style: {
color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 17)
}}
/>
} }
/>} />}
</div> </div>
...@@ -1611,24 +2013,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1611,24 +2013,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 18)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 18)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[18]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 18) // value={Number(handleValueFormula(tableMeta, 18)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 18)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[18]}
inputProps={{
style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 18)
}}
/>
} }
/>} />}
</div> </div>
...@@ -1665,24 +2103,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1665,24 +2103,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 19)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 19)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[19]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 19) // value={Number(handleValueFormula(tableMeta, 19)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 19)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 19)
}}
/>
} }
/>} />}
</div> </div>
......
...@@ -63,6 +63,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -63,6 +63,7 @@ export default class OperatingIndicatorMR extends Component {
editable: true, editable: true,
emptyData: false, emptyData: false,
templateNull: true, templateNull: true,
judulColumn: null,
get_for: 'view' get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -83,7 +84,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -83,7 +84,7 @@ export default class OperatingIndicatorMR extends Component {
getLatestUpdate() { getLatestUpdate() {
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
...@@ -147,12 +148,14 @@ export default class OperatingIndicatorMR extends Component { ...@@ -147,12 +148,14 @@ export default class OperatingIndicatorMR extends Component {
} }
getOperatingIDMonthly() { getOperatingIDMonthly() {
// console.log(this.props.data.operatingIndID);
let payload = { let payload = {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode.periode, "periode": this.props.data.periode,
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null
} }
api.create().getOpetratingIndID(payload).then(response => { api.create().getMonthlyOI(payload).then(response => {
console.log(response);
if (response) { if (response) {
if (response.data.data) { if (response.data.data) {
this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => { this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => {
...@@ -177,12 +180,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -177,12 +180,13 @@ export default class OperatingIndicatorMR extends Component {
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null, "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null,
"get_for": this.state.get_for "get_for": this.state.get_for
} }
console.log(payload);
api.create().getHierarkiMontlyReportOI(payload).then(response => { api.create().getHierarkiMontlyReportOI(payload).then(response => {
console.log(response); console.log(response);
// console.log(JSON.stringify(response));
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
console.log(res);
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
...@@ -195,13 +199,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -195,13 +199,13 @@ export default class OperatingIndicatorMR extends Component {
item.description, item.description,
item.uom === "" ? null : item.uom, item.uom === "" ? null : item.uom,
item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook, item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook,
item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.master_budget, item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.master_budget === "" ? "0.0" : item.monthly_report.master_budget,
item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget, item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_budget === "" ? "0.0" : item.monthly_report.rolling_budget,
item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual, item.monthly_report.actual === null ? "0.0" : item.monthly_report.actual === "" ? "0.0" : item.monthly_report.actual,
item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb, item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.amount_act_vs_mb === "" ? "0.0" : item.monthly_report.amount_act_vs_mb,
item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb, item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.percent_act_vs_mb === "" ? "0.0" : item.monthly_report.percent_act_vs_mb,
item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb, item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.amount_act_vs_rb === "" ? "0.0" : item.monthly_report.amount_act_vs_rb,
item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb, item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.percent_act_vs_rb === "" ? "0.0" : item.monthly_report.percent_act_vs_rb,
item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb, item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb,
item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb, item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb,
item.order, item.order,
...@@ -225,13 +229,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -225,13 +229,13 @@ export default class OperatingIndicatorMR extends Component {
item.description, item.description,
item.uom === "" ? null : item.uom, item.uom === "" ? null : item.uom,
item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook, item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook,
item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.master_budget, item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.master_budget === "" ? "0.0" : item.monthly_report.master_budget,
item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget, item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_budget === "" ? "0.0" : item.monthly_report.rolling_budget,
item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual, item.monthly_report.actual === null ? "0.0" : item.monthly_report.actual === "" ? "0.0" : item.monthly_report.actual,
item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb, item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.amount_act_vs_mb === "" ? "0.0" : item.monthly_report.amount_act_vs_mb,
item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb, item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.percent_act_vs_mb === "" ? "0.0" : item.monthly_report.percent_act_vs_mb,
item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb, item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.amount_act_vs_rb === "" ? "0.0" : item.monthly_report.amount_act_vs_rb,
item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb, item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.percent_act_vs_rb === "" ? "0.0" : item.monthly_report.percent_act_vs_rb,
item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb, item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb,
item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb, item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb,
item.order, item.order,
...@@ -305,7 +309,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -305,7 +309,7 @@ export default class OperatingIndicatorMR extends Component {
}) })
}) })
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
...@@ -353,7 +357,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -353,7 +357,7 @@ export default class OperatingIndicatorMR extends Component {
monthly_report: payload monthly_report: payload
} }
console.log(body) console.log(body)
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
} }
}); });
} }
...@@ -424,15 +428,15 @@ export default class OperatingIndicatorMR extends Component { ...@@ -424,15 +428,15 @@ export default class OperatingIndicatorMR extends Component {
}) })
let body = { let body = {
company_id: this.props.data.company.company_id, company_id: this.props.data.company.company_id,
operating_indicator_id: this.props.data.operatingIndID, operating_indicator_id: this.state.operatingIndIDMonthly,
periode: this.props.data.periode, periode: this.props.data.periode,
report_id: this.props.data.report_id, report_id: this.props.data.report_id,
status: type, status: type,
months: this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null, months: this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null,
monthly_report: data monthly_report: data
} }
console.log(data); // console.log(body);
// // console.log(JSON.stringify(body)) // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMonthlyReportOI(body).then(response => { api.create('UPLOAD').uploadMonthlyReportOI(body).then(response => {
// // console.log(response); // // console.log(response);
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -481,7 +485,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -481,7 +485,7 @@ export default class OperatingIndicatorMR extends Component {
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
...@@ -1374,6 +1378,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1374,6 +1378,11 @@ export default class OperatingIndicatorMR extends Component {
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Monthly Report Submission</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Monthly Report Submission</Typography>
</div> </div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleOI === true ? {this.state.visibleOI === true ?
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
...@@ -1463,7 +1472,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1463,7 +1472,7 @@ export default class OperatingIndicatorMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notesUpdate}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notesUpdate}</Typography>
</div> </div>
<div className="grid grid-2x"> <div className="grid grid-2x">
<div className="col-1"> <div className="col-1" style={{ paddingLeft: 20 }}>
<button <button
className="button" className="button"
type="button" type="button"
...@@ -1484,7 +1493,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1484,7 +1493,7 @@ export default class OperatingIndicatorMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 2 }}>
{this.state.get_for == 'view' && <button {this.state.get_for == 'view' && <button
type="button" type="button"
onClick={() => { onClick={() => {
...@@ -1492,7 +1501,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1492,7 +1501,7 @@ export default class OperatingIndicatorMR extends Component {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
style={{ marginRight: 20 }} style={{ marginRight: 21 }}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
...@@ -1517,19 +1526,23 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1517,19 +1526,23 @@ export default class OperatingIndicatorMR extends Component {
{this.state.get_for == 'edit' && <button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
disabled={this.state.editable} // disabled={this.state.editable}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() =>
setTimeout(() => { this.state.editable === true ?
this.createData("draft") this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
}, 100); :
})} this.setState({ loading: true }, () => {
setTimeout(() => {
this.createData("draft")
}, 100);
})}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
{this.state.editable === true? {this.state.editable === true?
...@@ -1543,15 +1556,19 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1543,15 +1556,19 @@ export default class OperatingIndicatorMR extends Component {
</button>} </button>}
{this.state.get_for == 'edit' && <button {this.state.get_for == 'edit' && <button
type="button" type="button"
disabled={this.state.editable} // disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => { onClick={() =>
setTimeout(() => { this.state.editable === true ?
this.createData("submitted") this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
}, 100); :
})} this.setState({ loading: true }, () => {
setTimeout(() => {
this.createData("submitted")
}, 100);
})}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
...@@ -1649,12 +1666,12 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1649,12 +1666,12 @@ export default class OperatingIndicatorMR extends Component {
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
disabled={this.state.editable} // disabled={this.state.editable}
onClick={() => onClick={() =>
this.state.editable === true ? this.state.editable === true ?
null : this.setState({ loading: true }, () => { null : this.setState({ loading: true }, () => {
...@@ -1677,16 +1694,17 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1677,16 +1694,17 @@ export default class OperatingIndicatorMR extends Component {
type="button" type="button"
onClick={() => onClick={() =>
this.state.editable === true ? this.state.editable === true ?
null : this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
this.setState({ loading: true }, () => { :
setTimeout(() => { this.setState({ loading: true }, () => {
this.uploadOI("submitted") setTimeout(() => {
}, 100); this.uploadOI("submitted")
})} }, 100);
disabled={this.state.editable} })}
// disabled={this.state.editable}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
......
...@@ -561,7 +561,7 @@ export default class ProfitLossMR extends Component { ...@@ -561,7 +561,7 @@ export default class ProfitLossMR extends Component {
let err = false let err = false
this.state.dataTable.map((i, index) => { this.state.dataTable.map((i, index) => {
if(i[0] === 3 && i[4] === 2) { if(i[0] === 3 && i[4] === 2) {
console.log(i); // console.log(i);
if ( i[19] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) { if ( i[19] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
console.log('msk 1'); console.log('msk 1');
// console.log(i); // console.log(i);
...@@ -608,8 +608,8 @@ export default class ProfitLossMR extends Component { ...@@ -608,8 +608,8 @@ export default class ProfitLossMR extends Component {
} }
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create().validateSubmitReportPL(payload).then((response) => { api.create().validateSubmitReportPL(payload).then((response) => {
console.log(response.data.data.result) // console.log(response.data.data.result)
console.log(err); // console.log(err);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
if (response.data.data.result && err === false) { if (response.data.data.result && err === false) {
......
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