Commit 4fee691b authored by Riri Novita's avatar Riri Novita

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

parents d037eb88 873b685d
...@@ -366,6 +366,7 @@ const create = (type = "") => { ...@@ -366,6 +366,7 @@ const create = (type = "") => {
const createDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/create_outlook_report', body) const createDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/create_outlook_report', body)
const getHierarkiDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/get_report_hierarki', body) const getHierarkiDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/get_report_hierarki', body)
const createDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/create_rolling_outlook', body) const createDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/create_rolling_outlook', body)
const getDetailReportOLPACAT = (body) => api.post('transaction/cat/outlook_pa/get_report_hierarki', body)
// Monthly // Monthly
const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body) const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body)
...@@ -802,7 +803,8 @@ const create = (type = "") => { ...@@ -802,7 +803,8 @@ const create = (type = "") => {
getHierarkiDBPLOLPA, getHierarkiDBPLOLPA,
createDBPLOLPA, createDBPLOLPA,
getHierarkiDBPLRO, getHierarkiDBPLRO,
createDBPLRO createDBPLRO,
getDetailReportOLPACAT
} }
} }
......
...@@ -860,9 +860,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -860,9 +860,9 @@ export default class CorporateAnnualTarget extends Component {
"october": i[22].value != undefined? String(Number(i[22].value).toFixed(1)) : String(i[22]), "october": i[22].value != undefined? String(Number(i[22].value).toFixed(1)) : String(i[22]),
"november": i[23].value != undefined? String(Number(i[23].value).toFixed(1)) : String(i[23]), "november": i[23].value != undefined? String(Number(i[23].value).toFixed(1)) : String(i[23]),
"december": i[24].value != undefined? String(Number(i[24].value).toFixed(1)) : String(i[24]), "december": i[24].value != undefined? String(Number(i[24].value).toFixed(1)) : String(i[24]),
"total_current_year": i[6] === String(Number(i[25]).toFixed(1)) == "" ? "0.0" : String(Number(i[25]).toFixed(1)), "total_current_year": String(Number(i[25]).toFixed(1)) == "" ? "0.0" : String(Number(i[25]).toFixed(1)),
"total_next_year": i[6] === String(Number(i[26]).toFixed(1)) == "" ? "0.0" : String(Number(i[26]).toFixed(1)), "total_next_year": String(Number(i[26]).toFixed(1)) == "" ? "0.0" : String(Number(i[26]).toFixed(1)),
"total_more_year": i[6] === String(Number(i[27]).toFixed(1)) == "" ? "0.0" : String(Number(i[27]).toFixed(1)), "total_more_year": String(Number(i[27]).toFixed(1)) == "" ? "0.0" : String(Number(i[27]).toFixed(1)),
"strategic": String(i[28]), "strategic": String(i[28]),
"pic": String(i[29]) "pic": String(i[29])
}) })
...@@ -1140,8 +1140,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1140,8 +1140,11 @@ export default class CorporateAnnualTarget extends Component {
let valuezz = value.formula[indexID].value let valuezz = value.formula[indexID].value
anjay.push(valuezz == "" || valuezz == null ? "0" : valuezz) anjay.push(valuezz == "" || valuezz == null ? "0" : valuezz)
} }
} else {
let array = dataTable2[tableMeta.rowIndex][30].filter((val) => val.periode == Number(column))
let valuezz = array[0].value
anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
let convertID = -1 let convertID = -1
if (tableMeta.rowData[11].value == 'FORMULA') { if (tableMeta.rowData[11].value == 'FORMULA') {
...@@ -1325,6 +1328,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1325,6 +1328,7 @@ export default class CorporateAnnualTarget extends Component {
const handleValueForecast = (value, tableMeta, periode) => { const handleValueForecast = (value, tableMeta, periode) => {
return handleValueFormula(value, tableMeta, periode, periode, 'forecast') return handleValueFormula(value, tableMeta, periode, periode, 'forecast')
} }
const handleChangeDropdown = (value, tableMeta) => { const handleChangeDropdown = (value, tableMeta) => {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
let valz = value.value let valz = value.value
......
...@@ -761,9 +761,9 @@ class HomePage extends Component { ...@@ -761,9 +761,9 @@ class HomePage extends Component {
pathname: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("master") ? `/home/master-budget/` : String(tableMeta.rowData[3]).toLocaleLowerCase().includes("monthly") ? `/home/monthly-report/` : String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? `/home/rolling-outlook/` : `/home/outlook-performance/`, pathname: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("master") ? `/home/master-budget/` : String(tableMeta.rowData[3]).toLocaleLowerCase().includes("monthly") ? `/home/monthly-report/` : String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? `/home/rolling-outlook/` : `/home/outlook-performance/`,
state: { state: {
userType: 'approver', userType: 'approver',
rawData: {...this.state.rawData[tableMeta.rowIndex], quarter: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? this.state.quarter.value : null }, rawData: {...this.state.rawData[tableMeta.rowIndex], quarter: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? this.state.rawData[tableMeta.rowIndex].quartal : null },
month: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("master") ? null : getDataMonth(this.state.rawData[tableMeta.rowIndex]), month: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("master") ? null : getDataMonth(this.state.rawData[tableMeta.rowIndex]),
quarter: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? this.state.quarter.value : null quarter: String(tableMeta.rowData[3]).toLocaleLowerCase().includes("rolling") ? this.state.rawData[tableMeta.rowIndex].quartal : null
} }
}}> }}>
<button <button
......
...@@ -208,8 +208,8 @@ export default class BalanceSheetOLPA extends Component { ...@@ -208,8 +208,8 @@ export default class BalanceSheetOLPA extends Component {
Number(item.balance_sheet.august).toFixed(1), Number(item.balance_sheet.august).toFixed(1),
Number(item.balance_sheet.september).toFixed(1), Number(item.balance_sheet.september).toFixed(1),
Number(item.balance_sheet.october).toFixed(1), Number(item.balance_sheet.october).toFixed(1),
Number(item.balance_sheet.november).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.balance_sheet.november).toFixed(1), formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1),
Number(item.balance_sheet.december).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.balance_sheet.december).toFixed(1), formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1),
Number(item.balance_sheet.total_current_year).toFixed(1), Number(item.balance_sheet.total_current_year).toFixed(1),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
...@@ -244,8 +244,8 @@ export default class BalanceSheetOLPA extends Component { ...@@ -244,8 +244,8 @@ export default class BalanceSheetOLPA extends Component {
Number(item.balance_sheet.august).toFixed(1), Number(item.balance_sheet.august).toFixed(1),
Number(item.balance_sheet.september).toFixed(1), Number(item.balance_sheet.september).toFixed(1),
Number(item.balance_sheet.october).toFixed(1), Number(item.balance_sheet.october).toFixed(1),
Number(item.balance_sheet.november).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.balance_sheet.november).toFixed(1), formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1),
Number(item.balance_sheet.december).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.balance_sheet.december).toFixed(1), formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1),
Number(item.balance_sheet.total_current_year).toFixed(1), Number(item.balance_sheet.total_current_year).toFixed(1),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
...@@ -310,8 +310,8 @@ export default class BalanceSheetOLPA extends Component { ...@@ -310,8 +310,8 @@ export default class BalanceSheetOLPA extends Component {
august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)), august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)), september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)), october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)), november: i[0] === 3 && i[17] === "" ? "0.0" : (i[0] === 5 || i[0] === 6 || i[0] === 7 ? String(Number(i[17].value).toFixed(1)) : String(Number(i[17]).toFixed(1))),
december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)), december: i[0] === 3 && i[18] === "" ? "0.0" : (i[0] === 5 || i[0] === 6 || i[0] === 7 ? String(Number(i[18].value).toFixed(1)) : String(Number(i[18]).toFixed(1))),
total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)), total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
}) })
}) })
...@@ -416,8 +416,8 @@ export default class BalanceSheetOLPA extends Component { ...@@ -416,8 +416,8 @@ export default class BalanceSheetOLPA extends Component {
Number(item.august).toFixed(1), Number(item.august).toFixed(1),
Number(item.september).toFixed(1), Number(item.september).toFixed(1),
Number(item.october).toFixed(1), Number(item.october).toFixed(1),
Number(item.november).toFixed(1), item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.november).toFixed(1), formula: item.november_formula } : Number(item.november).toFixed(1),
Number(item.december).toFixed(1), item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: Number(item.december).toFixed(1), formula: item.december_formula } : Number(item.december).toFixed(1),
Number(item.total_current_year).toFixed(1), Number(item.total_current_year).toFixed(1),
item.orders, item.orders,
item.condition_it_should_be, item.condition_it_should_be,
...@@ -466,8 +466,8 @@ export default class BalanceSheetOLPA extends Component { ...@@ -466,8 +466,8 @@ export default class BalanceSheetOLPA extends Component {
august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)), august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)), september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)), october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)), november: i[0] === 3 && i[17] === "" ? "0.0" : (i[0] === 5 || i[0] === 6 || i[0] === 7 ? String(Number(i[17].value).toFixed(1)) : String(Number(i[17]).toFixed(1))),
december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)), december: i[0] === 3 && i[18] === "" ? "0.0" : (i[0] === 5 || i[0] === 6 || i[0] === 7 ? String(Number(i[17].value).toFixed(1)) : String(Number(i[18]).toFixed(1))),
total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)), total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
}) })
}) })
...@@ -692,16 +692,16 @@ export default class BalanceSheetOLPA extends Component { ...@@ -692,16 +692,16 @@ export default class BalanceSheetOLPA extends Component {
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
// console.log(valuezz) // console.log(valuezz)
} }
// } else { } else {
// // console.log(baru); // console.log(baru);
// // console.log(value); // console.log(value);
// let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode)) let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
// // console.log(indexID) // console.log(indexID)
// if (indexID !== -1) { if (indexID !== -1) {
// // console.log(value.formula[indexID].value) // console.log(value.formula[indexID].value)
// let valuezz = value.formula[indexID].value let valuezz = value.formula[indexID].value
// anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
// } }
} }
} else if (String(item).includes('[M-1]')) { } else if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '') let tst = String(item).replace('[M-1]', '')
...@@ -738,7 +738,11 @@ export default class BalanceSheetOLPA extends Component { ...@@ -738,7 +738,11 @@ export default class BalanceSheetOLPA extends Component {
}) })
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
// if (tableMeta.rowData[5] == 'Profit (loss) MTD') {
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// }
let total = 0 let total = 0
let opt = "" let opt = ""
anjay.map((item, index) => { anjay.map((item, index) => {
...@@ -1675,8 +1679,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -1675,8 +1679,7 @@ export default class BalanceSheetOLPA extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
// value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1686,8 +1689,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -1686,8 +1689,7 @@ export default class BalanceSheetOLPA extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
// value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
......
...@@ -265,7 +265,7 @@ export default class RollingOutlook extends Component { ...@@ -265,7 +265,7 @@ export default class RollingOutlook extends Component {
item.number, item.number,
item.report_name, item.report_name,
item.revision, item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status, this.state.quarter.value == 'q1' && !this.state.isApprovedMB? "CLOSED" : (this.state.quarter.value != 'q1' && !this.state.isApprovedRO ? "CLOSED" : (this.state.isSubmit === false ? "CLOSED" : item.current_status)),
item.report_id, item.report_id,
// Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload, // Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload), item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
...@@ -540,7 +540,11 @@ export default class RollingOutlook extends Component { ...@@ -540,7 +540,11 @@ export default class RollingOutlook extends Component {
lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status, lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status,
loading: false, loading: false,
lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit btnApprove: response.data.data.is_submit,
isApprovedMB: response.data.data.is_approved_master_budget,
isApprovedRO: response.data.data.is_approved_rolling_before,
msgApproveMB: response.data.data.message_approval_master_budget,
msgApproveRO: response.data.data.message_approval_rolling_outlook
}, () => { }, () => {
console.log(this.state.lastStatus); console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
...@@ -1768,6 +1772,16 @@ export default class RollingOutlook extends Component { ...@@ -1768,6 +1772,16 @@ export default class RollingOutlook extends Component {
</div> </div>
)} )}
</div> </div>
{this.state.quarter != null && this.state.quarter.value == 'q1' && this.state.isApprovedMB === false && (
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.msgApproveMB}</span>
</div>
)}
{this.state.quarter != null && this.state.quarter.value != 'q1' && this.state.isApprovedRO === false && (
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.msgApproveRO}</span>
</div>
)}
{this.state.checkApprover === true ? {this.state.checkApprover === true ?
this.state.lastStatus === 'WAITING FOR REVIEW' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
...@@ -1775,7 +1789,16 @@ export default class RollingOutlook extends Component { ...@@ -1775,7 +1789,16 @@ export default class RollingOutlook extends Component {
</div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ? </div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span> <span>{this.state.lastStatus}</span>
</div> : null </div> : this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : this.state.lastStatus === 'REVISION' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.textRevision}</span>
</div> : this.state.lastStatus === 'APPROVED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus}`}</span>
</div> : null
: :
this.state.lastStatus === 'SUBMITTED' ? this.state.lastStatus === 'SUBMITTED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
...@@ -2008,6 +2031,7 @@ export default class RollingOutlook extends Component { ...@@ -2008,6 +2031,7 @@ export default class RollingOutlook extends Component {
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED'? true : false}
/> />
)} )}
......
...@@ -2289,7 +2289,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2289,7 +2289,7 @@ export default class BalanceSheetRO extends Component {
} }
} }
}, { }, {
name: `${this.props.periode} Total Outlook`, name: `31 Dec ${this.props.periode} Total Outlook`,
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' }}>
......
...@@ -388,6 +388,7 @@ export default class CashFlow extends Component { ...@@ -388,6 +388,7 @@ export default class CashFlow extends Component {
const handleValueFormula = (value, tableMeta, column, periode, forecast) => { const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
// console.log(tableMeta.rowData[5]) // console.log(tableMeta.rowData[5])
// console.log(column) // console.log(column)
loading = true loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/) let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = [] let baru = []
...@@ -466,25 +467,26 @@ export default class CashFlow extends Component { ...@@ -466,25 +467,26 @@ export default class CashFlow extends Component {
anjay.push(forecastt) anjay.push(forecastt)
} else { } else {
let tst = String(item).replace('[M-1]', '') let tst = String(item).replace('[M-1]', '[M1]')
let data = column == 7 ? 18 : column - 1 // let data = column == 7 ? 18 : column - 1
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode // let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period) // console.log(tst)
let indexID = tableMeta.rowData[column].formula.findIndex((val) => val.item_formula == String(`@${tst}`))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value let valuezz = tableMeta.rowData[column].formula[indexID].value
if (tableMeta.rowData[5] == "Cash at the beginning period" && column != 7) { // if (tableMeta.rowData[5] == "Cash at the beginning period" && column == 9) {
// console.log(data) // console.log(data)
// console.log(dataTable2[tableMeta.rowIndex+1][5]) // console.log(dataTable2[tableMeta.rowIndex+1][5])
// console.log(dataTable2[tableMeta.rowIndex+1][data]) // console.log(dataTable2[tableMeta.rowIndex+1][data])
// console.log(dataTable2[tableMeta.rowIndex-1][data].value) // console.log(dataTable2[tableMeta.rowIndex-1][data].value)
// console.log(dataTable2[tableMeta.rowIndex][data].value) // console.log(dataTable2[tableMeta.rowIndex][data].value)
// console.log(dataTable2[tableMeta.rowIndex+1][data].value) // console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let valuezzz = dataTable2[tableMeta.rowIndex + 1][data].value // let valuezzz = dataTable2[tableMeta.rowIndex + 1][data].value
anjay.push(valuezzz == "" ? 0 : valuezzz)
} else {
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} // } else {
// anjay.push(valuezz == "" ? 0 : valuezz)
// }
} }
} }
} else { } else {
...@@ -504,10 +506,10 @@ export default class CashFlow extends Component { ...@@ -504,10 +506,10 @@ export default class CashFlow extends Component {
} }
} }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[22] == item) let indexID = dataTable2.findIndex((val) => val[18] == item)
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][22]) { if (item == dataTable2[tableMeta.rowIndex][18]) {
anjay.push(0) anjay.push(0)
} else { } else {
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
...@@ -517,6 +519,7 @@ export default class CashFlow extends Component { ...@@ -517,6 +519,7 @@ export default class CashFlow extends Component {
anjay.push(-1) anjay.push(-1)
} }
} }
} }
} }
}) })
...@@ -678,15 +681,23 @@ export default class CashFlow extends Component { ...@@ -678,15 +681,23 @@ export default class CashFlow extends Component {
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
// if (column == 9 && tableMeta.rowData[1] == 3243762) {
// console.log(tableMeta.rowData)
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// }
if (tableMeta.rowData[5] == '2.1 Additional fixed assets and CIP' && column == 7) { // if (tableMeta.rowData[5] == '2.1 Additional fixed assets and CIP' && column == 7) {
console.log(tableMeta.rowData) // console.log(tableMeta.rowData)
console.log(splitFormula) // console.log(splitFormula)
console.log(baru) // console.log(baru)
console.log(anjay) // console.log(anjay)
console.log(anjay2) // console.log(anjay2)
console.log(total) // console.log(total)
} // }
if (dataTable2[tableMeta.rowIndex][column].value == undefined) { if (dataTable2[tableMeta.rowIndex][column].value == undefined) {
dataTable2[tableMeta.rowIndex][column] = total dataTable2[tableMeta.rowIndex][column] = total
......
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