Commit 3f23faff authored by Riri Novita's avatar Riri Novita

Opin

parent c6d8e226
......@@ -11,6 +11,7 @@ import Constant from '../../library/Constant';
import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../../library/Upload";
import { Alert } from '@material-ui/lab';
import { fixNumber, titleCase } from '../../library/Utils';
const LightTooltip = withStyles((theme) => ({
tooltip: {
......@@ -500,22 +501,42 @@ export default class OperatingIndicatorMR extends Component {
uploadOI(type) {
let data = []
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
uom: String(i[6]),
rolling_outlook: String(Number(i[7]).toFixed(1)),
master_budget: String(Number(i[8]).toFixed(1)),
rolling_budget: String(Number(i[9]).toFixed(1)),
actual: String(Number(i[10]).toFixed(1)),
amount_act_vs_mb: String(Number(i[11]).toFixed(1)),
percent_act_vs_mb: String(Number(i[12]).toFixed(1)),
amount_act_vs_rb: String(Number(i[13]).toFixed(1)),
percent_act_vs_rb: String(Number(i[14]).toFixed(1)),
mtd_vs_mb: String(i[15]),
mtd_vs_rb: String(i[16]),
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
uom: String(i[6]),
rolling_outlook: String(Number(i[7])),
master_budget: String(Number(i[8])),
rolling_budget: String(Number(i[9])),
actual: String(Number(i[10])),
amount_act_vs_mb: String(Number(i[11])),
percent_act_vs_mb: String(Number(i[12])),
amount_act_vs_rb: String(Number(i[13])),
percent_act_vs_rb: String(Number(i[14])),
mtd_vs_mb: String(i[15]),
mtd_vs_rb: String(i[16]),
})
})
})
} else {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
uom: String(i[6]),
rolling_outlook: String(fixNumber(Number(i[7]), 1)),
master_budget: String(fixNumber(Number(i[8]), 1)),
rolling_budget: String(fixNumber(Number(i[9]), 1)),
actual: String(fixNumber(Number(i[10]), 1)),
amount_act_vs_mb: String(fixNumber(Number(i[11]), 1)),
percent_act_vs_mb: String(fixNumber(Number(i[12]), 1)),
amount_act_vs_rb: String(fixNumber(Number(i[13]), 1)),
percent_act_vs_rb: String(fixNumber(Number(i[14]), 1)),
mtd_vs_mb: String(i[15]),
mtd_vs_rb: String(i[16]),
})
})
}
let body = {
company_id: this.props.data.company.company_id,
operating_indicator_id: this.state.operatingIndIDMonthly,
......@@ -641,7 +662,7 @@ export default class OperatingIndicatorMR extends Component {
}
})
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[data.rowIndex][2])
dataTable2[data.rowIndex][data.columnIndex + type] = Number(total).toFixed(1)
dataTable2[data.rowIndex][data.columnIndex + type] = this.props.defaultCurrency == 1 ? fixNumber(Number(total), 1) : Number(total)
// console.log(indexParent);
return total
}
......@@ -650,16 +671,16 @@ export default class OperatingIndicatorMR extends Component {
console.log(dataTable2);
let val = String(value).split(",").join("")
if (type === "actual") {
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
dataTable2[tableMeta.rowIndex][10] = this.props.defaultCurrency == 1 ? fixNumber(Number(val), 1) : Number(val)
} else {
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
let jagain = Number(dataTable2[indexParent][10]).toFixed(1)
dataTable2[indexParent][10] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1)
dataTable2[tableMeta.rowIndex][10] = this.props.defaultCurrency == 1 ? fixNumber(Number(val), 1) : Number(val)
let jagain = this.props.defaultCurrency == 1 ? fixNumber(Number(dataTable2[indexParent][10]), 1) : Number(dataTable2[indexParent][10])
dataTable2[indexParent][10] = this.props.defaultCurrency == 1 ? (jagain === undefined ? fixNumber((0 + Number(val)), 1) : Number(Number(jagain) + fixNumber(Number(val)), 1)) : (jagain === undefined ? (0 + Number(val)) : Number(Number(jagain) + Number(val)))
} else {
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
dataTable2[tableMeta.rowIndex][10] = this.props.defaultCurrency == 1 ? fixNumber(Number(val), 1) : Number(val)
}
}
}
......@@ -667,11 +688,11 @@ export default class OperatingIndicatorMR extends Component {
const handleVariance = (tableMeta, dex, type) => {
let total = 0
if (dex === 1) {
total = Number(tableMeta.rowData[10]) - Number(tableMeta.rowData[8]).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
total = Number(tableMeta.rowData[10]) - (this.props.defaultCurrency == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8]))
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = this.props.defaultCurrency == 1 ? fixNumber(Number(total), 1) : Number(total)
} else if (dex === 2) {
total = Number(tableMeta.rowData[10]) - Number(tableMeta.rowData[9]).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
total = Number(tableMeta.rowData[10]) - (this.props.defaultCurrency == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9]))
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = this.props.defaultCurrency == 1 ? fixNumber(Number(total), 1) : Number(total)
}
return total
}
......@@ -680,10 +701,10 @@ export default class OperatingIndicatorMR extends Component {
let total = 0
if (dex === 1) {
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = this.props.defaultCurrency == 1 ? fixNumber(Number(total), 1) : Number(total)
} else if (dex === 2) {
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = this.props.defaultCurrency == 1 ? fixNumber(Number(total), 1) : Number(total)
}
return total
}
......@@ -884,8 +905,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(val).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(val), 1) == 0 ?"0.0" : Number(val)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -896,8 +917,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(handleValue(tableMeta, 0)).toFixed(1)}
//decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 0)), 1) : Number(handleValue(tableMeta, 0)) == 0 ? "0.0" : Number(handleValue(tableMeta, 0))}
/>
</span> :
// tableMeta.rowData[0] === 6 ?
......@@ -905,7 +926,7 @@ export default class OperatingIndicatorMR extends Component {
// <FormControlLabel
// style={{ margin: 0 }}
// value={tableMeta.rowData[7]}
// decimalScale={1}
// //decimalScale={1}
// control={
// <NumberFormat
// thousandSeparator={true}
......@@ -930,8 +951,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ?"0.0" : Number(val)}
///decimalScale={1}
/>
}
/>
......@@ -986,8 +1007,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[8]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[8]), 1)}
//decimalScale={1}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -998,8 +1019,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 0)), 1) : Number(handleValue(tableMeta, 0)) == 0 ? "0.0" : Number(handleValue(tableMeta, 0))}
//decimalScale={1}
/>
</span>
// :
......@@ -1016,7 +1037,7 @@ export default class OperatingIndicatorMR extends Component {
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// //decimalScale={1}
// />
// }
// />
......@@ -1033,8 +1054,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8]) == 0 ? "0.0" : Number(tableMeta.rowData[8])}
//decimalScale={1}
/>
}
/>
......@@ -1053,8 +1074,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[9]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[9]), 1)}
//decimalScale={1}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1065,8 +1086,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 1)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 1)), 1) : Number(handleValue(tableMeta, 1)) == 0 ? "0.0" : Number(handleValue(tableMeta), 1)}
//decimalScale={1}
/>
</span>
// :
......@@ -1083,7 +1104,7 @@ export default class OperatingIndicatorMR extends Component {
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// //decimalScale={1}
// />
// }
// />
......@@ -1092,7 +1113,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={Number(tableMeta.rowData[9]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[9]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[9]), 1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1100,8 +1121,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9]) == 0 ? "0.0" : Number(tableMeta.rowData[9])}
//decimalScale={1}
/>
}
/>
......@@ -1121,8 +1142,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[10]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[10]), 1)}
//decimalScale={1}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1133,8 +1154,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 2)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 2)), 1) : Number(handleValue(tableMeta, 2)) == 0? "0.0" : Number(handleValue(tableMeta, 2))}
//decimalScale={1}
/>
</span>
:
......@@ -1149,10 +1170,10 @@ export default class OperatingIndicatorMR extends Component {
style={{ color: this.state.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
//decimalScale={1}
fixedDecimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || this.state.get_for == 'view'}
value={Number(tableMeta.rowData[10]).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10]) == 0 ? "0.0" : Number(tableMeta.rowData[10])}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1165,7 +1186,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={Number(tableMeta.rowData[8]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[8]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[8]), 1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1173,8 +1194,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(handleFormula(val, tableMeta, 2)).toFixed(1)}
//decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(val, tableMeta, 2)), 1) : Number(handleFormula(val, tableMeta, 2)) == 0 ? "0.0" : Number(handleFormula(val, tableMeta, 2))}
/>
}
/>
......@@ -1190,8 +1211,8 @@ export default class OperatingIndicatorMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10]) == 0 ? "0.0" : Number(tableMeta.rowData[10])}
//decimalScale={1}
/>
}
/>
......@@ -1277,14 +1298,14 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[11]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[11]), 1)}
//decimalScale={1}
/>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={Number(tableMeta.rowData[11]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[11]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[11]), 1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1292,8 +1313,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 1, 0)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1) : Number(handleVariance(tableMeta, 1, 0)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 1, 0))}
//decimalScale={1}
/>
}
/>
......@@ -1314,8 +1335,8 @@ export default class OperatingIndicatorMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[12]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[12]), 1)}
//decimalScale={1}
/>
:
<div style={{ flex: 1 }}>
......@@ -1330,8 +1351,8 @@ export default class OperatingIndicatorMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 1)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1) : Number(handleVariancePercent(tableMeta, 1, 1)) == 0 ? "0.0" : Number(handleVariancePercent(tableMeta, 1), 1)}
//decimalScale={1}
/>
}
/>
......@@ -1355,14 +1376,14 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[13]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)}
//decimalScale={1}
/>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={Number(tableMeta.rowData[13]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[13]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1370,8 +1391,8 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 2, 2)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1) : Number(handleVariance(tableMeta, 2, 2)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 2, 2))}
//decimalScale={1}
/>
}
/>
......@@ -1392,8 +1413,8 @@ export default class OperatingIndicatorMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(tableMeta.rowData[14]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[14]), 1)}
//decimalScale={1}
/>
:
<div style={{ flex: 1, width: 120 }}>
......@@ -1408,8 +1429,8 @@ export default class OperatingIndicatorMR extends Component {
placeholder=""
disabled={true}
suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 2, 3)).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1) : Number(handleVariancePercent(tableMeta, 2, 3)) == 0 ? "0.0" : Number(handleVariancePercent(tableMeta, 2, 3))}
//decimalScale={1}
/>
}
/>
......
......@@ -13,6 +13,7 @@ import { ExcelRenderer } from 'react-excel-renderer';
// import { Alert } from '@material-ui/lab';
import Constant from '../../library/Constant';
import MuiAlert from '@material-ui/lab/Alert';
import { fixNumber, titleCase } from '../../library/Utils';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -139,22 +140,22 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year).toFixed(1),
item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year).toFixed(1),
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year),
item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year),
item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year),
item.order
])
}
......@@ -175,22 +176,22 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year).toFixed(1),
item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year).toFixed(1),
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year),
item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year),
item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year),
item.order
])
if (item.children !== null) {
......@@ -213,27 +214,52 @@ export default class BalanceSheet extends Component {
createData(type) {
let payloadMB = []
this.state.dataTable.map((item, index) => {
payloadMB.push({
"item_report_id": item[1],
"total_actual_before": String(Number(item[7]).toFixed(1)),
"january": String(Number(item[8]).toFixed(1)),
"february": String(Number(item[9]).toFixed(1)),
"march": String(Number(item[10]).toFixed(1)),
"april": String(Number(item[11]).toFixed(1)),
"may": String(Number(item[12]).toFixed(1)),
"june": String(Number(item[13]).toFixed(1)),
"july": String(Number(item[14]).toFixed(1)),
"august": String(Number(item[15]).toFixed(1)),
"september": String(Number(item[16]).toFixed(1)),
"october": String(Number(item[17]).toFixed(1)),
"november": String(Number(item[18]).toFixed(1)),
"december": String(Number(item[19]).toFixed(1)),
"total_current_year": String(Number(item[20]).toFixed(1)),
"total_next_year": String(Number(item[21]).toFixed(1)),
"total_more_year": String(Number(item[22]).toFixed(1)),
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map((item, index) => {
payloadMB.push({
"item_report_id": item[1],
"total_actual_before": String(Number(item[7])),
"january": String(Number(item[8])),
"february": String(Number(item[9])),
"march": String(Number(item[10])),
"april": String(Number(item[11])),
"may": String(Number(item[12])),
"june": String(Number(item[13])),
"july": String(Number(item[14])),
"august": String(Number(item[15])),
"september": String(Number(item[16])),
"october": String(Number(item[17])),
"november": String(Number(item[18])),
"december": String(Number(item[19])),
"total_current_year": String(Number(item[20])),
"total_next_year": String(Number(item[21])),
"total_more_year": String(Number(item[22])),
})
})
})
} else {
this.state.dataTable.map((item, index) => {
payloadMB.push({
"item_report_id": item[1],
"total_actual_before": String(fixNumber(Number(item[7]), 1)),
"january": String(fixNumber(Number(item[8]), 1)),
"february": String(fixNumber(Number(item[9]), 1)),
"march": String(fixNumber(Number(item[10]), 1)),
"april": String(fixNumber(Number(item[11]), 1)),
"may": String(fixNumber(Number(item[12]), 1)),
"june": String(fixNumber(Number(item[13]), 1)),
"july": String(fixNumber(Number(item[14]), 1)),
"august": String(fixNumber(Number(item[15]), 1)),
"september": String(fixNumber(Number(item[16]), 1)),
"october": String(fixNumber(Number(item[17]), 1)),
"november": String(fixNumber(Number(item[18]), 1)),
"december": String(fixNumber(Number(item[19]), 1)),
"total_current_year": String(fixNumber(Number(item[20]), 1)),
"total_next_year": String(fixNumber(Number(item[21]), 1)),
"total_more_year": String(fixNumber(Number(item[22]), 1)),
})
})
}
let payload = {
"operating_indicator_id": this.props.data.operatingIndID,
"report_id": this.props.data.report_id,
......@@ -419,28 +445,54 @@ export default class BalanceSheet extends Component {
uploadOI(type) {
let data = []
// // console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"item_report": String(i[5]),
"total_actual_before": String(Number(i[7] == null ? "0" : i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)),
"april": String(Number(i[11]).toFixed(1)),
"may": String(Number(i[12]).toFixed(1)),
"june": String(Number(i[13]).toFixed(1)),
"july": String(Number(i[14]).toFixed(1)),
"august": String(Number(i[15]).toFixed(1)),
"september": String(Number(i[16]).toFixed(1)),
"october": String(Number(i[17]).toFixed(1)),
"november": String(Number(i[18]).toFixed(1)),
"december": String(Number(i[19]).toFixed(1)),
"total_current_year": String(Number(i[20]).toFixed(1)),
"total_next_year": String(Number(i[21]).toFixed(1)),
"total_more_year": String(Number(i[22]).toFixed(1)),
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"item_report": String(i[5]),
"total_actual_before": String(Number(i[7] == null ? "0" : i[7])),
"january": String(Number(i[8])),
"february": String(Number(i[9])),
"march": String(Number(i[10])),
"april": String(Number(i[11])),
"may": String(Number(i[12])),
"june": String(Number(i[13])),
"july": String(Number(i[14])),
"august": String(Number(i[15])),
"september": String(Number(i[16])),
"october": String(Number(i[17])),
"november": String(Number(i[18])),
"december": String(Number(i[19])),
"total_current_year": String(Number(i[20])),
"total_next_year": String(Number(i[21])),
"total_more_year": String(Number(i[22])),
})
})
})
} else {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"item_report": String(i[5]),
"total_actual_before": String(fixNumber(Number(i[7] == null ? "0" : i[7]), 1)),
"january": String(fixNumber(Number(i[8]), 1)),
"february": String(fixNumber(Number(i[9]), 1)),
"march": String(fixNumber(Number(i[10]), 1)),
"april": String(fixNumber(Number(i[11]), 1)),
"may": String(fixNumber(Number(i[12]), 1)),
"june": String(fixNumber(Number(i[13]), 1)),
"july": String(fixNumber(Number(i[14]), 1)),
"august": String(fixNumber(Number(i[15]), 1)),
"september": String(fixNumber(Number(i[16]), 1)),
"october": String(fixNumber(Number(i[17]), 1)),
"november": String(fixNumber(Number(i[18]), 1)),
"december": String(fixNumber(Number(i[19]), 1)),
"total_current_year": String(fixNumber(Number(i[20]), 1)),
"total_next_year": String(fixNumber(Number(i[21]), 1)),
"total_more_year": String(fixNumber(Number(i[22]), 1)),
})
})
}
let body = {
company_id: this.props.data.company.company_id,
operating_indicator_id: this.props.data.operatingIndID,
......@@ -753,8 +805,8 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
// decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>}
</div>
)
......@@ -786,9 +838,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -805,9 +857,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -828,8 +880,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -872,9 +924,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -891,9 +943,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -914,8 +966,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -957,9 +1009,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -976,9 +1028,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -999,8 +1051,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1042,9 +1094,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1061,9 +1113,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1084,8 +1136,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1127,9 +1179,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1146,9 +1198,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1169,8 +1221,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1212,9 +1264,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1231,9 +1283,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1254,8 +1306,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1297,9 +1349,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1316,9 +1368,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1339,8 +1391,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1382,9 +1434,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1401,9 +1453,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1424,8 +1476,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1467,9 +1519,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1486,9 +1538,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1509,8 +1561,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1552,9 +1604,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1571,9 +1623,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1594,8 +1646,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1637,9 +1689,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1656,9 +1708,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1679,8 +1731,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1722,9 +1774,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1741,9 +1793,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1764,8 +1816,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1807,9 +1859,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1826,9 +1878,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1849,8 +1901,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1893,9 +1945,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1912,9 +1964,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1935,8 +1987,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1979,9 +2031,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
/>
}
/>
......@@ -1998,9 +2050,9 @@ export default class BalanceSheet extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
disabled={true}
decimalScale={1}
// decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2021,8 +2073,8 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2142,6 +2194,7 @@ export default class BalanceSheet extends Component {
options={options}
/>
</MuiThemeProvider>
<div style={{ color: '#000', marginTop: 10, fontSize: 12 }}>(*) There may be discrepancies in amount due to rounding</div>
</div>
<div style={{ display: 'flex' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography>
......
......@@ -10,6 +10,7 @@ import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
import Constant from '../../library/Constant';
import { fixNumber, titleCase } from '../../library/Utils';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -256,24 +257,46 @@ export default class OperatingIndicatorRO extends Component {
createData(type) {
let payloadRO = []
this.state.dataTable.map((item, index) => {
payloadRO.push({
"item_report_id": item[1],
"january": String(Number(item[7]).toFixed(1)),
"february": String(Number(item[8]).toFixed(1)),
"march": String(Number(item[9]).toFixed(1)),
"april": String(Number(item[10]).toFixed(1)),
"may": String(Number(item[11]).toFixed(1)),
"june": String(Number(item[12]).toFixed(1)),
"july": String(Number(item[13]).toFixed(1)),
"august": String(Number(item[14]).toFixed(1)),
"september": String(Number(item[15]).toFixed(1)),
"october": String(Number(item[16]).toFixed(1)),
"november": String(Number(item[17]).toFixed(1)),
"december": String(Number(item[18]).toFixed(1)),
"total_current_year": String(Number(item[19]).toFixed(1)),
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map((item, index) => {
payloadRO.push({
"item_report_id": item[1],
"january": String(Number(item[7])),
"february": String(Number(item[8])),
"march": String(Number(item[9])),
"april": String(Number(item[10])),
"may": String(Number(item[11])),
"june": String(Number(item[12])),
"july": String(Number(item[13])),
"august": String(Number(item[14])),
"september": String(Number(item[15])),
"october": String(Number(item[16])),
"november": String(Number(item[17])),
"december": String(Number(item[18])),
"total_current_year": String(Number(item[19])),
})
})
})
} else {
this.state.dataTable.map((item, index) => {
payloadRO.push({
"item_report_id": item[1],
"january": String(fixNumber(Number(item[7]), 1)),
"february": String(fixNumber(Number(item[8]), 1)),
"march": String(fixNumber(Number(item[9]), 1)),
"april": String(fixNumber(Number(item[10]), 1)),
"may": String(fixNumber(Number(item[11]), 1)),
"june": String(fixNumber(Number(item[12]), 1)),
"july": String(fixNumber(Number(item[13]), 1)),
"august": String(fixNumber(Number(item[14]), 1)),
"september": String(fixNumber(Number(item[15]), 1)),
"october": String(fixNumber(Number(item[16]), 1)),
"november": String(fixNumber(Number(item[17]), 1)),
"december": String(fixNumber(Number(item[18]), 1)),
"total_current_year": String(fixNumber(Number(item[19]), 1)),
})
})
}
let payload = {
"operating_indicator_id": this.state.operatingIndIDRolling,
"report_id": this.props.data.report_id,
......@@ -461,25 +484,48 @@ export default class OperatingIndicatorRO extends Component {
uploadOI(type) {
let data = []
// // console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
item_report: String(i[5]),
january: String(Number(i[7]).toFixed(1)),
february: String(Number(i[8]).toFixed(1)),
march: String(Number(i[9]).toFixed(1)),
april: String(Number(i[10]).toFixed(1)),
may: String(Number(i[11]).toFixed(1)),
june: String(Number(i[12]).toFixed(1)),
july: String(Number(i[13]).toFixed(1)),
august: String(Number(i[14]).toFixed(1)),
september: String(Number(i[15]).toFixed(1)),
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
item_report: String(i[5]),
january: String(Number(i[7])),
february: String(Number(i[8])),
march: String(Number(i[9])),
april: String(Number(i[10])),
may: String(Number(i[11])),
june: String(Number(i[12])),
july: String(Number(i[13])),
august: String(Number(i[14])),
september: String(Number(i[15])),
october: String(Number(i[16])),
november: String(Number(i[17])),
december: String(Number(i[18])),
total_current_year: String(Number(i[19])),
})
})
})
} else {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
item_report: String(i[5]),
january: String(fixNumber(Number(i[7]), 1)),
february: String(fixNumber(Number(i[8]), 1)),
march: String(fixNumber(Number(i[9]), 1)),
april: String(fixNumber(Number(i[10]), 1)),
may: String(fixNumber(Number(i[11]), 1)),
june: String(fixNumber(Number(i[12]), 1)),
july: String(fixNumber(Number(i[13]), 1)),
august: String(fixNumber(Number(i[14]), 1)),
september: String(fixNumber(Number(i[15]), 1)),
october: String(fixNumber(Number(i[16]), 1)),
november: String(fixNumber(Number(i[17]), 1)),
december: String(fixNumber(Number(i[18]), 1)),
total_current_year: String(fixNumber(Number(i[19]), 1)),
})
})
}
let body = {
company_id: this.props.data.company.company_id,
operating_indicator_id: this.state.operatingIndIDRolling,
......@@ -810,8 +856,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -825,9 +871,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : (value === "0" ? "0.0" : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -844,9 +890,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : (value === "0" ? "0.0" : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -865,9 +911,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : (value === "0" ? "0.0" : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -906,8 +952,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -921,9 +967,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
value={value === "0" ? "0.0" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -940,9 +986,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : (value === "0" ? "0.0" : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -961,9 +1007,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)}
decimalScale={1}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : (value === "0" ? "0.0" : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1001,8 +1047,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1016,9 +1062,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
value={value === "0" ? "0.0" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1035,9 +1081,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : (value === "0" ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1056,9 +1102,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value === "0" ? "" : Number(value).toFixed(1)}
// value={Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : (value === "0" ? "0.0" : Number(value) == 0 ? "0.0" : Number(value))}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value)}
//decimalScale={1}
disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1096,8 +1142,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1111,9 +1157,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : fixNumber(Number(handleParent(tableMeta)), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta))) : Number(handleParent(tableMeta)) == 0 ? "0,0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1130,9 +1176,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1151,7 +1197,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : ((this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value)))}
decimalScale={1}
disabled={this.props.quartal == 'q1' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
......@@ -1189,8 +1235,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1204,9 +1250,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : fixNumber(Number(handleParent(tableMeta)), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta))) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1223,9 +1269,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1244,8 +1290,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={this.props.quartal == 'q1' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1282,8 +1328,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1297,9 +1343,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1316,9 +1362,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1337,8 +1383,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : (this.props.quartal == 'q2' || this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={this.props.quartal == 'q1' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1375,8 +1421,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1390,9 +1436,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : fixNumber(Number(handleParent(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta))) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1409,9 +1455,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1430,8 +1476,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1468,8 +1514,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1483,9 +1529,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : fixNumber(Number(handleParent(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta))) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1502,9 +1548,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1523,8 +1569,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1561,8 +1607,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1576,9 +1622,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)) : Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)) : fixNumber(Number(handleParent(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleParent(tableMeta))) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1595,9 +1641,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)) : Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)) : fixNumber(Number(handleFormula(tableMeta)), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(handleFormula(tableMeta))) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta)))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1616,8 +1662,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: this.props.quartal == 'q1' || this.props.quartal == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.quartal == 'q3' ? (value === "0" ? "" : Number(value).toFixed(1)) : Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : fixNumber(Number(value), 1)) : fixNumber(Number(value), 1)) : (this.props.quartal == 'q3' ? (value === "0" ? "0.0" : Number(value)) : Number(value) == 0 ? "0.0" : Number(value))}
//decimalScale={1}
disabled={this.props.quartal == 'q1' || this.props.quartal == 'q2' ? false : true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1654,8 +1700,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1669,9 +1715,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta)), 1) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1688,9 +1734,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(tableMeta)), 1) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1709,8 +1755,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
//decimalScale={1}
disabled={false}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1747,8 +1793,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1762,9 +1808,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta)), 1) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1781,9 +1827,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(tableMeta)), 1) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1802,8 +1848,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
//decimalScale={1}
disabled={false}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1840,8 +1886,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1855,9 +1901,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta)), 1) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1874,9 +1920,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(tableMeta)), 1) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1895,8 +1941,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
//decimalScale={1}
disabled={false}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......@@ -1933,8 +1979,8 @@ export default class OperatingIndicatorRO extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
//decimalScale={1}
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
/>
:
tableMeta.rowData[0] == 2 ?
......@@ -1948,9 +1994,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta)), 1) : Number(handleParent(tableMeta)) == 0 ? "0.0" : Number(handleParent(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
/>
}
/>
......@@ -1967,9 +2013,9 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(tableMeta)), 1) : Number(handleFormula(tableMeta)) == 0 ? "0.0" : Number(handleFormula(tableMeta))}
disabled={true}
decimalScale={1}
//decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1988,8 +2034,8 @@ export default class OperatingIndicatorRO extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
//decimalScale={1}
disabled={false}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
......
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