Commit 4faf8c57 authored by d.arizona's avatar d.arizona

update tengah malem

parent ebb784fa
......@@ -255,7 +255,7 @@ const create = (type = "") => {
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)
const getReportFRLastMR = (body) => api.post('/transaction/summary_ratio/monthly_report_last_year/get_report_hierarki', body)
const getReportBSSuma = (body) => api.post('/transaction/summary/balance_sheet/get_report_hierarki', body)
const getReportBSSuma = (body) => api.post('/transaction/summary_balance_sheet/summary/get_report_hierarki', body)
const getDashboardCAT = (body) => api.post('/dashboard/cat', body)
//CASH FLOW
......
......@@ -1116,6 +1116,7 @@ export default class SubHolding extends Component {
let dbSumaCF = []
let paylodCF = { ...payload, months: this.state.month.month_id }
api.create().getReportCFSuma(paylodCF).then(response => {
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data
......@@ -1339,10 +1340,13 @@ export default class SubHolding extends Component {
})
} else if (this.state.report.value === 7) {
let payload = {
"report_id": this.state.report.value,
"report_id": 2,
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"months": this.state.month.month_id
"months": this.state.month.month_id,
"revision": this.state.revisionType,
"quarter": 0,
"submission_id": this.state.submissionID
}
api.create().getReportBSSuma(payload).then(response => {
console.log(payload);
......@@ -1361,14 +1365,14 @@ export default class SubHolding extends Component {
item.level,
item.description,
item.balance_sheet.last_month,
item.balance_sheet.actual,
item.balance_sheet.mb,
item.balance_sheet.mtd_actual,
item.balance_sheet.mtd_mb,
item.balance_sheet.percent_of_mb,
item.balance_sheet.ol,
item.balance_sheet.mtd_ol,
item.balance_sheet.percent_of_ol,
item.balance_sheet.last_year,
item.balance_sheet.forecast_next_year,
item.balance_sheet.forecast_next_two_year,
item.balance_sheet.forecast_more_year,
item.order
])
}
......@@ -1389,14 +1393,14 @@ export default class SubHolding extends Component {
item.level,
item.description,
item.balance_sheet.last_month,
item.balance_sheet.actual,
item.balance_sheet.mb,
item.balance_sheet.mtd_actual,
item.balance_sheet.mtd_mb,
item.balance_sheet.percent_of_mb,
item.balance_sheet.ol,
item.balance_sheet.mtd_ol,
item.balance_sheet.percent_of_ol,
item.balance_sheet.last_year,
item.balance_sheet.mtd_last_year,
item.balance_sheet.forecast_next_year,
item.balance_sheet.forecast_next_two_year,
item.balance_sheet.forecast_more_year,
item.order
])
if (item.children !== null) {
......@@ -1409,7 +1413,7 @@ export default class SubHolding extends Component {
})
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
console.log(this.state.dataTable)
// // this.getBalanceSheetMR(payload)
// })
} else {
......@@ -1419,7 +1423,7 @@ export default class SubHolding extends Component {
} else if (this.state.report.value === 8) {
let dbSumaPL = []
let payloadPL = {...payload, months: this.state.month.month_id}
let payloadPL = {...payload, report_id: 1, months: this.state.month.month_id, quarter: 0}
api.create().getReportPLSuma(payloadPL).then(response => {
console.log(response);
if (response.data) {
......@@ -2290,6 +2294,47 @@ export default class SubHolding extends Component {
a.download = 'Report DB Operating Indicator.xlsx';
a.click();
}
} else if (this.state.report.value === 6) {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_cash_flow/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}&&months=${this.state.month.month_id}&&quarter=0`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report Cash Flow - Summary.xlsx';
a.click();
}
} else if (this.state.report.value === 7) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/transaction/summary_balance_sheet/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=2&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}&&months=${this.state.month.month_id}&&quarter=0`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/transaction/summary_balance_sheet/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=2&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}&&months=${this.state.month.month_id}&&quarter=0`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report Balance Sheet - Summary.xlsx';
a.click();
}
} else if (this.state.report.value === 8) {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_profit_loss/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=1&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}&&months=${this.state.month.month_id}&&quarter=`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report Profit & Loss - Summary.xlsx';
a.click();
}
} else {
setTimeout(() => {
this.setState({ loading: false })
......
......@@ -15300,7 +15300,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)}
value={Number(tableMeta.rowData[13]).toFixed(1)}
/>
}
/>
......@@ -15345,7 +15345,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)}
value={Number(tableMeta.rowData[14]).toFixed(1)}
/>
}
/>
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