Optimise charge table, implemented charge recording, optimised payment recording

This commit is contained in:
Deon George
2021-10-01 14:59:04 +10:00
parent c0ad46ba65
commit 7c5369203c
17 changed files with 731 additions and 48 deletions

View File

@@ -3,11 +3,11 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Interfaces\IDs;
use Illuminate\Support\Facades\DB;
use Leenooks\Traits\ScopeActive;
use App\Traits\{NextKey,PushNew};
use App\Interfaces\IDs;
use App\Traits\PushNew;
/**
* Class Payment
@@ -74,7 +74,6 @@ class Payment extends Model implements IDs
public function scopeUnapplied($query)
{
//DB::enableQueryLog();
return $query
->select(['payments.id','payment_date','account_id','checkout_id','total_amt',DB::raw("SUM(alloc_amt) as allocated")])
->leftJoin('payment_items',['payment_items.payment_id'=>'payments.id'])