+ Fix bug

This commit is contained in:
Djery-Tom 2020-07-09 19:43:47 +01:00
parent 39981f3d1c
commit 36e42fd176
1 changed files with 6 additions and 1 deletions

View File

@ -575,6 +575,7 @@ class iLinkTransactionController extends Controller
if (!$expiration_date) if (!$expiration_date)
$expiration_date = new \DateTime(); $expiration_date = new \DateTime();
$transaction->expiration_date = $expiration_date; $transaction->expiration_date = $expiration_date;
$transaction->final_country = $init_country;
$frais = floatval($request->montant * $config->taux_com_wallet_ag_carte_cash / 100); $frais = floatval($request->montant * $config->taux_com_wallet_ag_carte_cash / 100);
$montantRetrait = $transaction->montant - $frais; $montantRetrait = $transaction->montant - $frais;
@ -747,6 +748,7 @@ class iLinkTransactionController extends Controller
if (!$expiration_date) if (!$expiration_date)
$expiration_date = new \DateTime(); $expiration_date = new \DateTime();
$transaction->expiration_date = $expiration_date; $transaction->expiration_date = $expiration_date;
$transaction->final_country = $init_country;
$frais = $request->montant * $config->taux_com_wallet_ag_envoi_cash_carte / 100; $frais = $request->montant * $config->taux_com_wallet_ag_envoi_cash_carte / 100;
$montantDepot = $transaction->montant - $frais; $montantDepot = $transaction->montant - $frais;
@ -921,6 +923,8 @@ class iLinkTransactionController extends Controller
ORDER BY wit.date DESC LIMIT 10;', ['id_wallet' => $id_wallet_agent]); ORDER BY wit.date DESC LIMIT 10;', ['id_wallet' => $id_wallet_agent]);
foreach ($transactions as $data){ foreach ($transactions as $data){
$date = $data->date;
unset($data->date);
$wallet_user = isset($data->id_wallet_user) ? WalletsUser::findOrFail($data->id_wallet_user) : null ; $wallet_user = isset($data->id_wallet_user) ? WalletsUser::findOrFail($data->id_wallet_user) : null ;
$emetteur = $wallet_user ? $wallet_user->user->lastname.' '.$wallet_user->user->firstname : $data->prenom_emetteur . ' ' . $data->nom_emetteur; $emetteur = $wallet_user ? $wallet_user->user->lastname.' '.$wallet_user->user->firstname : $data->prenom_emetteur . ' ' . $data->nom_emetteur;
$destinataire = in_array($data->type,[12]) ? $emetteur : $data->prenom_destinataire . ' ' . $data->nom_destinataire; $destinataire = in_array($data->type,[12]) ? $emetteur : $data->prenom_destinataire . ' ' . $data->nom_destinataire;
@ -932,7 +936,8 @@ class iLinkTransactionController extends Controller
$data->montant = $this->toMoney($data->montant, $data->init_country); $data->montant = $this->toMoney($data->montant, $data->init_country);
$data->init_country = $this->getCountryName($data->init_country); $data->init_country = $this->getCountryName($data->init_country);
$data->final_country = $this->getCountryName($data->final_country); $data->final_country = $this->getCountryName($data->final_country);
$data->reseau_payeur = isset($data->network_destinataire) ? $this->getNetworkName($data->network_destinataire) : null; $data->reseau_payeur = isset($data->network_destinataire) ? $this->getNetworkName($data->network_destinataire).' '.$data->final_country : null;
$data->date = $date;
unset($data->type, $data->id_wallet_user, $data->network_destinataire,$data->nom_destinataire, $data->prenom_destinataire ,$data->taxe, unset($data->type, $data->id_wallet_user, $data->network_destinataire,$data->nom_destinataire, $data->prenom_destinataire ,$data->taxe,
$data->montant_net_final_country, $data->montant_net,$data->nom_emetteur, $data->prenom_emetteur); $data->montant_net_final_country, $data->montant_net,$data->nom_emetteur, $data->prenom_emetteur);
} }