add goyum hasaby
This commit is contained in:
@@ -53,6 +53,31 @@ class SberPaymentOrderFieldsForIndex
|
||||
->withIcons()
|
||||
->icons(OrderRepo::statusIcons())
|
||||
->sortable(),
|
||||
|
||||
Text::make(sprintf('%s (%s)', __('Paid'), __('This month')), function () use ($resource) {
|
||||
return static::paidField($resource, $resource->filter_month);
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Paid field
|
||||
*/
|
||||
public static function paidField($resource, $date = null)
|
||||
{
|
||||
$paid = false;
|
||||
$items = $resource->paymentItems;
|
||||
|
||||
$month = $date ?: date('m');
|
||||
|
||||
foreach ($items as $item) {
|
||||
if (boolval($item->paid)) {
|
||||
if ($item->created_at->format('m') == $month) {
|
||||
$paid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $paid ? 'Tölenen' : 'Tölenmedik';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user