Commit 132edc7b authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

issueeeeeeeeeeeee

See merge request !1247
parents 82626371 0805ec93
...@@ -279,6 +279,7 @@ const create = (type = "") => { ...@@ -279,6 +279,7 @@ const create = (type = "") => {
const getReportCFSumaMR = (body) => api.post('/transaction/summary_cash_flow/monthly_report/get_report_hierarki', body) const getReportCFSumaMR = (body) => api.post('/transaction/summary_cash_flow/monthly_report/get_report_hierarki', body)
const getReportCFSuma = (body) => api.post('/transaction/summary_cash_flow/summary/get_report_hierarki', body) const getReportCFSuma = (body) => api.post('/transaction/summary_cash_flow/summary/get_report_hierarki', body)
const getReportPLSuma = (body) => api.post('/transaction/summary_profit_loss/summary/get_report_hierarki', body) const getReportPLSuma = (body) => api.post('/transaction/summary_profit_loss/summary/get_report_hierarki', body)
const getReportPLSummary = (body) => api.post('/transaction/summary_profit_loss/summary/get_report_hierarki_summary', body)
const getReportFRSuma = (body) => api.post('/transaction/summary_ratio/summary/get_report_hierarki', body) const getReportFRSuma = (body) => api.post('/transaction/summary_ratio/summary/get_report_hierarki', body)
const getReportFRMB = (body) => api.post('/transaction/summary_ratio/master_budget/get_report_hierarki', body) const getReportFRMB = (body) => api.post('/transaction/summary_ratio/master_budget/get_report_hierarki', body)
const getReportFRMR = (body) => api.post('/transaction/summary_ratio/monthly_report/get_report_hierarki', body) const getReportFRMR = (body) => api.post('/transaction/summary_ratio/monthly_report/get_report_hierarki', body)
...@@ -660,6 +661,7 @@ const create = (type = "") => { ...@@ -660,6 +661,7 @@ const create = (type = "") => {
createReportCF, createReportCF,
getReportCFSuma, getReportCFSuma,
getReportPLSuma, getReportPLSuma,
getReportPLSummary,
getAllReportBS, getAllReportBS,
getAllReportPLDetail, getAllReportPLDetail,
getAllReportOI, getAllReportOI,
......
...@@ -1782,8 +1782,8 @@ export default class SubHolding extends Component { ...@@ -1782,8 +1782,8 @@ export default class SubHolding extends Component {
} else if (this.state.report.value === 8) { } else if (this.state.report.value === 8) {
let dbSumaPL = [] let dbSumaPL = []
let payloadPL = {...payload, report_id: 1, months: this.state.month.month_id, quarter: 0} let payloadPL = {...payload, report_id: 28, months: this.state.month.month_id, quarter: 0}
api.create().getReportPLSuma(payloadPL).then(response => { api.create().getReportPLSummary(payloadPL).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
......
...@@ -92,7 +92,7 @@ export default class ProfitLossRO extends Component { ...@@ -92,7 +92,7 @@ export default class ProfitLossRO extends Component {
} else { } else {
checkLastStatus = false checkLastStatus = false
} }
if (this.props.prevRevision) { if (this.props.prevRevision) {
checkPrevRev = true checkPrevRev = true
} else { } else {
...@@ -105,7 +105,7 @@ export default class ProfitLossRO extends Component { ...@@ -105,7 +105,7 @@ export default class ProfitLossRO extends Component {
checkStatus = false checkStatus = false
} }
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev}) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -219,11 +219,11 @@ export default class ProfitLossRO extends Component { ...@@ -219,11 +219,11 @@ export default class ProfitLossRO extends Component {
}) })
} }
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false}) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false })
} }
}) })
} }
downloadTemplate = async () => { downloadTemplate = async () => {
alert('Coming Soon ...') alert('Coming Soon ...')
// let res = await fetch( // let res = await fetch(
...@@ -279,6 +279,7 @@ export default class ProfitLossRO extends Component { ...@@ -279,6 +279,7 @@ export default class ProfitLossRO extends Component {
} }
const handleValue = (value, data) => { const handleValue = (value, data) => {
console.log(data);
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
...@@ -460,38 +461,38 @@ export default class ProfitLossRO extends Component { ...@@ -460,38 +461,38 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? value : this.state.get_for == 'view' ? value :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
control={ control={
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
defaultValue={value} defaultValue={value}
inputProps={{ inputProps={{
style: { style: {
color: "#5198ea" color: "#5198ea"
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleNotes(event.target.value, tableMeta) handleNotes(event.target.value, tableMeta)
// console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
/>} />}
</div> </div>
</div> </div>
) )
} }
} }
}, { }, {
name: `31 Dec ${Number(this.props.periode) - 1 } Actual`, name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96, borderRight: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96, borderRight: '1px #fff solid' }}>
...@@ -504,7 +505,7 @@ export default class ProfitLossRO extends Component { ...@@ -504,7 +505,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -513,12 +514,9 @@ export default class ProfitLossRO extends Component { ...@@ -513,12 +514,9 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 2 ?
<FormControlLabel <span style={{ fontSize: 12, textAlign: 'right' }}>
style={{ margin: 0 }}
value={val}
control={
<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' }}
...@@ -526,10 +524,64 @@ export default class ProfitLossRO extends Component { ...@@ -526,10 +524,64 @@ export default class ProfitLossRO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
/> />
} </span>
/> :
</div> tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={false}
value={Number(val).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<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(handleFormula(tableMeta, 6)).toFixed(1)}
/>
}
/>
</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(val).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
) )
...@@ -549,7 +601,7 @@ export default class ProfitLossRO extends Component { ...@@ -549,7 +601,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -558,23 +610,23 @@ export default class ProfitLossRO extends Component { ...@@ -558,23 +610,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -594,7 +646,7 @@ export default class ProfitLossRO extends Component { ...@@ -594,7 +646,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -603,23 +655,23 @@ export default class ProfitLossRO extends Component { ...@@ -603,23 +655,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -639,7 +691,7 @@ export default class ProfitLossRO extends Component { ...@@ -639,7 +691,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -648,23 +700,23 @@ export default class ProfitLossRO extends Component { ...@@ -648,23 +700,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -684,7 +736,7 @@ export default class ProfitLossRO extends Component { ...@@ -684,7 +736,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -693,23 +745,23 @@ export default class ProfitLossRO extends Component { ...@@ -693,23 +745,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -729,7 +781,7 @@ export default class ProfitLossRO extends Component { ...@@ -729,7 +781,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -738,23 +790,23 @@ export default class ProfitLossRO extends Component { ...@@ -738,23 +790,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -774,7 +826,7 @@ export default class ProfitLossRO extends Component { ...@@ -774,7 +826,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -783,23 +835,23 @@ export default class ProfitLossRO extends Component { ...@@ -783,23 +835,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -819,7 +871,7 @@ export default class ProfitLossRO extends Component { ...@@ -819,7 +871,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -828,23 +880,23 @@ export default class ProfitLossRO extends Component { ...@@ -828,23 +880,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -864,7 +916,7 @@ export default class ProfitLossRO extends Component { ...@@ -864,7 +916,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -873,23 +925,23 @@ export default class ProfitLossRO extends Component { ...@@ -873,23 +925,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -909,7 +961,7 @@ export default class ProfitLossRO extends Component { ...@@ -909,7 +961,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -918,23 +970,23 @@ export default class ProfitLossRO extends Component { ...@@ -918,23 +970,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -954,7 +1006,7 @@ export default class ProfitLossRO extends Component { ...@@ -954,7 +1006,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -963,23 +1015,23 @@ export default class ProfitLossRO extends Component { ...@@ -963,23 +1015,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -999,7 +1051,7 @@ export default class ProfitLossRO extends Component { ...@@ -999,7 +1051,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -1008,23 +1060,23 @@ export default class ProfitLossRO extends Component { ...@@ -1008,23 +1060,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -1044,7 +1096,7 @@ export default class ProfitLossRO extends Component { ...@@ -1044,7 +1096,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -1053,23 +1105,23 @@ export default class ProfitLossRO extends Component { ...@@ -1053,23 +1105,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -1089,7 +1141,7 @@ export default class ProfitLossRO extends Component { ...@@ -1089,7 +1141,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
<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' }}
...@@ -1098,23 +1150,23 @@ export default class ProfitLossRO extends Component { ...@@ -1098,23 +1150,23 @@ export default class ProfitLossRO extends Component {
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -1153,7 +1205,7 @@ export default class ProfitLossRO extends Component { ...@@ -1153,7 +1205,7 @@ export default class ProfitLossRO extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'? {this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -1229,15 +1281,15 @@ export default class ProfitLossRO extends Component { ...@@ -1229,15 +1281,15 @@ export default class ProfitLossRO extends Component {
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{!this.state.loading && ( {!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>
)} )}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
...@@ -1269,26 +1321,26 @@ export default class ProfitLossRO extends Component { ...@@ -1269,26 +1321,26 @@ export default class ProfitLossRO extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && this.state.viewOnly && {this.state.get_for == 'view' && this.state.viewOnly &&
<button <button
className="button" className="button"
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
}} }}
onClick={() => { onClick={() => {
this.setState({loading: true}, () => { this.setState({ loading: true }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
> >
<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>
</div> </div>
</button> </button>
} }
{this.state.get_for == 'edit' && <button {this.state.get_for == 'edit' && <button
className="button" className="button"
...@@ -1324,7 +1376,7 @@ export default class ProfitLossRO extends Component { ...@@ -1324,7 +1376,7 @@ export default class ProfitLossRO extends Component {
}} }}
onClick={() => onClick={() =>
this.state.saveDraft ? this.state.saveDraft ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
: :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
......
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