Commit 52b7e932 authored by Riri Novita's avatar Riri Novita

color

parent ac71facb
......@@ -274,6 +274,9 @@ const create = (type = "") => {
const getHierarkiReportYtd = (body) => api.post('/transaction/summary/ytd/get_report_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 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
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
......@@ -655,7 +658,9 @@ const create = (type = "") => {
getHierarkiCreateReportFRMB,
getHierarkiCreateReportFRMR,
createReportFRMB,
createReportFRMR
createReportFRMR,
getFullApproveMB,
getFullApproveMonthly
}
}
......
......@@ -48,7 +48,9 @@ export default class SubHolding extends Component {
listQuarter: null,
month: null,
quarter: null,
uom: null
uom: null,
approveMB: false,
approveMonthly: false
}
}
......@@ -59,6 +61,7 @@ export default class SubHolding extends Component {
componentDidMount() {
this.getDetailUser()
this.setState({ report: this.state.reportType[0], loading: true })
// this.getApproveMB()
}
getDetailUser() {
......@@ -76,6 +79,63 @@ 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(response);
if (response.data) {
if (response.data.status == "success") {
let approveMonthly =
this.state.month.month_id == 1?
response.data.data.january.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() {
api.create().getPerusahaanActive().then((response) => {
// console.log(response);
......@@ -271,6 +331,8 @@ export default class SubHolding extends Component {
"periode": this.state.periode.periode,
"report_type": "Master Budget",
}
this.getApproveMB()
this.getApproveMonthly()
api.create().getReportTypeBody(payload).then(response => {
console.log(response);
if (response.data) {
......@@ -3162,6 +3224,7 @@ export default class SubHolding extends Component {
width={this.props.width}
height={this.props.height}
open={this.props.open}
approved={this.state.approveMB && this.state.approveMonthly}
type={this.state.report ? this.state.report.value : 1}
dataTable={this.state.dataTable}
periode={this.state.periode ? this.state.periode.periode : null}
......
......@@ -4042,7 +4042,7 @@ export default class TableSubHolding extends Component {
control={
<NumberFormat
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"
placeholder=""
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