From 8e4bb0c2f6e53d24532b55866f899e97aab8e689 Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Wed, 1 Apr 2020 15:35:11 +0200 Subject: [PATCH] register, Grundpreis --- .env | 5 +- .idea/workspace.xml | 82 +++--- app/Http/Controllers/Api/PayoneController.php | 10 +- app/Http/Controllers/CronController.php | 187 +++++++++++- app/Http/Controllers/LeadController.php | 2 +- app/Http/Controllers/Pay/PayoneController.php | 5 +- .../Controllers/Sys/AdminToolsController.php | 34 ++- .../Controllers/Web/CheckoutController.php | 2 + .../Controllers/Web/RegisterController.php | 1 + app/Http/Controllers/WizardController.php | 1 - app/Mail/MailCustomMessage.php | 44 +-- app/Models/Product.php | 103 ++++--- app/Models/UserHistory.php | 8 + app/Services/Util.php | 2 +- app/User.php | 8 +- config/logging.php | 4 + config/mivita.php | 5 +- ...018_10_21_164001_create_products_table.php | 3 + resources/lang/de/email.php | 2 +- resources/lang/de/membership.php | 17 ++ resources/lang/de/reminder.php | 62 ++++ resources/views/admin/product/form.blade.php | 93 +++--- resources/views/admin/product/index.blade.php | 10 +- resources/views/emails/auth.blade.php | 22 +- resources/views/emails/custom.blade.php | 268 ++++++++++++++++++ resources/views/home.blade.php | 58 ++-- .../layouts/includes/layout-sidenav.blade.php | 3 + resources/views/sys/admin/cronjobs.blade.php | 50 ++++ .../user/membership/_abo_options.blade.php | 2 +- .../user/membership/_payment_order.blade.php | 2 +- .../views/user/membership/index.blade.php | 79 +++--- routes/web.php | 7 +- 32 files changed, 965 insertions(+), 216 deletions(-) create mode 100644 resources/lang/de/membership.php create mode 100644 resources/lang/de/reminder.php create mode 100644 resources/views/emails/custom.blade.php create mode 100644 resources/views/sys/admin/cronjobs.blade.php diff --git a/.env b/.env index 504cd98..3ef57d3 100644 --- a/.env +++ b/.env @@ -64,4 +64,7 @@ MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" MIVITA_RENEWAL_DAYS=29 -MIVITA_ABO_BOOKING_DAYS=14 +MIVITA_REMIND_FIRST_DAYS=21 +MIVITA_REMIND_SEC_DAYS=14 +MIVITA_ABO_BOOKING_DAYS=7 +MIVITA_REMIND_LAST_DAYS=2 \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 87eb13c..9ad240b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,52 +2,37 @@ - - - - + + + + - - + + + + + - - + + - - - - + + + + - - - - + + - - - + - - - - - - - - - - - - - - - - - - - - - @@ -284,6 +262,13 @@ + + + + + + + @@ -440,6 +425,11 @@ + + + + + @@ -482,11 +472,12 @@ - + + @@ -495,20 +486,23 @@ - + - + + - + + + diff --git a/app/Http/Controllers/Api/PayoneController.php b/app/Http/Controllers/Api/PayoneController.php index 059e7a4..09b49ec 100755 --- a/app/Http/Controllers/Api/PayoneController.php +++ b/app/Http/Controllers/Api/PayoneController.php @@ -141,11 +141,16 @@ class PayoneController extends Controller foreach($shopping_order->shopping_order_items as $shopping_order_item){ if($shopping_order_item->product){ if($shopping_order_item->product->action){ - $user = User::findOrFail($shopping_order->auth_user_id); $user->save(); $send_link = true; - $date = date("Y-m-d H:i:s", strtotime("+1 years")); + + //new date + $date = \Carbon::now()->modify('1 year'); + if($user->payment_account && $user->daysActiveAccount()>0){ + $date = \Carbon::parse($user->payment_account)->modify('1 year'); + } + foreach ($shopping_order_item->product->action as $do){ if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){ $user->payment_order_id = $shopping_order_item->product->id; //34 @@ -167,7 +172,6 @@ class PayoneController extends Controller } $user->payment_shop = $user->payment_account; //same Date, is upgrade $shopping_order->setUserHistoryValue(['status' => 9]); - } $user->save(); } diff --git a/app/Http/Controllers/CronController.php b/app/Http/Controllers/CronController.php index e38eea4..0f74f7b 100644 --- a/app/Http/Controllers/CronController.php +++ b/app/Http/Controllers/CronController.php @@ -2,9 +2,13 @@ namespace App\Http\Controllers; +use App\Mail\MailCustomMessage; use App\Mail\MailVerifyAccount; +use App\Models\UserHistory; +use App\Models\UserMessage; use App\Repositories\UserRepository; use App\User; +use Carbon; use Illuminate\Support\Facades\Mail; @@ -34,6 +38,15 @@ class CronController extends Controller //Mail reminder } + public function action($action = false, $key = false){ + + if($key !== 'key'){ + abort(404); + } + if($action === 'check_payments_account'){ + $this->checkPaymentsAccounts(); + } + } /** * Show the application dashboard. * @@ -61,10 +74,180 @@ class CronController extends Controller $user->save(); } } - - die("okay"); } + public function checkPaymentsAccounts(){ + + /*RULES + reminders + > 21 remind_first_days = 31 reminder_first + > 21 remind_first_days + sepa = 32 reminder_first_sepa + > 14 remind_sec_days = 33 reminder_sec + > 2 remind_last_days = 34 reminder_last + > 0 deaktiv = 35 reminder_deaktiv + > 0 deaktiv + sepa = 36 reminder_deaktiv_sepa + == 7 abo_booking_days + sepa + cron = 37 reminder_collect_sepa + */ + //max Date for reminder + $renewalDate = Carbon::now()->modify('+'.(config('mivita.remind_first_days')+1).' days'); + dump($renewalDate); + $users = User::where('payment_account', '!=', NULL) + ->where('active', '=', 1) + ->where('blocked', '!=', 1) + ->where('payment_account', '<', $renewalDate) + ->get(); + + + $user = User::find(2); + + /* $this->checkReminderPayments($user); + dump($user->daysActiveAccount()); + dump($user->email." | ".$user->getPaymentAccountDateFormat()); + die();*/ + foreach ($users as $user){ + + + //$this->checkReminderPayments($user); + + + // dump($user->nextRenewalAccount()); + //$userHistoryWizardPayment = UserHistory::whereUserId($user->id)->whereAction('wizard_payment')->get()->last(); + + //UserHistory::create(['user_id' => $user->id, 'action'=>'released_completed', 'status'=>0]); + + dump($user->daysActiveAccount()); + dump($user->email." | ".$user->getPaymentAccountDateFormat()); + + } + die(""); + } + + + private function checkReminderPayments(User $user){ + + + $isSend = $this->checkIsReminderSend($user, 31); + $isSend = $this->checkIsReminderSend($user, 32); + $isSend = $this->checkIsReminderSend($user, 33); + $isSend = $this->checkIsReminderSend($user, 34); + $isSend = $this->checkIsReminderSend($user, 35); + $isSend = $this->checkIsReminderSend($user, 36); + + return ; + + + //35 reminder_deaktiv, 36 reminder_deaktiv_sepa + if(!$user->isActiveAccount()){ + if($user->isAboOption()){ + $isSend = $this->checkIsReminderSend($user, 35); + return $isSend; + } + $isSend = $this->checkIsReminderSend($user, 36); + return $isSend; + } + + //34 reminder_last + if($user->daysActiveAccount() <= config('mivita.remind_last_days')){ + $isSend = $this->checkIsReminderSend($user, 34); + return $isSend; + } + + //33 reminder_sec + if($user->daysActiveAccount() <= config('mivita.remind_sec_days')){ + if(!$user->isAboOption()){ + $isSend = $this->checkIsReminderSend($user, 33); + return $isSend; + } + } + + //31 reminder_first, 32 reminder_first_sepa + if($user->daysActiveAccount() > config('mivita.remind_sec_days')){ + if($user->isAboOption()){ + $isSend = $this->checkIsReminderSend($user, 32); + return $isSend; + } + $isSend = $this->checkIsReminderSend($user, 31); + return $isSend; + + } + } + + + private function checkIsReminderSend(User $user, $status){ + + $isSend = UserHistory::whereUserId($user->id) + ->whereAction('reminder_payments') + ->whereIdentifier($user->payment_account) + ->whereStatus($status) + ->get()->last(); + + if($isSend){ + // return true; + } + $referenz = $this->sendReminderMail($user, $status); + //is not sent create + UserHistory::create(['user_id' => $user->id, 'action'=>'reminder_payments', 'referenz'=>$referenz, 'identifier'=>$user->payment_account, 'status'=>$status]); + return false; + + } + + private function sendReminderMail(User $user, $status){ + + $days = $user->daysActiveAccount(); + if($days < 0){ + $days = $days*-1; + } + + $pay_date = Carbon::parse($user->payment_account)->modify('- '.config('mivita.abo_booking_days').' days')->format('d.m.Y'); + $datetime = $user->getPaymentAccountDateFormat(); + + $price = ""; + if($user->payment_order_id && isset($user->payment_order_product->price)){ + $price = 'von '.$user->payment_order_product->getFormattedPrice().' EUR'; + } + + $message = __('reminder.copy_first_'.$status, ['days'=>$days, 'datetime'=>$datetime, 'price' =>$price, 'pay_date'=>$pay_date]); + $message_last = __('reminder.copy_last_'.$status, ['days'=>$days, 'datetime'=>$datetime, 'price' =>$price, 'pay_date'=>$pay_date]); + $button = __('reminder.button_'.$status); + + $message = preg_replace("/[\n\r]/","",$message); + $message_last = preg_replace("/[\n\r]/","",$message_last); + + $data = [ + 'subject' => __('reminder.subject')." | ID: ".$status, + 'message' => $message, + 'message_last' => $message_last, + 'url' => route('user_membership'), + 'button' => $button, + ]; + dump($data); + $sender = User::find(1); + + $customer_mail = UserMessage::create([ + 'user_id' => $user->id, + 'send_user_id' => $sender->id, + 'email' => $user->email, + 'subject' => $data['subject'], + 'message' => $data['message']." ".$data['message_last'], + ]); + + try{ + Mail::to($user->email)->send(new MailCustomMessage($user, $data, $sender, false)); + } + catch(\Exception $e){ + \Log::channel('cron')->error('Mail Error: '.$e->getMessage()); + // Never reached + $customer_mail->fail = true; + $customer_mail->error = $e->getMessage(); + $customer_mail->save(); + return 0; + } + $customer_mail->send = true; + $customer_mail->sent_at = now(); + $customer_mail->save(); + return 1; + } + } \ No newline at end of file diff --git a/app/Http/Controllers/LeadController.php b/app/Http/Controllers/LeadController.php index efcd7b9..bd42deb 100755 --- a/app/Http/Controllers/LeadController.php +++ b/app/Http/Controllers/LeadController.php @@ -277,7 +277,7 @@ class LeadController extends Controller 'message' => $input['account_incomplete_message'], 'confirmation_code' => $confirmation_code, ]; - Mail::to($user->email)->send(new MailCustomMessage($user, $data, \Auth::user())); + Mail::to($user->email)->send(new MailCustomMessage($user, $data, \Auth::user(), true)); UserHistory::create(['user_id' => $user->id, 'action'=>'released_incomplete', 'status'=>0]); \Session()->flash('alert-success', "E-Mail an Berater gesendet."); diff --git a/app/Http/Controllers/Pay/PayoneController.php b/app/Http/Controllers/Pay/PayoneController.php index 5cc7e03..8054ffc 100644 --- a/app/Http/Controllers/Pay/PayoneController.php +++ b/app/Http/Controllers/Pay/PayoneController.php @@ -71,6 +71,7 @@ class PayoneController extends Controller public function init($shopping_user, $shopping_order){ $this->shopping_user = $shopping_user; $this->shopping_order = $shopping_order; + $this->default['mode'] = $this->shopping_order->mode; } public function getShoppingPayment(){ @@ -328,7 +329,6 @@ class PayoneController extends Controller ]; $request = array_merge($this->default, $this->prepayment); return Payone::sendRequest($request); - } @@ -348,9 +348,8 @@ class PayoneController extends Controller // "language" => 'de', ]; - $request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls); - // dd($request); + $request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls); return Payone::sendRequest($request); } diff --git a/app/Http/Controllers/Sys/AdminToolsController.php b/app/Http/Controllers/Sys/AdminToolsController.php index 468db3c..4f7ec87 100755 --- a/app/Http/Controllers/Sys/AdminToolsController.php +++ b/app/Http/Controllers/Sys/AdminToolsController.php @@ -32,6 +32,38 @@ class AdminToolsController extends Controller dd('index'); } + /** + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function cronjobs() + { + //$user_shops = UserShop::all(); + $text = ""; + $values = [ + 'check_payments_account' => route('cron_jobs_action', ['check_payments_account', 'key']) + ]; + $data = [ + 'values' => $values, + 'text' => $text, + ]; + + return view('sys.admin.cronjobs', $data); + + + + } + /** + * @param Request $request + * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View + */ + public function cronjobsStore() + { + $data = Input::all(); + \Session()->flash('alert-save', true); + return back(); + } + + /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ @@ -75,10 +107,8 @@ class AdminToolsController extends Controller public function domainSSLStore() { $data = Input::all(); - \Session()->flash('alert-save', true); return back(); - } diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index f17c4db..5e67d8f 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -136,6 +136,7 @@ class CheckoutController extends Controller //need precheck the card if(Input::get('payment_method') === 'cc'){ $pay = new PayoneController(); + $pay->init($shopping_user, $shopping_order); $ret['cc'] = $pay->checkCreditCard($data); if($ret['cc']['status'] === 'ERROR' || $ret['cc']['status'] === 'INVALID'){ /* PaymentTransaction::create([ @@ -163,6 +164,7 @@ class CheckoutController extends Controller //need precheck the card if(Input::get('payment_method') === 'elv' && is_null(Input::get('mandate_identification'))){ $pay = new PayoneController(); + $pay->init($shopping_user, $shopping_order); $amount = (int) (float) Yard::instance('shopping')->totalWithShipping(2, '.', ',') *100; $ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user); diff --git a/app/Http/Controllers/Web/RegisterController.php b/app/Http/Controllers/Web/RegisterController.php index 11678fd..7547816 100755 --- a/app/Http/Controllers/Web/RegisterController.php +++ b/app/Http/Controllers/Web/RegisterController.php @@ -7,6 +7,7 @@ use App\Http\Controllers\Controller; use App\Mail\MailContact; use App\Mail\MailVerifyAccount; use App\Repositories\UserRepository; +use App\Services\UserService; use App\User; use GuzzleHttp\Client; use Input; diff --git a/app/Http/Controllers/WizardController.php b/app/Http/Controllers/WizardController.php index 2ae25a8..986411d 100755 --- a/app/Http/Controllers/WizardController.php +++ b/app/Http/Controllers/WizardController.php @@ -400,7 +400,6 @@ class WizardController extends Controller Yard::instance('shopping')->destroy(); $product = Product::find(Input::get('switchers-package-wizard')); $showAboOptions = false; - if(Input::get('abo_options')){ $showAboOptions = true; $user->abo_options = true; diff --git a/app/Mail/MailCustomMessage.php b/app/Mail/MailCustomMessage.php index 0bbe586..deb6c38 100644 --- a/app/Mail/MailCustomMessage.php +++ b/app/Mail/MailCustomMessage.php @@ -17,15 +17,19 @@ class MailCustomMessage extends Mailable protected $sender; public $subject; public $message; + public $message_last; + protected $save; - public function __construct(User $user, $data, $sender) + public function __construct(User $user, $data, $sender, $save = false) { + $this->save = $save; $this->data = $data; $this->user = $user; $this->sender = $sender; $this->subject = isset($data['subject']) ? $data['subject'] : __('email.email_subject'); $this->message = isset($data['message']) ? $data['message'] : ''; + $this->message_last = isset($data['message_last']) ? $data['message_last'] : ''; } @@ -39,18 +43,17 @@ class MailCustomMessage extends Mailable $salutation = __('email.dear_mrs')." ".$this->user->account->first_name.","; } } - - - - UserMessage::create([ - 'user_id' => $this->user->id, - 'send_user_id' => $this->sender->id, - 'email' => $this->user->email, - 'subject' => $this->subject, - 'message' => $this->message, - 'send' => true, - 'sent_at' => now(), - ]); + if($this->save){ + UserMessage::create([ + 'user_id' => $this->user->id, + 'send_user_id' => $this->sender->id, + 'email' => $this->user->email, + 'subject' => $this->subject, + 'message' => $this->message." ".$this->message_last, + 'send' => true, + 'sent_at' => now(), + ]); + } $url = ""; $button = ""; if(isset($this->data['confirmation_code'])){ @@ -58,11 +61,18 @@ class MailCustomMessage extends Mailable $button = __('email.button_account'); } - return $this->view('emails.auth')->with([ + + if(isset($this->data['url'])){ + $url =$this->data['url']; + $button = $this->data['button']; + + } + return $this->view('emails.custom')->with([ 'url' => $url, - 'salutation' => $salutation, + 'title' => $salutation, 'button' => $button, - 'copy1line' => $this->message, + 'content' => $this->message, + 'content_last' => $this->message_last, 'copy2line' => __('email.copy2line'), 'copy3line' => __('email.copy3line'), 'greetings' => __('email.greetings'), @@ -70,4 +80,4 @@ class MailCustomMessage extends Mailable ]); } -} \ No newline at end of file +} diff --git a/app/Models/Product.php b/app/Models/Product.php index 46f4f72..a3db2da 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -2,6 +2,7 @@ namespace App\Models; +use App\Services\Util; use Cviebrock\EloquentSluggable\Sluggable; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -104,11 +105,6 @@ class Product extends Model upgrade # need upgrade_to_id set user->payment_order_id to the package in the payment api */ - protected $identifiers_types = [ - 'show_upgrade' => 'Kann gepdatet werden', - 'show_order' => 'Wird immer als Option angezeigt', - 'upgrade' => 'Produktupgrade zu upgrade_to_id', - ]; protected $table = 'products'; protected $casts = [ @@ -138,6 +134,8 @@ class Product extends Model 'points', 'weight', 'contents', + 'contents_total', + 'unit', 'number', 'icons', 'description', @@ -152,12 +150,28 @@ class Product extends Model 'upgrade_to_id' ]; + public $identifiers_types = [ + '' => '-', + 'show_upgrade' => 'Kann gepdatet werden', + 'show_order' => 'Wird immer als Option angezeigt', + 'upgrade' => 'Produktupgrade zur Upgrade to ID', + ]; + public $unitTypes = [ + 0 => '', + 1 => 'ml', + 2 => 'g', + 3 => 'Liter', + 4 => 'KG', + ]; + public $showATs = [ - 0 => 'nur User Shop', - 1 => 'User + Berater Shop', - 2 => 'nur Berater Shop', - 3 => 'Registrierung Shop', - 4 => 'Mitgliedschaft Berater', + 0 => 'Nur Kunden Shop', + 1 => 'Kunden + Berater Shop', + 2 => 'Nur Berater Shop', + 3 => 'Registrierung / Mitgliedschaft Berater', + 4 => 'Nur Mitgliedschaft Berater', + 5 => 'Onboarding Berater', + ]; public $actions = [ @@ -221,50 +235,63 @@ class Product extends Model public function getFormattedPrice() { - if(!isset($this->attributes['price'])){ - return ""; - } - if(\App::getLocale() == "en"){ - return number_format($this->attributes['price'], 2, '.', ','); - } - return number_format($this->attributes['price'], 2, ',', '.'); + return isset($this->attributes['price']) ? Util::formatNumber($this->attributes['price']) : ""; } public function getFormattedPriceEk() { - if(!isset($this->attributes['price_ek'])){ - return ""; - } - if(\App::getLocale() == "en"){ - return number_format($this->attributes['price_ek'], 2, '.', ','); - } - return number_format($this->attributes['price_ek'], 2, ',', '.'); + return isset($this->attributes['price_ek']) ? Util::formatNumber($this->attributes['price_ek']) : ""; } public function getFormattedTax() { - if(!isset($this->attributes['tax'])){ - return ""; - } - if(\App::getLocale() == "en"){ - return number_format($this->attributes['tax'], 2, '.', ','); - } - return number_format($this->attributes['tax'], 2, ',', '.'); + return isset($this->attributes['tax']) ? Util::formatNumber($this->attributes['tax']) : ""; } public function getFormattedPriceOld() { - if(!isset($this->attributes['price_old'])){ - return ""; - } - if(\App::getLocale() == "en"){ - return number_format($this->attributes['price_old'], 2, '.', ','); - } - return number_format($this->attributes['price_old'], 2, ',', '.'); + return isset($this->attributes['price_old']) ? Util::formatNumber($this->attributes['price_old']) : ""; } + public function getBasePriceFormattedFull(){ + if($price = $this->getBasePrice()){ + $unit = $this->attributes['unit']; + //ml g + if($unit === 1 || $unit === 2){ + return Util::formatNumber($price) . ' € 100/'.$this->getUnitType(); + } + //l kg + if($unit === 3 || $unit === 4){ + return Util::formatNumber($price) . ' € 1/'.$this->getUnitType(); + } + } + return ""; + } + public function getBasePriceFormatted(){ + if($price = $this->getBasePrice()){ + return Util::formatNumber($price); + } + return ""; + } + public function getBasePrice(){ + if(isset($this->attributes['unit']) && isset($this->attributes['contents_total']) && $this->attributes['contents_total'] != 0){ + $unit = $this->attributes['unit']; + //ml g + if($unit === 1 || $unit === 2){ + return $this->attributes['price'] * 100 / $this->attributes['contents_total']; + } + //l kg + if($unit === 3 || $unit === 4){ + return $this->attributes['price'] * 1000 / $this->attributes['contents_total']; + } + } + return ""; + } + public function getUnitType(){ + return isset($this->unitTypes[$this->unit]) ? $this->unitTypes[$this->unit] : '-'; + } public function setPosAttribute($value){ $this->attributes['pos'] = is_numeric($value) ? $value : null; diff --git a/app/Models/UserHistory.php b/app/Models/UserHistory.php index 1e8e3db..e85364f 100644 --- a/app/Models/UserHistory.php +++ b/app/Models/UserHistory.php @@ -61,6 +61,14 @@ class UserHistory extends Model 21 => 'payment_not_found', 22 => 'checkout_cancel', 23 => 'checkout_error', + 31 => 'reminder_first', + 32 => 'reminder_first_sepa', + 33 => 'reminder_sec', + 34 => 'reminder_last', + 35 => 'reminder_deaktiv', + 36 => 'reminder_deaktiv_sepa', + 37 => 'reminder_collect_sepa', + 50 => 'delete_membership' ]; protected $status_colors = [ diff --git a/app/Services/Util.php b/app/Services/Util.php index 12c0e04..bd5ec59 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -110,7 +110,7 @@ class Util public static function getUserHistoryValue($key){ if($user_history = self::getUserHistory()) { - return $user_history->{$user_history}; + return $user_history->{$key}; } return null; } diff --git a/app/User.php b/app/User.php index d59c718..26b8bb2 100755 --- a/app/User.php +++ b/app/User.php @@ -239,7 +239,9 @@ class User extends Authenticatable - + public function isAboOption(){ + return ($this->abo_options && $this->account && $this->account->payment_data) ? true : false; + } public function isActiveAccount(){ return $this->payment_account ? Carbon::parse($this->payment_account)->gt(Carbon::now()) : false; } @@ -251,15 +253,15 @@ class User extends Authenticatable public function isRenewalAccount() { if ($this->payment_account) { - return Carbon::parse($this->payment_account)->modify('-'.config('mivita.renewal_days').' days')->lt(Carbon::now()); + return Carbon::parse($this->payment_account)->modify('-'.(config('mivita.renewal_days')+1).' days')->lt(Carbon::now()); } return false; } + public function nextRenewalAccount(){ return $this->payment_account ? Carbon::parse($this->payment_account)->modify('-'.config('mivita.renewal_days').' days')->format(\Util::formatDateTimeDB()) : false ; } - public function daysActiveAccount(){ return Carbon::now()->diffInDays(Carbon::parse($this->payment_account), false); } diff --git a/config/logging.php b/config/logging.php index 2615106..30394b1 100755 --- a/config/logging.php +++ b/config/logging.php @@ -38,6 +38,10 @@ return [ 'driver' => 'single', 'path' => storage_path('logs/payone.log'), ], + 'cron' => [ + 'driver' => 'single', + 'path' => storage_path('logs/corn.log'), + ], 'stack' => [ 'driver' => 'stack', 'channels' => ['single'], diff --git a/config/mivita.php b/config/mivita.php index 80a2918..5479de1 100755 --- a/config/mivita.php +++ b/config/mivita.php @@ -4,7 +4,10 @@ return [ 'renewal_days' => env('MIVITA_RENEWAL_DAYS', '29'), - 'abo_booking_days' => env('MIVITA_ABO_BOOKING_DAYS', '14'), + 'abo_booking_days' => env('MIVITA_ABO_BOOKING_DAYS', '7'), + 'remind_first_days' => env('MIVITA_REMIND_FIRST_DAYS', '21'), + 'remind_sec_days' => env('MIVITA_REMIND_SEC_DAYS', '14'), + 'remind_last_days' => env('MIVITA_REMIND_LAST_DAYS', '2'), ]; diff --git a/database/migrations/2018_10_21_164001_create_products_table.php b/database/migrations/2018_10_21_164001_create_products_table.php index 09ec87e..5221e75 100644 --- a/database/migrations/2018_10_21_164001_create_products_table.php +++ b/database/migrations/2018_10_21_164001_create_products_table.php @@ -36,6 +36,9 @@ class CreateProductsTable extends Migration $table->string('contents')->nullable(); + $table->unsignedInteger('contents_total')->nullable(); + $table->unsignedTinyInteger('unit')->nullable(); + $table->string('number')->nullable(); $table->string('icons')->nullable(); //as array cast diff --git a/resources/lang/de/email.php b/resources/lang/de/email.php index 2c28c3e..4a24966 100644 --- a/resources/lang/de/email.php +++ b/resources/lang/de/email.php @@ -42,7 +42,7 @@ 'status_copy1line' => 'Status zu Deiner Bestellung auf mivita.care', 'footer_copy1' => 'mivita e.K. | Leinfeld 2 | 87755 Kirchhaslach | Telefon: +49 (0) 8333 946 98 90 | Fax: +49 (0) 8333 7268 E-Mail: info@mivita.care', 'footer_copy2' => 'Geschäftsinhaber: Alois Ried | Registergericht: Memmingen | Registernummer: HRA 12236 | USt-ID-Nr.: DE 244162340', - 'footer_copy3' => '© 2019 All Rights Reserved', + 'footer_copy3' => '© 2020 All Rights Reserved', 'checkout_mail_hl1' => 'Du hast folgende Artikel bestellt:', 'checkout_mail_shipping' => 'Verpackungs- u. Versandkosten', 'checkout_mail_status_info' => 'Statusinfo:', diff --git a/resources/lang/de/membership.php b/resources/lang/de/membership.php new file mode 100644 index 0000000..afd1dcb --- /dev/null +++ b/resources/lang/de/membership.php @@ -0,0 +1,17 @@ + 'Mitgliedschaft / Jahresbeitrag', + 'home_copy_alert_31' => 'Deine Mitgliedschaft läuft zum :datetime aus', + 'home_copy_last_31' => 'Es bleiben Dir jetzt noch entspannte :days Tage Zeit, Deine Mitgliedschaft zu verlängern. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.', + 'home_copy_SEPA_32' => 'Da Du uns ein SEPA-Lastschrift-Mandat erteilt hast, brauchst Du nicht weiter aktiv zu werden. Entsprechend dieses Mandates werden wir den Rechnungsbetrag :price am :pay_date von Deinem Konto abbuchen.', + 'home_copy_last_33' => 'Es bleiben Dir jetzt noch :days Tage Zeit, Deine Mitgliedschaft zu verlängern. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.', + 'home_copy_SEPA_33' => 'Von Deinem SEPA-Lastschrift-Mandat, das du uns erteilt hast, konnten wir bisher den Rechnungsbetrag :price am :pay_date nicht abbuchen.', + 'home_copy_last_34' => 'huiii... jetzt wird es aber Zeit! Deine Mitgliedschaft läuft bereits in :days Tagen aus, und zwar exakt am :datetime. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.', + 'home_copy_alert_35' => 'Deine Mitgliedschaft läuft heute aus!', + 'home_copy_last_35' => 'huiii... jetzt wird es aber Zeit! Deine Mitgliedschaft läuft bereits heute aus, und zwar exakt am :datetime. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.', + 'home_copy_alert_36_today' => 'Dein Mitgliedschaft ist heute am :datetime ausgelaufen!', + 'home_copy_alert_36' => 'Dein Mitgliedschaft ist vor :days Tagen am :datetime ausgelaufen!', + 'home_copy_last_36' => 'wie angekündigt, haben wir Deinen Berater-Account pausiert, da Du Deine Mitgliedschaft nicht rechtzeitig verlängert hast. Wenn Du wieder von den Vorteilen und Features bei MIVITA profitieren möchtest, kannst Du Deinen Account jederzeit reaktivieren.', + 'home_copy_SEPA_36' => 'Leider war es uns nicht möglich, den fälligen Betrag per SEPA-Lastschrift-Mandat für die Mitgliedsgebühr von Deinem angegebenen Konto einzuziehen.' + ); diff --git a/resources/lang/de/reminder.php b/resources/lang/de/reminder.php new file mode 100644 index 0000000..32c9758 --- /dev/null +++ b/resources/lang/de/reminder.php @@ -0,0 +1,62 @@ + 'Deine Mitgliedschaft bei mivita.care', + 'button_31' => 'MITGLIEDSCHAFT VERLÄNGERN', + 'copy_first_31' => '

wir wollten Dir jetzt schon mal rechtzeitig Bescheid geben, dass Deine Mitgliedschaft zum :datetime ausläuft. Zur Zeit hast Du keine automatisierte Verlängerung mit SEPA-Lastschrift eingestellt. Daher solltest Du jetzt aktiv werden und rechtzeitig verlängern, damit Du weiterhin

+
    +
  • Produkte von MIVITA beziehen kannst
  • +
  • Kunden über Deinen Onlineshop einkaufen können (optional)
  • +
  • Du von Vertriebspartnerumsätzen partizipieren kannst
  • +
+

Aber alles gut - es bleiben Dir jetzt noch entspannte :days Tage Zeit, Deine Mitgliedschaft zu verlängern. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.

+

Wir senden Dir schon ganz bald eine weitere Erinnerung zu, aber dann hast Du es jetzt schon mal im Hinterkopf. Falls Du jetzt schon für den Anschluss um 1 Jahr verlängern möchtest, kannst Du das mit Klick auf den Button unten tun. Was weg ist, ist weg :) ...

', + 'copy_last_31' => '', + 'button_32' => 'MITGLIEDSCHAFT VERWALTEN', + 'copy_first_32' => '

wir wollten Dir jetzt schon mal rechtzeitig Bescheid geben, dass Deine Mitgliedschaft zum :datetime automatisch verlängert wird. Da Du uns ein SEPA-Lastschrift-Mandat erteilt hast, brauchst Du nicht weiter aktiv zu werden. Entsprechend dieses Mandates werden wir den Rechnungsbetrag :price am :pay_date von Deinem Konto abbuchen.

+

Deine Mitgliedschaft verlängert sich im Anschluss um ein weiteres Jahr, damit Du weiterhin

+
    +
  • Produkte von MIVITA beziehen kannst
  • +
  • Kunden über Deinen Onlineshop einkaufen können (optional)
  • +
  • Du von Vertriebspartnerumsätzen partizipieren kannst
  • +
+

Soweit so gut. Solltest Du allerdings die Mitgliedschaft beenden bzw. erstmal pausieren wollen, dann kannst Du das in Deinem Mitgliederbereich selber einstellen. Folge dazu einfach dem grünen Button unten.

+

Für den Fall, dass Du erstmal nicht verlängern möchtest, wird Dein Account solange pausiert bis Du Deine Mitgliedschaft erneuerst. Beachte aber bitte, dass alle Vorteile und Funktionen, vom vergünstigten Einkaufen bis hin zur Provisionsabrechnung ebenfalls pausieren.

', + 'copy_last_32' => '', + 'button_33' => 'MITGLIEDSCHAFT VERLÄNGERN', + 'copy_first_33' => '

hier nochmal eine kurze Erinnerung, dass Deine Mitgliedschaft zum :datetime ausläuft. Zur Zeit hast Du keine automatisierte Verlängerung mit SEPA-Lastschrift eingestellt. Daher solltest Du jetzt aktiv werden und rechtzeitig verlängern, damit Du weiterhin

+
    +
  • Produkte von MIVITA beziehen kannst
  • +
  • Kunden über Deinen Onlineshop einkaufen können (optional)
  • +
  • Du von Vertriebspartnerumsätzen partizipieren kannst
  • +
+

Aber alles gut - es bleiben Dir jetzt noch entspannte :days Tage Zeit, Deine Mitgliedschaft zu verlängern. Solltest Du allerdings die Frist verstreichen lassen, wird Dein Account solange automatisch pausiert bis Du Deine Mitgliedschaft erneuerst.

+

Wir senden Dir schon ganz bald eine weitere Erinnerung zu, aber dann hast Du es jetzt schon mal im Hinterkopf. Falls Du jetzt schon für den Anschluss um 1 Jahr verlängern möchtest, kannst Du das mit Klick auf den Button unten tun. Was weg ist, ist weg :) ...

', + 'copy_last_33' => '', + 'button_34' => 'MITGLIEDSCHAFT VERLÄNGERN', + 'copy_first_34' => '

huiii... jetzt wird es aber Zeit! Deine Mitgliedschaft läuft bereits in :days Tagen aus, und zwar exakt am :datetime. Zur Zeit hast Du keine automatisierte Verlängerung mit SEPA-Lastschrift eingestellt. Daher solltest Du jetzt aktiv werden und Deine Mitgliedschaft verlängern, da Dein Account sonst pausiert.

+

Wenn Du weiterhin

+
    +
  • Produkte von MIVITA beziehen
  • +
  • einen Onlineshop nutzen (optional)
  • +
  • und von Vertriebspartnerumsätzen partizipieren möchtest
  • +
+

solltest Du jetzt schnell handeln und Deine Mitgliedschaft verlängern:

', + 'copy_last_34' => '', + 'button_35' => 'MITGLIEDSCHAFT VERWALTEN', + 'copy_first_35' => '

wie angekündigt, haben wir Deinen Berater-Account pausiert, da Du Deine Mitgliedschaft nicht rechtzeitig verlängert hast. Wenn Du wieder von den Vorteilen und Features bei MIVITA profitieren möchtest, kannst Du Deinen Account jederzeit reaktivieren.

+

Klick auf den Button, falls Du Änderungen an Deiner Mitgliedschaft vornehmen möchtest:

', + 'copy_last_35' => '

Hinweis:
Auch wenn Dein Account pausiert, werden Dir vergangene bzw. noch offene Provisionen selbstverständlich im nächsten Zahlungslauf ausgezahlt.Solltest Du Deinen Account vollständig löschen wollen, dann schreibe bitte eine Email an info@mivita.care. Unser Berater-Service wird sich dann umgehend darum kümmern.

+

Wir hoffen, Dich ganz bald wieder als aktives Mitglied der MIVITA Family begrüßen zu dürfen.

', + 'button_36' => 'MITGLIEDSCHAFT VERWALTEN', + 'copy_first_36' => '

leider war es uns nicht möglich, den fälligen Betrag für die Mitgliedsgebühr von Deinem angegebenen Konto einzuziehen.

+

Wie angekündigt, haben wir daher heute Deinen Berater-Account pausiert, da Du Deine Mitgliedschaft damit nicht rechtzeitig verlängern konntest. Wenn Du wieder von den Vorteilen und Features bei MIVITA profitieren möchtest, kannst Du Deinen Account jederzeit auch über eine andere Zahlungsweise reaktivieren (z. B. Paypal, Kreditkarte, SOFORT Überweisung oder Vorauskasse).

+

Klick dazu einfach auf folgenden Button und nimm entsprechende Einstellungen in Deinem Berater-Account vor:

', + 'copy_last_36' => '

Hinweis:
Auch wenn Dein Account pausiert, werden Dir vergangene bzw. noch offene Provisionen selbstverständlich im nächsten Zahlungslauf ausgezahlt.Solltest Du Deinen Account vollständig löschen wollen, dann schreibe bitte eine Email an info@mivita.care. Unser Berater-Service wird sich dann umgehend darum kümmern.

+

Wir hoffen, Dich ganz bald wieder als aktives Mitglied der MIVITA Family begrüßen zu dürfen.

', + 'button_37' => 'MITGLIEDSCHAFT VERWALTEN', + 'copy_first_37' => '

wie angekündigt, haben wir heute gemäß Deines SEPA-Lastschriftmandates den Einzug von :price für ein weiteres Jahr der Mitgliedschaft bei MIVITA veranlasst. Dieser Rechnungsbetrag wird in den nächsten Tagen von Deinem Konto abgebucht. Bitte beachte, dass die Verlängerung erst nach Zahlungseingang aktiv ist.

+

Falls Du in Zukunft Änderungen vornehmen möchtest, kannst Du alle Funktionen sowie die Mitgliedschaft in Deinem Berater-Account einstellen.

+

Folge dazu einfach dem unten stehenden Button:

', + 'copy_last_37' => '', + ); \ No newline at end of file diff --git a/resources/views/admin/product/form.blade.php b/resources/views/admin/product/form.blade.php index b9d047b..7de4132 100755 --- a/resources/views/admin/product/form.blade.php +++ b/resources/views/admin/product/form.blade.php @@ -13,54 +13,41 @@ {!! Form::checkbox('active', 1, $product->active, ['class'=>'custom-control-input']) !!} {{__('aktiv')}} - + {{ Form::text('name', $product->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
-
+ {{--
{{ Form::text('title', $product->title, array('placeholder'=>__('Title'), 'class'=>'form-control', 'id'=>'title')) }}
-
- - {{ Form::select('show_at', $product->showATs, $product->show_at, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'show_at') ) }} -
-
- - {{ Form::text('identifier', $product->identifier, array('placeholder'=>__('Kennung'), 'class'=>'form-control', 'id'=>'identifier')) }} -
+ --}} +
-
- +
+
+
+ + {{ Form::select('show_at', $product->showATs, $product->show_at, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'show_at') ) }} +
-
- - {{ Form::text('pos', $product->pos, array('placeholder'=>__('pos'), 'class'=>'form-control', 'id'=>'pos')) }} +
+ + {{ Form::text('pos', $product->pos, array('placeholder'=>__('1, 2, 3, etc'), 'class'=>'form-control', 'id'=>'pos')) }}
- - {{ Form::textarea('copy', $product->copy , array('placeholder'=>__('Leistungen'), 'class'=>'form-control summernote', 'id'=>'copy')) }} + + {{ Form::textarea('copy', $product->copy , array('placeholder'=>__('Produktbeschreibung'), 'class'=>'form-control summernote', 'id'=>'copy')) }}
-
-
- - {{ Form::select('action[]', $product->actions, $product->action, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'action', 'multiple') ) }} -
-
- - {{ Form::text('upgrade_to_id', $product->upgrade_to_id, array('placeholder'=>__('Product ID when need an upgrade'), 'class'=>'form-control', 'id'=>'upgrade_to_id')) }} -
-
-
@@ -117,28 +104,42 @@ {{ __('Inhalte') }}
-
- - {{ Form::text('contents', $product->contents, array('placeholder'=>__('contents'), 'class'=>'form-control', 'id'=>'contents')) }} +
+ +
+ + {{ Form::text('contents', $product->contents, array('placeholder'=>__('Bsp: 150 ml'), 'class'=>'form-control', 'id'=>'contents')) }} +
+
+ + {{ Form::text('contents_total', $product->contents_total, array('placeholder'=>__('Bsp: 150'), 'class'=>'form-control', 'id'=>'contents_total')) }} +
+
+ + {{ Form::select('unit', $product->unitTypes, $product->unit, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'unit') ) }} +
+
+ + {{ Form::text('base_price', $product->getBasePriceFormattedFull(), array('placeholder'=>__(''), 'class'=>'form-control', 'id'=>'base_price', 'readonly')) }}
-
+
{{ Form::text('number', $product->number, array('placeholder'=>__('number'), 'class'=>'form-control', 'id'=>'number')) }}
-
+
{{ Form::text('icons', $product->icons, array('placeholder'=>__('icons'), 'class'=>'form-control', 'id'=>'icons')) }}
- -
+
+
@@ -156,3 +157,25 @@
+
+
+ {{ __('Admin Einstellungen') }} +
+
+
+
+ + {{ Form::select('action[]', $product->actions, $product->action, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'action', 'multiple') ) }} +
+
+ + {{ Form::select('identifier', $product->identifiers_types, $product->identifier, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'identifier') ) }} +
+
+ + {{ Form::text('upgrade_to_id', $product->upgrade_to_id, array('placeholder'=>__('Product ID when need an upgrade'), 'class'=>'form-control', 'id'=>'upgrade_to_id')) }} +
+
+
+
+ diff --git a/resources/views/admin/product/index.blade.php b/resources/views/admin/product/index.blade.php index 979c84f..5a70ddc 100755 --- a/resources/views/admin/product/index.blade.php +++ b/resources/views/admin/product/index.blade.php @@ -14,6 +14,10 @@ {{__('Bild')}} {{__('Name')}} {{__('Kategorie')}} + {{__('Preis')}} + {{__('Inhalt')}} + {{__('Einheit')}} + {{__('Grundpreis')}} {{__('Status')}} @@ -32,17 +36,19 @@ @endif - {{ $value->name }} @foreach($value->categories as $category) {{ $category->category->name }} @endforeach + {{ $value->getFormattedPrice() }} + {{ $value->contents_total }} + {{ $value->getUnitType() }} + {{ $value->getBasePriceFormatted() }} @if($value->active) @else@endif   - @endforeach diff --git a/resources/views/emails/auth.blade.php b/resources/views/emails/auth.blade.php index 737bab5..dabb23d 100644 --- a/resources/views/emails/auth.blade.php +++ b/resources/views/emails/auth.blade.php @@ -95,7 +95,12 @@
- {{ $copy1line }} + @if(isset($copy1line)) + {{ strip_tags($copy1line) }} + @endif + @if(isset($content)) + {{ strip_tags($content) }} + @endif
@@ -139,6 +144,7 @@ {{ $salutation }} + @if(isset($copy1line)) + @endif + @if(isset($content)) + + + + @endif
@@ -155,6 +161,20 @@
+ + + + +
+ {!! nl2br($content) !!} +
+
diff --git a/resources/views/emails/custom.blade.php b/resources/views/emails/custom.blade.php new file mode 100644 index 0000000..24c1675 --- /dev/null +++ b/resources/views/emails/custom.blade.php @@ -0,0 +1,268 @@ + + + + + + mivita.care + + + + + + + + + + + + +
+ {{ strip_tags($content) }} +
+ + + + + +
+
+ + + + +
+ + + + +
+
+ + + + + + + + + +
+
+ + mivita.care + +
+ +

+
+
+ + + + + + + + + + + + + + + @if(isset($content_last) && $content_last != "") + + + + @endif + + + + +
+
+ {{ $title }} +
+
+ + + + +
+ {!! nl2br($content) !!} +
+
+
+ + + + + + +
+ + + + + + +
+

+ {{ $button }} +

+
+
+
+
+ + + + + +
+ {{ $copy2line }}
+ {{ $url }} +
+
+ +
+ + + + +
+ {!! nl2br($content_last) !!} +
+
+
+ + + + + + + + +
+ {{ $copy3line }} +
+ {{ $greetings }}

{{ $sender }} +

+
+ +
+
+ + + + + + + +
+

+ {{__('email.footer_copy1')}} +

+ www.mivita.care +
+
+

{{__('email.footer_copy2')}}

+ Datenschutzerklärung
+

{{__('email.footer_copy3')}}

+
+
+
+
+
+
+ + + diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index bcfbe84..55c047a 100755 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -27,36 +27,60 @@
-
@if($user->active == 1) - @if($user->payment_account && $user->daysActiveAccount() <= config('mivita.renewal_days')) + @if($user->payment_account && $user->daysActiveAccount() <= config('mivita.remind_first_days'))
- {{__('Mitgliedschaft / Jahresbeitrag') }} + {{__('membership.home_hl') }}
-
Achtung: Deine Mitgliedschaft wurde verlängert!
- @if($user->daysActiveAccount() <= 0) @if($user->isActiveAccount()) -
Dein Zahlungsfrist läuft heute aus, bitte aktualisiere jetzt Deine Mitgliedschaft!
+
{{__('membership.home_copy_alert_35')}}
+

{{__('membership.home_copy_last_35', ['days'=>$user->daysActiveAccount(), 'datetime'=>$user->getPaymentAccountDateFormat()])}}

@else -
Dein Zahlungsfrist ist vor {{ $user->daysActiveAccount()*-1 }} Tagen ausgelaufen, bitte aktualisiere jetzt Deine Mitgliedschaft!
+ {{-- 35, 36 --}} + @if($user->daysActiveAccount() == 0) +
{{__('membership.home_copy_alert_36_today', ['datetime'=>$user->getPaymentAccountDateFormat()])}}
+ @else +
{{__('membership.home_copy_alert_36', ['days'=>$user->daysActiveAccount()*-1, 'datetime'=>$user->getPaymentAccountDateFormat()])}}
@endif - @elseif($user->daysActiveAccount() < config('mivita.abo_booking_days') ) -
Dein Zahlungsfrist läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Mitgliedschaft!
- @else -
Dein Zahlungsfrist läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Mitgliedschaft!
- @if($user->abo_options && $user->payment_account) -

Deine automatische Verlängerung ist aktiv, wir werden am {!! Carbon::parse($user->payment_account)->modify('-'.config('mivita.abo_booking_days').' days')->format('d.m.Y') !!} Deine Mitgliedschaftsgebühr automatisch per SEPA Mandat einziehen.
- @endif - @endif -

Erst wenn Dein Jahresbeitrag bei uns eingeht wird Deine Mitgliedschaft automastisch für ein Jahr verlängert. Die Verlängerung gilt ab erstes Abschlussdatum ein weiteres volles Jahr, bis zum {{$user->modifyActiveAccount()}}. - Sollte nach Ablauf der Zahlungsfrist Dein Jahresbeitrag nicht bei uns eingehen, wird Dein Account gesperrt.

+ @if($user->payment_account && $user->isAboOption()) + {{ __('membership.home_copy_SEPA_36', ['price'=> 'von '.$user->payment_order_product->getFormattedPrice().' EUR', 'pay_date'=>Carbon::parse($user->payment_account)->modify('- '.config('mivita.abo_booking_days').' days')->format('d.m.Y')]) }} +
+ @endif +

{{__('membership.home_copy_last_36', ['days'=>$user->daysActiveAccount(), 'datetime'=>$user->getPaymentAccountDateFormat()])}}

+ @endif + @elseif($user->daysActiveAccount() < config('mivita.remind_last_days') ) + {{-- 33 --}} +
{{ __('membership.home_copy_alert_31', ['datetime'=>$user->getPaymentAccountDateFormat()]) }}
+

{{__('membership.home_copy_last_34', ['days'=>$user->daysActiveAccount(), 'datetime'=>$user->getPaymentAccountDateFormat()])}}

+ @elseif($user->daysActiveAccount() < config('mivita.remind_sec_days')) + {{-- 33 --}} +
{{ __('membership.home_copy_alert_31', ['datetime'=>$user->getPaymentAccountDateFormat()]) }}
+ @if($user->payment_account && $user->isAboOption()) + @if($user->daysActiveAccount() < config('mivita.abo_booking_days') ) +

{{ __('membership.home_copy_SEPA_33', ['price'=> 'von '.$user->payment_order_product->getFormattedPrice().' EUR', 'pay_date'=>Carbon::parse($user->payment_account)->modify('- '.config('mivita.abo_booking_days').' days')->format('d.m.Y')]) }}

+ @else +

{{ __('membership.home_copy_SEPA_32', ['price'=> 'von '.$user->payment_order_product->getFormattedPrice().' EUR', 'pay_date'=>Carbon::parse($user->payment_account)->modify('- '.config('mivita.abo_booking_days').' days')->format('d.m.Y')]) }}

+ @endif +
+ @endif +

{{__('membership.home_copy_last_33', ['days'=>$user->daysActiveAccount()])}}

+ @else + {{-- 32 / 31 --}} +
{{ __('membership.home_copy_alert_31', ['datetime'=>$user->getPaymentAccountDateFormat()]) }}
+ @if($user->payment_account && $user->isAboOption()) + {{ __('membership.home_copy_SEPA_32', ['price'=> 'von '.$user->payment_order_product->getFormattedPrice().' EUR', 'pay_date'=>Carbon::parse($user->payment_account)->modify('- '.config('mivita.abo_booking_days').' days')->format('d.m.Y')]) }} +
+ @endif +

{{__('membership.home_copy_last_31', ['days'=>$user->daysActiveAccount()])}}

+ + @endif
- @if(!$user->abo_options) + @if(!$user->isAboOption())