Commit 9ea4d65d authored by Riri Novita's avatar Riri Novita

robs

parent dbaf488f
......@@ -220,7 +220,8 @@ export default class BalanceSheetRO extends Component {
item.balance_sheet.total_current_year === "" ? "0" : item.balance_sheet.total_current_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong
item.condition_if_wrong,
item.balance_sheet.forecast_formula == null ? [] : item.balance_sheet.forecast_formula
])
}
if (item.children !== null) {
......@@ -255,7 +256,8 @@ export default class BalanceSheetRO extends Component {
item.balance_sheet.total_current_year === "" ? "0" : item.balance_sheet.total_current_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong
item.condition_if_wrong,
item.balance_sheet.forecast_formula == null ? [] : item.balance_sheet.forecast_formula
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -724,6 +726,23 @@ export default class BalanceSheetRO extends Component {
return total
}
const handleForecast = (tableMeta, periode, column) => {
let total = 0
// console.log(tableMeta.rowData)
console.log( dataTable2[tableMeta.rowIndex][23])
// console.log(total)
// dataTable2[tableMeta.rowIndex][column] = total
if (column == 19 && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)") {
total = tableMeta.rowData[7].value
dataTable2[tableMeta.rowIndex][column] = tableMeta.rowData[7].value
} else {
total = handleValueFormula(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][23])
}
// console.log(total)
return total
}
const handleValueFormula = (value, tableMeta, colIdx) => {
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = []
......@@ -772,7 +791,7 @@ export default class BalanceSheetRO extends Component {
}
} else {
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
// console.log(indexID)
console.log(indexID)
if (indexID !== -1) {
// console.log(value.formula[indexID].value)
let valuezz = value.formula[indexID].value
......@@ -2312,6 +2331,7 @@ export default class BalanceSheetRO extends Component {
value={Number(val).toFixed(1)}
/>
:
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
......@@ -2319,9 +2339,100 @@ export default class BalanceSheetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta)).toFixed(1)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={false}
value={Number(val).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(val, tableMeta)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[0] === 7 ?
(Number(handleValidation(val, tableMeta)).toFixed(1) >= Number(this.state.minValue) && Number(handleValidation(val, tableMeta)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValidation(val, tableMeta)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `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(handleValidation(val, tableMeta)).toFixed(1)}
/>
</LightTooltip>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
......@@ -2340,6 +2451,24 @@ export default class BalanceSheetRO extends Component {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
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