Update insurance renew and pay message

This commit is contained in:
Djery-Tom 2022-05-04 16:57:05 +01:00
parent 26df499acd
commit 365121cea0
5 changed files with 14 additions and 7 deletions

View File

@ -584,6 +584,11 @@ class InsuranceController extends Controller
]);
$this->insuranceVerification($insurance);
$this->latestSubscriptionVerification($insurance->network_id, $insurance->user_id);
if (NhInsurancesInvoice::where('insurance_id', $id)->where('state', InsuranceInvoiceState::UNPAID)->count() > 0) {
return $this->errorResponse(trans('errors.unpaid_bill'));
}
try {
DB::beginTransaction();
$datetime = $this->getCurrentTimeByCountryCode($user->network->country->code_country);
@ -757,7 +762,7 @@ class InsuranceController extends Controller
'bonus_amount' => $this->toMoneyWithCurrencyCode($bonus_amount, $currency), 'total_bonus_amount' => $this->toMoneyWithCurrencyCode($total_bonus_amount, $currency), 'number_of_beneficiaries' => $insurance->number_of_beneficiaries,
'gender' => trans('states.' . $user->identification->gender), 'insurance_name' => $insurance->network->name, 'months' => $monthPrice->number_of_months])));
DB::commit();
return $this->successResponse(trans('messages.insurance_renew_paid'));
return $this->successResponse(trans('messages.insurance_renew_done'));
} catch (Throwable $e) {
Log::error($e->getMessage() . '\n' . $e->getTraceAsString());
DB::rollBack();

View File

@ -358,7 +358,7 @@ class InsuranceInvoiceController extends Controller
'start_at' => $invoice->insurance->start_at, 'payment_id' => $payment->payment_id
])));
DB::commit();
return $this->successResponse(trans('messages.insurance_invoice_paid'));
return $this->successResponse(trans('messages.insurance_invoice_paid', ['amount' => $this->toMoneyWithCurrencyCode($amountToPaid, $currency)]));
} catch (Throwable $e) {
Log::error($e->getMessage() . '\n' . $e->getTraceAsString());
DB::rollBack();

View File

@ -17,7 +17,9 @@
"illuminate/mail": "^8.80",
"kitloong/laravel-migrations-generator": "^5.0",
"laravel/lumen-framework": "^8.0",
"sentry/sentry-laravel": "^2.9"
"sentry/sentry-laravel": "^2.9",
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^2.3"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",

View File

@ -172,7 +172,7 @@ Your insurance has been renewed.
- Number of beneficiaries : :number_of_beneficiaries
- Number of months: :months
",
'insurance_renew_paid' => "Insurance renewal paid",
'insurance_renew_done' => "Insurance renewal done",
"invoice_generated" => "Invoice has been generated",
'insurance_expired' => "Insurance expired",
'insurance_expired_mail' => ":gender :name ,
@ -219,7 +219,7 @@ Your insurance has expired.
'insurance_payment_reminder_title' => "Your invoice number :invoice_id has not been paid for :n_reminder days .in :n_suspension days your insurance will be suspended",
'insurance_payment_suspended' => "Insurance suspended",
'insurance_payment_suspended_title' => 'You have an outstanding payment',
'insurance_invoice_paid' => "Insurance invoice paid",
'insurance_invoice_paid' => "Receipt of: amount recorded",
'none' => "None",
'n_days' => ":n days",
'insurance_invoice_generated_title' => "Your insurance invoice issued",

View File

@ -189,7 +189,7 @@ Votre assurance a été renouvelée.
- Nombre d'ayants droit : :number_of_beneficiaries
- Nombre de mois : :months
",
'insurance_renew_paid' => "Renouvellement de l'assurance payée",
'insurance_renew_done' => "Renouvellement de l'assurance effectuée",
"invoice_generated" => "La facture a été générée",
'insurance_expired' => "Assurance arrivée à échéance",
'insurance_expired_mail' => ":gender :name ,
@ -236,7 +236,7 @@ Votre assurance est arrivée à échéance.
'insurance_payment_reminder_title' => "Votre facture numéro :invoice_id n'est pas réglée depuis :n_reminder jours .\nDans :n_suspension jours votre assurance sera suspendue",
'insurance_payment_suspended' => "Assurance suspendue",
'insurance_payment_suspended_title' => 'Vous avez un paiement non effectué',
'insurance_invoice_paid' => "Facture de l'assurance payée",
'insurance_invoice_paid' => "Encaissement de :amount enregistré",
'none' => "Aucun",
'n_days' => ":n jours",
'insurance_invoice_generated_title' => "Facture de votre assurance émise",