From d9d0426ada13ac80fb76cfd1d4a655151c76f20c Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Fri, 3 Jul 2020 18:26:59 +0100 Subject: [PATCH] + Fix bug on currency in calculator --- application/views/calculator.php | 14 +++++++------- .../views/historique_transactions_ilink.php | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/application/views/calculator.php b/application/views/calculator.php index a5b5abc8..e938ba28 100755 --- a/application/views/calculator.php +++ b/application/views/calculator.php @@ -11,7 +11,7 @@ use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration; use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider; use Brick\Math\RoundingMode; use Brick\Money\Money; - +$context = new \Brick\Money\Context\AutoContext(); extract($_POST); //$showResult = false; @@ -383,14 +383,14 @@ $converter = new CurrencyConverter($provider);
currency_code); - $money2 = Money::of(round(@$montant - @$frais - @$taxe, 0), @$d->currency_code); - $money3 = Money::of(round(@$montant - @$frais - @$taxe, 0), @$d->currency_code); - $moneyTaxe = Money::of(round(@$taxe, 0), @$d->currency_code); + $money = Money::of(round(@$montant,2), @$d->currency_code,$context); + $money2 = Money::of(round(@$montant - @$frais - @$taxe, 2), @$d->currency_code,$context); + $money3 = Money::of(round(@$montant - @$frais - @$taxe, 2), @$d->currency_code,$context); + $moneyTaxe = Money::of(round(@$taxe, 2), @$d->currency_code,$context); $money2 = $converter->convert($money2, @$f->currency_code, RoundingMode::DOWN); $money3 = $converter->convert($money3, @$d->currency_code, RoundingMode::DOWN); - $moneyFrais = Money::of(round(@$frais, 0), @$d->currency_code); - $moneyTotalTaxe = Money::of(round(@$frais + @$taxe, 0), @$d->currency_code); + $moneyFrais = Money::of(round(@$frais, 2), @$d->currency_code,$context); + $moneyTotalTaxe = Money::of(round(@$frais + @$taxe, 2), @$d->currency_code,$context); ?>
diff --git a/application/views/historique_transactions_ilink.php b/application/views/historique_transactions_ilink.php index 70373352..abcf2f24 100755 --- a/application/views/historique_transactions_ilink.php +++ b/application/views/historique_transactions_ilink.php @@ -166,6 +166,11 @@ use Brick\Money\Money; $destinataire = ($row->id_destinataire ? $row->id_destinataire.' | ' : '').($row->nom_destinataire ? $row->nom_destinataire : '').(' '.$row->prenom_destinataire? $row->prenom_destinataire : ''); } + if($row->user_phone){ + $emetteur = $row->user_phone.' | '.$row->user; + }else{ + $emetteur = ($row->nom_emetteur? $row->nom_emetteur : '').(' '.$row->prenom_emetteur ? $row->prenom_emetteur : ''); + } $moneyNetFinal =Money::of(round($row->montant_net_final_country,2),$row->final_currency ? $row->final_currency : 'XAF',$context); echo " $row->id_transaction @@ -183,7 +188,7 @@ use Brick\Money\Money; ".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$context)->formatTo('fr_FR')." ".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')." ".$row->agent." - ".$row->user_phone.' | '.$row->user." + ".$emetteur." ".$destinataire." ".toLocateDate($row->date,$this->session->userdata('timezone')).""; ?>