Commit 77820289 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

salah didam

See merge request !1106
parents 81c8e6ac 3954b743
...@@ -274,6 +274,9 @@ const create = (type = "") => { ...@@ -274,6 +274,9 @@ const create = (type = "") => {
const getHierarkiReportYtd = (body) => api.post('/transaction/summary/ytd/get_report_hierarki', body) const getHierarkiReportYtd = (body) => api.post('/transaction/summary/ytd/get_report_hierarki', body)
const getHierarkiReportHistorical = (body) => api.post('/transaction/historical/get_historical_hierarki', body) const getHierarkiReportHistorical = (body) => api.post('/transaction/historical/get_historical_hierarki', body)
const getHierarkiReportMTD = (body) => api.post('/transaction/summary/mtd/get_report_hierarki', body) const getHierarkiReportMTD = (body) => api.post('/transaction/summary/mtd/get_report_hierarki', body)
const getFullApproveMB = (body) => api.post('/transaction/master_budget/get_approved_submit', body)
const getFullApproveMonthly = (body) => api.post('/transaction/monthly_report/get_approved_submit', body)
//CASH FLOW //CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body) const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
...@@ -655,7 +658,9 @@ const create = (type = "") => { ...@@ -655,7 +658,9 @@ const create = (type = "") => {
getHierarkiCreateReportFRMB, getHierarkiCreateReportFRMB,
getHierarkiCreateReportFRMR, getHierarkiCreateReportFRMR,
createReportFRMB, createReportFRMB,
createReportFRMR createReportFRMR,
getFullApproveMB,
getFullApproveMonthly
} }
} }
......
...@@ -48,7 +48,9 @@ export default class SubHolding extends Component { ...@@ -48,7 +48,9 @@ export default class SubHolding extends Component {
listQuarter: null, listQuarter: null,
month: null, month: null,
quarter: null, quarter: null,
uom: null uom: null,
approveMB: false,
approveMonthly: false
} }
} }
...@@ -59,6 +61,7 @@ export default class SubHolding extends Component { ...@@ -59,6 +61,7 @@ export default class SubHolding extends Component {
componentDidMount() { componentDidMount() {
this.getDetailUser() this.getDetailUser()
this.setState({ report: this.state.reportType[0], loading: true }) this.setState({ report: this.state.reportType[0], loading: true })
// this.getApproveMB()
} }
getDetailUser() { getDetailUser() {
...@@ -76,6 +79,65 @@ export default class SubHolding extends Component { ...@@ -76,6 +79,65 @@ export default class SubHolding extends Component {
}) })
} }
getApproveMB() {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
}
api.create().getFullApproveMB(payload).then((response) => {
console.log(response);
if (response.data) {
if (response.data.status == "success") {
this.setState({ approveMB: response.data.data.is_master_budget_approve})
}
}
})
}
getApproveMonthly() {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
}
api.create().getFullApproveMonthly(payload).then((response) => {
console.log(payload);
console.log(response);
if (response.data) {
if (response.data.status == "success") {
console.log(response.data.data);
let approveMonthly =
this.state.month.month_id == 1?
response.data.data.januari.is_approve :
this.state.month.month_id == 2?
response.data.data.februari.is_approve :
this.state.month.month_id == 3?
response.data.data.march.is_approve :
this.state.month.month_id == 4?
response.data.data.april.is_approve :
this.state.month.month_id == 5?
response.data.data.may.is_approve :
this.state.month.month_id == 6?
response.data.data.june.is_approve :
this.state.month.month_id == 7?
response.data.data.july.is_approve :
this.state.month.month_id == 8?
response.data.data.august.is_approve :
this.state.month.month_id == 9?
response.data.data.september.is_approve :
this.state.month.month_id == 10?
response.data.data.october.is_approve :
this.state.month.month_id == 11?
response.data.data.november.is_approve :
response.data.data.december.is_approve
this.setState({ approveMonthly })
}
}
})
}
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
// console.log(response); // console.log(response);
...@@ -271,6 +333,8 @@ export default class SubHolding extends Component { ...@@ -271,6 +333,8 @@ export default class SubHolding extends Component {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"report_type": "Master Budget", "report_type": "Master Budget",
} }
this.getApproveMB()
this.getApproveMonthly()
api.create().getReportTypeBody(payload).then(response => { api.create().getReportTypeBody(payload).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
...@@ -3162,6 +3226,8 @@ export default class SubHolding extends Component { ...@@ -3162,6 +3226,8 @@ export default class SubHolding extends Component {
width={this.props.width} width={this.props.width}
height={this.props.height} height={this.props.height}
open={this.props.open} open={this.props.open}
approvedMB={this.state.approveMB}
approveMonthly={this.state.approveMonthly}
type={this.state.report ? this.state.report.value : 1} type={this.state.report ? this.state.report.value : 1}
dataTable={this.state.dataTable} dataTable={this.state.dataTable}
periode={this.state.periode ? this.state.periode.periode : null} periode={this.state.periode ? this.state.periode.periode : null}
......
...@@ -4042,7 +4042,7 @@ export default class TableSubHolding extends Component { ...@@ -4042,7 +4042,7 @@ export default class TableSubHolding extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.approved ? 'black' : '#5198ea' , fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
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