Commit 56b5df01 authored by Deni Rinaldi's avatar Deni Rinaldi

tadaaaaa

parent 08348269
......@@ -788,10 +788,20 @@ export default class TaxPlanning extends Component {
splitFormula.map((item) => {
let re = /^[a-zA-Z0-9_]+$/;
let items = String(item).substr(Number(String(item).length) - 1, 1)
let subForm = String(item).substr(0, Number(String(item).length) - 1)
// if (tableMeta.rowData[24] === 96) {
// console.log(item, items);
// }
if (item !== "") {
if (!re.test(items)) {
baru.push(String(item).substr(0, Number(String(item).length) - 1))
baru.push(String(item).substr(Number(String(item).length) - 1, 1))
if (items === '(') {
baru.push(String(item).substr(0, Number(String(item).length) - 2))
baru.push(String(item).substr(Number(String(item).length) - 2, 1))
baru.push(items)
} else {
baru.push(subForm)
baru.push(items)
}
} else {
baru.push(String(item))
}
......@@ -857,7 +867,6 @@ export default class TaxPlanning extends Component {
}
}
})
console.log(anjay);
let total = 0
let total2 = 0
let opt = ""
......@@ -936,8 +945,10 @@ export default class TaxPlanning extends Component {
}
}
total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8], baru, anjay, total);
total = R.equals(total, NaN) ? "0.0" : Number(total).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return total
}
......@@ -1218,7 +1229,7 @@ export default class TaxPlanning extends Component {
}
else if (indexChilds == 2) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(val)
} else if (indexChilds == 3){
} else if (indexChilds == 3) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
}
}
......@@ -1695,11 +1706,45 @@ export default class TaxPlanning extends Component {
/>
</div>
:
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.fcp).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
tableMeta.rowData[2] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1709,77 +1754,33 @@ export default class TaxPlanning extends Component {
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.fcp).toFixed(1)}
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)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[2] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
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)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[2] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleParent(tableMeta, 2)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[2] === 4 ?
null
:
tableMeta.rowData[2] === 6 ?
tableMeta.rowData[2] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
value={Number(handleParent(tableMeta, 2)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[2] === 4 ?
null
:
tableMeta.rowData[2] === 5 ?
tableMeta.rowData[2] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1789,38 +1790,31 @@ export default class TaxPlanning extends Component {
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
:
tableMeta.rowData[2] === 1 ?
// value[1] === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value.fcp)}
// />
null
tableMeta.rowData[2] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
:
tableMeta.rowData[2] === 7 ?
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).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>
tableMeta.rowData[2] === 1 ?
// value[1] === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value.fcp)}
// />
null
:
tableMeta.rowData[2] === 7 ?
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1830,16 +1824,33 @@ export default class TaxPlanning extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
</LightTooltip>
:
null
/> :
<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
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
</LightTooltip>
:
null
}
</div>
</div>
......@@ -1884,11 +1895,45 @@ export default class TaxPlanning extends Component {
/>
</div>
:
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1898,119 +1943,68 @@ export default class TaxPlanning extends Component {
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
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)}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
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)}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[3] === 4 ?
null
:
tableMeta.rowData[3] === 6 ?
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[3] === 4 ?
null
:
tableMeta.rowData[3] === 5 ?
tableMeta.rowData[3] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={false}
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 1 ?
// value[2] === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value[2])}
// />
null
tableMeta.rowData[3] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={false}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
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)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
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>
tableMeta.rowData[3] === 1 ?
// value[2] === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value[2])}
// />
null
:
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)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2020,17 +2014,34 @@ export default class TaxPlanning extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
</LightTooltip>
:
null
}
/> :
<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
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
</LightTooltip>
:
null
}
</div>
</div>
</div>
......@@ -7436,18 +7447,18 @@ export default class TaxPlanning extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
// console.log(tableMeta.rowData);
// console.log(dataTable2);
return (
<div>
<div className="grid grid-3x content-center">
{/* <div className="col-1"> */}
<div style={{ textAlign: 'right' }}>
{String(tableMeta.rowData[8]).toUpperCase() === 'TAX LOSS CARRY FORWARD' ||
String(tableMeta.rowData[8]).toUpperCase() === 'ADJUSTMENT' ||
String(tableMeta.rowData[8]).toUpperCase() === 'INC TAX ART 22' ||
String(tableMeta.rowData[8]).toUpperCase() === 'INC TAX ART 23' ||
String(tableMeta.rowData[8]).toUpperCase() === 'INC TAX ART 24' ||
String(tableMeta.rowData[8]).toUpperCase() === 'INC TAX ART 25'
{tableMeta.rowData[24] === 81 ||
tableMeta.rowData[24] === 88 ||
tableMeta.rowData[24] === 92 ||
tableMeta.rowData[24] === 93 ||
tableMeta.rowData[24] === 94 ||
tableMeta.rowData[24] === 95
?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -7470,7 +7481,7 @@ export default class TaxPlanning extends Component {
}
/>
</div> :
String(tableMeta.rowData[8]).toUpperCase() === 'INCOME BEFORE TAX (NPBT)' ?
tableMeta.rowData[24] === 77 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -7488,7 +7499,7 @@ export default class TaxPlanning extends Component {
/>
</div>
:
String(tableMeta.rowData[8]).toUpperCase() === 'TAXABLE INCOME' ?
tableMeta.rowData[24] === 83 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -7506,7 +7517,7 @@ export default class TaxPlanning extends Component {
/>
</div>
:
String(tableMeta.rowData[8]).toUpperCase() === 'CORPORATE INCOME TAX' ?
tableMeta.rowData[24] === 87 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -7524,7 +7535,7 @@ export default class TaxPlanning extends Component {
/>
</div>
:
String(tableMeta.rowData[8]).toUpperCase() === 'CORPORATE INCOME TAX AFTER ADJUSTMENT' ?
tableMeta.rowData[24] === 89 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -7542,7 +7553,7 @@ export default class TaxPlanning extends Component {
/>
</div>
:
tableMeta.rowData[8] === "Under payment /(Over Payment ) Income Tax Art. 29" ?
tableMeta.rowData[24] === 96 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -7554,7 +7565,7 @@ export default class TaxPlanning extends Component {
type="text"
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)}
value={Number(handleNewFormula(tableMeta, 3, "@89-(@92+@93+@94+95)")).toFixed(1)}
value={Number(handleNewFormula(tableMeta, 3, "@89-(@92+@93+@94+@95)")).toFixed(1)}
/>
}
/>
......@@ -7613,14 +7624,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 1 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 1)).toFixed(1)}
/>
null
:
tableMeta.rowData[3] === 7 ?
(Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
......
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