Commit 430b6820 authored by d.arizona's avatar d.arizona

update

parent a673f6d2
...@@ -441,6 +441,10 @@ const create = (type = "") => { ...@@ -441,6 +441,10 @@ const create = (type = "") => {
const getHierarkiCronJobMRCF = () => api.get('/transaction/report/get_hierarki_monthly_report/cash_flow') const getHierarkiCronJobMRCF = () => api.get('/transaction/report/get_hierarki_monthly_report/cash_flow')
const getHierarkiCronJobMRRatio = () => api.get('/transaction/report/get_hierarki_monthly_report/ratio') const getHierarkiCronJobMRRatio = () => api.get('/transaction/report/get_hierarki_monthly_report/ratio')
// Ratio X LOCF
const getRatioLOCF = (body) => api.get(`/transaction/cronjob/create_monthly_report/${body.report}/${body.monthlyReportId}/${body.companyId}/${body.months}/${body.periode}`)
const triggerRatioFromLOCF = (body) => api.get(`/transaction/cronjob/create_monthly_report_locf/${body.report}/${body.monthlyReportId}/${body.companyId}/${body.months}/${body.periode}`)
// MonthlyPL // MonthlyPL
// const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body) // const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
// const createMonthlyReportPL = (body) => api.post('transaction/monthly_report_pl/create_monthly_report', body) // const createMonthlyReportPL = (body) => api.post('transaction/monthly_report_pl/create_monthly_report', body)
...@@ -807,7 +811,9 @@ const create = (type = "") => { ...@@ -807,7 +811,9 @@ const create = (type = "") => {
getHierarkiDBPLRO, getHierarkiDBPLRO,
createDBPLRO, createDBPLRO,
getDetailReportOLPACAT, getDetailReportOLPACAT,
createCATOLPA createCATOLPA,
getRatioLOCF,
triggerRatioFromLOCF
} }
} }
......
...@@ -18976,6 +18976,15 @@ export default class TableSubHolding extends Component { ...@@ -18976,6 +18976,15 @@ export default class TableSubHolding extends Component {
}, },
] ]
const handleCashend = (tableMeta, col) => {
let indexRow = tableMeta.rowIndex
let indexCol = tableMeta.columnIndex
let dataTable = dataTable2
let value = Number(dataTable[indexRow-2][col]) + Number(dataTable[indexRow-1][col])
return Number(value).toFixed(1)
}
const columnDBCF = [ const columnDBCF = [
{ {
name: "", name: "",
...@@ -19077,7 +19086,8 @@ export default class TableSubHolding extends Component { ...@@ -19077,7 +19086,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[109]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 109) : Number(tableMeta.rowData[109]).toFixed(1)}
// value={Number(tableMeta.rowData[109]).toFixed(1)}
/> />
} }
/> />
...@@ -19100,7 +19110,8 @@ export default class TableSubHolding extends Component { ...@@ -19100,7 +19110,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[110]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 110) : Number(tableMeta.rowData[110]).toFixed(1)}
// value={Number(tableMeta.rowData[110]).toFixed(1)}
/> />
} }
/> />
...@@ -19126,8 +19137,9 @@ export default class TableSubHolding extends Component { ...@@ -19126,8 +19137,9 @@ export default class TableSubHolding extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} suffix={'%'}
value={Number(tableMeta.rowData[111]).toFixed(1)} // 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)}
/>
} }
/> />
</div> </div>
...@@ -19149,7 +19161,8 @@ export default class TableSubHolding extends Component { ...@@ -19149,7 +19161,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[112]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 112) : Number(tableMeta.rowData[112]).toFixed(1)}
// value={Number(tableMeta.rowData[112]).toFixed(1)}
/> />
} }
/> />
...@@ -19212,7 +19225,8 @@ export default class TableSubHolding extends Component { ...@@ -19212,7 +19225,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[113]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 113) : Number(tableMeta.rowData[113]).toFixed(1)}
// value={Number(tableMeta.rowData[113]).toFixed(1)}
/> />
} }
/> />
...@@ -19235,7 +19249,8 @@ export default class TableSubHolding extends Component { ...@@ -19235,7 +19249,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[114]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 114) : Number(tableMeta.rowData[114]).toFixed(1)}
// value={Number(tableMeta.rowData[114]).toFixed(1)}
/> />
} }
/> />
...@@ -19261,7 +19276,8 @@ export default class TableSubHolding extends Component { ...@@ -19261,7 +19276,8 @@ export default class TableSubHolding extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} suffix={'%'}
value={Number(tableMeta.rowData[115]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 115) : Number(tableMeta.rowData[115]).toFixed(1)}
// value={Number(tableMeta.rowData[115]).toFixed(1)}
/> />
} }
/> />
...@@ -19284,7 +19300,8 @@ export default class TableSubHolding extends Component { ...@@ -19284,7 +19300,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[116]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 116) : Number(tableMeta.rowData[116]).toFixed(1)}
// value={Number(tableMeta.rowData[116]).toFixed(1)}
/> />
} }
/> />
...@@ -19348,7 +19365,8 @@ export default class TableSubHolding extends Component { ...@@ -19348,7 +19365,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[117]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 117) : Number(tableMeta.rowData[117]).toFixed(1)}
// value={Number(tableMeta.rowData[117]).toFixed(1)}
/> />
} }
/> />
...@@ -19371,7 +19389,8 @@ export default class TableSubHolding extends Component { ...@@ -19371,7 +19389,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[118]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 118) : Number(tableMeta.rowData[118]).toFixed(1)}
// value={Number(tableMeta.rowData[118]).toFixed(1)}
/> />
} }
/> />
...@@ -19397,7 +19416,8 @@ export default class TableSubHolding extends Component { ...@@ -19397,7 +19416,8 @@ export default class TableSubHolding extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} suffix={'%'}
value={Number(tableMeta.rowData[119]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 119) : Number(tableMeta.rowData[119]).toFixed(1)}
// value={Number(tableMeta.rowData[119]).toFixed(1)}
/> />
} }
/> />
...@@ -19420,7 +19440,8 @@ export default class TableSubHolding extends Component { ...@@ -19420,7 +19440,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[120]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 120) : Number(tableMeta.rowData[120]).toFixed(1)}
// value={Number(tableMeta.rowData[120]).toFixed(1)}
/> />
} }
/> />
...@@ -19483,7 +19504,8 @@ export default class TableSubHolding extends Component { ...@@ -19483,7 +19504,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[121]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 121) : Number(tableMeta.rowData[121]).toFixed(1)}
// value={Number(tableMeta.rowData[121]).toFixed(1)}
/> />
} }
/> />
...@@ -19506,7 +19528,8 @@ export default class TableSubHolding extends Component { ...@@ -19506,7 +19528,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[122]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 122) : Number(tableMeta.rowData[122]).toFixed(1)}
// value={Number(tableMeta.rowData[122]).toFixed(1)}
/> />
} }
/> />
...@@ -19531,7 +19554,8 @@ export default class TableSubHolding extends Component { ...@@ -19531,7 +19554,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[123]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 123) : Number(tableMeta.rowData[123]).toFixed(1)}
// value={Number(tableMeta.rowData[123]).toFixed(1)}
suffix={'%'} suffix={'%'}
/> />
} }
...@@ -19555,7 +19579,8 @@ export default class TableSubHolding extends Component { ...@@ -19555,7 +19579,8 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[124]).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == 'cash at the end of the period' ? handleCashend(tableMeta, 124) : Number(tableMeta.rowData[124]).toFixed(1)}
// value={Number(tableMeta.rowData[124]).toFixed(1)}
/> />
} }
/> />
...@@ -173,6 +173,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -173,6 +173,7 @@ export default class ListOfCreditFacilities extends Component {
} }
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev}) this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
// this.setState({viewOnly: true})
} }
getItemHierarki() { getItemHierarki() {
...@@ -757,7 +758,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -757,7 +758,7 @@ export default class ListOfCreditFacilities extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport('LOCF')
// this.props.onClickClose() // this.props.onClickClose()
// this.props.getReport() // this.props.getReport()
} else { } else {
...@@ -961,13 +962,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -961,13 +962,13 @@ export default class ListOfCreditFacilities extends Component {
getDataRatio() { getDataRatio() {
let payload = { let payload = {
"report_id": this.props.report_id, "report": 'ratio',
"revision": this.props.revision, "monthlyReportId": this.props.monthlyReportId,
"periode": 2021, "periode": this.props.periode,
"company_id": this.props.company.company_id, "companyId": this.props.company.company_id,
"submission_id": this.state.submissionID "months": this.props.month.month_id
} }
api.create().getReportHierarkiFRMR(payload).then(response => { api.create().getRatioLOCF(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
...@@ -1153,7 +1154,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1153,7 +1154,7 @@ export default class ListOfCreditFacilities extends Component {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport('LOCF')
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false}, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false}, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
......
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