Commit 14137ac7 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

Didam

See merge request !538
parents a5456185 08221675
...@@ -596,7 +596,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -596,7 +596,7 @@ export default class FixedAssetsMovement extends Component {
} }
const handleForecast = (tableMeta, periode) => { const handleForecast = (tableMeta, periode) => {
let total = 0 let total = 0
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'ending balance' || String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') { if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'gain/ (loss) on fixed assets' || String(tableMeta.rowData[5]).toLocaleLowerCase() == 'ending balance' || String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') {
// console.log(dataTable2[tableMeta.rowIndex][23]) // console.log(dataTable2[tableMeta.rowIndex][23])
// console.log() // console.log()
let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode) let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode)
...@@ -604,7 +604,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -604,7 +604,8 @@ export default class FixedAssetsMovement extends Component {
total = dataTable2[tableMeta.rowIndex][23][indexID].value total = dataTable2[tableMeta.rowIndex][23][indexID].value
} }
} else { } else {
total = handleValueFormula(tableMeta.columnIndex, tableMeta)
// console.log(dataTable2[tableMeta.rowIndex])
} }
// if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') { // if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') {
// total = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex - 1] // total = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex - 1]
......
...@@ -129,7 +129,9 @@ export default class TaxPlanning extends Component { ...@@ -129,7 +129,9 @@ export default class TaxPlanning extends Component {
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.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -169,6 +171,9 @@ export default class TaxPlanning extends Component { ...@@ -169,6 +171,9 @@ export default class TaxPlanning extends Component {
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.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -458,6 +463,9 @@ export default class TaxPlanning extends Component { ...@@ -458,6 +463,9 @@ 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.tax_planning.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula,
item.error item.error
] ]
}) })
...@@ -720,7 +728,8 @@ export default class TaxPlanning extends Component { ...@@ -720,7 +728,8 @@ export default class TaxPlanning extends Component {
let dataFormula = [] let dataFormula = []
let id = 0 let id = 0
let double = false let double = false
const handleValueFormula = (value, tableMeta, dex) => { const handleValueFormula = (value, tableMeta, dex, xntd) => {
// 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 = []
...@@ -820,9 +829,13 @@ export default class TaxPlanning extends Component { ...@@ -820,9 +829,13 @@ export default class TaxPlanning extends Component {
}) })
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8]) // console.log(tableMeta.rowData[8])
// if (xntd !== undefined) {
// console.log(tableMeta.rowData[8])
// console.log(xntd)
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
// console.log(total) // console.log(total)
// }
// console.log(splitFormula) // console.log(splitFormula)
// let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf // let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf
...@@ -849,6 +862,50 @@ export default class TaxPlanning extends Component { ...@@ -849,6 +862,50 @@ export default class TaxPlanning extends Component {
return total return total
} }
const handleForecast = (tableMeta, periode, dex) => {
let total = 0
// console.log(dataTable2[tableMeta.rowIndex][6])
// console.log(dex)
let data = dex == 1? dataTable2[tableMeta.rowIndex][6].tbc : dex == 2? dataTable2[tableMeta.rowIndex][6].fcp : dataTable2[tableMeta.rowIndex][6].tbf
// let valuue =
let forecast = dex == 1 ? dataTable2[tableMeta.rowIndex][27] : dex == 2? dataTable2[tableMeta.rowIndex][28] : dataTable2[tableMeta.rowIndex][29]
if (data.includes('#PL')) {
// console.log(tableMeta.rowData[8])
forecast.map((item,index) => {
if (periode == item.periode) {
total += Number(item.value)
}
})
} else {
// console.log(tableMeta.rowData[8])
// console.log(data)
total = handleValueFormula(5, tableMeta, dex, data)
// console.log(total)
}
if (dex == 1) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = total
}
} else if (dex == 2) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = total
}
} else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = total
}
}
return total
}
const handleChange = (value, tableMeta, indexChilds) => { const handleChange = (value, tableMeta, indexChilds) => {
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
// let data = this.state.dataTable2 // let data = this.state.dataTable2
...@@ -861,7 +918,7 @@ export default class TaxPlanning extends Component { ...@@ -861,7 +918,7 @@ export default class TaxPlanning extends Component {
a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val)) a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
} }
} else { } else {
console.log(tableMeta) // console.log(tableMeta)
if (indexChilds == 0) { if (indexChilds == 0) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val)
} }
...@@ -1103,8 +1160,8 @@ export default class TaxPlanning extends Component { ...@@ -1103,8 +1160,8 @@ export default class TaxPlanning extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[27] ? {tableMeta.rowData[30] ?
tableMeta.rowData[27].length > 0 ? tableMeta.rowData[30].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
...@@ -6432,26 +6489,26 @@ export default class TaxPlanning extends Component { ...@@ -6432,26 +6489,26 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[1] === 6 ? tableMeta.rowData[1] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 1)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[1] === 5 ? tableMeta.rowData[1] === 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 1)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[1] === 1 ? tableMeta.rowData[1] === 1 ?
// value[0] === "" ? // value[0] === "" ?
...@@ -6511,26 +6568,25 @@ export default class TaxPlanning extends Component { ...@@ -6511,26 +6568,25 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[2] === 6 ? tableMeta.rowData[2] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 2)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[2] === 5 ? tableMeta.rowData[2] === 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 2)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[2] === 1 ? tableMeta.rowData[2] === 1 ?
// value[1] === "" ? // value[1] === "" ?
...@@ -6589,26 +6645,25 @@ export default class TaxPlanning extends Component { ...@@ -6589,26 +6645,25 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[3] === 6 ? tableMeta.rowData[3] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[3] === 5 ? 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 1 ?
// value[2] === "" ? // value[2] === "" ?
...@@ -6700,26 +6755,25 @@ export default class TaxPlanning extends Component { ...@@ -6700,26 +6755,25 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[1] === 6 ? tableMeta.rowData[1] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 1)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[1] === 5 ? tableMeta.rowData[1] === 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 1)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[1] === 1 ? tableMeta.rowData[1] === 1 ?
// value[0] === "" ? // value[0] === "" ?
...@@ -6779,26 +6833,25 @@ export default class TaxPlanning extends Component { ...@@ -6779,26 +6833,25 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[2] === 6 ? tableMeta.rowData[2] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 2)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[2] === 5 ? tableMeta.rowData[2] === 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 2)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[2] === 1 ? tableMeta.rowData[2] === 1 ?
// value[1] === "" ? // value[1] === "" ?
...@@ -6857,26 +6910,25 @@ export default class TaxPlanning extends Component { ...@@ -6857,26 +6910,25 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[3] === 6 ? tableMeta.rowData[3] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)}
// /> />
null // null
: :
tableMeta.rowData[3] === 5 ? 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 1 ?
// value[2] === "" ? // value[2] === "" ?
......
...@@ -239,7 +239,7 @@ class HomePage extends Component { ...@@ -239,7 +239,7 @@ class HomePage extends Component {
</div> </div>
); );
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <div style={{ flex: 1, backgroundColor: '#f8f8f8', minHeight: this.props.height }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
{this.state.isApprover === true ? {this.state.isApprover === true ?
<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