Commit 8f1ec8c2 authored by qorri_di's avatar qorri_di

Fixing Tax Planning by rifka

- MR
- RO
parent eef9e9c4
...@@ -495,17 +495,10 @@ export default class TaxPlanningMR extends Component { ...@@ -495,17 +495,10 @@ export default class TaxPlanningMR extends Component {
console.log(this.state.dataTable) console.log(this.state.dataTable)
console.log(dataTable2) console.log(dataTable2)
dataTable2.map(i => { dataTable2.map(i => {
data.push({ console.log(i)
item_report_id: i[4], // this.setState({ loading: false })
trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)), console.log(i[9].tbf)
fiscal_correction: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].fcp).toFixed(2)) : String(Number(i[9].fcp).toFixed(1)), if (String(i[8]) === "Control (should be nil)") {
trial_balance_fiscal: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].tbf).toFixed(2)) : String(Number(i[9].tbf).toFixed(1)),
trial_balance_fiscal_actual: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[10]).toFixed(2)) : String(Number(i[10]).toFixed(1)),
trial_balance_fiscal_mb: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[11]).toFixed(2)) : String(Number(i[11]).toFixed(1))
})
if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true })
console.log(i[9].tbf) console.log(i[9].tbf)
console.log(this.state.minValue) console.log(this.state.minValue)
console.log(this.state.maxValue) console.log(this.state.maxValue)
...@@ -517,6 +510,15 @@ export default class TaxPlanningMR extends Component { ...@@ -517,6 +510,15 @@ export default class TaxPlanningMR extends Component {
editAble = false editAble = false
} }
} }
data.push({
item_report_id: i[4],
trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)),
fiscal_correction: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].fcp).toFixed(2)) : String(Number(i[9].fcp).toFixed(1)),
trial_balance_fiscal: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].tbf).toFixed(2)) : String(Number(i[9].tbf).toFixed(1)),
trial_balance_fiscal_actual: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[10]).toFixed(2)) : String(Number(i[10]).toFixed(1)),
trial_balance_fiscal_mb: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[11]).toFixed(2)) : String(Number(i[11]).toFixed(1))
})
}) })
// this.setState({ loading: false, buttonError: errorContrl, editable: editAble, saveDraft: false }) // this.setState({ loading: false, buttonError: errorContrl, editable: editAble, saveDraft: false })
console.log(errorContrl) console.log(errorContrl)
...@@ -1668,7 +1670,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1668,7 +1670,7 @@ export default class TaxPlanningMR extends Component {
onClick={() => { onClick={() => {
this.setState({ loading: true, buttonDraft: false }, () => { this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => { setTimeout(() => {
// this.setState({ loading: false, buttonError: false, editable: true }) this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate(dataTable2) this.handleValidate(dataTable2)
}, 100); }, 100);
}) })
...@@ -1787,6 +1789,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1787,6 +1789,7 @@ export default class TaxPlanningMR extends Component {
// this.forceUpdate() // this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => { this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate(dataTable2) this.handleValidate(dataTable2)
}, 100); }, 100);
}) })
......
...@@ -745,9 +745,10 @@ export default class TaxPlanning extends Component { ...@@ -745,9 +745,10 @@ export default class TaxPlanning extends Component {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
this.state.dataTable.map((i, index) => { this.state.dataTable.map((i, index) => {
if (String(i[8]) == "Control (should be nil)") { if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true }) // this.setState({ loading: true })
let n = 0 let n = 0
for (n = (this.props.quarter == 'q1' ? 12 : (this.props.quarter == 'q2' ? 15 : 18)); n <= 20; n++) { for (n = (this.props.quarter == 'q1' ? 12 : (this.props.quarter == 'q2' ? 15 : 18)); n <= 20; n++) {
console.log(i[n].tbf.value)
if ((Number(i[n].tbf.value) < Number(this.state.minValue) || Number(i[n].tbf.value) > Number(this.state.maxValue))) { if ((Number(i[n].tbf.value) < Number(this.state.minValue) || Number(i[n].tbf.value) > Number(this.state.maxValue))) {
errorContrl = true errorContrl = true
editAble = true editAble = true
...@@ -6165,6 +6166,7 @@ export default class TaxPlanning extends Component { ...@@ -6165,6 +6166,7 @@ export default class TaxPlanning extends Component {
onClick={() => { onClick={() => {
this.setState({ loading: true, dataTable: dataTable2 }, () => { this.setState({ loading: true, dataTable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate() this.handleValidate()
}, 100); }, 100);
}) })
...@@ -6279,6 +6281,7 @@ export default class TaxPlanning extends Component { ...@@ -6279,6 +6281,7 @@ export default class TaxPlanning extends Component {
// this.forceUpdate() // this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => { this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate() this.handleValidate()
}, 100); }, 100);
}) })
......
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