Commit d22af569 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-' into 'master'

Deni

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