Commit 303907e6 authored by Riri Novita's avatar Riri Novita

apdet

parent 6ab465fa
...@@ -192,7 +192,7 @@ export default class SubHolding extends Component { ...@@ -192,7 +192,7 @@ export default class SubHolding extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriod(this.state.company.company_id).then(response => { api.create().getLastPeriod(this.state.company.company_id).then(response => {
// console.log(response); console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -229,7 +229,8 @@ export default class SubHolding extends Component { ...@@ -229,7 +229,8 @@ export default class SubHolding extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod) console.log(this.state.lastPeriod)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.latestPeriode)
let dateNow = new Date() let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1); dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear() let yearNow = dateNow.getFullYear()
......
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