Commit 710a0259 authored by rifkaki's avatar rifkaki

template

parent 6c13b3c9
...@@ -51,7 +51,8 @@ export default class BalanceSheetMR extends Component { ...@@ -51,7 +51,8 @@ export default class BalanceSheetMR extends Component {
minValue: 0, minValue: 0,
maxValue: 0, maxValue: 0,
updateBy: '-', updateBy: '-',
notes: "" notes: "",
judulColumn: null,
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -281,7 +282,7 @@ export default class BalanceSheetMR extends Component { ...@@ -281,7 +282,7 @@ export default class BalanceSheetMR extends Component {
months: this.props.month.month_id months: this.props.month.month_id
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
} }
}); });
} }
...@@ -2059,7 +2060,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2059,7 +2060,7 @@ export default class BalanceSheetMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("BALANCE") && String(this.state.judul).includes("SHEET") ? String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("BALANCE") && String(this.state.judul).includes("SHEET") ?
this.checkUpload() : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}} }}
......
...@@ -87,7 +87,8 @@ export default class ProfitLossMR extends Component { ...@@ -87,7 +87,8 @@ export default class ProfitLossMR extends Component {
maxValue: 0, maxValue: 0,
updateBy: '-', updateBy: '-',
notesUpdate: '-', notesUpdate: '-',
bebas: false bebas: false,
judulColumn: null
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -376,7 +377,7 @@ export default class ProfitLossMR extends Component { ...@@ -376,7 +377,7 @@ export default class ProfitLossMR extends Component {
profit_loss: payload profit_loss: payload
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
} }
}); });
} }
...@@ -2145,7 +2146,7 @@ export default class ProfitLossMR extends Component { ...@@ -2145,7 +2146,7 @@ export default class ProfitLossMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ? String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ?
this.checkUpload() : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}} }}
......
...@@ -308,8 +308,8 @@ export default class TaxPlanningMR extends Component { ...@@ -308,8 +308,8 @@ export default class TaxPlanningMR extends Component {
tax_planning: payload tax_planning: payload
} }
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
console.log(this.state.judulColumn) // console.log(this.state.judulColumn)
console.log(this.state.judul) // console.log(this.state.judul)
} }
}); });
} }
......
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