Commit 90a82d4d authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

upload tp

See merge request !1328
parents 2572c15b 8b76b47f
...@@ -419,6 +419,7 @@ export default class TaxPlanning extends Component { ...@@ -419,6 +419,7 @@ export default class TaxPlanning extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
// this.props.saveToMonthlyReport() // this.props.saveToMonthlyReport()
this.props.onClickClose() this.props.onClickClose()
this.props.refresh()
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
...@@ -430,6 +431,7 @@ export default class TaxPlanning extends Component { ...@@ -430,6 +431,7 @@ export default class TaxPlanning extends Component {
} }
// this.props.saveToMonthlyReport() // this.props.saveToMonthlyReport()
this.props.onClickClose() this.props.onClickClose()
this.props.refresh()
}) })
} }
} else { } else {
...@@ -441,9 +443,10 @@ export default class TaxPlanning extends Component { ...@@ -441,9 +443,10 @@ export default class TaxPlanning extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
console.log("masuk upload")
console.log(resp) console.log(resp)
if (err) { if (err) {
// console.log(err); console.log(err);
} }
else { else {
let isi = resp.rows.slice(4) let isi = resp.rows.slice(4)
...@@ -565,7 +568,7 @@ export default class TaxPlanning extends Component { ...@@ -565,7 +568,7 @@ export default class TaxPlanning extends Component {
// {tbc: item.formula.tbc, fcp: item.formula.fcp, tbf: item.formula.tbf}, // {tbc: item.formula.tbc, fcp: item.formula.fcp, tbf: item.formula.tbf},
item.level, item.level,
item.item_report, item.item_report,
{ tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.january.tbc, formula: item.january_formula } : item.january.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 || item.type_report_id.fcp == 7 ? { value: item.january.fcp, formula: item.january_formula } : item.january.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 || item.type_report_id.tbf == 7 ? { value: item.january.tbf, formula: item.january_formula } : item.january.tbf }, { tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.january.tbc, formula: item.january_formula } : item.january.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.january.fcp, formula: item.january_formula } : item.january.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.january.tbf, formula: item.january_formula } : item.january.tbf },
{ tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.february.tbc, formula: item.february_formula } : item.february.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.february.fcp, formula: item.february_formula } : item.february.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.february.tbf, formula: item.february_formula } : item.february.tbf }, { tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.february.tbc, formula: item.february_formula } : item.february.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.february.fcp, formula: item.february_formula } : item.february.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.february.tbf, formula: item.february_formula } : item.february.tbf },
{ tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.march.tbc, formula: item.march_formula } : item.march.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.march.fcp, formula: item.march_formula } : item.march.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.march.tbf, formula: item.march_formula } : item.march.tbf }, { tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.march.tbc, formula: item.march_formula } : item.march.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.march.fcp, formula: item.march_formula } : item.march.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.march.tbf, formula: item.march_formula } : item.march.tbf },
{ tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.april.tbc, formula: item.april_formula } : item.april.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.april.fcp, formula: item.april_formula } : item.april.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.april.tbf, formula: item.april_formula } : item.april.tbf }, { tbc: item.type_report_id.tbc == 5 || item.type_report_id.tbc == 6 || item.type_report_id.tbc == 7 ? { value: item.april.tbc, formula: item.april_formula } : item.april.tbc, fcp: item.type_report_id.fcp == 5 || item.type_report_id.fcp == 6 || item.type_report_id.fcp == 7 ? { value: item.april.fcp, formula: item.april_formula } : item.april.fcp, tbf: item.type_report_id.tbf == 5 || item.type_report_id.tbf == 6 || item.type_report_id.tbf == 7 ? { value: item.april.tbf, formula: item.april_formula } : item.april.tbf },
...@@ -593,20 +596,20 @@ export default class TaxPlanning extends Component { ...@@ -593,20 +596,20 @@ export default class TaxPlanning extends Component {
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.forecast_tbc_formula, // item.forecast_tbc_formula,
item.forecast_fcp_formula, // item.forecast_fcp_formula,
item.forecast_tbf_formula, // item.forecast_tbf_formula,
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 }, () => {
console.log(this.state.dataTable);
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[27].length > 0) { if (item[27].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 })
} }
}) })
// console.log(this.state.dataTable);
}) })
} }
} }
...@@ -679,25 +682,26 @@ export default class TaxPlanning extends Component { ...@@ -679,25 +682,26 @@ export default class TaxPlanning extends Component {
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf) tbf: i[3] === 3 && i[20].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
}, },
total_current_year: String(Number(i[21]).toFixed(1)), total_current_year: String(Number(i[21]).toFixed(1)),
total_next_year: { // total_next_year: {
tbc: String(Number(i[22].tbc).toFixed(1)), // tbc: String(Number(i[22].tbc).toFixed(1)),
fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[22].fcp).toFixed(1)) : String(Number(i[22].fcp).toFixed(1)), // fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[22].fcp).toFixed(1)) : String(Number(i[22].fcp).toFixed(1)),
tbf: String(Number(i[22].tbf).toFixed(1)) // tbf: String(Number(i[22].tbf).toFixed(1))
}, // },
total_more_year: { // total_more_year: {
tbc: String(Number(i[23].tbc).toFixed(1)), // tbc: String(Number(i[23].tbc).toFixed(1)),
fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[23].fcp).toFixed(1)) : String(Number(i[23].fcp).toFixed(1)), // fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[23].fcp).toFixed(1)) : String(Number(i[23].fcp).toFixed(1)),
tbf: String(Number(i[23].tbf).toFixed(1)) // tbf: String(Number(i[23].tbf).toFixed(1))
} // }
}) })
}) })
let body = { let body = {
submission_id: this.props.submissionID, rolling_outlook_id: this.props.rollingOutlookID,
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
quartal: this.props.quarter,
status: type,
tax_planning: data, tax_planning: data,
status: type
} }
// console.log(data); // console.log(data);
api.create('UPLOAD').importRollingOutlookTP(body).then(response => { api.create('UPLOAD').importRollingOutlookTP(body).then(response => {
...@@ -705,7 +709,8 @@ export default class TaxPlanning extends Component { ...@@ -705,7 +709,8 @@ export default class TaxPlanning extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() // this.props.getReport()
this.props.refresh()
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -714,6 +719,8 @@ export default class TaxPlanning extends Component { ...@@ -714,6 +719,8 @@ export default class TaxPlanning extends Component {
window.location.reload(); window.location.reload();
}, 1000); }, 1000);
} }
this.props.onClickClose()
this.props.refresh()
}) })
// alert(response.data.status) // alert(response.data.status)
} }
...@@ -824,11 +831,12 @@ export default class TaxPlanning extends Component { ...@@ -824,11 +831,12 @@ export default class TaxPlanning extends Component {
} }
downloadTemplate = async () => { downloadTemplate = async () => {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`
console.log(url);
let res = await fetch( let res = await fetch(
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}` // `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`
) )
console.log(`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`)
res = await res.blob() res = await res.blob()
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
...@@ -920,7 +928,12 @@ export default class TaxPlanning extends Component { ...@@ -920,7 +928,12 @@ export default class TaxPlanning extends Component {
if (splitform[1] == 'TP1' || splitform[1] == 'TP2' || splitform[1] == 'TP3') { if (splitform[1] == 'TP1' || splitform[1] == 'TP2' || splitform[1] == 'TP3') {
let indexID = dataTable2.findIndex((val) => val[24] == splitform[0]) let indexID = dataTable2.findIndex((val) => val[24] == splitform[0])
if (indexID !== -1) { if (indexID !== -1) {
// console.log(splitform)
let data = splitform[1] == 'TP1' ? dataTable2[indexID][tableMeta.columnIndex].tbc : splitform[1] == 'TP2' ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf let data = splitform[1] == 'TP1' ? dataTable2[indexID][tableMeta.columnIndex].tbc : splitform[1] == 'TP2' ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
// console.log(data)
// if(value == null){
// console.log(tableMeta);
// }
let valuezz = data.value == undefined ? data : data.value let valuezz = data.value == undefined ? data : data.value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
...@@ -1113,22 +1126,6 @@ export default class TaxPlanning extends Component { ...@@ -1113,22 +1126,6 @@ export default class TaxPlanning extends Component {
} }
} }
const handleTotalControl = (tableMeta, dex, periode) => {
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value)
}
}
})
let nilai = Number(total) + Number(dataTable2[88][21])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = nilai
// console.log(nilai);
return nilai
}
const handleTotal = (tableMeta, dex, periode) => { const handleTotal = (tableMeta, dex, periode) => {
let total = 0 let total = 0
let totalfcp = 0 let totalfcp = 0
...@@ -1288,7 +1285,7 @@ export default class TaxPlanning extends Component { ...@@ -1288,7 +1285,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
this.state.get_for == 'view'? // this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1323,105 +1320,105 @@ export default class TaxPlanning extends Component { ...@@ -1323,105 +1320,105 @@ export default class TaxPlanning extends Component {
} }
/> />
</div> </div>
: // :
tableMeta.rowData[3] === 3 ? // tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
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="input" // placeholder="input"
disabled={this.props.isApprover == true ? 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 ? 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)}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
onBlur={(event) => { // onBlur={(event) => {
// updateValue(event.target.value) // // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) // handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2) // // console.log(dataTable2)
}} // }}
/> // />
} // }
/> // />
</div> // </div>
: // :
tableMeta.rowData[3] === 2 ? // tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleParent(tableMeta, 3)).toFixed(1)} // value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/> // />
</span> // </span>
: // :
tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ? // tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
: // :
tableMeta.rowData[3] === 7 ? // tableMeta.rowData[3] === 7 ?
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ? // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'black' // color: 'black'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> : // /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'red' // color: 'red'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
</LightTooltip> // </LightTooltip>
: // :
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
/> // />
} // }
/> // />
</div> // </div>
} }
</div> </div>
</div> </div>
...@@ -1458,7 +1455,7 @@ export default class TaxPlanning extends Component { ...@@ -1458,7 +1455,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
this.state.get_for == 'view'? // this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1493,105 +1490,105 @@ export default class TaxPlanning extends Component { ...@@ -1493,105 +1490,105 @@ export default class TaxPlanning extends Component {
} }
/> />
</div> </div>
: // :
tableMeta.rowData[3] === 3 ? // tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
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="input" // placeholder="input"
disabled={this.props.isApprover == true ? 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 ? 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)}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
onBlur={(event) => { // onBlur={(event) => {
// updateValue(event.target.value) // // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) // handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2) // // console.log(dataTable2)
}} // }}
/> // />
} // }
/> // />
</div> // </div>
: // :
tableMeta.rowData[3] === 2 ? // tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleParent(tableMeta, 3)).toFixed(1)} // value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/> // />
</span> // </span>
: // :
tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ? // tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
: // :
tableMeta.rowData[3] === 7 ? // tableMeta.rowData[3] === 7 ?
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ? // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'black' // color: 'black'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> : // /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'red' // color: 'red'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
</LightTooltip> // </LightTooltip>
: // :
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
/> // />
} // }
/> // />
</div> // </div>
} }
</div> </div>
</div> </div>
...@@ -1628,7 +1625,7 @@ export default class TaxPlanning extends Component { ...@@ -1628,7 +1625,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
this.state.get_for == 'view'? // this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1663,105 +1660,105 @@ export default class TaxPlanning extends Component { ...@@ -1663,105 +1660,105 @@ export default class TaxPlanning extends Component {
} }
/> />
</div> </div>
: // :
tableMeta.rowData[3] === 3 ? // tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
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="input" // placeholder="input"
disabled={this.props.isApprover == true ? 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 ? 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)}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
onBlur={(event) => { // onBlur={(event) => {
// updateValue(event.target.value) // // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) // handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2) // // console.log(dataTable2)
}} // }}
/> // />
} // }
/> // />
</div> // </div>
: // :
tableMeta.rowData[3] === 2 ? // tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleParent(tableMeta, 3)).toFixed(1)} // value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/> // />
</span> // </span>
: // :
tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ? // tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
: // :
tableMeta.rowData[3] === 7 ? // tableMeta.rowData[3] === 7 ?
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ? // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'black' // color: 'black'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> : // /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ // style={{
fontSize: 12, // fontSize: 12,
textAlign: 'right', // textAlign: 'right',
borderColor: 'transparent', // borderColor: 'transparent',
margin: 0, // margin: 0,
width: 96, // width: 96,
backgroundColor: 'transparent', // backgroundColor: 'transparent',
color: 'red' // color: 'red'
}} // }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> // />
</LightTooltip> // </LightTooltip>
: // :
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value.tbf} // value={value.tbf}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(value.tbf).toFixed(1)} // value={Number(value.tbf).toFixed(1)}
/> // />
} // }
/> // />
</div> // </div>
} }
</div> </div>
</div> </div>
......
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