Commit d14a15cd authored by Deni Rinaldi's avatar Deni Rinaldi

bs

parent 1dcaae42
......@@ -103,8 +103,8 @@ export default class BalanceSheetMR extends Component {
if (response.data) {
if (response.data.status === 'success') {
this.setState({
minValue: response.data.data[0] ? response.data.data[0].min_value : -5,
maxValue: response.data.data[0] ? response.data.data[0].max_value : 5,
minValue: response.data.data[0] ? Number(response.data.data[0].min_value) : -5,
maxValue: response.data.data[0] ? Number(response.data.data[0].max_value) : 5,
}, () => {
this.getItemHierarki()
})
......@@ -152,16 +152,16 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.master_budget === "" ? "0" : item.balance_sheet.master_budget,
item.balance_sheet.rolling_budget === "" ? "0" : item.balance_sheet.rolling_budget,
item.balance_sheet.actual === "" ? "0" : item.balance_sheet.actual,
item.balance_sheet.actual_previous_month === null ? "5.0" : item.balance_sheet.actual_previous_month === "" ? "5.0" : item.balance_sheet.actual_previous_month,
item.balance_sheet.actual_previous_month === null ? "0.0" : item.balance_sheet.actual_previous_month === "" ? "0.0" : item.balance_sheet.actual_previous_month,
item.balance_sheet.amount_act_vs_previous_month === "" ? "0" : item.balance_sheet.amount_act_vs_previous_month,
item.balance_sheet.percent_act_vs_previous_month === "" ? "0" : item.balance_sheet.percent_act_vs_previous_month,
item.balance_sheet.amount_act_vs_mb === "" ? "0" : item.balance_sheet.amount_act_vs_mb,
item.balance_sheet.percent_act_vs_mb === "" ? "0" : item.balance_sheet.percent_act_vs_mb,
item.balance_sheet.amount_act_vs_rb === "" ? "0" : item.balance_sheet.amount_act_vs_rb,
item.balance_sheet.percent_act_vs_rb === "" ? "0" : item.balance_sheet.percent_act_vs_rb,
item.balance_sheet.mtd_vs_previous_month === "" ? null : item.balance_sheet.mtd_vs_previous_month,
item.balance_sheet.mtd_vs_mb === "" ? null : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === "" ? null : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.mtd_vs_previous_month === "" ? "-" : item.balance_sheet.mtd_vs_previous_month,
item.balance_sheet.mtd_vs_mb === "" ? "-" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === "" ? "-" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula,
item.order
])
......@@ -186,16 +186,16 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.master_budget === "" ? "0" : item.balance_sheet.master_budget,
item.balance_sheet.rolling_budget === "" ? "0" : item.balance_sheet.rolling_budget,
item.balance_sheet.actual === "" ? "0" : item.balance_sheet.actual,
item.balance_sheet.actual_previous_month === null ? "5.0" : item.balance_sheet.actual_previous_month === "" ? "5.0" : item.balance_sheet.actual_previous_month,
item.balance_sheet.actual_previous_month === null ? "0.0" : item.balance_sheet.actual_previous_month === "" ? "0.0" : item.balance_sheet.actual_previous_month,
item.balance_sheet.amount_act_vs_previous_month === "" ? "0" : item.balance_sheet.amount_act_vs_previous_month,
item.balance_sheet.percent_act_vs_previous_month === "" ? "0" : item.balance_sheet.percent_act_vs_previous_month,
item.balance_sheet.amount_act_vs_mb === "" ? "0" : item.balance_sheet.amount_act_vs_mb,
item.balance_sheet.percent_act_vs_mb === "" ? "0" : item.balance_sheet.percent_act_vs_mb,
item.balance_sheet.amount_act_vs_rb === "" ? "0" : item.balance_sheet.amount_act_vs_rb,
item.balance_sheet.percent_act_vs_rb === "" ? "0" : item.balance_sheet.percent_act_vs_rb,
item.balance_sheet.mtd_vs_previous_month === "" ? null : item.balance_sheet.mtd_vs_previous_month,
item.balance_sheet.mtd_vs_mb === "" ? null : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === "" ? null : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.mtd_vs_previous_month === "" ? "-" : item.balance_sheet.mtd_vs_previous_month,
item.balance_sheet.mtd_vs_mb === "" ? "-" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === "" ? "-" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula,
item.order
])
......@@ -314,9 +314,9 @@ export default class BalanceSheetMR extends Component {
0,
0,
0,
item.mtd_vs_previous_month === "" ? "" : item.mtd_vs_previous_month,
item.mtd_vs_mb === "" ? "" : item.mtd_vs_mb,
item.mtd_vs_rb === "" ? "" : item.mtd_vs_rb === null ? 0 : item.mtd_vs_rb,
item.mtd_vs_previous_month === "" ? "0" : item.mtd_vs_previous_month,
item.mtd_vs_mb === "" ? "0" : item.mtd_vs_mb,
item.mtd_vs_rb === "" ? "0" : item.mtd_vs_rb === null ? '0' : item.mtd_vs_rb,
item.actual_formula,
item.order,
item.error
......@@ -499,7 +499,7 @@ export default class BalanceSheetMR extends Component {
render() {
let dataTable2 = this.state.dataTable
const handleText = (value, tableMeta, type) => {
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value
dataTable2[tableMeta.rowIndex][type] = value
// console.log(dataTable2[tableMeta.rowIndex]);
}
const handleChange = (value, tableMeta, type) => {
......@@ -1488,14 +1488,13 @@ export default class BalanceSheetMR extends Component {
}
}),
customBodyRender: (val, tableMeta, updateValue) => {
// console.log(tableMeta.rowData);
return (
<div>
<div className="grid grid-3x content-center">
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null :
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -1512,7 +1511,7 @@ export default class BalanceSheetMR extends Component {
textAlign: 'right'
}}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 7)
handleText(event.target.value, tableMeta, 17)
}}
/>
}
......@@ -1523,7 +1522,7 @@ export default class BalanceSheetMR extends Component {
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null :
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -1540,7 +1539,7 @@ export default class BalanceSheetMR extends Component {
textAlign: 'right'
}}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 8)
handleText(event.target.value, tableMeta, 18)
}}
/>
}
......@@ -1551,7 +1550,7 @@ export default class BalanceSheetMR extends Component {
<div className="col-3">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null :
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -1568,7 +1567,7 @@ export default class BalanceSheetMR extends Component {
textAlign: 'right'
}}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 9)
handleText(event.target.value, tableMeta, 19)
}}
/>
}
......
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