Commit c5f77f47 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-PROD' of http://103.44.149.204/d.arizona/tia-dev into ENV-PROD

parents 9ead75a6 a8e08a8f
This diff is collapsed.
...@@ -552,6 +552,7 @@ export default class BudgetTahunan extends Component { ...@@ -552,6 +552,7 @@ export default class BudgetTahunan extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
// ubah code dibawah ini jika mau mengubah default periode jadi tahun saat ini
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : 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(this.props.location.state.rawData) // // console.log(this.props.location.state.rawData)
...@@ -3055,7 +3056,7 @@ export default class BudgetTahunan extends Component { ...@@ -3055,7 +3056,7 @@ export default class BudgetTahunan extends Component {
disabled={this.state.listCompany === null ? true : this.state.intent === 'Home' ? true : false} disabled={this.state.listCompany === null ? true : this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => { onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => {
this.setState({ visibleTableHistory: false }) this.setState({ visibleTableHistory: false })
// this.getLastPeriod() this.getLastPeriod()
this.getCurrency(newInputValue.company_id) this.getCurrency(newInputValue.company_id)
this.getRevision() this.getRevision()
})} })}
......
...@@ -175,7 +175,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -175,7 +175,7 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(item.cat.weight).includes('%') ? (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%') : ((String(Number(item.cat.weight)) + '%') + '%')), item.type_report_id == 1 ? `${fixNumber(Number(item.weight) * 100)}%` : (String(item.cat.weight).includes('%') ? (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%') : ((String(Number(item.cat.weight)) + '%') + '%')),
parentTrue ? item.cat.uom : item.uom, parentTrue ? item.cat.uom : item.uom,
parentTrue ? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type }, parentTrue ? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
parentTrue ? item.cat.max_ach == "" ? null : { value: titleCase(item.cat.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, parentTrue ? item.cat.max_ach == "" ? null : { value: titleCase(item.cat.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
...@@ -219,7 +219,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -219,7 +219,7 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.description, item.description,
item.type_report_id == 1 ? (`${String(item.weight).includes('%') ? String(item.weight) : String((Number(item.weight) * 100) + '% ')}`) : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%'), item.type_report_id == 1 ? (`${String(item.weight).includes('%') ? String(item.weight) : String(fixNumber((Number(item.weight) * 100)) + '% ')}`) : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%'),
item.cat.uom, item.cat.uom,
item.kpi_type == "" ? null : { value: item.kpi_type }, item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
......
...@@ -483,7 +483,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -483,7 +483,7 @@ export default class BalanceSheetOLPA extends Component {
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
console.log(this.state.dataTable); // console.log(this.state.dataTable);
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
...@@ -552,6 +552,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -552,6 +552,7 @@ export default class BalanceSheetOLPA extends Component {
balance_sheet: data, balance_sheet: data,
status: type status: type
} }
console.log(body);
// console.log(JSON.stringify(body)); // console.log(JSON.stringify(body));
api.create('UPLOAD').uploadOLPA(body).then(response => { api.create('UPLOAD').uploadOLPA(body).then(response => {
console.log(response); console.log(response);
...@@ -628,13 +629,13 @@ export default class BalanceSheetOLPA extends Component { ...@@ -628,13 +629,13 @@ export default class BalanceSheetOLPA extends Component {
// console.log(Number(i[18].value).toFixed(1)) // console.log(Number(i[18].value).toFixed(1))
// console.log(Number(i[19]).toFixed(1)) // console.log(Number(i[19]).toFixed(1))
if ((this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[17].value), 1) : Number(i[17].value) < Number(this.state.minValue)) || (this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[17].value), 1) : Number(i[17].value) > Number(this.state.maxValue))) { if (this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[17].value), 1) < Number(this.state.minValue)) : (Number(i[17].value) < Number(this.state.minValue)) || this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[17].value), 1) > Number(this.state.maxValue)) : (Number(i[17].value) > Number(this.state.maxValue))) {
console.log("masuk selisih control 1") console.log("masuk selisih control 1")
err = true err = true
} else if ((this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[18].value), 1) : Number(i[18].value) < Number(this.state.minValue)) || (this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[18].value), 1) : Number(i[18].value) > Number(this.state.maxValue))) { } else if (this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[18].value), 1) < Number(this.state.minValue)) : (Number(i[18].value) < Number(this.state.minValue)) || this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[18].value), 1) > Number(this.state.maxValue)) : (Number(i[18].value) > Number(this.state.maxValue))) {
console.log("masuk selisih control 2") console.log("masuk selisih control 2")
err = true err = true
} else if ((this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[19]), 1) : Number(i[19]) < Number(this.state.minValue)) || (this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[19]), 1) : Number(i[19]) > Number(this.state.maxValue))) { } else if (this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[19]), 1) < Number(this.state.minValue)) : (Number(i[19]) < Number(this.state.minValue)) || this.props.defaultCurrency.id == 1 ? (fixNumber(Number(i[19]), 1) > Number(this.state.maxValue)) : (Number(i[19]) > Number(this.state.maxValue))) {
console.log("masuk selisih control 3") console.log("masuk selisih control 3")
err = true err = true
} }
...@@ -658,7 +659,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -658,7 +659,7 @@ export default class BalanceSheetOLPA extends Component {
total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19])), total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19])),
}) })
}) })
console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
"outlook_pa_id": this.props.outlook_pa_id, "outlook_pa_id": this.props.outlook_pa_id,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -669,26 +670,26 @@ export default class BalanceSheetOLPA extends Component { ...@@ -669,26 +670,26 @@ export default class BalanceSheetOLPA extends Component {
"status": "submitted" "status": "submitted"
} }
api.create().validateSubmitReportOLPA(payload).then((response) => { api.create().validateSubmitReportOLPA(payload).then((response) => {
// console.log(response) console.log(response)
// console.log(response.data.data.result) // console.log(response.data.data.result)
// console.log(err); console.log(err);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
if (response.data.data.result && err === false) { if (response.data.data.result && err === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
if (kansas == 0) { if (kansas == 0) {
this.setState({ kansas: 1, loading: true }, () => { // this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() // this.handleValidate()
}) // })
} else { } else {
this.setState({ kansas: 0 }) this.setState({ kansas: 0 })
} }
} else { } else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: true }) this.setState({ loading: false, buttonError: true, editable: true, saveDraft: true })
if (kansas == 0) { if (kansas == 0) {
this.setState({ kansas: 1, loading: true }, () => { // this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() // this.handleValidate()
}) // })
} else { } else {
this.setState({ kansas: 0 }) this.setState({ kansas: 0 })
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4344,6 +4344,8 @@ export default class SubHolding extends Component { ...@@ -4344,6 +4344,8 @@ export default class SubHolding extends Component {
onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => { onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType() this.getReportType()
this.getCurrency(newInputValue.company_id) this.getCurrency(newInputValue.company_id)
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
this.setState({ report: bizpar[0], reportType: bizpar })
})} })}
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
......
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