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)
...@@ -850,13 +852,13 @@ export default class TaxPlanningMR extends Component { ...@@ -850,13 +852,13 @@ export default class TaxPlanningMR extends Component {
item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value) item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value)
: :
(type == 2 ? (type == 2 ?
item[tableMeta.columnIndex].fcp.value == undefined ? Number(item[tableMeta.columnIndex].fcp == "" || item[tableMeta.columnIndex].fcp == "0.0" ? 0 : item[tableMeta.columnIndex].fcp) : Number(item[tableMeta.columnIndex].fcp.value == "" || item[tableMeta.columnIndex].fcp.value == "0.0" ? 0 : item[tableMeta.columnIndex].fcp.value) item[tableMeta.columnIndex].fcp.value == undefined ? Number(item[tableMeta.columnIndex].fcp == "" || item[tableMeta.columnIndex].fcp == "0.0" ? 0 : item[tableMeta.columnIndex].fcp) : Number(item[tableMeta.columnIndex].fcp.value == "" || item[tableMeta.columnIndex].fcp.value == "0.0" ? 0 : item[tableMeta.columnIndex].fcp.value)
:
(type == 3 ?
item[tableMeta.columnIndex].tbf.value == undefined ? Number(item[tableMeta.columnIndex].tbf == "" || item[tableMeta.columnIndex].tbf == "0.0" ? 0 : item[tableMeta.columnIndex].tbf) : Number(item[tableMeta.columnIndex].tbf.value == "" || item[tableMeta.columnIndex].tbf.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbf.value)
: :
item[tableMeta.columnIndex].value == undefined ? Number(item[tableMeta.columnIndex] == "" || item[tableMeta.columnIndex] == "0.0" ? 0 : item[tableMeta.columnIndex]) : Number(item[tableMeta.columnIndex].value == "" || item[tableMeta.columnIndex].value == "0.0" ? 0 : item[tableMeta.columnIndex].value) (type == 3 ?
) item[tableMeta.columnIndex].tbf.value == undefined ? Number(item[tableMeta.columnIndex].tbf == "" || item[tableMeta.columnIndex].tbf == "0.0" ? 0 : item[tableMeta.columnIndex].tbf) : Number(item[tableMeta.columnIndex].tbf.value == "" || item[tableMeta.columnIndex].tbf.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbf.value)
:
item[tableMeta.columnIndex].value == undefined ? Number(item[tableMeta.columnIndex] == "" || item[tableMeta.columnIndex] == "0.0" ? 0 : item[tableMeta.columnIndex]) : Number(item[tableMeta.columnIndex].value == "" || item[tableMeta.columnIndex].value == "0.0" ? 0 : item[tableMeta.columnIndex].value)
)
) )
) )
} }
...@@ -1384,7 +1386,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1384,7 +1386,7 @@ export default class TaxPlanningMR extends Component {
null null
: :
this.state.get_for == 'view' ? this.state.get_for == 'view' ?
// Number(value).toFixed(1) // Number(value).toFixed(1)
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1526,7 +1528,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1526,7 +1528,7 @@ export default class TaxPlanningMR extends Component {
// </button> // </button>
// </a> // </a>
// <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> // <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
// </div> // </div>
: :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
...@@ -1597,10 +1599,10 @@ export default class TaxPlanningMR extends Component { ...@@ -1597,10 +1599,10 @@ export default class TaxPlanningMR extends Component {
<div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}> <div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
{ {
this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => { this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
return ( return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
) )
}) : }) :
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
} }
...@@ -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);
}) })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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