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 = "") => {
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 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 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)
......@@ -660,6 +661,7 @@ const create = (type = "") => {
createReportCF,
getReportCFSuma,
getReportPLSuma,
getReportPLSummary,
getAllReportBS,
getAllReportPLDetail,
getAllReportOI,
......
......@@ -1782,8 +1782,8 @@ export default class SubHolding extends Component {
} else if (this.state.report.value === 8) {
let dbSumaPL = []
let payloadPL = {...payload, report_id: 1, months: this.state.month.month_id, quarter: 0}
api.create().getReportPLSuma(payloadPL).then(response => {
let payloadPL = {...payload, report_id: 28, months: this.state.month.month_id, quarter: 0}
api.create().getReportPLSummary(payloadPL).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === 'success') {
......
......@@ -92,7 +92,7 @@ export default class ProfitLossRO extends Component {
} else {
checkLastStatus = false
}
if (this.props.prevRevision) {
checkPrevRev = true
} else {
......@@ -105,7 +105,7 @@ export default class ProfitLossRO extends Component {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
}
handleGetFor(type) {
......@@ -219,11 +219,11 @@ export default class ProfitLossRO extends Component {
})
}
} 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 () => {
alert('Coming Soon ...')
// let res = await fetch(
......@@ -279,6 +279,7 @@ export default class ProfitLossRO extends Component {
}
const handleValue = (value, data) => {
console.log(data);
let total = 0
dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) {
......@@ -460,38 +461,38 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? value :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
control={
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
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)}
defaultValue={value}
inputProps={{
style: {
color: "#5198ea"
}
}}
onBlur={(event) => {
// updateValue(event.target.value)
handleNotes(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>}
this.state.get_for == 'view' ? value :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
control={
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
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)}
defaultValue={value}
inputProps={{
style: {
color: "#5198ea"
}
}}
onBlur={(event) => {
// updateValue(event.target.value)
handleNotes(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>}
</div>
</div>
)
}
}
}, {
name: `31 Dec ${Number(this.props.periode) - 1 } Actual`,
name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: {
customHeadRender: (columnMeta) => (
<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 {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -513,12 +514,9 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
:
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -526,10 +524,64 @@ export default class ProfitLossRO extends Component {
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
/>
}
/>
</div>
</span>
:
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>
)
......@@ -549,7 +601,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -558,23 +610,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -594,7 +646,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -603,23 +655,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -639,7 +691,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -648,23 +700,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -684,7 +736,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -693,23 +745,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -729,7 +781,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -738,23 +790,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -774,7 +826,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -783,23 +835,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -819,7 +871,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -828,23 +880,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -864,7 +916,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -873,23 +925,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -909,7 +961,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -918,23 +970,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -954,7 +1006,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -963,23 +1015,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -999,7 +1051,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1008,23 +1060,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -1044,7 +1096,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1053,23 +1105,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -1089,7 +1141,7 @@ export default class ProfitLossRO extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view' ?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1098,23 +1150,23 @@ export default class ProfitLossRO extends Component {
disabled={true}
value={Number(val).toFixed(1)}
/>
:
<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 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>
)
......@@ -1153,7 +1205,7 @@ export default class ProfitLossRO extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<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' }}>
<a data-tip={'Download'} data-for="download">
<button
......@@ -1229,15 +1281,15 @@ export default class ProfitLossRO extends Component {
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
)}
{!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
)}
</div>
<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 {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && this.state.viewOnly &&
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<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>
</div>
</button>
{this.state.get_for == 'view' && this.state.viewOnly &&
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => {
this.setState({ loading: true }, () => {
this.handleGetFor('edit')
})
}}
>
<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>
</div>
</button>
}
{this.state.get_for == 'edit' && <button
className="button"
......@@ -1324,7 +1376,7 @@ export default class ProfitLossRO extends Component {
}}
onClick={() =>
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.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