Commit ff1c173f authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

Rifka

See merge request !822
parents 01be1e41 d9798eee
......@@ -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,
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.actual_formula,
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_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) {
......@@ -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,
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.actual_formula,
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_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.length > 0) {
......@@ -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),
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.actual_formula,
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.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
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => {
if (item[16].length > 0) {
if (item[18].length > 0) {
// console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
}
......@@ -493,7 +497,6 @@ export default class TaxPlanningMR extends Component {
render() {
let dataTable2 = this.state.dataTable
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 splitFormula = String(form).split('@')
let baru = []
......@@ -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) {
// form.replace("(", "")
// form.replace(")", "")
let opgab = []
baru.map((item, index) => {
if( item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))){
......@@ -532,7 +529,9 @@ export default class TaxPlanningMR extends Component {
baru = opgab
}
}
let totalShldBeNil = 0
console.log(baru)
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
......@@ -567,12 +566,14 @@ export default class TaxPlanningMR extends Component {
}
} else {
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))
console.log(indexID);
if (indexID !== -1) {
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
console.log(anjay)
}
}
} else {
......@@ -726,27 +727,18 @@ export default class TaxPlanningMR extends Component {
}
}
const handleTotal = (value, tableMeta, dex) => {
console.log(value)
let total = 0
// console.log(tableMeta)
let total = value
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) {
let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
// console.log(valItemFCP)
total = Number(value) + Number(valItemFCP)
total = Number(tableMeta.rowData[16]) + Number(valItemFCP)
}
})
if (dex == 4) {
console.log('masuk')
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
}
dataTable2[tableMeta.rowIndex][10] = Number(total).toFixed(1)
return total
}
const handleParent = (tableMeta, type) => {
......@@ -1288,7 +1280,7 @@ export default class TaxPlanningMR extends Component {
type="text"
placeholder=""
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 {
)
}
}
},
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
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