Commit f02988d0 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

+_+

See merge request !534
parents 85a8846d 60d009df
...@@ -101,7 +101,7 @@ export default class BalanceSheet extends Component { ...@@ -101,7 +101,7 @@ export default class BalanceSheet extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before, item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before,
Number(item.balance_sheet.january).toFixed(1), Number(item.balance_sheet.january).toFixed(1),
Number(item.balance_sheet.february).toFixed(1), Number(item.balance_sheet.february).toFixed(1),
Number(item.balance_sheet.march).toFixed(1), Number(item.balance_sheet.march).toFixed(1),
...@@ -138,7 +138,7 @@ export default class BalanceSheet extends Component { ...@@ -138,7 +138,7 @@ export default class BalanceSheet extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before, item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before,
Number(item.balance_sheet.january).toFixed(1), Number(item.balance_sheet.january).toFixed(1),
Number(item.balance_sheet.february).toFixed(1), Number(item.balance_sheet.february).toFixed(1),
Number(item.balance_sheet.march).toFixed(1), Number(item.balance_sheet.march).toFixed(1),
...@@ -309,11 +309,11 @@ export default class BalanceSheet extends Component { ...@@ -309,11 +309,11 @@ export default class BalanceSheet extends Component {
item.error item.error
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, errorPreview: false }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, errorPreview: false, saveDraft: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[25].length > 0) { if (item[25].length > 0) {
console.log('error') console.log('error')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
} }
}) })
// console.log(this.state.dataTable); // console.log(this.state.dataTable);
...@@ -395,21 +395,21 @@ export default class BalanceSheet extends Component { ...@@ -395,21 +395,21 @@ export default class BalanceSheet extends Component {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
total_actual_before: String(Number(i[6]).toFixed(1)), total_actual_before: String(Number(i[6]).toFixed(1)),
january: i[0] === 3 && i[7] === "" ? "0" : String(Number(i[7]).toFixed(1)), january: i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)),
february: i[0] === 3 && i[8] === "" ? "0" : String(Number(i[8]).toFixed(1)), february: i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)),
march: i[0] === 3 && i[9] === "" ? "0" : String(Number(i[9]).toFixed(1)), march: i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
april: i[0] === 3 && i[10] === "" ? "0" : String(Number(i[10]).toFixed(1)), april: i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
may: i[0] === 3 && i[11] === "" ? "0" : String(Number(i[11]).toFixed(1)), may: i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
june: i[0] === 3 && i[12] === "" ? "0" : String(Number(i[12]).toFixed(1)), june: i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)),
july: i[0] === 3 && i[13] === "" ? "0" : String(Number(i[13]).toFixed(1)), july: i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)),
august: i[0] === 3 && i[14] === "" ? "0" : String(Number(i[14]).toFixed(1)), august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
september: i[0] === 3 && i[15] === "" ? "0" : String(Number(i[15]).toFixed(1)), september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
october: i[0] === 3 && i[16] === "" ? "0" : String(Number(i[16]).toFixed(1)), october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
november: i[0] === 3 && i[17] === "" ? "0" : String(Number(i[17]).toFixed(1)), november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)),
december: i[0] === 3 && i[18] === "" ? "0" : String(Number(i[18]).toFixed(1)), december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)),
total_current_year: i[0] === 3 && i[19] === "" ? "0" : String(Number(i[19]).toFixed(1)), total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
total_next_year: i[0] === 3 && i[20] === "" ? "0" : String(Number(i[20]).toFixed(1)), total_next_year: i[0] === 3 && i[20] === "" ? "0.0" : String(Number(i[20]).toFixed(1)),
total_more_year: i[0] === 3 && i[21] === "" ? "0" : String(Number(i[21]).toFixed(1)), total_more_year: i[0] === 3 && i[21] === "" ? "0.0" : String(Number(i[21]).toFixed(1)),
}) })
}) })
console.log(JSON.stringify(data)) console.log(JSON.stringify(data))
...@@ -3105,13 +3105,13 @@ export default class BalanceSheet extends Component { ...@@ -3105,13 +3105,13 @@ export default class BalanceSheet extends Component {
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.errorPreview !== true ? 'pointer' : 'default', cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => onClick={() =>
this.state.errorPreview === true ? this.state.saveDraft === true ?
null : null :
this.setState({ loading: true }, () => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
......
This diff is collapsed.
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