Commit 6b4f7cdc authored by d.arizona's avatar d.arizona

update superadmin approval & cf summ

parent dc2f45e1
......@@ -478,6 +478,10 @@ const create = (type = "") => {
const getMonitoringMR = (body) => api.get(`transaction/monitoring/monthly_report/${body.year}/${body.month}`)
const getMonitoringRO = (body) => api.get(`transaction/monitoring/rolling_outlook/${body.year}/${body.quarter}`)
const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook_pa?year=${body.year}`)
// Superadmin Approve
const getListApprover = (report,monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
// ------
// STEP 3
// ------
......@@ -823,6 +827,8 @@ const create = (type = "") => {
getMonitoringMR,
getMonitoringRO,
getMonitoringOLPA,
getListApprover,
getIdToken
}
}
......
This diff is collapsed.
......@@ -18976,15 +18976,87 @@ export default class TableSubHolding extends Component {
},
]
const handleCashend = (tableMeta, col) => {
const handleCashend = (tableMeta, col, type) => {
let value = 0
if (String(type).includes('percent')) {
let mtd_actual = tableMeta.rowData[109] == '' ? 0 : Number(tableMeta.rowData[109])
let mtd = tableMeta.rowData[110] == '' ? 0 : Number(tableMeta.rowData[110])
// console.log(mtd)
// let persenMtd = Number(mtd_actual / mtd)
let persenMtd = 0
if (mtd < 0) {
if (mtd_actual >= mtd) {
persenMtd = ((mtd - mtd_actual) / mtd + 1 )
} else {
persenMtd = ((mtd - mtd_actual) / mtd)
}
}
else {
persenMtd = Number(mtd_actual / mtd)
}
let ytd_actual = tableMeta.rowData[113 ] == '' ? 0 : Number(tableMeta.rowData[113 ])
let ytd = tableMeta.rowData[114] == '' ? 0 : Number(tableMeta.rowData[114])
// let persenYtd = Number(ytd_actual / ytd)
let persenYtd = 0
if (ytd < 0) {
if (ytd_actual >= ytd) {
persenYtd = ((ytd - ytd_actual) / ytd + 1 )
} else {
persenYtd = ((ytd - ytd_actual) / ytd)
}
}
else {
persenYtd = Number(ytd_actual/ytd)
}
let quarter_actual = tableMeta.rowData[117] == '' ? 0 : Number(tableMeta.rowData[117])
let quarter = tableMeta.rowData[118] == '' ? 0 : Number(tableMeta.rowData[118])
// let persenQuarter = Number(quarter_actual / quarter)
let persenQuarter = 0
if (quarter < 0) {
if (quarter_actual >= quarter) {
persenQuarter = (quarter - quarter_actual) / quarter + 1
} else {
persenQuarter = (quarter - quarter_actual) / quarter
}
}
else {
persenQuarter = quarter_actual / quarter
}
let fy_actual = tableMeta.rowData[121] == '' ? 0 : Number(tableMeta.rowData[121])
let fy = tableMeta.rowData[122] == '' ? 0 : Number(tableMeta.rowData[122])
// let persenFy = Number(fy_actual / fy)
let persenFy = 0
if (fy < 0) {
if (fy_actual >= fy) {
persenFy = (fy - fy_actual) / fy + 1
} else {
persenFy = (fy - fy_actual) / fy
}
}
else {
persenFy = fy_actual / fy
}
value = String(type).includes('MTD') ? persenMtd : String(type).includes('YTD') ? persenYtd : String(type).includes('Quarter') ? persenQuarter : persenFy
value = (value == Infinity || value == -Infinity || isNaN(value) ? 0 : Number(value * 100).toFixed(1))
// value = isNaN(value) || value == 'Infinity' || value == '-Infinity' ? (value == '' || value == 0 ? -0 : 0) : (value== '' || value == 0 ? persenFy * -100 : persenFy * 100)
} else {
let indexRow = tableMeta.rowIndex
let indexCol = tableMeta.columnIndex
let dataTable = dataTable2
let value = Number(dataTable[indexRow-2][col]) + Number(dataTable[indexRow-1][col])
value = Number(dataTable[indexRow-2][col]) + Number(dataTable[indexRow-1][col])
value = Number(value).toFixed(1)
dataTable2[tableMeta.rowIndex][col] = value
}
return Number(value).toFixed(1)
return value
}
const columnDBCF = [
{
name: "",
......@@ -19138,7 +19210,7 @@ export default class TableSubHolding extends Component {
disabled={true}
suffix={'%'}
// value={Number(tableMeta.rowData[111]).toFixed(1)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 111) : Number(tableMeta.rowData[111]).toFixed(1)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 111, 'percentMTD') : Number(tableMeta.rowData[111]).toFixed(1)}
/>
}
/>
......@@ -19276,7 +19348,7 @@ export default class TableSubHolding extends Component {
placeholder=""
disabled={true}
suffix={'%'}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 115) : Number(tableMeta.rowData[115]).toFixed(1)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 115, 'percentYTD') : Number(tableMeta.rowData[115]).toFixed(1)}
// value={Number(tableMeta.rowData[115]).toFixed(1)}
/>
}
......@@ -19416,7 +19488,7 @@ export default class TableSubHolding extends Component {
placeholder=""
disabled={true}
suffix={'%'}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 119) : Number(tableMeta.rowData[119]).toFixed(1)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 119, 'percentQuarter') : Number(tableMeta.rowData[119]).toFixed(1)}
// value={Number(tableMeta.rowData[119]).toFixed(1)}
/>
}
......@@ -19554,7 +19626,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 123) : Number(tableMeta.rowData[123]).toFixed(1)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 123, 'percentFY') : Number(tableMeta.rowData[123]).toFixed(1)}
// value={Number(tableMeta.rowData[123]).toFixed(1)}
suffix={'%'}
/>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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