public function getLastPeriodOfFiscalYear(array $input)
  {
    $period = $this->Period->lastPeriodbyOrganizationAndByFiscalYear($this->AuthenticationManager->getCurrentUserOrganizationId(), $input['id'])->toArray();

    $period['endDate'] = $this->Carbon->createFromFormat('Y-m-d', $period['end_date'])->format($this->Lang->get('form.phpShortDateFormat'));
    unset($period['end_date']);
    $period['month'] = $period['month'] . ' - ' . $this->Lang->get('decima-accounting::period-management.' . $period['month']);

    return json_encode($period);
  }
public function getLastPeriodOfFiscalYear(array $input)
  {
    $period = $this->Period->lastPeriodbyOrganizationAndByFiscalYear($this->AuthenticationManager->getCurrentUserOrganizationId(), $input['id'])->toArray();

    $period['endDate'] = $this->Carbon->createFromFormat('Y-m-d', $period['end_date'])->format($this->Lang->get('form.phpShortDateFormat'));
    unset($period['end_date']);
    $period['month'] = $period['month'] . ' - ' . $this->Lang->get('decima-accounting::period-management.' . $period['month']);

    return json_encode($period);
  }
public function getLastPeriodOfFiscalYear ( array $ input ) { $ period = $ this -> Period -> lastPeriodbyOrganizationAndByFiscalYear ( $ this -> AuthenticationManager -> getCurrentUserOrganizationId ( ) , $ input [ 'id' ] ) -> toArray ( ) ; $ period [ 'endDate' ] = $ this -> Carbon -> createFromFormat ( 'Y-m-d' , $ period [ 'end_date' ] ) -> format ( $ this -> Lang -> get ( 'form.phpShortDateFormat' ) ) ; unset ( $ period [ 'end_date' ] ) ; $ period [ 'month' ] = $ period [ 'month' ] . ' - ' . $ this -> Lang -> get ( 'decima-accounting::period-management.' . $ period [ 'month' ] ) ; return json_encode ( $ period ) ; }
Get last period of fiscal year

@param array $input
An array as follows: array(id => $id);

@return array
An array as follows: array( 'id' = $id, 'month' => $month, 'end_date' => $endDate)
Get last period of fiscal year