From f47029ca78e74386c56777df3e779d47aede9337 Mon Sep 17 00:00:00 2001 From: Mohit Panjwani Date: Wed, 3 Feb 2021 14:25:05 +0530 Subject: [PATCH] fix payment invalid-number issue --- app/Models/Payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 1c485663..2f8640cd 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -268,7 +268,7 @@ class Payment extends Model implements HasMedia { // Get the last created order $payment = Payment::where('payment_number', 'LIKE', $value . '-%') - ->orderBy('created_at', 'desc') + ->orderBy('payment_number', 'desc') ->first(); if (!$payment) { // We get here if there is no order at all