+ Fix on date and while cancelling transaction
This commit is contained in:
parent
6b2e0af795
commit
6e4cd34390
|
@ -31,7 +31,7 @@ MAIL_FROM_ADDRESS=noreply@ilink-app.com
|
|||
MAIL_FROM_NAME="iLink World"
|
||||
MAIL_ENCRYPTION=tls
|
||||
|
||||
VISA_API_URL=localhost:8082
|
||||
VISA_API_URL=10.24.96.5:81
|
||||
VISA_API_USERNAME=admin
|
||||
VISA_API_PASSWORD=PasswordHere!
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ class TransactionController extends Controller
|
|||
{
|
||||
$transaction = WalletTransaction::findOrFail($id_transaction);
|
||||
$transactionInverse = new WalletTransaction;
|
||||
$transactionInverse->date = new \DateTime();
|
||||
$transactionInverse->date = $this->getCurrentTime($transaction->wallet->networks_agent->network->country_id);
|
||||
$transactionInverse->statut = $transaction->statut;
|
||||
$transactionInverse->montant = -$transaction->montant;
|
||||
$transactionInverse->numCarte = $transaction->numCarte;
|
||||
|
@ -249,6 +249,7 @@ class TransactionController extends Controller
|
|||
$transactionInverse->commission_sup = -$transaction->commission_sup;
|
||||
$transactionInverse->commission_hyp = -$transaction->commission_hyp;
|
||||
$transactionInverse->commission_banque = -$transaction->commission_banque;
|
||||
$transactionInverse->facade = $transaction->facade;
|
||||
$transactionInverse->type = $transaction->type;
|
||||
$transactionInverse->expiration_date = $transaction->expiration_date;
|
||||
|
||||
|
|
|
@ -164,15 +164,17 @@ class UserGroupController extends Controller
|
|||
if ($group->actif)
|
||||
return $this->errorResponse(trans('errors.group_already_active'));
|
||||
|
||||
$datetime = $this->getCurrentTimeByCountryCode($sponsor->network->country->code_country);;
|
||||
|
||||
++$group->nombre_validation;
|
||||
++$group->nombre_utilisateurs;
|
||||
if ($group->nombre_validation == 3) {
|
||||
$group->actif = true;
|
||||
$group->date_activation = new \DateTime();
|
||||
$group->date_activation = $datetime;
|
||||
}
|
||||
|
||||
$sponsor->group_id = $group->id;
|
||||
$sponsor->date_adhesion = $this->getCurrentTimeByCountryCode($sponsor->network->country->code_country);
|
||||
$sponsor->date_adhesion = $datetime;
|
||||
$sponsor->save();
|
||||
$group->save();
|
||||
$demande->statut = true;
|
||||
|
@ -594,8 +596,9 @@ ug.date_creation , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.cou
|
|||
$walletUser = WalletsUser::where('idUser', $request->id_user)->firstOrFail();
|
||||
|
||||
$montant_total = $demande_credit->montant + $demande_credit->frais + $demande_credit->taxe;
|
||||
$datetime = $this->getCurrentTimeByCountryCode($user->network->country->code_country);
|
||||
|
||||
$demande_credit->date_validation = new \DateTime();
|
||||
$demande_credit->date_validation = $datetime;
|
||||
$demande_credit->date_remboursement_prevu = $demande_credit->date_validation->modify('+' . $demande_credit->duree_mois . ' month');
|
||||
$demande_credit->etat = 'VALIDE';
|
||||
|
||||
|
@ -604,7 +607,7 @@ ug.date_creation , ug.createur , ug.sponsor1 , ug.sponsor2 , ug.sponsor3, ug.cou
|
|||
$walletHyper->balance_princ -= $demande_credit->montant;
|
||||
|
||||
$demande->statut = true;
|
||||
$demande->date_validation = $this->getCurrentTimeByCountryCode($user->network->country->code_country);
|
||||
$demande->date_validation = $datetime;
|
||||
$user->save();
|
||||
$walletUser->save();
|
||||
$walletHyper->save();
|
||||
|
|
|
@ -360,7 +360,6 @@ class iLinkTransactionController extends Controller
|
|||
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
$transaction->frais = $frais;
|
||||
$transaction->date = new \DateTime();
|
||||
$walletHyperviseur->save();
|
||||
$walletUser->save();
|
||||
$transaction->id_transaction = $this->getTransactionID();
|
||||
|
@ -558,7 +557,6 @@ class iLinkTransactionController extends Controller
|
|||
|
||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
$transaction->frais = $frais;
|
||||
$transaction->date = new \DateTime();
|
||||
$transaction->bank = $user->bank->operators_country->operator->nom;
|
||||
$transaction->country = $user->bank->network->country->name;
|
||||
$transaction->id_bank = $user->id_bank_country;
|
||||
|
@ -672,7 +670,6 @@ class iLinkTransactionController extends Controller
|
|||
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
$transaction->frais = $frais;
|
||||
$transaction->date = new \DateTime();
|
||||
$walletHyperviseur->save();
|
||||
$walletUser->save();
|
||||
$transaction->id_transaction = $this->getTransactionID();
|
||||
|
@ -1931,7 +1928,7 @@ class iLinkTransactionController extends Controller
|
|||
{
|
||||
$transaction = WalletIlinkTransaction::where('id_transaction', $id_transaction)->firstOrFail();
|
||||
$transactionInverse = $transaction->replicate();
|
||||
$transactionInverse->date = new \DateTime();
|
||||
$transactionInverse->date = $this->getCurrentTimeByCountryCode($transaction->country->code_country);
|
||||
$transactionInverse->montant = -$transaction->montant;
|
||||
$transactionInverse->montant_net = -$transaction->montant_net;
|
||||
$transactionInverse->montant_net_final_country = -$transaction->montant_net_final_country;
|
||||
|
|
|
@ -164,7 +164,7 @@ class WalletIlinkTransaction extends Model
|
|||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class, 'final_country');
|
||||
return $this->belongsTo(Country::class, 'init_country');
|
||||
}
|
||||
|
||||
public function wallet()
|
||||
|
|
Loading…
Reference in New Issue