Commit 9afbc8aa authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'riri' into 'master'

aplod

See merge request !337
parents 2a135ea5 fedb60a2
......@@ -241,8 +241,8 @@ export default class ProfitLoss extends Component {
payload.push({
item_report_id: i[0] === undefined ? "" : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(),
notes: i[2] === undefined ? "" : reg.test(String(i[2])) === false ? "" : String(i[2]).trim(),
total_actual_before: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
notes: i[2] === undefined ? "" : String(i[2]).trim(),
total_actual_before: i[3] === undefined ? "0" : String(i[3]).trim(),
january: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
february: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
march: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
......@@ -267,7 +267,7 @@ export default class ProfitLoss extends Component {
report_id: this.props.report_id,
profit_loss: payload
}
console.log(body)
console.log(payload)
this.setState({ payload: body, judul: resp.rows[1][0] })
}
});
......@@ -308,6 +308,7 @@ export default class ProfitLoss extends Component {
item.error
]
})
// console.log(dataTable)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
if (this.state.dataTable[23].length > 0) {
this.setState({ buttonError: true, errorPreview: true })
......@@ -323,7 +324,7 @@ export default class ProfitLoss extends Component {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: i[6],
notes: String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
......@@ -349,6 +350,7 @@ export default class ProfitLoss extends Component {
profit_loss: data
}
console.log(data);
// console.log(JSON.stringify(body));
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response);
if (response.data) {
......@@ -2211,7 +2213,7 @@ export default class ProfitLoss extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadProfitLoss()
......
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