Commit 520b3fdd authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

Riri

See merge request !1463
parents 3e9838f2 f9dfdc90
...@@ -206,19 +206,18 @@ export default class BalanceSheetRO extends Component { ...@@ -206,19 +206,18 @@ export default class BalanceSheetRO extends Component {
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_last_year === "" ? "0" : item.balance_sheet.total_last_year, item.balance_sheet.total_last_year === "" ? "0" : item.balance_sheet.total_last_year,
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.january, formula: item.balance_sheet.january_formula } : Number(item.balance_sheet.january).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.january).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.january, formula: item.balance_sheet.january_formula } : Number(item.balance_sheet.january).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.february, formula: item.balance_sheet.february_formula } : Number(item.balance_sheet.february).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.february).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.february, formula: item.balance_sheet.february_formula } : Number(item.balance_sheet.february).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.march, formula: item.balance_sheet.march_formula } : Number(item.balance_sheet.march).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.march).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.march, formula: item.balance_sheet.march_formula } : Number(item.balance_sheet.march).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.april, formula: item.balance_sheet.april_formula } : Number(item.balance_sheet.april).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.april).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.april, formula: item.balance_sheet.april_formula } : Number(item.balance_sheet.april).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.may, formula: item.balance_sheet.may_formula } : Number(item.balance_sheet.may).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.may).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.may, formula: item.balance_sheet.may_formula } : Number(item.balance_sheet.may).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.june, formula: item.balance_sheet.june_formula } : Number(item.balance_sheet.june).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.june).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.june, formula: item.balance_sheet.june_formula } : Number(item.balance_sheet.june).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.july, formula: item.balance_sheet.july_formula } : Number(item.balance_sheet.july).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.july).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.july, formula: item.balance_sheet.july_formula } : Number(item.balance_sheet.july).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.august, formula: item.balance_sheet.august_formula } : Number(item.balance_sheet.august).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.august).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.august, formula: item.balance_sheet.august_formula } : Number(item.balance_sheet.august).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.september, formula: item.balance_sheet.september_formula } : Number(item.balance_sheet.september).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.september).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.september, formula: item.balance_sheet.september_formula } : Number(item.balance_sheet.september).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.october, formula: item.balance_sheet.october_formula } : Number(item.balance_sheet.october).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.october).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.october, formula: item.balance_sheet.october_formula } : Number(item.balance_sheet.october).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.november, formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.november).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.november, formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.december, formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.december, formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1),
item.balance_sheet.total_current_year === "" ? "0" : item.balance_sheet.total_current_year,
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong, item.condition_if_wrong,
...@@ -242,18 +241,18 @@ export default class BalanceSheetRO extends Component { ...@@ -242,18 +241,18 @@ export default class BalanceSheetRO extends Component {
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_last_year === "" ? "0" : item.balance_sheet.total_last_year, item.balance_sheet.total_last_year === "" ? "0" : item.balance_sheet.total_last_year,
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.january, formula: item.balance_sheet.january_formula } : Number(item.balance_sheet.january).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.january).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.january, formula: item.balance_sheet.january_formula } : Number(item.balance_sheet.january).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.february, formula: item.balance_sheet.february_formula } : Number(item.balance_sheet.february).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.february).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.february, formula: item.balance_sheet.february_formula } : Number(item.balance_sheet.february).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.march, formula: item.balance_sheet.march_formula } : Number(item.balance_sheet.march).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.march).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.march, formula: item.balance_sheet.march_formula } : Number(item.balance_sheet.march).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.april, formula: item.balance_sheet.april_formula } : Number(item.balance_sheet.april).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.april).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.april, formula: item.balance_sheet.april_formula } : Number(item.balance_sheet.april).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.may, formula: item.balance_sheet.may_formula } : Number(item.balance_sheet.may).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.may).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.may, formula: item.balance_sheet.may_formula } : Number(item.balance_sheet.may).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.june, formula: item.balance_sheet.june_formula } : Number(item.balance_sheet.june).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.june).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.june, formula: item.balance_sheet.june_formula } : Number(item.balance_sheet.june).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.july, formula: item.balance_sheet.july_formula } : Number(item.balance_sheet.july).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.july).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.july, formula: item.balance_sheet.july_formula } : Number(item.balance_sheet.july).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.august, formula: item.balance_sheet.august_formula } : Number(item.balance_sheet.august).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.august).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.august, formula: item.balance_sheet.august_formula } : Number(item.balance_sheet.august).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.september, formula: item.balance_sheet.september_formula } : Number(item.balance_sheet.september).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.september).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.september, formula: item.balance_sheet.september_formula } : Number(item.balance_sheet.september).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.october, formula: item.balance_sheet.october_formula } : Number(item.balance_sheet.october).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.october).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.october, formula: item.balance_sheet.october_formula } : Number(item.balance_sheet.october).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.november, formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.november).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.november, formula: item.balance_sheet.november_formula } : Number(item.balance_sheet.november).toFixed(1),
String(item.description).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.balance_sheet.december, formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1), this.props.status === 'CLOSED' ? Number(item.balance_sheet.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.balance_sheet.december, formula: item.balance_sheet.december_formula } : Number(item.balance_sheet.december).toFixed(1),
item.balance_sheet.total_current_year === "" ? "0" : item.balance_sheet.total_current_year, item.balance_sheet.total_current_year === "" ? "0" : item.balance_sheet.total_current_year,
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
...@@ -634,11 +633,19 @@ export default class BalanceSheetRO extends Component { ...@@ -634,11 +633,19 @@ export default class BalanceSheetRO extends Component {
const handleValue = (data) => { const handleValue = (data) => {
let total = 0 let total = 0
if (data.rowData[5] == "Cash and cash equivalent" && data.columnIndex == 19) {
console.log(data.rowData[19]);
}
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
// if (data.rowData[5] == 'Retained Earnings') { // if (data.rowData[5] == 'Retained Earnings') {
// console.log(item[data.columnIndex].value) // console.log(item[data.columnIndex].value)
// } // }
if (data.rowData[1] === item[2]) { if (data.rowData[1] === item[2]) {
if(item[data.columnIndex] == undefined ) {
console.log(item);
}
let itemVal = item[data.columnIndex].value !== undefined ? Number(item[data.columnIndex].value) : Number(item[data.columnIndex]) let itemVal = item[data.columnIndex].value !== undefined ? Number(item[data.columnIndex].value) : Number(item[data.columnIndex])
total = item[data.columnIndex] === undefined ? Number(total) + 0 : Number(total) + itemVal total = item[data.columnIndex] === undefined ? Number(total) + 0 : Number(total) + itemVal
} }
...@@ -676,7 +683,7 @@ export default class BalanceSheetRO extends Component { ...@@ -676,7 +683,7 @@ export default class BalanceSheetRO extends Component {
let total = 0 let total = 0
// console.log(tableMeta.rowData) // console.log(tableMeta.rowData)
console.log( dataTable2[tableMeta.rowIndex][23]) // console.log( dataTable2[tableMeta.rowIndex][23])
// console.log(total) // console.log(total)
// dataTable2[tableMeta.rowIndex][column] = total // dataTable2[tableMeta.rowIndex][column] = total
if (column == 19 && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)") { if (column == 19 && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)") {
...@@ -737,7 +744,7 @@ export default class BalanceSheetRO extends Component { ...@@ -737,7 +744,7 @@ export default class BalanceSheetRO extends Component {
} }
} else { } else {
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode)) let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
console.log(indexID) // console.log(indexID)
if (indexID !== -1) { if (indexID !== -1) {
// console.log(value.formula[indexID].value) // console.log(value.formula[indexID].value)
let valuezz = value.formula[indexID].value let valuezz = value.formula[indexID].value
...@@ -2322,7 +2329,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2322,7 +2329,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(val, tableMeta)).toFixed(1)} value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/> />
} }
/> />
......
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