Commit f32abce6 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

semoga taxpaln issue terakhir

parent 14137ac7
......@@ -463,9 +463,9 @@ export default class TaxPlanning extends Component {
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_if_wrong.tbc, fcp: item.condition_if_wrong.fcp, tbf: item.condition_if_wrong.tbf },
item.tax_planning.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula,
item.forecast_tbc_formula,
item.forecast_fcp_formula,
item.forecast_tbf_formula,
item.error
]
})
......@@ -747,9 +747,26 @@ export default class TaxPlanning extends Component {
}
}
})
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
// form.replace("(", "")
// form.replace(")", "")
let opgab = []
baru.map((item, index) => {
if( item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))){
opgab.push(String(item).substr(0, Number(String(item).length) - 1))
opgab.push(String(item).substr(Number(String(item).length) - 1, 1))
} else {
opgab.push(item)
}
})
if(opgab.length > 0){
baru = opgab
}
}
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*') {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
} else {
if (String(item).includes('#')) {
......@@ -803,63 +820,118 @@ export default class TaxPlanning extends Component {
})
let total = 0
let total2 = 0
let opt = ""
let opt2 = ""
let prio = false
let simpen2 = ""
anjay.map((item, index) => {
if (item == "+") {
opt = "tambah"
if (prio) {
opt2 = "tambah"
} else {
opt = "tambah"
}
} else if (item == "-") {
opt = "kurang"
if (prio) {
opt2 = "kurang"
} else {
opt = "kurang"
}
} else if (item == "*") {
opt = "kali"
if (prio) {
opt2 = "kali"
} else {
opt = "kali"
}
} else if (item == "/") {
opt = "bagi"
} else {
if (opt == "tambah") {
total = Number(total) + Number(item)
} else if (opt == "kurang") {
total = Number(total) - Number(item)
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
if (prio) {
opt2 = "bagi"
} else {
opt = "bagi"
}
} else if (item == "(") {
prio = true
simpen2 = "active"
} else if (item == ")") {
prio = false
}
else {
if (prio) {
if (opt2 == "tambah") {
total2 = Number(total2) + Number(item)
} else if (opt2 == "kurang") {
total2 = Number(total2) - Number(item)
} else if (opt2 == "kali") {
total2 = Number(total2) * Number(item)
} else if (opt2 == "bagi") {
total2 = Number(total2) / Number(item) == NaN ? 0 : Number(total2) / Number(item)
} else {
total2 += Number(item)
}
} else {
total += Number(item)
if (opt == "tambah") {
total = Number(total) + Number(item)
} else if (opt == "kurang") {
total = Number(total) - Number(item)
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
} else {
total += Number(item)
}
}
}
})
if(simpen2 == "active") {
if (opt == "tambah") {
total = Number(total) + Number(total2)
} else if (opt == "kurang") {
total = Number(total) - Number(total2)
} else if (opt == "kali") {
total = Number(total) * Number(total2)
} else if (opt == "bagi") {
total = Number(total) / Number(total2) == NaN ? 0 : Number(total) / Number(total2)
}
}
total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8])
// if (xntd !== undefined) {
// console.log(tableMeta.rowData[8])
// console.log(xntd)
// console.log(baru)
// console.log(anjay)
// console.log(total)
// }
// console.log(splitFormula)
if (xntd !== undefined && tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
console.log(tableMeta.rowData[8])
// console.log(splitFormula)
console.log(xntd)
console.log(baru)
console.log(anjay)
console.log(total)
console.log(total2)
console.log(opt)
}
// let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf
if (dex == 1) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = Number(total).toFixed(1)
}
} else if (dex == 2) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = Number(total).toFixed(1)
}
} else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1)
}
}
return total
return Number(total).toFixed(1)
}
const handleForecast = (tableMeta, periode, dex) => {
......@@ -6523,7 +6595,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
// tableMeta.rowData[1] === 7 ?
// Number(handleValueFormula(value, tableMeta, 1)).toFixed(1) === Number(tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc).toFixed(1) ?
// <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, 1)).toFixed(1)}
// /> : tableMeta.rowData[26].tbc === "STOPPER" ?
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc}`} 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, 1)).toFixed(1)}
// />
// </LightTooltip> :
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc}`} 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, 1)).toFixed(1)}
// />
// </LightTooltip>
// :
null
}
</div>
</div>
......@@ -6601,7 +6728,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
// tableMeta.rowData[2] === 7 ?
// Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) === Number(tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp).toFixed(1) ?
// <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)}
// /> : tableMeta.rowData[26].fcp === "STOPPER" ?
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp}`} 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> :
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp}`} 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>
......@@ -6678,7 +6860,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
tableMeta.rowData[3] === 7 ?
Number(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1) === Number(tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf).toFixed(1) ?
<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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/> : tableMeta.rowData[26].tbf === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf}`} 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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf}`} 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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/>
</LightTooltip>
:
null
}
</div>
</div>
......@@ -6788,7 +7025,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
// tableMeta.rowData[1] === 7 ?
// Number(handleValueFormula(value, tableMeta, 1)).toFixed(1) === Number(tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc).toFixed(1) ?
// <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, 1)).toFixed(1)}
// /> : tableMeta.rowData[26].tbc === "STOPPER" ?
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc}`} 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, 1)).toFixed(1)}
// />
// </LightTooltip> :
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbc === "" ? "0" : tableMeta.rowData[25].tbc}`} 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, 1)).toFixed(1)}
// />
// </LightTooltip>
// :
null
}
</div>
</div>
......@@ -6866,7 +7158,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
// tableMeta.rowData[2] === 7 ?
// Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) === Number(tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp).toFixed(1) ?
// <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)}
// /> : tableMeta.rowData[26].fcp === "STOPPER" ?
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp}`} 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> :
// <LightTooltip title={`Value Should be ${tableMeta.rowData[25].fcp === "" ? "0" : tableMeta.rowData[25].fcp}`} 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>
......@@ -6943,7 +7290,62 @@ export default class TaxPlanning extends Component {
// />
null
:
null
tableMeta.rowData[3] === 7 ?
Number(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1) === Number(tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf).toFixed(1) ?
<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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/> : tableMeta.rowData[26].tbf === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf}`} 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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[25].tbf === "" ? "0" : tableMeta.rowData[25].tbf}`} 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(handleForecast(tableMeta, Number(this.props.periode)+2, 3)).toFixed(1)}
/>
</LightTooltip>
:
null
}
</div>
</div>
......@@ -7246,7 +7648,7 @@ export default class TaxPlanning extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......
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