diff --git a/app/Nova/Actions/MakeSberPaymentAction.php b/app/Nova/Actions/MakeSberPaymentAction.php index a475268..ca2775d 100644 --- a/app/Nova/Actions/MakeSberPaymentAction.php +++ b/app/Nova/Actions/MakeSberPaymentAction.php @@ -64,19 +64,21 @@ class MakeSberPaymentAction extends Action public function fields(NovaRequest $request) { $usd_to_tmt = CurrencyRate::where('currency_from', 'USD')->where('currency_to', 'TMT')->first('value'); + $usd_to_rub = CurrencyRate::where('currency_from', 'USD')->where('currency_to', 'RUB')->first('value'); + $rub_to_tmt = CurrencyRate::where('currency_from', 'RUB')->where('currency_to', 'TMT')->first('value'); - if (! $usd_to_tmt) { + if (! $usd_to_tmt || ! $usd_to_rub || ! $rub_to_tmt) { return []; } - $max_value = number_format(96.05 * 250 * 0.036621, 2, '.', ''); + $max_value = number_format($usd_to_rub * 250 * $rub_to_tmt, 2, '.', ''); $tvebTaxTMT = $usd_to_tmt->value * 18; $bankTax = 120.75; return [ Heading::make(Blade::render(<<1 USD = $usd_to_tmt->value TMT -