Update checkout, enable editing of checkout, show details on invoices
This commit is contained in:
@@ -2,33 +2,43 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
class Checkout extends Model
|
||||
{
|
||||
protected $table = 'ab_checkout';
|
||||
public $timestamps = FALSE;
|
||||
use ScopeActive;
|
||||
|
||||
protected $casts = [
|
||||
'plugin_data'=>'json',
|
||||
];
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function payments()
|
||||
{
|
||||
return $this->hasMany(Payment::class);
|
||||
}
|
||||
|
||||
/** SCOPES **/
|
||||
/* STATIC METHODS */
|
||||
|
||||
/**
|
||||
* Search for a record
|
||||
*
|
||||
* @param $query
|
||||
* @param string $term
|
||||
* @return
|
||||
*/
|
||||
public function scopeActive($query)
|
||||
public static function available(): Collection
|
||||
{
|
||||
return $query->where('active',TRUE);
|
||||
return self::active()->get();
|
||||
}
|
||||
|
||||
/** FUNCTIONS **/
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getIconAttribute(): string
|
||||
{
|
||||
switch(strtolower($this->name)) {
|
||||
case 'paypal': return 'fab fa-cc-paypal';
|
||||
default: return 'fas fa-money-bill-alt';
|
||||
}
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
public function fee(float $amt,int $items=1): float
|
||||
{
|
||||
|
@@ -109,7 +109,7 @@ class Invoice extends Model implements IDs
|
||||
private int $_total = 0;
|
||||
private int $_total_tax = 0;
|
||||
|
||||
/* STATIC */
|
||||
/* STATIC METHODS */
|
||||
|
||||
/**
|
||||
* This works out what multiplier to use to change billing periods
|
||||
|
@@ -17,7 +17,7 @@ class SSL extends Type
|
||||
protected $public_key = NULL;
|
||||
protected $crt_parse = NULL;
|
||||
|
||||
/* STATIC */
|
||||
/* STATIC METHODS */
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
|
Reference in New Issue
Block a user