some stan
This commit is contained in:
@@ -31,14 +31,5 @@ class ListCardOrders extends ListRecords
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
return [
|
||||
null => Tab::make('All'),
|
||||
'new' => Tab::make()->query(fn ($query) => $query->where('status', 'new')),
|
||||
'processing' => Tab::make()->query(fn ($query) => $query->where('status', 'processing')),
|
||||
'shipped' => Tab::make()->query(fn ($query) => $query->where('status', 'shipped')),
|
||||
'delivered' => Tab::make()->query(fn ($query) => $query->where('status', 'delivered')),
|
||||
'cancelled' => Tab::make()->query(fn ($query) => $query->where('status', 'cancelled')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,11 @@ class VisaMasterPaymentOrderResource extends Resource
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the query for the record route binding
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder<\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder>
|
||||
*/
|
||||
public static function getRecordRouteBindingEloquentQuery(): Builder
|
||||
{
|
||||
return parent::getRecordRouteBindingEloquentQuery()
|
||||
|
||||
@@ -22,11 +22,13 @@ class CurrencyRate extends Model
|
||||
|
||||
/**
|
||||
* Get the user's first name.
|
||||
*
|
||||
* @return Attribute<string, void>
|
||||
*/
|
||||
protected function name(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => $this->currency_from.'-'.$this->currency_to,
|
||||
get: fn (): string => $this->currency_from.'-'.$this->currency_to,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class OnlinePaymentRepository
|
||||
/**
|
||||
* Online payment
|
||||
*/
|
||||
protected ?OnlinePayment $onlinePayment;
|
||||
protected OnlinePayment $onlinePayment;
|
||||
|
||||
/**
|
||||
* If payment is successful
|
||||
@@ -117,7 +117,7 @@ class OnlinePaymentRepository
|
||||
/**
|
||||
* Online payment
|
||||
*/
|
||||
public function onlinePayment(): ?OnlinePayment
|
||||
public function onlinePayment(): OnlinePayment
|
||||
{
|
||||
return $this->onlinePayment;
|
||||
}
|
||||
|
||||
@@ -74,17 +74,18 @@ class PayVisaMasterPaymentAction
|
||||
->helperText(sprintf('Iň ýokary möçberi: %s TMT', $max_value))
|
||||
->live()
|
||||
->afterStateUpdated(function (Set $set, ?string $state) use ($usd_to_tmt, $bankFee, $gbusFee) {
|
||||
if (! $state || $state === 0 || $state === '') {
|
||||
if (is_null($state) || $state == 0 || $state == '') {
|
||||
$set('usd_rate', '');
|
||||
|
||||
return;
|
||||
}
|
||||
$state = floatval($state);
|
||||
|
||||
$usd_rate = floatval(number_format($state / $usd_to_tmt, 2, '.', ''));
|
||||
$total_amount = floatval(number_format($state, 2, '.', '')) + $bankFee + $gbusFee;
|
||||
$usd_rate = $state / $usd_to_tmt;
|
||||
$total_amount = $state + $bankFee + $gbusFee;
|
||||
|
||||
$set('usd_rate', $usd_rate);
|
||||
$set('total_amount', $total_amount);
|
||||
$set('usd_rate', number_format($usd_rate, 2, '.', ''));
|
||||
$set('total_amount', number_format($total_amount, 2, '.', ''));
|
||||
}),
|
||||
|
||||
TextInput::make('usd_rate')
|
||||
|
||||
@@ -21,9 +21,9 @@ use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
* @property string $email
|
||||
* @property string $region
|
||||
* @property string $address
|
||||
* @property array $sender_datas
|
||||
* @property array $payment_reciever
|
||||
* @property array $documents
|
||||
* @property array<string, string> $sender_datas
|
||||
* @property array<string, string> $payment_reciever
|
||||
* @property array<string, string> $documents
|
||||
* @property string $status
|
||||
* @property string $notes
|
||||
* @property string $sender_full_name
|
||||
@@ -77,7 +77,7 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @return BelongsTo<User, VisaMasterPaymentOrder>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -87,7 +87,7 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
/**
|
||||
* Branch
|
||||
*
|
||||
* @return BelongsTo<Branch, VisaMasterPaymentOrder>
|
||||
* @return BelongsTo<Branch, $this>
|
||||
*/
|
||||
public function branch(): BelongsTo
|
||||
{
|
||||
@@ -97,7 +97,7 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
/**
|
||||
* Payment itmes
|
||||
*
|
||||
* @return HasMany<VisaMasterPaymentOrderItem, self>
|
||||
* @return HasMany<VisaMasterPaymentOrderItem, $this>
|
||||
*/
|
||||
public function paymentItems(): HasMany
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class VisaMasterPaymentOrderItem extends Model
|
||||
/**
|
||||
* Parent order
|
||||
*
|
||||
* @return BelongsTo<VisaMasterPaymentOrder, self>
|
||||
* @return BelongsTo<VisaMasterPaymentOrder, $this>
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
@@ -48,7 +48,7 @@ class VisaMasterPaymentOrderItem extends Model
|
||||
/**
|
||||
* Online payment
|
||||
*
|
||||
* @return BelongsTo<OnlinePayment, self>
|
||||
* @return BelongsTo<OnlinePayment, $this>
|
||||
*/
|
||||
public function onlinePayment(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -16,17 +16,17 @@ class VisaMasterPaymentOrderRepository
|
||||
/**
|
||||
* Bank fee
|
||||
*/
|
||||
public int|string|float $bankFee = 20;
|
||||
public int|float $bankFee = 20;
|
||||
|
||||
/**
|
||||
* Gbus fee
|
||||
*/
|
||||
public int|string|float $gbusFee = 3;
|
||||
public int|float $gbusFee = 3;
|
||||
|
||||
/**
|
||||
* Bank fee
|
||||
*/
|
||||
public function bankFee(): int|string|float
|
||||
public function bankFee(): int|float
|
||||
{
|
||||
return $this->bankFee;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class VisaMasterPaymentOrderRepository
|
||||
/**
|
||||
* Gbus fee
|
||||
*/
|
||||
public function gbusFee(): int|string|float
|
||||
public function gbusFee(): int|float
|
||||
{
|
||||
return $this->gbusFee;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user