Account next invoice, and authorisations

This commit is contained in:
Deon George
2019-07-04 14:55:05 +10:00
parent 59a8ef2476
commit 21ea60c4f9
26 changed files with 532 additions and 102 deletions

View File

@@ -79,7 +79,7 @@ class Product extends Model
private function getDefaultLanguage()
{
return config('SITE_SETUP')->language();
return config('SITE_SETUP')->language;
}
public function getDescriptionAttribute()
@@ -179,9 +179,21 @@ class Product extends Model
}
}
/**
* Get the price for this product based on the period being requested.
*
* If the price period doesnt exist, we'll take the default period (0) which should.
*
* @param int $period
* @return mixed
*/
public function price(int $period)
{
return Arr::get($this->price_array,sprintf('%s.1.price_base',$period));
return Arr::get(
$this->price_array,
sprintf('%s.1.price_base',$period),
Arr::get($this->price_array,sprintf('%s.0.price_base',$period))
);
}
public function PricePeriods()