stan errors

This commit is contained in:
2025-03-13 17:12:22 +05:00
parent d85fca1f09
commit 744cbf29f2

View File

@@ -2,6 +2,7 @@
namespace App\Modules\SberPaymentOrder\Nova\Resources\Concerns; namespace App\Modules\SberPaymentOrder\Nova\Resources\Concerns;
use App\Modules\SberPaymentOrder\Nova\Resources\NovaSberPaymentOrder;
use App\Nova\Resources\Branch\Branch; use App\Nova\Resources\Branch\Branch;
use App\Repos\Order\OrderRepo; use App\Repos\Order\OrderRepo;
use App\Repos\System\Settings\Location\RegionRepo; use App\Repos\System\Settings\Location\RegionRepo;
@@ -17,7 +18,7 @@ class SberPaymentOrderFieldsForIndex
/** /**
* Loan Order fields for "create" * Loan Order fields for "create"
*/ */
public static function make($resource): array public static function make(NovaSberPaymentOrder $resource): array
{ {
return [ return [
ID::make()->hide(), ID::make()->hide(),
@@ -63,13 +64,16 @@ class SberPaymentOrderFieldsForIndex
/** /**
* Paid field * Paid field
*/ */
public static function paidField($resource, $date = null) public static function paidField(NovaSberPaymentOrder $resource, ?string $date = null): string
{ {
$paid = false; /** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrder */
$items = $resource->paymentItems; $model = $resource->model();
$items = $model->paymentItems;
$month = $date ?: date('m'); $month = $date ?: date('m');
$paid = false;
foreach ($items as $item) { foreach ($items as $item) {
if (boolval($item->paid)) { if (boolval($item->paid)) {
if ($item->created_at->format('m') == $month) { if ($item->created_at->format('m') == $month) {