Commit fd587cd0 authored by Riri Novita's avatar Riri Novita

month + mtd

parent cacee229
......@@ -265,6 +265,7 @@ const create = (type = "") => {
const getReportBSSuma = (body) => api.post('/transaction/summary_balance_sheet/summary/get_report_hierarki', body)
const getDashboardCAT = (body) => api.post('/dashboard/cat', body)
const getHierarkiReportHistorical = (body) => api.post('/transaction/historical/get_historical_hierarki', body)
const getHierarkiReportMTD = (body) => api.post('/transaction/summary/mtd/get_report_hierarki', body)
//CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
......@@ -637,7 +638,8 @@ const create = (type = "") => {
createReportPLMB,
createReportPLMR,
getPLID,
getHierarkiReportHistorical
getHierarkiReportHistorical,
getHierarkiReportMTD
}
}
......
......@@ -32,6 +32,7 @@ export default class SummaryOfTriputra extends Component {
loading: false,
previewTable: false,
listMonths: null,
month: null
}
}
......@@ -193,7 +194,7 @@ export default class SummaryOfTriputra extends Component {
let index = data.findIndex((val) => val.month_name == month)
console.log(index)
console.log(monthData)
this.setState({ listMonths: defaultProps, month: index == -1 ? monthData[0].month_name : monthData[index].month_name }, () => {
this.setState({ listMonths: defaultProps, month: index == -1 ? monthData[0] : monthData[index] }, () => {
this.getDataTable()
})
console.log(this.state.month)
......@@ -263,21 +264,19 @@ export default class SummaryOfTriputra extends Component {
}
getDataTable() {
// let payload = {
// "report_id": this.state.report.value,
// "revision": this.state.lastRevision,
// "periode": this.state.periode.periode,
// "company_id": this.state.company.company_id,
// "submission_id": this.state.submissionID
// }
let payload = {
"report_type": this.state.report.value,
"periode": this.state.periode.periode,
"months" : this.state.month.month_id
}
let newPayload = {
"periode": this.state.periode.periode,
"report_type":"historical"
}
if (this.state.report.value === 1) {
// api.create().getDetailReportMB(payload).then(response => {
// // console.log(response);
// // console.log(payload)
api.create().getHierarkiReportMTD(payload).then(response => {
console.log(response);
console.log(payload)
let dataTable = []
// if (response.data) {
// let res = response.data.data
......@@ -357,7 +356,7 @@ export default class SummaryOfTriputra extends Component {
// } else {
// this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
// }
// })
})
} else if (this.state.report.value === 2) {
// api.create().getDetailReportMB(payload).then(response => {
// console.log(payload);
......@@ -794,6 +793,7 @@ export default class SummaryOfTriputra extends Component {
width={this.props.width}
height={this.props.height}
open={this.props.open}
month={this.state.month}
type={this.state.report ? this.state.report.value : 1}
dataTable={this.state.dataTable}
periode={this.state.periode ? this.state.periode.periode : null}
......
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