Commit 25358045 authored by faisalhamdi's avatar faisalhamdi

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

parents 16c0057b bfb82284
......@@ -282,6 +282,7 @@ const create = (type = "") => {
const submitRollingOutlook = (body) => api.post('transaction/rolling_outlook/submit_rolling_outlook', body)
const getRollingOutlookCompanySubmitted = (body) => api.post('transaction/rolling_outlook/get_company_submitted', body)
const getRollingOutlookCF = (body) => api.post('transaction/cash_flow/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookCF = (body) => api.post('transaction/cash_flow/rolling_outlook/create_rolling_outlook', body)
//REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
......@@ -784,7 +785,8 @@ const create = (type = "") => {
approvalRolling,
createPeriodeRevisionRO,
historyApprovalRO,
getRollingOutlookCF
getRollingOutlookCF,
createRollingOutlookCF
}
}
......
......@@ -508,10 +508,10 @@ export default class OperatingIndicator extends Component {
borderColor: 'transparent'
}}
onClick={() =>
tableMeta.rowData[4] ?
// tableMeta.rowData[4] ?
this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2])
:
null
// :
// null
}
>
<Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
......
......@@ -890,17 +890,19 @@ export default class RollingOutlook extends Component {
<span>COMPLETED</span> :
val === "draft" ?
<span>DRAFT</span> :
val === "revision" ?
<span>REVISION</span> :
val === "approval_proccess" ?
<span>APPROVAL PROCCESS</span> :
val === "approval_review" ?
<span>APPROVAL REVIEW</span> :
val === "not-yet" ?
<span>OPEN</span> :
val === "CLOSED" ?
<span>CLOSED</span> :
<img src={Images.cross} style={{ width: 31, height: 24 }} />
val === "incomplete" ?
<span>INCOMPLETE</span> :
val === "revision" ?
<span>REVISION</span> :
val === "approval_process" ?
<span>APPROVAL PROCCESS</span> :
val === "approval_review" ?
<span>APPROVAL REVIEW</span> :
val === "not-yet" ?
<span>OPEN</span> :
val === "CLOSED" ?
<span>CLOSED</span> :
<img src={Images.cross} style={{ width: 31, height: 24 }} />
}
</div >
);
......
......@@ -62,6 +62,7 @@ export default class BalanceSheetRO extends Component {
}
componentDidMount() {
console.log(this.props);
// this.getItemHierarki()
this.getLatestUpdate()
this.getSettingControl()
......@@ -1065,6 +1066,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 6)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 6)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1196,6 +1198,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 7)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1327,6 +1330,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 8)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 8)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1458,6 +1462,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1589,6 +1594,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 10)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 10)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1720,6 +1726,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1851,6 +1858,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1982,6 +1990,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2113,6 +2122,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2244,6 +2254,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......
......@@ -86,6 +86,7 @@ export default class CashFlow extends Component {
}
componentDidMount() {
console.log(this.props);
this.setState({ loading: true })
this.getSettingControl()
// console.log(this.props.PLBSFAMSubmitted)
......@@ -256,27 +257,23 @@ export default class CashFlow extends Component {
}
async downloadAllData() {
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
// console.log(url);
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
// alert('Coming Soon ...')
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
console.log(url);
let res = await fetch(
this.props.submissionID == null ? resNull : resReal
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID === null ? "" : this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
)
console.log(this.props.submissionID);
console.log(resReal)
console.log(resNull)
res = await res.blob()
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Master Budget Cash Flow.xlsx';
a.download = 'Rolling Outlook Cash Flow.xlsx';
a.click();
this.setState({ loading: false })
} else {
this.setState({ loading: false })
}
setTimeout(() => {
this.setState({ loading: false })
}, 500);
}
closeAlert() {
......@@ -288,33 +285,48 @@ export default class CashFlow extends Component {
let listCF = []
dataTable2.map((item, index) => {
listCF.push(
// {
// "item_report_id": item[1],
// "parent": item[2],
// "formula": String(item[3]),
// "item_name": item[5],
// "january": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
// "february": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
// "march": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
// "april": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
// "may": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
// "june": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
// "july": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
// "august": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
// "september": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
// "october": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
// "november": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
// "december": String(item[18].value == undefined ? item[18] : Number(item[18].value).toFixed(1)),
// "total_current_year": String(item[19] != '' ? Number(item[19]).toFixed(1) : item[19]),
// "total_next_year": String(item[20] != '' ? Number(item[20]).toFixed(1) : item[20]),
// "total_more_year": String(item[21] != '' ? Number(item[21]).toFixed(1) : item[21]),
// "kpi_type": "",
// "max_ach": "",
// "pic": "",
// "strategic": "",
// "total_actual_before": "",
// "uom": "",
// "weight": ""
// }
{
"item_report_id": item[1],
"parent": item[2],
"formula": String(item[3]),
"item_name": item[5],
"january": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
"february": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
"march": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
"april": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
"may": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
"june": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
"july": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
"august": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
"september": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
"october": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
"november": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
"december": String(item[18].value == undefined ? item[18] : Number(item[18].value).toFixed(1)),
"total_current_year": String(item[19] != '' ? Number(item[19]).toFixed(1) : item[19]),
"total_next_year": String(item[20] != '' ? Number(item[20]).toFixed(1) : item[20]),
"total_more_year": String(item[21] != '' ? Number(item[21]).toFixed(1) : item[21]),
"kpi_type": "",
"max_ach": "",
"pic": "",
"strategic": "",
"total_actual_before": "",
"uom": "",
"weight": ""
"january": String(item[6].value == undefined ? item[6] : Number(item[6].value).toFixed(1)),
"february": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
"march": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
"april": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
"may": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
"june": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
"july": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
"august": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
"september": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
"october": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
"november": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
"december": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
}
)
})
......@@ -325,25 +337,44 @@ export default class CashFlow extends Component {
createCashFlow(dbcf) {
let payload = {
"submission_id": this.props.submissionID,
"rolling_outlook_id": this.props.rollingOutlookID,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": 6,
"report_id": this.props.report_id,
"status": "submitted",
"quartal": this.props.quarter,
"cash_flow": dbcf
}
console.log(dbcf)
console.log(JSON.stringify(payload))
this.props.createCashFlow(payload)
api.create().createRollingOutlookCF(payload).then(response => {
console.log(payload);
console.log(response);
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.refresh()
} else {
this.setState({ loading: false, handleTekTekTek: 0 }, () => {
this.props.onClickClose()
this.props.refresh()
})
}
} else {
this.setState({ loading: false, handleTekTekTek: 0 })
}
})
this.props.onClickClose()
this.props.refresh()
}
render() {
let dataTable2 = this.state.dataTable
let loading = false
const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
console.log(tableMeta.rowData[5])
console.log(column)
// console.log(tableMeta.rowData[5])
// console.log(column)
loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = []
......@@ -451,7 +482,7 @@ export default class CashFlow extends Component {
anjay.push(valuezz == "" ? 0 : Number(valuezz))
}
} else {
console.log(value)
// console.log(value)
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = value.formula[indexID].value
......@@ -809,25 +840,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
(Number(tableMeta.rowData[6].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[6].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6].value).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>
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[6].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[6].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -837,16 +851,34 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6].value).toFixed(1)}
/>
</LightTooltip>
:
<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(tableMeta.rowData[6].value).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-2">
......@@ -864,7 +896,7 @@ export default class CashFlow extends Component {
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7].value).toFixed(1)}
// value={Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
// value={Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
/>
</span>
:
......@@ -881,24 +913,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
(Number(tableMeta.rowData[7].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[7].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7].value).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>
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[7].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[7].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -908,16 +924,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7].value).toFixed(1)}
/>
</LightTooltip>
/> :
<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(tableMeta.rowData[7].value).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-3">
......@@ -949,25 +982,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
(Number(tableMeta.rowData[8].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[8].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
// value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={Number(tableMeta.rowData[8].value).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>
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[8].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[8].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -977,17 +993,35 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
// value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={Number(tableMeta.rowData[8].value).toFixed(1)}
/>
</LightTooltip>
/> :
<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={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={Number(tableMeta.rowData[8].value).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-4">
......@@ -1004,7 +1038,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
</span>
:
......@@ -1017,28 +1051,12 @@ export default class CashFlow extends Component {
placeholder=""
disabled={true}
// value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], 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>
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1048,16 +1066,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
</LightTooltip>
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], 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
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
</div>
......@@ -1077,7 +1112,7 @@ export default class CashFlow extends Component {
placeholder=""
disabled={true}
// value={Number(tableMeta.rowData[10].value).toFixed(1)}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
</span>
:
......@@ -1093,24 +1128,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], 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>
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1120,16 +1139,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
</LightTooltip>
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], 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
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-2">
......@@ -1146,7 +1182,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
</span>
:
......@@ -1158,28 +1194,12 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], 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>
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1189,16 +1209,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
</LightTooltip>
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], 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
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-3">
......@@ -1231,24 +1268,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], 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>
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1258,16 +1279,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
/>
</LightTooltip>
/> :
<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={this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-4">
......@@ -1300,24 +1338,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], 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>
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1327,16 +1349,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
/>
</LightTooltip>
/> :
<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={this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
</div>
......@@ -1371,24 +1410,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], 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>
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1398,16 +1421,33 @@ export default class CashFlow extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
/>
</LightTooltip>
/> :
<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={this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-2">
......@@ -1476,7 +1516,7 @@ export default class CashFlow extends Component {
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-3">
......@@ -1545,7 +1585,7 @@ export default class CashFlow extends Component {
/>
</LightTooltip>
:
null
null
}
</div>
<div className="col-4">
......@@ -1981,7 +2021,7 @@ export default class CashFlow extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2138,7 +2138,7 @@ export default class OperatingIndicatorRO extends Component {
</button>
</div>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 2 }}>
{this.state.get_for == 'view' && this.state.viewOnly &&
{this.state.get_for == 'view' &&
<button
type="button"
onClick={() => {
......
......@@ -444,7 +444,7 @@ export default class ProfitLossROO extends Component {
orders: i[0] === undefined ? "" : String(i[0]).trim(),
"item_report_id": i[1] === undefined ? 0 : i[1],
"item_report": i[2] === undefined ? "" : String(i[2]).trim(),
"notes": i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
"notes": i[3] === undefined ? "" : reg.test(String(i[3])) === false ? "" : String(i[3]).trim(),
"january": i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
"february": i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
"march": i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment