Commit e24c6e5f authored by d.arizona's avatar d.arizona

dah semua

parent 7d6e8282
......@@ -452,7 +452,9 @@ export default class BudgetTahunan extends Component {
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// // console.log(this.props.location.state.rawData)
// console.log(this.state.lastPeriod)
console.log(this.state.lastPeriod)
console.log(periode)
console.log(index)
// console.log(periodeData)
// // // console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
......@@ -1158,7 +1160,8 @@ export default class BudgetTahunan extends Component {
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula,
item.profit_detail.notes
])
if (item.children !== null) {
......@@ -1196,7 +1199,8 @@ export default class BudgetTahunan extends Component {
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula,
item.profit_detail.notes
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -1206,7 +1210,7 @@ export default class BudgetTahunan extends Component {
}
}
})
// console.log(dataTable)
console.log(dataTable)
this.setState({ dbPL: dataTable, loading: false }, () => {
this.olahDataPL(this.state.dbPL, type)
})
......@@ -1545,7 +1549,7 @@ export default class BudgetTahunan extends Component {
"total_current_year": String(item[19]),
"total_next_year": String(item[20] != ''? Number(item[20]).toFixed(1) : item[20]),
"total_more_year": String(item[21] != ''? Number(item[21]).toFixed(1) : item[21]),
"notes": "",
"notes": String(item[26]),
}
)
......
......@@ -165,18 +165,18 @@ export default class SubHolding extends Component {
options: periodeData,
getOptionLabel: (option) => option.periode,
};
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear()
console.log(yearNow)
console.log(periode)
let index = data.sort((a, b) => a - b).findIndex((val) => val == String(this.state.report.label).toLocaleLowerCase().includes('summary') ? yearNow : periode)
let index = data.sort((a, b) => a - b).findIndex((val) => val == (String(this.state.report.label).toLocaleLowerCase().includes('summary') ? yearNow : periode))
// console.log(data)
// console.log(this.state.latestPeriode)
// console.log(periodeData)
// console.log(index)
console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
// this.getDataTable()
// this.getSubmission()
......@@ -266,6 +266,20 @@ export default class SubHolding extends Component {
}
getReportType() {
console.log('sini deh')
let data = this.state.listPeriode.options
let currentYear = new Date().getFullYear()
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
let index = data.sort((a, b) => a - b).findIndex((val) => val.periode == (String(this.state.report.label).toLocaleLowerCase().includes('summary') ? yearNow : periode))
// console.log(index)
this.setState({periode: data[index]})
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
......
......@@ -1467,6 +1467,7 @@ export default class MonthlyReport extends Component {
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order,
item.profit_detail.notes
])
}
if (item.children !== null) {
......@@ -1509,6 +1510,7 @@ export default class MonthlyReport extends Component {
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order,
item.profit_detail.notes
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -1768,12 +1770,14 @@ export default class MonthlyReport extends Component {
item[6].value = this.handleValueFormulaDBPLMR(item[6],item,6)
listPL.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1)
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1),
"notes": item[8]
})
} else {
listPL.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1)
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1),
"notes": item[8]
})
}
......
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