Commit fb267e58 authored by Deni Rinaldi's avatar Deni Rinaldi

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

parents f629a31f ef68e97c
...@@ -226,7 +226,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -226,7 +226,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}) })
// // console.log(dataTable) // console.log(dataTable)
this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => { this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => {
// // console.log(dataCustomerPrs) // // console.log(dataCustomerPrs)
}) })
...@@ -1271,7 +1271,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1271,7 +1271,11 @@ export default class CorporateAnnualTarget extends Component {
if (idParent !== null) { if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'FINANCIAL PERSPECTIVE') { if (dataTable2[indexsss][6] == 'FINANCIAL PERSPECTIVE') {
return true if (tableMeta.rowData[0] == 3) {
return false
} else {
return true
}
} else { } else {
return false return false
} }
...@@ -1744,11 +1748,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1744,11 +1748,11 @@ export default class CorporateAnnualTarget extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
......
...@@ -1122,6 +1122,7 @@ export default class MonthlyReport extends Component { ...@@ -1122,6 +1122,7 @@ export default class MonthlyReport extends Component {
periode={this.state.periode.periode} periode={this.state.periode.periode}
monthlyReportId={this.state.monthlyReportId} monthlyReportId={this.state.monthlyReportId}
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleFAM: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleFAM: false, visibleMonthlyReport: true })}
/> />
)} )}
......
...@@ -520,9 +520,11 @@ export default class BalanceSheetMR extends Component { ...@@ -520,9 +520,11 @@ export default class BalanceSheetMR extends Component {
if (String(item).includes('#')) { if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) { if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '') let tst = String(item).replace('[M-1]', '')
let indexID = dataTable2.findIndex((val) => val[21] == tst) // let indexID = dataTable2.findIndex((val) => val[21] == tst)
let data = tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][9] let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
...@@ -584,9 +586,11 @@ export default class BalanceSheetMR extends Component { ...@@ -584,9 +586,11 @@ export default class BalanceSheetMR extends Component {
let totalPrio = 0 let totalPrio = 0
let optPrio = "" let optPrio = ""
let prio = false let prio = false
let optPrev = ""
anjay2.map((item, index) => { anjay2.map((item, index) => {
if (Array.isArray(item)) { if (Array.isArray(item)) {
prio = true prio = true
optPrev = opt
item.map((items, indexs) => { item.map((items, indexs) => {
if (items == "+") { if (items == "+") {
optPrio = "tambah" optPrio = "tambah"
...@@ -628,7 +632,17 @@ export default class BalanceSheetMR extends Component { ...@@ -628,7 +632,17 @@ export default class BalanceSheetMR extends Component {
if (item == "+") { if (item == "+") {
opt = "tambah" opt = "tambah"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -636,7 +650,17 @@ export default class BalanceSheetMR extends Component { ...@@ -636,7 +650,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "-") { } else if (item == "-") {
opt = "kurang" opt = "kurang"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -644,7 +668,17 @@ export default class BalanceSheetMR extends Component { ...@@ -644,7 +668,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "*") { } else if (item == "*") {
opt = "kali" opt = "kali"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -652,7 +686,17 @@ export default class BalanceSheetMR extends Component { ...@@ -652,7 +686,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "/") { } else if (item == "/") {
opt = "bagi" opt = "bagi"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
......
...@@ -680,7 +680,7 @@ export default class ProfitLossMR extends Component { ...@@ -680,7 +680,7 @@ export default class ProfitLossMR extends Component {
} }
} }
}, { }, {
name: "Rolling Outlook (FY 2021)", name: `Rolling Outlook (FY ${this.props.periode})`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#07a7d0', width: 96, borderLeft: '1px #fff solid', borderRight: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#07a7d0', width: 96, borderLeft: '1px #fff solid', borderRight: '1px #fff solid' }}>
...@@ -698,7 +698,7 @@ export default class ProfitLossMR extends Component { ...@@ -698,7 +698,7 @@ export default class ProfitLossMR extends Component {
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={tableMeta.rowData[9]} value={tableMeta.rowData[7]}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
......
...@@ -89,46 +89,6 @@ export default class OperatingIndicator extends Component { ...@@ -89,46 +89,6 @@ export default class OperatingIndicator extends Component {
}) })
} }
// getMonth() {
// api.create().getMonthTransaction().then(response => {
// console.log(response);
// let dateNow = new Date
// let month = format(dateNow, 'MMMM')
// if (response.data) {
// if (response.data.status === "success") {
// console.log(response);
// let data = response.data.data
// let monthData = data.map((item) => {
// return {
// month_id: item.id,
// month_value: String(item.month_name).substr(0, 3)
// }
// })
// let defaultProps = {
// options: monthData,
// getOptionLabel: (option) => option.month_value,
// };
// let index = data.sort((a, b) => a - b).findIndex((val) => val.month_name == month)
// console.log(index);
// this.setState({ listMonth: defaultProps, month: index == -1 ? monthData[0] : monthData[index] }, () => {
// this.getLastPeriod()
// })
// } 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' })
// }
// })
// }
getReportAttachment() { getReportAttachment() {
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -295,34 +255,6 @@ export default class OperatingIndicator extends Component { ...@@ -295,34 +255,6 @@ export default class OperatingIndicator extends Component {
}) })
} }
getRevision() {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode
}
api.create().getRevision(payload).then(response => {
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
let data = response.data.data
let revisionData = data.map((item) => {
return {
revision: item,
}
})
let defaultProps = {
options: revisionData,
getOptionLabel: (option) => option.revision,
};
this.setState({ listRevision: defaultProps, revision: revisionData[0] }, () => {
this.getReport()
this.getReportAttachment()
})
}
}
})
}
getOperatingID() { getOperatingID() {
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -386,7 +318,8 @@ export default class OperatingIndicator extends Component { ...@@ -386,7 +318,8 @@ export default class OperatingIndicator extends Component {
visibleOperatingIndicator: false, visibleOperatingIndicator: false,
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: true, visibleDetailMonthly: true,
visibleDetailRolling: false visibleDetailRolling: false,
months: id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : 0
}, () => console.log(this.state.dataDetail)) }, () => console.log(this.state.dataDetail))
...@@ -449,6 +382,13 @@ export default class OperatingIndicator extends Component { ...@@ -449,6 +382,13 @@ export default class OperatingIndicator extends Component {
}) })
} }
saveMonthlyOI(payload) {
api.create().createMonthlyReportOI(payload).then((response) => {
this.getReport()
this.getOperatingID()
})
}
render() { render() {
const columns = ["#", "Report Type", const columns = ["#", "Report Type",
// { // {
...@@ -671,14 +611,14 @@ export default class OperatingIndicator extends Component { ...@@ -671,14 +611,14 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail} data={this.state.dataDetail}
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
// month={this.state.month} months={this.state.months}
company={this.state.company} company={this.state.company}
onClickClose={() => this.setState({ visibleDetailMonthly: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailMonthly: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
this.forceUpdate() this.forceUpdate()
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveOperatingInd={this.saveOperatingInd.bind(this)} saveMonthlyOI={this.saveMonthlyOI.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
......
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