Commit f9f8d2dd authored by faisalhamdi's avatar faisalhamdi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into faisal

parents 596417ef 90a82d4d
...@@ -260,8 +260,10 @@ const create = (type = "") => { ...@@ -260,8 +260,10 @@ const create = (type = "") => {
const createRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/create_rolling_outlook', body) const createRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/create_rolling_outlook', body)
const checkImportRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/check_import', body) const checkImportRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/check_import', body)
const importRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/import_rolling_outlook', body) const importRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/import_rolling_outlook', body)
const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body) const getRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body) const createRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/create_rolling_outlook', body)
const checkImportRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/check_import', body)
const importRollingOutlookTP = (body) => api.post('transaction/tax_planning/rolling_outlook/import_rolling_outlook', body)
const getRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/get_report_hierarki', body) const getRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/create_rolling_outlook', body) const createRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/create_rolling_outlook', body)
const checkImportRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/check_import', body) const checkImportRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/check_import', body)
...@@ -274,6 +276,7 @@ const create = (type = "") => { ...@@ -274,6 +276,7 @@ const create = (type = "") => {
const checkUploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/check_import', body) const checkUploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/check_import', body)
const uploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook', body) const uploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook', body)
const submitRollingOutlook = (body) => api.post('transaction/rolling_outlook/submit_rolling_outlook', body) const submitRollingOutlook = (body) => api.post('transaction/rolling_outlook/submit_rolling_outlook', body)
const getRollingOutlookCompanySubmitted = (body) => api.post('transaction/rolling_outlook/get_company_submitted', body)
//REPORT NEW //REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body) const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
...@@ -346,8 +349,9 @@ const create = (type = "") => { ...@@ -346,8 +349,9 @@ const create = (type = "") => {
const uploadAttOLPA = (body) => api.post('transaction/outlook_pa/upload_attachment', body) const uploadAttOLPA = (body) => api.post('transaction/outlook_pa/upload_attachment', body)
const deleteAttOLPA = (id) => api.post(`transaction/outlook_pa/delete_attachment/${id}`) const deleteAttOLPA = (id) => api.post(`transaction/outlook_pa/delete_attachment/${id}`)
const getReportOLPA = (body) => api.post('transaction/outlook_pa/get_all_report', body) const getReportOLPA = (body) => api.post('transaction/outlook_pa/get_all_report', body)
const approvalSubmissionOLPA = (body) => api.post('transaction/outlook_pa/approval_submission', body) const approvalSubmissionOLPA = (body) => api.post('transaction/outlook_pa/approval_outlook', body)
const checkApproverOLPA = () => api.get('transaction/outlook_pa/is_approver') const checkApproverOLPA = () => api.get('transaction/outlook_pa/is_approver')
const createPeriodeRevisionOLPA = (body) => api.post('transaction/outlook_pa/create_periode_revision', body)
// Monthly // Monthly
const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body) const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body)
...@@ -729,6 +733,8 @@ const create = (type = "") => { ...@@ -729,6 +733,8 @@ const create = (type = "") => {
createRollingOutlookBS, createRollingOutlookBS,
getRollingOutlookTP, getRollingOutlookTP,
createRollingOutlookTP, createRollingOutlookTP,
checkImportRollingOutlookTP,
importRollingOutlookTP,
getAllMasterDataCat, getAllMasterDataCat,
getParentItemReport, getParentItemReport,
saveMasterDataCat, saveMasterDataCat,
...@@ -762,7 +768,9 @@ const create = (type = "") => { ...@@ -762,7 +768,9 @@ const create = (type = "") => {
getLastestUpdateROOI, getLastestUpdateROOI,
checkUploadRollingOutlookOI, checkUploadRollingOutlookOI,
uploadRollingOutlookOI, uploadRollingOutlookOI,
submitRollingOutlook submitRollingOutlook,
getRollingOutlookCompanySubmitted,
createPeriodeRevisionOLPA
} }
} }
......
...@@ -492,7 +492,7 @@ export default class MonthlyReport extends Component { ...@@ -492,7 +492,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"status": selectedStatus "status": selectedStatus
} }
this.setState({ isApprovedMB: true }) // this.setState({ isApprovedMB: true })
api.create().getCompanySubmittedMonthly(body).then(response => { api.create().getCompanySubmittedMonthly(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
......
...@@ -564,7 +564,7 @@ export default class OperatingIndicator extends Component { ...@@ -564,7 +564,7 @@ export default class OperatingIndicator extends Component {
{this.state.visibleOperatingIndicator && ( {this.state.visibleOperatingIndicator && (
<div> <div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Operating Indicator</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Operating Indicator Submission</Typography>
</div> </div>
<div style={{ padding: 20, width: '100%' }}> <div style={{ padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10 }}> <Paper style={{ paddingTop: 10 }}>
......
...@@ -99,7 +99,7 @@ export default class OutlookPA extends Component { ...@@ -99,7 +99,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getCompanySubmittedOLPA(body).then(response => { api.create().getCompanySubmittedOLPA(body).then(response => {
// console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -233,7 +233,7 @@ export default class OutlookPA extends Component { ...@@ -233,7 +233,7 @@ export default class OutlookPA extends Component {
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
// console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -291,8 +291,9 @@ export default class OutlookPA extends Component { ...@@ -291,8 +291,9 @@ export default class OutlookPA extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriodOLPA(this.state.company.company_id).then(response => { api.create().getLastPeriodOLPA(this.state.company.company_id).then(response => {
// console.log(response); // console.log(response);
let currentYear = new Date().getFullYear()
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: Number(response.data.data.last_periode) < Number(currentYear)? String(currentYear) : response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
}) })
} }
...@@ -314,7 +315,7 @@ export default class OutlookPA extends Component { ...@@ -314,7 +315,7 @@ export default class OutlookPA extends Component {
data.push(item) data.push(item)
} }
} else { } else {
if ((item >= 2000) && (item == Number(this.state.lastPeriod) + 1 || item < Number(this.state.lastPeriod) + 1)) { if ((item >= 2000) && (item == Number(this.state.lastPeriod) || item < Number(this.state.lastPeriod))) {
data.push(item) data.push(item)
} }
} }
...@@ -328,7 +329,7 @@ export default class OutlookPA extends Component { ...@@ -328,7 +329,7 @@ export default class OutlookPA extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : Number(this.state.lastPeriod) + 1) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : Number(this.state.lastPeriod))
let index = data.sort((a, b) => a - b).findIndex((val) => val == periode) let index = data.sort((a, b) => a - b).findIndex((val) => val == periode)
// console.log(data) // console.log(data)
// console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
...@@ -449,13 +450,13 @@ export default class OutlookPA extends Component { ...@@ -449,13 +450,13 @@ export default class OutlookPA extends Component {
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD') "max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD')
} }
// console.log(payload) // console.log(payload)
api.create().approvalSubmission(body).then((res) => { api.create().approvalSubmissionOLPA(body).then((res) => {
// console.log(res) console.log(res)
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getOutlookPAID()
}) })
if (type == 'revision') { if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res)) api.create().createPeriodeRevisionOLPA(payload).then((res) => console.log(res))
} }
}) })
} }
......
...@@ -144,6 +144,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -144,6 +144,7 @@ export default class BalanceSheetOLPA extends Component {
"outlook_pa_id": this.props.outlook_pa_id, "outlook_pa_id": this.props.outlook_pa_id,
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": this.props.revision, "revision": this.props.revision,
"get_for": this.state.get_for,
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
} }
......
...@@ -122,6 +122,7 @@ export default class ProfitLossOLPA extends Component { ...@@ -122,6 +122,7 @@ export default class ProfitLossOLPA extends Component {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": Number(this.props.revision), "revision": Number(this.props.revision),
"get_for": this.state.get_for,
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"outlook_pa_id": this.props.outlook_pa_id "outlook_pa_id": this.props.outlook_pa_id
......
...@@ -146,6 +146,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -146,6 +146,7 @@ export default class TaxPlanningOLPA extends Component {
let payload = { let payload = {
"outlook_pa_id": this.props.outlook_pa_id, "outlook_pa_id": this.props.outlook_pa_id,
"report_id": this.props.report_id, "report_id": this.props.report_id,
"get_for": this.state.get_for,
"revision": this.props.revision, "revision": this.props.revision,
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
......
...@@ -64,10 +64,12 @@ export default class RollingOutlook extends Component { ...@@ -64,10 +64,12 @@ export default class RollingOutlook extends Component {
minDateRevision: new Date(), minDateRevision: new Date(),
maxDateRevision: new Date(), maxDateRevision: new Date(),
btnApprove: false, btnApprove: false,
listStatus: [],
selectedStatus: [],
quarterList: [ quarterList: [
{value: 'q1', name: 'Q1'}, { value: 'q1', name: 'Q1' },
{value: 'q2', name: 'Q2'}, { value: 'q2', name: 'Q2' },
{value: 'q3', name: 'Q3'}, { value: 'q3', name: 'Q3' },
// {value: 'ol_pa', name: 'OL PA'}, // {value: 'ol_pa', name: 'OL PA'},
], ],
quarter: null quarter: null
...@@ -87,56 +89,126 @@ export default class RollingOutlook extends Component { ...@@ -87,56 +89,126 @@ export default class RollingOutlook extends Component {
// this.checkApprover() // this.checkApprover()
// }) // })
// } else { // } else {
this.checkApprover() this.getPermission()
// } // }
} }
getPermission() {
let payload = {
menu: "rolling outlook & cat revision"
}
api.create().getPermission(payload).then(response => {
console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
btnCreate: response.data.data.create,
btnEdit: response.data.data.edit
}, () => {
this.checkApprover()
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
checkApprover() { checkApprover() {
let listStatus1 = [
{ name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' },
{ name: 'Waiting for Review / Approval', value: 'approval_proccess' },
{ name: 'Approved', value: 'approved' },
]
let listStatus2 = [
{ name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' },
{ name: 'Approved', value: 'approved' },
]
api.create().getRollingOutlookIsApprover().then(response => { api.create().getRollingOutlookIsApprover().then(response => {
console.log(response); console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }, () => this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
this.getPeriode()) this.getPeriode())
} else { } else {
this.setState({ isApprover: false, checkApprover: false }, () => this.setState({ isApprover: false, checkApprover: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () =>
this.getDetailUser()) this.getPeriode())
// this.getDetailUser())
} }
}) })
} }
getCompanySubmitted() { getCompanySubmitted() {
let selectedStatus = this.state.selectedStatus.map((item) => {
return item.value
})
let body = { let body = {
"periode": this.state.periode.periode "periode": this.state.periode.periode,
"quartal": this.state.quarter.value,
"status": selectedStatus
} }
api.create().getCompanySubmitted(body).then(response => { // this.setState({ isApprovedMB: true })
api.create().getRollingOutlookCompanySubmitted(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data if (response.data.data.length > 0) {
let companyData = data.map((item) => { let data = response.data.data
return { let companyData = data.map((item) => {
company_id: item.company_id, return {
company_name: item.company_name, company_id: item.company_id,
} company_name: item.company_name,
}) }
})
if (companyData.length > 0) { let arrayBaru = []
companyData = companyData.sort((a,b) => a.company_name.localeCompare(b.company_name)) this.state.userCompany.map((item, index) => {
} let indexID = companyData.findIndex((val) => val.company_id == item)
if (indexID !== -1) {
arrayBaru.push(companyData[indexID])
}
})
let defaultProps = { if (arrayBaru.length > 0) {
options: companyData, arrayBaru = arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name))
getOptionLabel: (option) => titleCase(option.company_name),
};
this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
// console.log(response.data.data);
if (response.data.data.length > 0) {
this.getRevision()
} else {
this.setState({ listRevision: null, revision: null, dataTable: [], loading: false, checkApprover: false, lastRevision: "", visibleTableHistory: false })
} }
// let defaultProps = {
}) options: arrayBaru,
getOptionLabel: (option) => titleCase(option.company_name),
}
let indexID = null
if (this.state.rawData !== undefined) {
indexID = arrayBaru.findIndex((val) => val.company_id == this.state.rawData.company_id)
}
// console.log(response.data.data.length)
this.setState({ listCompany: defaultProps, company: indexID == null ? arrayBaru[0] : arrayBaru[indexID], company_submit: defaultProps }, () => {
// console.log(response.data.data.length)
if (response.data.data.length > 0) {
this.getRevision()
} else {
// console.log(this.state.listCompany)
// console.log(this.state.company_submit)
this.setState({ listRevision: null, revision: null, dataTable: [], lastRevision: "", visibleTableHistory: false })
}
//
})
} else {
this.setState({ listRevision: null, revision: null, listCompany: null, company: null, dataTable: [], lastRevision: "", visibleTableHistory: false, loading: false }, () => {
document.body.style.overflow = 'unset';
})
}
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -235,8 +307,9 @@ export default class RollingOutlook extends Component { ...@@ -235,8 +307,9 @@ export default class RollingOutlook 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.getRole(response.data.data.role_id)
this.setState({ userCompany: response.data.data.company }, () => { this.setState({ userCompany: response.data.data.company }, () => {
this.getCompanyActive() this.getCompanySubmitted()
}) })
} }
} }
...@@ -244,6 +317,35 @@ export default class RollingOutlook extends Component { ...@@ -244,6 +317,35 @@ export default class RollingOutlook extends Component {
}) })
} }
getRole(id) {
api.create().getDetailRole(id).then((response) => {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
// this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
// // // console.log(response.data.data)
if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') {
this.setState({ isAdmin: true })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
console.log(response); console.log(response);
...@@ -259,7 +361,7 @@ export default class RollingOutlook extends Component { ...@@ -259,7 +361,7 @@ export default class RollingOutlook extends Component {
}) })
if (companyData.length > 0) { if (companyData.length > 0) {
companyData = companyData.sort((a,b) => a.company_name.localeCompare(b.company_name)) companyData = companyData.sort((a, b) => a.company_name.localeCompare(b.company_name))
} }
let arrayBaru = [] let arrayBaru = []
...@@ -271,7 +373,7 @@ export default class RollingOutlook extends Component { ...@@ -271,7 +373,7 @@ export default class RollingOutlook extends Component {
}) })
if (arrayBaru.length > 0) { if (arrayBaru.length > 0) {
arrayBaru = arrayBaru.sort((a,b) => a.company_name.localeCompare(b.company_name)) arrayBaru = arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name))
} }
let defaultProps = { let defaultProps = {
...@@ -311,20 +413,21 @@ export default class RollingOutlook extends Component { ...@@ -311,20 +413,21 @@ export default class RollingOutlook extends Component {
getPeriode() { getPeriode() {
api.create().getPeriodeTransaction().then(response => { api.create().getPeriodeTransaction().then(response => {
// let dateNow = new Date console.log(response)
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let currentYear = new Date().getFullYear() let currentYear = new Date().getFullYear()
// console.log(currentYear)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = [] let data = []
response.data.data.map((item) => { response.data.data.map((item) => {
if (this.state.isApprover) { if (this.state.isApprover) {
if (item >= 2000 && item <= (Number(currentYear) + 1)) { if (item >= 2000 && item <= (Number(currentYear))) {
data.push(item) data.push(item)
} }
} else { } else {
if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) { // if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
// data.push(item)
// }
if ((item >= 2000) && (item == currentYear || item <= currentYear)) {
data.push(item) data.push(item)
} }
} }
...@@ -338,25 +441,42 @@ export default class RollingOutlook extends Component { ...@@ -338,25 +441,42 @@ export default class RollingOutlook extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod === undefined ? String(Number(currentYear)) : this.state.lastPeriod)
let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear()
// let indexMonthMR = MR.findIndex((val) => val.value == yearNow)
// console.log(yearNow)
let index = data.sort((a, b) => a - b).findIndex((val) => val == yearNow)
// console.log(data)
// console.log(this.state.lastPeriod)
// console.log(periodeData)
// console.log(index)
let defaultPropsQuarter = { let defaultPropsQuarter = {
options: this.state.quarterList, options: this.state.quarterList,
getOptionLabel: (option) => option.name getOptionLabel: (option) => option.name
} }
this.setState({ listPeriode: defaultProps, listQuarter: defaultPropsQuarter, quarter: this.state.quarterList[0], periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
let index = data.sort((a, b) => a - b).findIndex((val) => val === (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.latestPeriode)) // if (this.state.isApprover === true && this.state.submittedOnly) {
// console.log(data) this.getDetailUser()
console.log(this.state.lastPeriod) // this.getCompanySubmitted()
// console.log(periodeData) // console.log('masuk')
// console.log(index) // } else {
this.setState({ listQuarter: defaultPropsQuarter, quarter: this.state.quarterList[0], listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { // this.getRevision()
if (this.state.isApprover === true) { // }
this.getCompanySubmitted() })
} else { } else {
this.getRevision() this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
} }
}) })
} }
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
}) })
} }
...@@ -517,7 +637,7 @@ export default class RollingOutlook extends Component { ...@@ -517,7 +637,7 @@ export default class RollingOutlook extends Component {
visibleCAT: false, visibleCAT: false,
visibleTP: true, visibleTP: true,
}) })
} else if (item === 'CAT') { } else if (item === 'CAT') {
this.setState({ this.setState({
visibleRollingOutlook: false, visibleRollingOutlook: false,
visibleBS: false, visibleBS: false,
...@@ -525,7 +645,7 @@ export default class RollingOutlook extends Component { ...@@ -525,7 +645,7 @@ export default class RollingOutlook extends Component {
visibleCAT: true, visibleCAT: true,
visibleTP: false, visibleTP: false,
}) })
} }
}) })
} }
...@@ -618,8 +738,8 @@ export default class RollingOutlook extends Component { ...@@ -618,8 +738,8 @@ export default class RollingOutlook extends Component {
let cobaSplit = String(fileName).split("-") let cobaSplit = String(fileName).split("-")
let mapSplit = "" let mapSplit = ""
cobaSplit.map((item, index) => { cobaSplit.map((item, index) => {
if (item != ""){ if (item != "") {
mapSplit+= index == 0 ? `${titleCase(item)}` : ` ${item}` mapSplit += index == 0 ? `${titleCase(item)}` : ` ${item}`
} }
}) })
// console.log(mapSplit); // console.log(mapSplit);
...@@ -634,7 +754,7 @@ export default class RollingOutlook extends Component { ...@@ -634,7 +754,7 @@ export default class RollingOutlook extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = "(Rolling Outlook Attachment) - " +mapSplit; a.download = "(Rolling Outlook Attachment) - " + mapSplit;
a.click(); a.click();
} }
} }
...@@ -682,7 +802,7 @@ export default class RollingOutlook extends Component { ...@@ -682,7 +802,7 @@ export default class RollingOutlook extends Component {
validateRevision() { validateRevision() {
let arrayRevisi = this.state.detailRevisiCheck let arrayRevisi = this.state.detailRevisiCheck
let remarksKosong = 0 let remarksKosong = 0
arrayRevisi.map((item,index) => { arrayRevisi.map((item, index) => {
if (item.remarks == "") { if (item.remarks == "") {
remarksKosong += 1 remarksKosong += 1
} }
...@@ -697,7 +817,7 @@ export default class RollingOutlook extends Component { ...@@ -697,7 +817,7 @@ export default class RollingOutlook extends Component {
render() { render() {
const handleMaxDate = () => { const handleMaxDate = () => {
let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD')) let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD'))
return handleDate < 0? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD') return handleDate < 0 ? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD')
} }
const columns = ["#", "Report Type", const columns = ["#", "Report Type",
{ {
...@@ -775,7 +895,7 @@ export default class RollingOutlook extends Component { ...@@ -775,7 +895,7 @@ export default class RollingOutlook extends Component {
onClick={() => onClick={() =>
tableMeta.rowData[5] == true ? tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: null : null
} }
> >
{/* {this.state.isApprover == true ? {/* {this.state.isApprover == true ?
...@@ -943,10 +1063,10 @@ export default class RollingOutlook extends Component { ...@@ -943,10 +1063,10 @@ export default class RollingOutlook extends Component {
{...this.state.listPeriode} {...this.state.listPeriode}
id="periode" id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => { onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
if (this.state.isApprover === true) { this.setState({ visibleTableHistory: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted() this.getCompanySubmitted()
} else { } else {
this.setState({ visibleTableHistory: false })
this.getRevision() this.getRevision()
} }
})} })}
...@@ -966,14 +1086,35 @@ export default class RollingOutlook extends Component { ...@@ -966,14 +1086,35 @@ export default class RollingOutlook extends Component {
disabled={this.state.intent === 'Home' ? true : false} disabled={this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ quarter: newInputValue }, () => { onChange={(event, newInputValue) => this.setState({ quarter: newInputValue }, () => {
this.setState({ visibleTableHistory: false }) this.setState({ visibleTableHistory: false })
this.getRevision() if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
this.getRevision()
}
})} })}
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) => <TextField {...params} label="Quarter" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.quarter} value={this.state.quarter}
/> />
</div> </div>
<div style={{ marginTop: 20 }}>
<Autocomplete
multiple
id="tags-standard"
options={this.state.listStatus}
getOptionLabel={(option) => option.name}
style={{ width: 250 }}
onChange={(event, newInputValue) => {
this.setState({ selectedStatus: newInputValue, loading: true }, () => {
console.log(newInputValue);
this.getCompanySubmitted()
})
}}
value={this.state.selectedStatus}
renderInput={(params) => <TextField {...params} label="Submission Status" margin="normal" style={{ marginTop: 7 }} />}
/>
</div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Autocomplete <Autocomplete
{...this.state.listCompany} {...this.state.listCompany}
...@@ -1372,7 +1513,7 @@ export default class RollingOutlook extends Component { ...@@ -1372,7 +1513,7 @@ export default class RollingOutlook extends Component {
id="startDate" id="startDate"
label="Valid From" label="Valid From"
format="dd-MM-yyyy" format="dd-MM-yyyy"
onChange={(e) => this.setState({minDateRevision: moment(e).format('YYYY/MM/DD')}, () => this.setState({maxDateRevision: handleMaxDate()}))} onChange={(e) => this.setState({ minDateRevision: moment(e).format('YYYY/MM/DD') }, () => this.setState({ maxDateRevision: handleMaxDate() }))}
value={moment(this.state.minDateRevision).format('YYYY/MM/DD')} value={moment(this.state.minDateRevision).format('YYYY/MM/DD')}
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
...@@ -1399,7 +1540,7 @@ export default class RollingOutlook extends Component { ...@@ -1399,7 +1540,7 @@ export default class RollingOutlook extends Component {
id="startDate" id="startDate"
label="Valid To" label="Valid To"
format="dd-MM-yyyy" format="dd-MM-yyyy"
onChange={(e) => this.setState({maxDateRevision: moment(e).format('YYYY/MM/DD')})} onChange={(e) => this.setState({ maxDateRevision: moment(e).format('YYYY/MM/DD') })}
minDate={moment(this.state.minDateRevision).format('YYYY/MM/DD')} minDate={moment(this.state.minDateRevision).format('YYYY/MM/DD')}
value={moment(this.state.maxDateRevision).format('YYYY/MM/DD')} value={moment(this.state.maxDateRevision).format('YYYY/MM/DD')}
KeyboardButtonProps={{ KeyboardButtonProps={{
......
...@@ -173,9 +173,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -173,9 +173,9 @@ export default class OperatingIndicatorRO extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.rolling_outlook.january, item.rolling_outlook.january === "" ? "0" : item.rolling_outlook.january,
item.rolling_outlook.february, item.rolling_outlook.february === "" ? "0" : item.rolling_outlook.february,
item.rolling_outlook.march, item.rolling_outlook.march === "" ? "0" : item.rolling_outlook.march,
item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april, item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april,
item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may, item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may,
item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june, item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june,
...@@ -206,9 +206,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -206,9 +206,9 @@ export default class OperatingIndicatorRO extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.rolling_outlook.january, item.rolling_outlook.january === "" ? "0" : item.rolling_outlook.january,
item.rolling_outlook.february, item.rolling_outlook.february === "" ? "0" : item.rolling_outlook.february,
item.rolling_outlook.march, item.rolling_outlook.march === "" ? "0" : item.rolling_outlook.march,
item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april, item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april,
item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may, item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may,
item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june, item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june,
...@@ -827,7 +827,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -827,7 +827,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "" ? "" : Number(handleParent(tableMeta)).toFixed(1)} value={ value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -846,7 +846,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -846,7 +846,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={ value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -868,7 +868,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -868,7 +868,7 @@ export default class OperatingIndicatorRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
value={value === "" ? "" : Number(value).toFixed(1)} value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -923,7 +923,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -923,7 +923,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "" ? "" :Number(handleParent(tableMeta)).toFixed(1)} value={ value === "0" ? "" :Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -942,7 +942,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -942,7 +942,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={ value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -964,7 +964,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -964,7 +964,7 @@ export default class OperatingIndicatorRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
value={value === "" ? "" : Number(value).toFixed(1)} value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1018,7 +1018,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1018,7 +1018,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "" ? "" : Number(handleParent(tableMeta)).toFixed(1)} value={ value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1037,7 +1037,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1037,7 +1037,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1058,7 +1058,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1058,7 +1058,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value === "" ? "" : Number(value).toFixed(1)} value={value === "0" ? "" : Number(value).toFixed(1)}
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
...@@ -1113,7 +1113,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1113,7 +1113,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1132,7 +1132,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1132,7 +1132,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={ this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1153,7 +1153,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1153,7 +1153,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1'? false : true} disabled={this.props.quartal == 'q1'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1206,7 +1206,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1206,7 +1206,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1225,7 +1225,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1225,7 +1225,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1246,7 +1246,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1246,7 +1246,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1'? false : true} disabled={this.props.quartal == 'q1'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1299,7 +1299,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1299,7 +1299,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1318,7 +1318,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1318,7 +1318,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1339,7 +1339,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1339,7 +1339,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1'? false : true} disabled={this.props.quartal == 'q1'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1392,7 +1392,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1392,7 +1392,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1411,7 +1411,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1411,7 +1411,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1432,7 +1432,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1432,7 +1432,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252' , fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252' , fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true} disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1485,7 +1485,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1485,7 +1485,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1504,7 +1504,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1504,7 +1504,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1525,7 +1525,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1525,7 +1525,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true} disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1578,7 +1578,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1578,7 +1578,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1597,7 +1597,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1597,7 +1597,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1618,7 +1618,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1618,7 +1618,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.quartal == 'q3'? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true} disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2'? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -2045,12 +2045,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2045,12 +2045,7 @@ export default class OperatingIndicatorRO extends Component {
{!this.state.emptyData && <div style={{ display: 'flex', justifyContent: 'space-between' }}> {!this.state.emptyData && <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode} <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode} {String(this.props.quartal).toLocaleUpperCase()}
{
this.props.quartal === "q1" ? ' Q1 ' :
this.props.quartal === "q2" ? ' Q2 ' :
this.props.quartal === "q3" ? ' Q3 ' : ''
}
</Typography> </Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
...@@ -2234,12 +2229,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2234,12 +2229,7 @@ export default class OperatingIndicatorRO extends Component {
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode} <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode} {String(this.props.quartal).toLocaleUpperCase()}
{
this.props.quartal === "q1" ? ' Q1 ' :
this.props.quartal === "q2" ? ' Q2 ' :
this.props.quartal === "q3" ? ' Q3 ' : ''
}
</Typography> </Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
......
...@@ -246,9 +246,9 @@ export default class ProfitLossROO extends Component { ...@@ -246,9 +246,9 @@ export default class ProfitLossROO extends Component {
item.description, item.description,
item.profit_loss.notes, item.profit_loss.notes,
item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total, item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total,
item.profit_loss.january, item.profit_loss.january === "" ? "0" : item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february === "" ? "0" : item.profit_loss.february,
item.profit_loss.march, item.profit_loss.march === "" ? "0" : item.profit_loss.march,
item.profit_loss.april === "" ? "0" : item.profit_loss.april, item.profit_loss.april === "" ? "0" : item.profit_loss.april,
item.profit_loss.may === "" ? "0" : item.profit_loss.may, item.profit_loss.may === "" ? "0" : item.profit_loss.may,
item.profit_loss.june === "" ? "0" : item.profit_loss.june, item.profit_loss.june === "" ? "0" : item.profit_loss.june,
...@@ -281,9 +281,9 @@ export default class ProfitLossROO extends Component { ...@@ -281,9 +281,9 @@ export default class ProfitLossROO extends Component {
item.description, item.description,
item.profit_loss.notes, item.profit_loss.notes,
item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total, item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total,
item.profit_loss.january, item.profit_loss.january === "" ? "0" : item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february === "" ? "0" : item.profit_loss.february,
item.profit_loss.march, item.profit_loss.march === "" ? "0" : item.profit_loss.march,
item.profit_loss.april === "" ? "0" : item.profit_loss.april, item.profit_loss.april === "" ? "0" : item.profit_loss.april,
item.profit_loss.may === "" ? "0" : item.profit_loss.may, item.profit_loss.may === "" ? "0" : item.profit_loss.may,
item.profit_loss.june === "" ? "0" : item.profit_loss.june, item.profit_loss.june === "" ? "0" : item.profit_loss.june,
...@@ -397,7 +397,7 @@ export default class ProfitLossROO extends Component { ...@@ -397,7 +397,7 @@ export default class ProfitLossROO extends Component {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"quartal": this.props.quarter, "quartal": this.props.quarter,
"status": type, "status": type,
"balance_sheet": data "profit_loss": data
} }
console.log(payload); console.log(payload);
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
...@@ -1040,7 +1040,7 @@ export default class ProfitLossROO extends Component { ...@@ -1040,7 +1040,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1057,7 +1057,7 @@ export default class ProfitLossROO extends Component { ...@@ -1057,7 +1057,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1078,7 +1078,7 @@ export default class ProfitLossROO extends Component { ...@@ -1078,7 +1078,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1095,7 +1095,7 @@ export default class ProfitLossROO extends Component { ...@@ -1095,7 +1095,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1138,7 +1138,7 @@ export default class ProfitLossROO extends Component { ...@@ -1138,7 +1138,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1155,7 +1155,7 @@ export default class ProfitLossROO extends Component { ...@@ -1155,7 +1155,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1176,7 +1176,7 @@ export default class ProfitLossROO extends Component { ...@@ -1176,7 +1176,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1193,7 +1193,7 @@ export default class ProfitLossROO extends Component { ...@@ -1193,7 +1193,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1236,7 +1236,7 @@ export default class ProfitLossROO extends Component { ...@@ -1236,7 +1236,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1253,7 +1253,7 @@ export default class ProfitLossROO extends Component { ...@@ -1253,7 +1253,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1274,7 +1274,7 @@ export default class ProfitLossROO extends Component { ...@@ -1274,7 +1274,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1291,7 +1291,7 @@ export default class ProfitLossROO extends Component { ...@@ -1291,7 +1291,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={val === "" ? "" : Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1334,7 +1334,7 @@ export default class ProfitLossROO extends Component { ...@@ -1334,7 +1334,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1351,7 +1351,7 @@ export default class ProfitLossROO extends Component { ...@@ -1351,7 +1351,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1372,7 +1372,7 @@ export default class ProfitLossROO extends Component { ...@@ -1372,7 +1372,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1389,7 +1389,7 @@ export default class ProfitLossROO extends Component { ...@@ -1389,7 +1389,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1432,7 +1432,7 @@ export default class ProfitLossROO extends Component { ...@@ -1432,7 +1432,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1449,7 +1449,7 @@ export default class ProfitLossROO extends Component { ...@@ -1449,7 +1449,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1470,7 +1470,7 @@ export default class ProfitLossROO extends Component { ...@@ -1470,7 +1470,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1487,7 +1487,7 @@ export default class ProfitLossROO extends Component { ...@@ -1487,7 +1487,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1530,7 +1530,7 @@ export default class ProfitLossROO extends Component { ...@@ -1530,7 +1530,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1547,7 +1547,7 @@ export default class ProfitLossROO extends Component { ...@@ -1547,7 +1547,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1568,7 +1568,7 @@ export default class ProfitLossROO extends Component { ...@@ -1568,7 +1568,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1585,7 +1585,7 @@ export default class ProfitLossROO extends Component { ...@@ -1585,7 +1585,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1628,7 +1628,7 @@ export default class ProfitLossROO extends Component { ...@@ -1628,7 +1628,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1645,7 +1645,7 @@ export default class ProfitLossROO extends Component { ...@@ -1645,7 +1645,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1666,7 +1666,7 @@ export default class ProfitLossROO extends Component { ...@@ -1666,7 +1666,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1683,7 +1683,7 @@ export default class ProfitLossROO extends Component { ...@@ -1683,7 +1683,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1726,7 +1726,7 @@ export default class ProfitLossROO extends Component { ...@@ -1726,7 +1726,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1743,7 +1743,7 @@ export default class ProfitLossROO extends Component { ...@@ -1743,7 +1743,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1764,7 +1764,7 @@ export default class ProfitLossROO extends Component { ...@@ -1764,7 +1764,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1781,7 +1781,7 @@ export default class ProfitLossROO extends Component { ...@@ -1781,7 +1781,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1824,7 +1824,7 @@ export default class ProfitLossROO extends Component { ...@@ -1824,7 +1824,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1841,7 +1841,7 @@ export default class ProfitLossROO extends Component { ...@@ -1841,7 +1841,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1862,7 +1862,7 @@ export default class ProfitLossROO extends Component { ...@@ -1862,7 +1862,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1879,7 +1879,7 @@ export default class ProfitLossROO extends Component { ...@@ -1879,7 +1879,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q3'? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -2316,7 +2316,7 @@ export default class ProfitLossROO extends Component { ...@@ -2316,7 +2316,7 @@ export default class ProfitLossROO extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision}) {String(this.props.quarter).toLocaleUpperCase()}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
...@@ -2540,7 +2540,7 @@ export default class ProfitLossROO extends Component { ...@@ -2540,7 +2540,7 @@ export default class ProfitLossROO extends Component {
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision}) {String(this.props.quarter).toLocaleUpperCase()}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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