Commit dce04942 authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 0678e8d4 ff1c173f
...@@ -38,7 +38,7 @@ const create = (type = "") => { ...@@ -38,7 +38,7 @@ const create = (type = "") => {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
// 40 second timeout... // 40 second timeout...
timeout: 100000 timeout: 40000
}) })
break; break;
default: default:
......
...@@ -744,18 +744,25 @@ export default class BudgetTahunan extends Component { ...@@ -744,18 +744,25 @@ export default class BudgetTahunan extends Component {
}) })
// // console.log(JSON.stringify(data)); // // console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(data).then(response => { api.create('UPLOAD').createSubmitReport(data).then(response => {
// // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.ok) {
this.getSubmission() if (response.data.status === 'success') {
this.getSubmission()
} else {
this.setState({ loading: false }, () => {
this.getSubmission()
document.body.style.overflow = 'unset';
})
}
} else { } else {
this.setState({ loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false}, () => {
this.getSubmission() this.getSubmission()
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
} }
} else { } else {
this.setState({ loading: false }, () => { this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false }, () => {
this.getSubmission() this.getSubmission()
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
......
...@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component { ...@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -183,7 +183,7 @@ export default class CashFlow extends Component { ...@@ -183,7 +183,7 @@ export default class CashFlow extends Component {
// } else { // } else {
api.create().getDetailReportCF(payload).then(response => { api.create().getDetailReportCF(payload).then(response => {
let dataTable = [] let dataTable = []
// console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -278,7 +278,7 @@ export default class CashFlow extends Component { ...@@ -278,7 +278,7 @@ export default class CashFlow extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
// } // }
......
...@@ -269,7 +269,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -269,7 +269,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
} }
...@@ -670,7 +670,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -670,7 +670,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -195,7 +195,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -195,7 +195,7 @@ export default class FixedAssetsMovement extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false}) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false})
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
} }
...@@ -447,7 +447,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -447,7 +447,7 @@ export default class FixedAssetsMovement extends Component {
} else { } else {
// this.setState({ loading: false }) // this.setState({ loading: false })
// alert(response.problem) // alert(response.problem)
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -205,7 +205,7 @@ export default class ProfitLoss extends Component { ...@@ -205,7 +205,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
...@@ -447,7 +447,7 @@ export default class ProfitLoss extends Component { ...@@ -447,7 +447,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -230,7 +230,7 @@ export default class TaxPlanning extends Component { ...@@ -230,7 +230,7 @@ export default class TaxPlanning extends Component {
}) })
} }
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true, alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error'})
} }
}) })
} }
...@@ -632,7 +632,7 @@ export default class TaxPlanning extends Component { ...@@ -632,7 +632,7 @@ export default class TaxPlanning extends Component {
// alert(response.data.status) // alert(response.data.status)
} }
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error' })
} }
}) })
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider } from '@material-ui/core' import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider, TextareaAutosize } from '@material-ui/core'
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import api from '../../api'; import api from '../../api';
...@@ -794,7 +794,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -794,7 +794,7 @@ export default class ListOfCreditFacilities extends Component {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": this.props.revision, "revision": this.props.revision,
"periode": this.props.periode, "periode": 2021,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"submission_id": this.state.submissionID "submission_id": this.state.submissionID
} }
...@@ -1228,7 +1228,28 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1228,7 +1228,28 @@ export default class ListOfCreditFacilities extends Component {
}) })
console.log(dataTable2) console.log(dataTable2)
} else { } else {
if (value.value !== undefined) {
if (value.value == 'Investment Loan') {
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'Revolving Loan (KMK)') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'others') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
}
}
dataTable2[tableMeta.rowIndex][column] = value dataTable2[tableMeta.rowIndex][column] = value
console.log(dataTable2)
} }
} }
...@@ -1238,7 +1259,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1238,7 +1259,6 @@ export default class ListOfCreditFacilities extends Component {
if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") { if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") {
indexNyasar = true indexNyasar = true
} }
if (value == null) { if (value == null) {
index = -1 index = -1
} else { } else {
...@@ -1524,7 +1544,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1524,7 +1544,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0}} style={{ padding: 0, margin: 0}}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 150, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} /> <textarea style={{ borderColor: 'white', width: 150, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div> </div>
} }
/> />
...@@ -1558,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1558,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} /> <textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div> </div>
} }
/> />
...@@ -1581,22 +1601,28 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1581,22 +1601,28 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{ tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9? { tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null : null :
<ThemeProvider theme={theme}> <div style={{ padding: 0, margin: 0 }}>
<Input <textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" defaultValue={tableMeta.rowData[8]}
disableUnderline={true} onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }} </div>
type="text" // <ThemeProvider theme={theme}>
placeholder="" // <Input
disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false} // disableUnderline={true}
defaultValue={tableMeta.rowData[8]} // style={{color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
onBlur={(event) => { // type="text"
// // // console.log(event.target.value) // placeholder=""
// updateValue(event.target.value) // disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
handleChange(event.target.value, tableMeta, tableMeta.columnIndex) // defaultValue={tableMeta.rowData[8]}
// // // console.log(dataTable2) // multiline
}} // rowsMax={3}
/> // onBlur={(event) => {
</ThemeProvider> // // // // console.log(event.target.value)
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
// // // // console.log(dataTable2)
// }}
// />
// </ThemeProvider>
} }
</div> </div>
...@@ -1675,7 +1701,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1675,7 +1701,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={val} value={Number(val).toFixed(2)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
maxLength={4} maxLength={4}
onBlur={(event) => { onBlur={(event) => {
...@@ -3516,13 +3542,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3516,13 +3542,13 @@ export default class ListOfCreditFacilities 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}
<MuiThemeProvider theme={getMuiTheme()}> {!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>}
</div> </div>
<div style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}> <div style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}>
...@@ -3530,7 +3556,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3530,7 +3556,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}> <div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography>
</div> </div>
<div style={{border: '1px solid black', padding: 5}}> <div style={{border: '1px solid black', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalOutStand}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalOutStand}</Typography>
</div> </div>
</div> </div>
...@@ -3540,7 +3566,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3540,7 +3566,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}> <div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography>
</div> </div>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5}}> <div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.diff}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.diff}</Typography>
</div> </div>
</div> </div>
...@@ -3660,7 +3686,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3660,7 +3686,7 @@ export default class ListOfCreditFacilities 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.dataLoaded && <MuiThemeProvider theme={getMuiTheme()}> {this.state.dataLoaded && !this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
......
...@@ -140,12 +140,14 @@ export default class TaxPlanningMR extends Component { ...@@ -140,12 +140,14 @@ export default class TaxPlanningMR extends Component {
fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction, fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal, tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
}, },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual, 0,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb, item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.tax_planning.actual_formula, item.tax_planning.actual_formula,
item.order, item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf }, { tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf },
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf }, { tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -172,12 +174,13 @@ export default class TaxPlanningMR extends Component { ...@@ -172,12 +174,13 @@ export default class TaxPlanningMR extends Component {
fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction, fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal, tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
}, },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual, 0,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb, item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.tax_planning.actual_formula, item.tax_planning.actual_formula,
item.order, item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf }, { tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf },
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf }, { tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -335,18 +338,19 @@ export default class TaxPlanningMR extends Component { ...@@ -335,18 +338,19 @@ export default class TaxPlanningMR extends Component {
fcp: item.fiscal_correction === null ? "0.0" : item.fiscal_correction === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.fiscal_correction).toFixed(2) : Number(item.fiscal_correction).toFixed(1), fcp: item.fiscal_correction === null ? "0.0" : item.fiscal_correction === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.fiscal_correction).toFixed(2) : Number(item.fiscal_correction).toFixed(1),
tbf: item.trial_balance_fiscal === null ? "0.0" : item.trial_balance_fiscal === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal).toFixed(2) : Number(item.trial_balance_fiscal).toFixed(1), tbf: item.trial_balance_fiscal === null ? "0.0" : item.trial_balance_fiscal === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal).toFixed(2) : Number(item.trial_balance_fiscal).toFixed(1),
}, },
item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_actual).toFixed(2) : Number(item.trial_balance_fiscal_actual).toFixed(1), 0,
item.trial_balance_fiscal_mb === null ? "0.0" : item.trial_balance_fiscal_mb === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_mb).toFixed(2) : Number(item.trial_balance_fiscal_mb).toFixed(1), item.trial_balance_fiscal_mb === null ? "0.0" : item.trial_balance_fiscal_mb === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_mb).toFixed(2) : Number(item.trial_balance_fiscal_mb).toFixed(1),
item.actual_formula, item.actual_formula,
item.orders, item.orders,
{ tbc: item.condition_it_should_be.tbc, fcp: item.condition_it_should_be.fcp, tbf: item.condition_it_should_be.tbf }, { tbc: item.condition_it_should_be.tbc, fcp: item.condition_it_should_be.fcp, tbf: item.condition_it_should_be.tbf },
{ tbc: item.condition_if_wrong.tbc, fcp: item.condition_if_wrong.fcp, tbf: item.condition_if_wrong.tbf }, { tbc: item.condition_if_wrong.tbc, fcp: item.condition_if_wrong.fcp, tbf: item.condition_if_wrong.tbf },
item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_actual).toFixed(2) : Number(item.trial_balance_fiscal_actual).toFixed(1),
item.error item.error
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[16].length > 0) { if (item[18].length > 0) {
// console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true }) this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
} }
...@@ -493,7 +497,6 @@ export default class TaxPlanningMR extends Component { ...@@ -493,7 +497,6 @@ export default class TaxPlanningMR extends Component {
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => { const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
// console.log(xntd)
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
let splitFormula = String(form).split('@') let splitFormula = String(form).split('@')
let baru = [] let baru = []
...@@ -511,14 +514,8 @@ export default class TaxPlanningMR extends Component { ...@@ -511,14 +514,8 @@ export default class TaxPlanningMR extends Component {
} }
} }
}) })
// if (forecast !== undefined) {
// console.log(splitFormula)
// }
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29" || forecast !== undefined) { if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29" || forecast !== undefined) {
// form.replace("(", "")
// form.replace(")", "")
let opgab = [] let opgab = []
baru.map((item, index) => { baru.map((item, index) => {
if( item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))){ if( item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))){
...@@ -532,7 +529,9 @@ export default class TaxPlanningMR extends Component { ...@@ -532,7 +529,9 @@ export default class TaxPlanningMR extends Component {
baru = opgab baru = opgab
} }
} }
let totalShldBeNil = 0 let totalShldBeNil = 0
console.log(baru)
baru.map((item, index) => { baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') { if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item) anjay.push(item)
...@@ -567,12 +566,14 @@ export default class TaxPlanningMR extends Component { ...@@ -567,12 +566,14 @@ export default class TaxPlanningMR extends Component {
} }
} else { } else {
let data = tableMeta.rowData[12] let data = tableMeta.rowData[12]
// console.log(data); console.log(data);
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode)) let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
console.log(indexID);
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = data[indexID].value let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
console.log(anjay)
} }
} }
} else { } else {
...@@ -726,27 +727,18 @@ export default class TaxPlanningMR extends Component { ...@@ -726,27 +727,18 @@ export default class TaxPlanningMR extends Component {
} }
} }
const handleTotal = (value, tableMeta, dex) => { const handleTotal = (value, tableMeta, dex) => {
console.log(value) // console.log(tableMeta)
let total = 0 let total = value
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) { if (index == 9) {
let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
// console.log(valItemFCP) total = Number(tableMeta.rowData[16]) + Number(valItemFCP)
total = Number(value) + Number(valItemFCP)
} }
}) })
if (dex == 4) { dataTable2[tableMeta.rowIndex][10] = Number(total).toFixed(1)
console.log('masuk') return total
dataTable2[tableMeta.rowIndex][10] = Number(total).toFixed(1)
console.log(dataTable2[tableMeta.rowIndex][10])
console.log(total)
return total
} else {
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
} }
const handleParent = (tableMeta, type) => { const handleParent = (tableMeta, type) => {
...@@ -1288,7 +1280,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1288,7 +1280,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(value, tableMeta, 5)).toFixed(2) : Number(handleTotal(value, tableMeta, 5)).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -1298,7 +1290,19 @@ export default class TaxPlanningMR extends Component { ...@@ -1298,7 +1290,19 @@ export default class TaxPlanningMR extends Component {
) )
} }
} }
}, },
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{ {
name: "", name: "",
options: { options: {
......
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