public function __construct() { parent::__construct(); $this->startDate = $this->input('start_date', date('01-m-Y', strtotime('-1 month'))); $this->endDate = $this->input('end_date', date('t-m-Y', strtotime('-1 month'))); $this->currency = ModelSettings::getInstance()->getCurrency(); $this->organisations = ModelOrganisation::get(); }
public function __construct() { parent::__construct(); $this->settings = ModelSettings::getInstance(); $this->startDate = $this->input('start_date', date('01-m-Y', strtotime('-1 month'))); $this->endDate = $this->input('end_date', date('t-m-Y', strtotime('-1 month'))); $this->payments = ModelPayment::getByPeriod($this->startDate, $this->endDate); }
public function __construct($organisationId) { parent::__construct(); $this->organisation = ModelOrganisation::getById($organisationId); if (!$this->organisation->hasRow()) { $this->setError(lang('Organisation not found')); redirect(url('admin.payment')); } $this->startDate = $this->input('start_date', date('Y-m-01', strtotime('-1 month'))); $this->endDate = $this->input('end_date', date('Y-m-t', strtotime('-1 month'))); $this->settings = ModelSettings::getInstance(); $this->payments = ModelPayment::getByOrganisationPeriod($this->organisation->id, $this->startDate, $this->endDate); $this->chargeCustomer(); $this->markPayed(); }