Replace direct calls to Carbon class.

This commit is contained in:
James Cole
2023-02-11 07:36:45 +01:00
parent 79e98cf8a2
commit c979cfcd89
44 changed files with 137 additions and 103 deletions

View File

@@ -158,7 +158,7 @@ trait ConvertsExchangeRates
private function convertAmount(string $amount, TransactionCurrency $from, TransactionCurrency $to, ?Carbon $date = null): string
{
Log::debug(sprintf('Converting %s from %s to %s', $amount, $from->code, $to->code));
$date = $date ?? Carbon::now();
$date = $date ?? today(config('app.timezone'));
$rate = $this->getRate($from, $to, $date);
return bcmul($amount, $rate);