Commit 39d9c7d9 authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 213b78e4 05e03f42
...@@ -196,7 +196,16 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -196,7 +196,16 @@ export default class FixedAssetsMovementMR extends Component {
orders: i[0] === undefined ? "" : String(i[0]).trim(), orders: i[0] === undefined ? "" : String(i[0]).trim(),
item_report_id: i[1] === undefined ? "" : String(i[1]).trim(), item_report_id: i[1] === undefined ? "" : String(i[1]).trim(),
item_report: i[2] === undefined ? "" : String(i[2]).trim(), item_report: i[2] === undefined ? "" : String(i[2]).trim(),
actual: i[3] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[3]).trim(), mtd_actual: i[3] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[3]).trim(),
mtd_mb: "",
mtd_rb: "",
act_previous_month: "",
act_vs_prev_month_amount: "",
act_vs_prev_month_percent: "",
act_vs_mb_amount: "",
act_vs_mb_percent: "",
act_vs_rb_amount: "",
act_vs_rb_percent: ""
}) })
} }
}) })
...@@ -233,13 +242,13 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -233,13 +242,13 @@ export default class FixedAssetsMovementMR extends Component {
item.mtd_mb, item.mtd_mb,
item.mtd_rb, item.mtd_rb,
item.mtd_actual, item.mtd_actual,
item.act_previous_month, "",
item.act_vs_prev_month_amount, "",
item.act_vs_prev_month_percent, "",
item.act_vs_mb_amount, "",
item.act_vs_mb_percent, "",
item.act_vs_rb_amount, "",
item.act_vs_rb_percent, "",
item.order, item.order,
item.error item.error
] ]
...@@ -265,16 +274,16 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -265,16 +274,16 @@ export default class FixedAssetsMovementMR extends Component {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
item_report: String(i[5]).trim(), item_report: String(i[5]).trim(),
master_budget: String(Number(i[6]).toFixed(1)), master_budget: String(Number(i[6]).toFixed(3)),
rolling_budget: String(Number(i[7]).toFixed(1)), rolling_budget: String(Number(i[7]).toFixed(3)),
actual: String(Number(i[8]).toFixed(1)), actual: String(Number(i[8]).toFixed(3)),
actual_previous_month: String(Number(i[9]).toFixed(1)), actual_previous_month: String(Number(i[9]).toFixed(3)),
amount_act_vs_previous_month: String(Number(i[10]).toFixed(1)), amount_act_vs_previous_month: String(Number(i[10]).toFixed(3)),
percent_act_vs_previous_month: String(Number(i[11]).toFixed(1)), percent_act_vs_previous_month: String(Number(i[11]).toFixed(3)),
amount_act_vs_mb: String(Number(i[12]).toFixed(1)), amount_act_vs_mb: String(Number(i[12]).toFixed(3)),
percent_act_vs_mb: String(Number(i[13]).toFixed(1)), percent_act_vs_mb: String(Number(i[13]).toFixed(3)),
amount_act_vs_rb: String(Number(i[14]).toFixed(1)), amount_act_vs_rb: String(Number(i[14]).toFixed(3)),
percent_act_vs_rb: String(Number(i[15]).toFixed(1)), percent_act_vs_rb: String(Number(i[15]).toFixed(3)),
}) })
}) })
let body = { let body = {
...@@ -372,16 +381,16 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -372,16 +381,16 @@ export default class FixedAssetsMovementMR extends Component {
console.log(tableMeta); console.log(tableMeta);
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
if (type === "actual") { if (type === "actual") {
dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(3)
} else { } else {
console.log(val); console.log(val);
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
console.log(indexParent); console.log(indexParent);
if (indexParent > 0) { if (indexParent > 0) {
// console.log(indexParent) // console.log(indexParent)
dataTable2[tableMeta.rowIndex][9] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][9] = Number(val).toFixed(3)
let jagain = Number(dataTable2[indexParent][8]).toFixed(1) let jagain = Number(dataTable2[indexParent][8]).toFixed(3)
dataTable2[indexParent][9] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1) dataTable2[indexParent][9] = jagain === undefined ? (0 + Number(val)).toFixed(3) : Number(Number(jagain) + Number(val)).toFixed(3)
// if (tableMeta.rowData[5] === 'Cash & Bank Balance') { // if (tableMeta.rowData[5] === 'Cash & Bank Balance') {
// console.log(value); // console.log(value);
// console.log(a); // console.log(a);
...@@ -389,7 +398,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -389,7 +398,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(dataTable2[indexParent]); // console.log(dataTable2[indexParent]);
// } // }
} else { } else {
dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(3)
} }
} }
} }
...@@ -404,7 +413,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -404,7 +413,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
}) })
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[data.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[data.rowIndex][2])
let a = dataTable2[data.rowIndex][data.columnIndex + type] = Number(total).toFixed(1) let a = dataTable2[data.rowIndex][data.columnIndex + type] = Number(total).toFixed(3)
// console.log(indexParent); // console.log(indexParent);
return a return a
} }
...@@ -483,13 +492,13 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -483,13 +492,13 @@ export default class FixedAssetsMovementMR extends Component {
let total = 0 let total = 0
if (dex === 1) { if (dex === 1) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} else if (dex === 2) { } else if (dex === 2) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} else if (dex === 3) { } else if (dex === 3) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} }
return total return total
} }
...@@ -499,15 +508,15 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -499,15 +508,15 @@ export default class FixedAssetsMovementMR extends Component {
if (dex === 1) { if (dex === 1) {
// total = Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12]) // total = Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])
total = R.equals((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12]) total = R.equals((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][12])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} else if (dex === 2) { } else if (dex === 2) {
// total = Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8]) // total = Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])
total = R.equals((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8]) total = R.equals((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} else if (dex === 3) { } else if (dex === 3) {
// total = Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9]) // total = Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])
total = R.equals((Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9]) total = R.equals((Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])), NaN) ? '0' : R.equals((Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])), Infinity) ? '0' : Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(3)
} }
return total return total
} }
...@@ -625,7 +634,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -625,7 +634,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(1)} value={Number(tableMeta.rowData[6]).toFixed(3)}
/> />
} }
/> />
...@@ -638,7 +647,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -638,7 +647,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)} value={Number(handleFormula(value, tableMeta, 0)).toFixed(3)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
...@@ -649,7 +658,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -649,7 +658,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)} value={Number(handleFormula(value, tableMeta, 0)).toFixed(3)}
/> />
</span> : </span> :
null null
...@@ -669,7 +678,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -669,7 +678,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(value, tableMeta, 1)).toFixed(1)} value={Number(handleFormula(value, tableMeta, 1)).toFixed(3)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 3 ? tableMeta.rowData[0] === 3 ?
...@@ -684,7 +693,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -684,7 +693,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)} value={Number(tableMeta.rowData[7]).toFixed(3)}
/> />
} }
/> />
...@@ -710,7 +719,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -710,7 +719,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={false}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(3)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -726,8 +735,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -726,8 +735,8 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(handleValue(tableMeta, 2)).toFixed(1)} // value={Number(handleValue(tableMeta, 2)).toFixed(3)}
value={Number(handleFormula(value, tableMeta, 2)).toFixed(1)} value={Number(handleFormula(value, tableMeta, 2)).toFixed(3)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
...@@ -738,7 +747,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -738,7 +747,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(value, tableMeta, 2)).toFixed(1)} value={Number(handleFormula(value, tableMeta, 2)).toFixed(3)}
/> />
</span> : </span> :
null null
...@@ -773,7 +782,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -773,7 +782,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} value={Number(handleValue(tableMeta, 0)).toFixed(3)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 3 ? tableMeta.rowData[0] === 3 ?
...@@ -788,7 +797,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -788,7 +797,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(3)}
/> />
} }
/> />
...@@ -872,7 +881,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -872,7 +881,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
...@@ -896,7 +905,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -896,7 +905,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
...@@ -924,7 +933,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -924,7 +933,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
...@@ -948,7 +957,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -948,7 +957,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
...@@ -976,7 +985,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -976,7 +985,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
...@@ -1000,7 +1009,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1000,7 +1009,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleVariance(tableMeta, 1, 2)).toFixed(3)}
/> />
} }
/> />
......
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