Commit 60724db5 authored by rifkaki's avatar rifkaki

MR TP, historical

parent 22cad9d6
...@@ -116,6 +116,7 @@ export default class TaxPlanningMR extends Component { ...@@ -116,6 +116,7 @@ export default class TaxPlanningMR extends Component {
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ this.setState({
...@@ -468,12 +469,13 @@ export default class TaxPlanningMR extends Component { ...@@ -468,12 +469,13 @@ export default class TaxPlanningMR extends Component {
}) })
} }
handleValidate() { handleValidate(dataTable2) {
let data = [] let data = []
let errorContrl = this.state.buttonError let errorContrl = this.state.buttonError
let editAble = this.state.editAble let editAble = this.state.editAble
// console.log(this.state.dataTable) console.log(this.state.dataTable)
this.state.dataTable.map(i => { console.log(dataTable2)
dataTable2.map(i => {
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)), trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)),
...@@ -484,7 +486,11 @@ export default class TaxPlanningMR extends Component { ...@@ -484,7 +486,11 @@ export default class TaxPlanningMR extends Component {
}) })
if (String(i[8]) == "Control (should be nil)") { if (String(i[8]) == "Control (should be nil)") {
if (i[9].tbf < this.state.minValue || i[9].tbf > this.state.maxValue) { this.setState({ loading: true })
console.log(i[9].tbf)
console.log(this.state.minValue)
console.log(this.state.maxValue)
if (Number(i[9].tbf) < Number(this.state.minValue) || Number(i[9].tbf) > Number(this.state.maxValue)) {
errorContrl = true errorContrl = true
editAble = true editAble = true
} else { } else {
...@@ -494,7 +500,7 @@ export default class TaxPlanningMR extends Component { ...@@ -494,7 +500,7 @@ export default class TaxPlanningMR extends Component {
} }
}) })
// this.setState({ loading: false, buttonError: errorContrl, editable: editAble, saveDraft: false }) // this.setState({ loading: false, buttonError: errorContrl, editable: editAble, saveDraft: false })
console.log(errorContrl)
let i = this.state.dataTable let i = this.state.dataTable
let payload = { let payload = {
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
...@@ -780,7 +786,6 @@ export default class TaxPlanningMR extends Component { ...@@ -780,7 +786,6 @@ export default class TaxPlanningMR extends Component {
} }
const handleChange = (value, tableMeta, indexChilds) => { const handleChange = (value, tableMeta, indexChilds) => {
console.log(dataTable2)
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
// let data = this.state.dataTable2 // let data = this.state.dataTable2
let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[tableMeta.rowIndex][5]) let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[tableMeta.rowIndex][5])
...@@ -802,6 +807,7 @@ export default class TaxPlanningMR extends Component { ...@@ -802,6 +807,7 @@ export default class TaxPlanningMR extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(val)
} }
} }
console.log(dataTable2)
} }
const handleTotal = (value, tableMeta, dex) => { const handleTotal = (value, tableMeta, dex) => {
// console.log(tableMeta) // console.log(tableMeta)
...@@ -1556,13 +1562,13 @@ export default class TaxPlanningMR extends Component { ...@@ -1556,13 +1562,13 @@ export default class TaxPlanningMR extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider>} </MuiThemeProvider>
{/* )} */} {/* )} */}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20, marginLeft: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20, marginLeft: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
...@@ -1630,7 +1636,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1630,7 +1636,7 @@ export default class TaxPlanningMR extends Component {
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() this.handleValidate(dataTable2)
}, 100); }, 100);
}) })
} }
......
...@@ -619,7 +619,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -619,7 +619,8 @@ export default class SummaryOfTriputra extends Component {
item.revenue_last_three_year, item.revenue_last_three_year,
item.revenue_last_two_year, item.revenue_last_two_year,
item.revenue_last_year, item.revenue_last_year,
item.revenue, // item.revenue,
0,
item.ebitda_last_ten_year, item.ebitda_last_ten_year,
item.ebitda_last_nine_year, item.ebitda_last_nine_year,
item.ebitda_last_eight_year, item.ebitda_last_eight_year,
...@@ -630,7 +631,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -630,7 +631,8 @@ export default class SummaryOfTriputra extends Component {
item.ebitda_last_three_year, item.ebitda_last_three_year,
item.ebitda_last_two_year, item.ebitda_last_two_year,
item.ebitda_last_year, item.ebitda_last_year,
item.ebitda, // item.ebitda,
0,
item.tpat_last_ten_year, item.tpat_last_ten_year,
item.tpat_last_nine_year, item.tpat_last_nine_year,
item.tpat_last_eight_year, item.tpat_last_eight_year,
...@@ -641,7 +643,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -641,7 +643,8 @@ export default class SummaryOfTriputra extends Component {
item.tpat_last_three_year, item.tpat_last_three_year,
item.tpat_last_two_year, item.tpat_last_two_year,
item.tpat_last_year, item.tpat_last_year,
item.tpat, // item.tpat,
0,
item.npat_last_ten_year, item.npat_last_ten_year,
item.npat_last_nine_year, item.npat_last_nine_year,
item.npat_last_eight_year, item.npat_last_eight_year,
...@@ -652,7 +655,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -652,7 +655,8 @@ export default class SummaryOfTriputra extends Component {
item.npat_last_three_year, item.npat_last_three_year,
item.npat_last_two_year, item.npat_last_two_year,
item.npat_last_year, item.npat_last_year,
item.npat, // item.npat,
0,
item.total_asset_last_ten_year, item.total_asset_last_ten_year,
item.total_asset_last_nine_year, item.total_asset_last_nine_year,
item.total_asset_last_eight_year, item.total_asset_last_eight_year,
...@@ -663,7 +667,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -663,7 +667,8 @@ export default class SummaryOfTriputra extends Component {
item.total_asset_last_three_year, item.total_asset_last_three_year,
item.total_asset_last_two_year, item.total_asset_last_two_year,
item.total_asset_last_year, item.total_asset_last_year,
item.total_asset, // item.total_asset,
0,
item.total_equity_last_ten_year, item.total_equity_last_ten_year,
item.total_equity_last_nine_year, item.total_equity_last_nine_year,
item.total_equity_last_eight_year, item.total_equity_last_eight_year,
...@@ -674,7 +679,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -674,7 +679,8 @@ export default class SummaryOfTriputra extends Component {
item.total_equity_last_three_year, item.total_equity_last_three_year,
item.total_equity_last_two_year, item.total_equity_last_two_year,
item.total_equity_last_year, item.total_equity_last_year,
item.total_equity, // item.total_equity,
0,
item.order, item.order,
]) ])
} }
......
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