Commit 35324807 authored by qorri_di's avatar qorri_di

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

Fixing Tax Planning by rifka

See merge request !1782
parents 61ca1917 8f1ec8c2
......@@ -495,17 +495,10 @@ export default class TaxPlanningMR extends Component {
console.log(this.state.dataTable)
console.log(dataTable2)
dataTable2.map(i => {
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))
})
if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true })
console.log(i)
// this.setState({ loading: false })
console.log(i[9].tbf)
if (String(i[8]) === "Control (should be nil)") {
console.log(i[9].tbf)
console.log(this.state.minValue)
console.log(this.state.maxValue)
......@@ -517,6 +510,15 @@ export default class TaxPlanningMR extends Component {
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 })
console.log(errorContrl)
......@@ -1668,7 +1670,7 @@ export default class TaxPlanningMR extends Component {
onClick={() => {
this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => {
// this.setState({ loading: false, buttonError: false, editable: true })
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate(dataTable2)
}, 100);
})
......@@ -1787,6 +1789,7 @@ export default class TaxPlanningMR extends Component {
// this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate(dataTable2)
}, 100);
})
......
......@@ -745,9 +745,10 @@ export default class TaxPlanning extends Component {
// console.log(this.state.dataTable)
this.state.dataTable.map((i, index) => {
if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true })
// this.setState({ loading: true })
let n = 0
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))) {
errorContrl = true
editAble = true
......@@ -6165,6 +6166,7 @@ export default class TaxPlanning extends Component {
onClick={() => {
this.setState({ loading: true, dataTable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate()
}, 100);
})
......@@ -6279,6 +6281,7 @@ export default class TaxPlanning extends Component {
// this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate()
}, 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