Fix payment entry
This commit is contained in:
@@ -57,7 +57,7 @@ final class PaymentsImport implements ShouldQueue
|
||||
}
|
||||
|
||||
// Find the last payment logged
|
||||
$last = Carbon::createFromTimestamp(Payment::whereIN('checkout_id',$cos)->where('account_id',$ao->id)->max('payment_date'));
|
||||
$last = Carbon::createFromTimestamp(Payment::whereIN('checkout_id',$cos)->where('account_id',$ao->id)->max('paid_at'));
|
||||
|
||||
$o = $this->o->getDebits([
|
||||
'customerId'=>$c->Id,
|
||||
@@ -79,7 +79,7 @@ final class PaymentsImport implements ShouldQueue
|
||||
|
||||
$lp = $ao->payments->last();
|
||||
|
||||
if ($lp AND (($pd == $lp->payment_date) OR ($p->Id == $lp->checkout_data))) {
|
||||
if ($lp AND (($pd == $lp->paid_at) OR ($p->Id == $lp->checkout_data))) {
|
||||
Log::alert(sprintf('%s:Payment Already Recorded: [%s] %s %s (%s)',self::LOGKEY,$pd->format('Y-m-d'),$ao->id,$p->Id,$p->Amount));
|
||||
continue;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ final class PaymentsImport implements ShouldQueue
|
||||
// New Payment
|
||||
$po = new Payment;
|
||||
$po->site_id = 1; // @todo
|
||||
$po->payment_date = $pd;
|
||||
$po->paid_at = $pd;
|
||||
$po->checkout_id = '999'; // @todo
|
||||
$po->checkout_data = $p->Id;
|
||||
$po->total_amt = $p->Amount;
|
||||
|
Reference in New Issue
Block a user