Cocker Setup

This commit is contained in:
Kevin Adametz 2025-08-29 14:48:03 +02:00
parent 8fdaa0ba1d
commit 8c11130b5d
191 changed files with 8152 additions and 18186 deletions

View file

@ -38,23 +38,23 @@ class CheckPaymentsAccount extends Command
$this->info('COMMAND [payments:check-accounts] started.');
// Die Logik wurde 1:1 aus der checkPaymentsAccounts-Methode übernommen
$renewalDate = Carbon::now()->modify('+'.(config('mivita.remind_first_days')+1).' days');
$renewalDate = Carbon::now()->modify('+' . (config('mivita.remind_first_days') + 1) . ' days');
Log::channel('cron')->info('Erneuerungsdatum für Zahlungen: ' . $renewalDate->format('Y-m-d H:i:s'));
$users = User::where('payment_account', '!=', NULL)
->where('active', '=', 1)
->where('blocked', '!=', 1)
->where('payment_account', '<', $renewalDate)
->get();
->where('active', '=', 1)
->where('blocked', '!=', 1)
->where('payment_account', '<', $renewalDate)
->get();
Log::channel('cron')->info('Found ' . $users->count() . ' users for payment reminders.');
$this->info('Found ' . $users->count() . ' users for payment reminders.');
foreach ($users as $user){
Log::channel('cron')->info('Prüfe Zahlungserinnerungen für Benutzer: ' . $user->email);
$this->checkReminderPayments($user);
foreach ($users as $user) {
Log::channel('cron')->info('Prüfe Zahlungserinnerungen für Benutzer: ' . $user->email);
$this->checkReminderPayments($user);
}
Log::channel('cron')->info('COMMAND [payments:check-accounts] finished.');
$this->info('COMMAND [payments:check-accounts] finished.');
return 0; // Success
@ -79,28 +79,28 @@ class CheckPaymentsAccount extends Command
private function checkReminderPayments(User $user)
{
//35 reminder_deaktiv, 36 reminder_deaktiv_sepa
if(!$user->isActiveAccount()){
if (!$user->isActiveAccount()) {
Log::channel('cron')->info('Inaktives Konto für Benutzer: ' . $user->email);
$this->checkIsReminderSend($user, 35);
return;
}
//34 reminder_last
if($user->daysActiveAccount() <= config('mivita.remind_last_days')){
if ($user->daysActiveAccount() <= config('mivita.remind_last_days')) {
Log::channel('cron')->info('Letzte Erinnerung für Benutzer: ' . $user->email . ' (Tage aktiv: ' . $user->daysActiveAccount() . ')');
$this->checkIsReminderSend($user, 34);
return;
}
//33 reminder_sec
if($user->daysActiveAccount() <= config('mivita.remind_sec_days')){
if ($user->daysActiveAccount() <= config('mivita.remind_sec_days')) {
Log::channel('cron')->info('Zweite Erinnerung für Benutzer: ' . $user->email . ' (Tage aktiv: ' . $user->daysActiveAccount() . ')');
$this->checkIsReminderSend($user, 33);
return;
}
//31 reminder_first
if($user->daysActiveAccount() > config('mivita.remind_sec_days')){
if ($user->daysActiveAccount() > config('mivita.remind_sec_days')) {
Log::channel('cron')->info('Erste Erinnerung für Benutzer: ' . $user->email . ' (Tage aktiv: ' . $user->daysActiveAccount() . ')');
$this->checkIsReminderSend($user, 31);
return;
@ -117,28 +117,28 @@ class CheckPaymentsAccount extends Command
private function checkIsReminderSend(User $user, $status)
{
$isSend = UserHistory::whereUserId($user->id)
->whereAction('reminder_payments')
->whereIdentifier($user->payment_account)
->whereStatus($status)
->latest()
->first();
->whereAction('reminder_payments')
->whereIdentifier($user->payment_account)
->whereStatus($status)
->latest()
->first();
if($isSend){
if ($isSend) {
Log::channel('cron')->info('Erinnerung bereits gesendet für Benutzer: ' . $user->email . ' (Status: ' . $status . ')');
return true;
}
Log::channel('cron')->info('Sende neue Erinnerung für Benutzer: ' . $user->email . ' (Status: ' . $status . ')');
$referenz = $this->sendReminderMail($user, $status);
UserHistory::create([
'user_id' => $user->id,
'action' => 'reminder_payments',
'referenz' => $referenz,
'identifier' => $user->payment_account,
'user_id' => $user->id,
'action' => 'reminder_payments',
'referenz' => $referenz,
'identifier' => $user->payment_account,
'status' => $status
]);
return false;
}
@ -155,8 +155,8 @@ class CheckPaymentsAccount extends Command
$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)){
if ($user->payment_order_id && isset($user->payment_order_product->price)) {
$price = 'von ' . $user->payment_order_product->getFormattedPrice() . ' EUR';
}
@ -171,16 +171,16 @@ class CheckPaymentsAccount extends Command
'subject' => __('reminder.subject') . " | ID: " . $status,
'message' => $message,
'message_last' => $message_last,
'url' => route('user_membership'),
'url' => config('app.url') . '/user/membership',
'button' => $button,
];
$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 {
if(!Util::isTestSystem()){
if($status >= 34){
if (!Util::isTestSystem()) {
if ($status >= 34) {
Log::channel('cron')->info('Sende kritische Erinnerung mit BCC an: ' . $user->email);
Mail::to($user->email)
->locale($user->getLocale())
@ -195,19 +195,19 @@ class CheckPaymentsAccount extends Command
} else {
Log::channel('cron')->info('Testsystem: E-Mail-Versand simuliert für: ' . $user->email);
}
} catch(\Exception $e) {
} catch (\Exception $e) {
Log::channel('cron')->error('Mail-Fehler für Benutzer ' . $user->email . ': ' . $e->getMessage());
$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();
Log::channel('cron')->info('Erinnerungsmail erfolgreich gesendet an: ' . $user->email);
return 1;
}
}
}

View file

@ -25,7 +25,7 @@ class CheckoutController extends Controller
{
private $checkoutRepo;
private $instance = 'checkout';
/**
* Create a new controller instance.
*
@ -50,7 +50,7 @@ class CheckoutController extends Controller
<a href="{{ Util::getMyMivitaPortalUrl() }}" class="btn btn-primary btn-block mt-3 faa-parent animated-hover"><i class="fa fa-sign-in"></i> {{ __('website.to_customer_portal') }} </a>
@endif
@if(Auth::guard('user')->check())
*/
*/
$shopping_data = Yard::instance($this->instance)->getYardExtra('shopping_data');
$is_from = $shopping_data['is_from'] ?? 'shopping';
$is_for = $shopping_data['is_for'] ?? false;
@ -70,14 +70,17 @@ class CheckoutController extends Controller
}
}
if (Session::has('new_session')) {
$this->checkoutRepo->sessionDestroy();
$this->checkoutRepo->sessionDestroy();
Session::forget('new_session');
}
}
$shopping_user = $this->initializeShoppingUserSession($is_from, $is_for, $shopping_data, $homeparty_id);
$this->prepareShoppingUserData($shopping_user);
$payment_methods = $this->checkoutRepo->getPaymentsMethods($is_from, $is_abo);
if ($shopping_user === null) {
abort(403, 'ShoppingUser not found');
}
$data = [
'is_from' => $is_from,
'is_for' => $is_for,
@ -97,8 +100,8 @@ class CheckoutController extends Controller
return view('web.templates.checkout', $data);
}
/**
* Bereitet die ShoppingUser-Daten vor
*
@ -142,7 +145,7 @@ class CheckoutController extends Controller
if (isset($data['payment_method'])) {
$this->checkoutRepo->isPaymentsMethodsActive($data['payment_method'], $data['is_from'], $data['is_abo']);
}
Util::setInstanceStatus(2, true); // link_check
// Länderwechsel verarbeiten
@ -155,16 +158,16 @@ class CheckoutController extends Controller
if ($validator->fails()) {
return back()->withErrors($validator)->withInput(Request::all());
}
// Benutzer und Bestellung erstellen
$shopping_user = $this->checkoutRepo->makeShoppingUser($data);
$shopping_order = $this->checkoutRepo->makeShoppingOrder($shopping_user, $data);
// CustomerPriority prüfen
if ($shopping_user->is_from === 'shopping') {
CustomerPriority::checkOne(ShoppingUser::find($shopping_user->id), true);
}
Util::setUserHistoryValue(['status' => 2, 'shopping_order_id' => $shopping_order->id]);
// Zahlungsmethode verarbeiten
@ -188,7 +191,7 @@ class CheckoutController extends Controller
} else {
Yard::instance($this->instance)->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']);
}
return back()->withInput(Request::all());
}
@ -220,7 +223,7 @@ class CheckoutController extends Controller
'shipping_salutation' => 'required'
]);
}
return Validator::make(Request::all(), $rules);
}
@ -236,7 +239,7 @@ class CheckoutController extends Controller
{
$result = [];
$payment_method = Request::get('payment_method');
// Kreditkarte prüfen
if ($payment_method === 'cc') {
$result = $this->checkCreditCard($data, $shopping_user, $shopping_order);
@ -260,7 +263,7 @@ class CheckoutController extends Controller
$reference = $pay->setPrePayment($payment_method, $amount, 'EUR', $result);
$this->checkoutRepo->putSessionPayments('payment_reference', $reference);
$pay->setPersonalData();
return $pay->ResponseData();
}
@ -277,7 +280,7 @@ class CheckoutController extends Controller
$pay = new PayoneController();
$pay->init($shopping_user, $shopping_order);
$ret['cc'] = $pay->checkCreditCard($data);
if ($ret['cc']['status'] === 'ERROR' || $ret['cc']['status'] === 'INVALID') {
Session::flash('cc-error', 1);
Session::flash('errormessage', $ret['cc']['errormessage']);
@ -303,14 +306,14 @@ class CheckoutController extends Controller
$pay->init($shopping_user, $shopping_order);
$amount = Yard::instance($this->instance)->totalWithShipping(2, '.', '') * 100;
$ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user);
if ($ret['elv']['status'] === 'ERROR' || $ret['elv']['status'] === 'INVALID') {
Session::flash('elv-error', 1);
Session::flash('errormessage', $ret['elv']['errormessage']);
Session::flash('customermessage', $ret['elv']['customermessage']);
return redirect(route('checkout.checkout_card'))->withInput(Request::all());
}
if ($ret['elv']['status'] === 'APPROVED' && $ret['elv']['mandate_status'] !== "active") {
Session::flash('elv-managemandate', 1);
Session::flash('elv-mandate_identification', $ret['elv']['mandate_identification']);
@ -318,7 +321,7 @@ class CheckoutController extends Controller
Session::flash('elv-creditor_identifier', $ret['elv']['creditor_identifier']);
return redirect(route('checkout.checkout_card'))->withInput(Request::all());
}
$ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder'];
} else {
$ret['elv'] = [
@ -328,7 +331,7 @@ class CheckoutController extends Controller
'bic' => $data['elv_bic'],
'bankaccountholder' => $data['elv_bankaccountholder']
];
$this->storeUserPaymentsData($shopping_user, $ret);
}
$ret['returnstatus'] = 'VALID';
@ -347,7 +350,7 @@ class CheckoutController extends Controller
'is_checkout' => true,
'yard_instance' => $this->instance,
];
return view('web.templates.checkout-is-final', $data);
}
@ -364,13 +367,13 @@ class CheckoutController extends Controller
$ShoppingPayment = ShoppingPayment::where('shopping_order_id', $shopping_order_id)
->where('reference', $reference)
->first();
if (!$ShoppingPayment) {
Util::setUserHistoryValue(['status' => 21]);
Session::flash('checkout-error', 'Der Zahlungsvorgang konnte nicht abgeschlossen werden, die Zahlung wurde nicht gefunden: ' . $reference);
return redirect(route('checkout.checkout_card'));
}
$ShoppingPayment->status = $status;
$ShoppingPayment->save();
@ -384,7 +387,7 @@ class CheckoutController extends Controller
Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
return redirect(route('checkout.checkout_card'));
}
if ($status === "error") {
Util::setUserHistoryValue(['status' => 23]);
Util::setInstanceStatus(6); // link_failed
@ -419,7 +422,7 @@ class CheckoutController extends Controller
'is_checkout' => true,
'yard_instance' => $this->instance,
];
return view('web.templates.checkout-final', $data);
}
@ -457,7 +460,7 @@ class CheckoutController extends Controller
'is_checkout' => true,
'yard_instance' => $this->instance,
];
return view('web.templates.checkout-final', $data);
}
@ -493,20 +496,20 @@ class CheckoutController extends Controller
$shopping_order = ShoppingOrder::find($payt->transmitted_data['param']);
$shopping_order->txaction = 'invoice_open';
$shopping_order->save();
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
if ($shopping_payment) {
$shopping_payment->txaction = 'invoice_open';
$shopping_payment->save();
}
$send_link = Payment::paymentStatusPaidAction($shopping_order, false, $shopping_payment);
$data = [
'mode' => $payt->transmitted_data['mode'],
'txaction' => $payt->txaction,
'send_link' => $send_link,
];
Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data);
}
}
@ -539,7 +542,7 @@ class CheckoutController extends Controller
//Bestelllink
if ($is_for === 'ot-customer' || $is_for === 'abo-ot-customer') {
//customer shop mit den Daten aus dem Salescenter shopping_data
return $this->checkoutRepo->makeCustomerShoppingUser($shopping_data, $is_for, $is_from);
return $this->checkoutRepo->makeCustomerShoppingUser($shopping_data, $is_for, $is_from);
}
//Webshop
return $this->checkoutRepo->initShoppingUser($is_for, $is_from, $homeparty_id);
@ -548,7 +551,7 @@ class CheckoutController extends Controller
return $this->getExistingShoppingUser();
}
/**
/**
* Holt den existierenden ShoppingUser und bereitet ihn vor
*
* @return ShoppingUser
@ -559,8 +562,7 @@ class CheckoutController extends Controller
$shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id);
$shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id);
$shopping_user->same_as_billing = $shopping_user->same_as_billing ? false : true; // reinvert
return $shopping_user;
}
}
}

View file

@ -1,4 +1,5 @@
<?php
namespace App\Mail;
use App\User;
@ -24,34 +25,34 @@ class MailAutoReleaseAccount extends Mailable
public function build()
{
$content = __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
if($this->user->account->phone){
$content = __(strtoupper($this->user->account->salutation)) . " ";
$content .= $this->user->account->first_name . " " . $this->user->account->last_name . "\n";
$content .= $this->user->account->address . "\n";
$content .= $this->user->account->zipcode . " " . $this->user->account->city . "\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de . "\n\n" : "\n\n";
if ($this->user->account->phone) {
$content .= "Telefon: ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone." " : " ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone . " " : " ";
$content .= $this->user->account->phone;
}
if($this->user->account->mobil){
if ($this->user->account->mobil) {
$content .= "Mobil: ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone." " : " ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone . " " : " ";
$content .= $this->user->account->mobil;
}
$content .= "E-Mail: ".$this->user->email;
$content .= "E-Mail: " . $this->user->email;
$copy1line = "Ein neuer Berater hat sich registriert und wurde automatisch freigeschaltet. Seine Daten müssen nachträglich Überprüfung werden:"."\n";
$copy1line .= "+ Überprüfung der Ausweisdaten"."\n";
$copy1line .= "+ Überprüfung des Gewerbenachweises"."\n";
$copy1line .= "+ Eintrag Account ID"."\n";
$copy1line .= "+ Überprüfung / Kenntnisnahme Sponsor"."\n";
$copy1line .= "+ Überprüfung der Rechnungsdaten"."\n";
$copy1line .= 'Sollte Daten nicht vollständig sein, bitte Kontakt zum Berater aufnehmen.'."\n";
$copy1line = "Ein neuer Berater hat sich registriert und wurde automatisch freigeschaltet. Seine Daten müssen nachträglich Überprüfung werden:" . "\n";
$copy1line .= "+ Überprüfung der Ausweisdaten" . "\n";
$copy1line .= "+ Überprüfung des Gewerbenachweises" . "\n";
$copy1line .= "+ Eintrag Account ID" . "\n";
$copy1line .= "+ Überprüfung / Kenntnisnahme Sponsor" . "\n";
$copy1line .= "+ Überprüfung der Rechnungsdaten" . "\n";
$copy1line .= 'Sollte Daten nicht vollständig sein, bitte Kontakt zum Berater aufnehmen.' . "\n";
return $this->view('emails.info')->with([
'url' => config('app.url_crm') . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'url' => \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'title' => 'Berater Registrierung prüfen',
'button' => 'zur Berater Prüfung',
'copy1line' => $copy1line,
@ -59,4 +60,4 @@ class MailAutoReleaseAccount extends Mailable
'content' => $content,
]);
}
}
}

View file

@ -1,4 +1,5 @@
<?php
namespace App\Mail;
use App\User;
@ -24,13 +25,13 @@ class MailInfo extends Mailable
$this->action = $action;
$this->data = $data;
if($this->action === "delete_membership"){
if ($this->action === "delete_membership") {
$this->subject = 'Mitgliedschaft beenden - beantragt';
}
if($this->action === "check_is_like_customer"){
if ($this->action === "check_is_like_customer") {
$this->subject = 'Kunden überprüfen - Kundenhoheit';
}
if($this->action === "change_is_like_customer"){
if ($this->action === "change_is_like_customer") {
$this->subject = 'Kunden erneut überprüfen - Kundenhoheit';
}
}
@ -40,68 +41,68 @@ class MailInfo extends Mailable
{
$content = "";
if($this->action === "delete_membership"){
$content .= __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
if($this->user->account->phone){
if ($this->action === "delete_membership") {
$content .= __(strtoupper($this->user->account->salutation)) . " ";
$content .= $this->user->account->first_name . " " . $this->user->account->last_name . "\n";
$content .= $this->user->account->address . "\n";
$content .= $this->user->account->zipcode . " " . $this->user->account->city . "\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de . "\n\n" : "\n\n";
if ($this->user->account->phone) {
$content .= "Telefon: ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone." " : " ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone . " " : " ";
$content .= $this->user->account->phone;
}
if($this->user->account->mobil){
if ($this->user->account->mobil) {
$content .= "Mobil: ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone." " : " ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone . " " : " ";
$content .= $this->user->account->mobil;
}
$content .= "E-Mail: ".$this->user->email;
$content .= "E-Mail: " . $this->user->email;
$copy1line = "Infos zum Berater:"."\n";
$copy1line = "Infos zum Berater:" . "\n";
$button = "zum Berater";
$title = "Ein Berater möchte seine Mitgliedschaft beenden.";
$url = config('app.url_crm') . '/admin/lead/edit/' . $this->user->id . '?show=check_lead';
$url = \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead';
}
if($this->action === "check_is_like_customer") {
$copy1line = "Hier geht es zum Kunden:"."\n";
if ($this->action === "check_is_like_customer") {
$copy1line = "Hier geht es zum Kunden:" . "\n";
$button = "zum Kunden";
$title = "Ein Kunden muss überprüft werden und einem Berater zugeordnet werden, da die Adresse nicht eindeutig ist.";
$url = config('app.url_crm') . '/admin/customer/detail/' . $this->user->id;
$content .= $this->user ? 'Firma: '.$this->user->billing_company."\n" : '';
$content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation)." ";
$content .= $this->user->billing_firstname." ";
$content .= $this->user->billing_lastname."\n";
$url = \App\Services\Util::getMyMivitaUrl() . '/admin/customer/detail/' . $this->user->id;
$content .= $this->user ? 'Firma: ' . $this->user->billing_company . "\n" : '';
$content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation) . " ";
$content .= $this->user->billing_firstname . " ";
$content .= $this->user->billing_lastname . "\n";
$content .= $this->user->billing_address;
$content .= $this->user->billing_address_2 ? '/ '.$this->user->billing_address_2."\n" : "\n";
$content .= $this->user->billing_zipcode." ";
$content .= $this->user->billing_city."\n";
$content .= $this->user->billing_email."\n";
$content .= $this->user->billing_phone."\n";
$content .= $this->user->billing_address_2 ? '/ ' . $this->user->billing_address_2 . "\n" : "\n";
$content .= $this->user->billing_zipcode . " ";
$content .= $this->user->billing_city . "\n";
$content .= $this->user->billing_email . "\n";
$content .= $this->user->billing_phone . "\n";
$content .= $this->user->billing_country->getLocated();
}
if($this->action === "change_is_like_customer"){
$copy1line = "Hier geht es zum Kunden:"."\n";
if ($this->action === "change_is_like_customer") {
$copy1line = "Hier geht es zum Kunden:" . "\n";
$button = "zum Kunden";
$title = "Ein Kunden muss erneut überprüft werden, da bei einer Änderung eine bestehende Kundenhoheit gefunden wurde.";
$url = config('app.url_crm') . '/admin/customer/detail/' . $this->user->id;
$content .= "Folgende Daten für die Kundenhoheit wurden geändert:"."\n";
foreach ($this->data as $key=>$value){
$content .= $this->user->{$key}." => ".$value."\n";
$url = \App\Services\Util::getMyMivitaUrl() . '/admin/customer/detail/' . $this->user->id;
$content .= "Folgende Daten für die Kundenhoheit wurden geändert:" . "\n";
foreach ($this->data as $key => $value) {
$content .= $this->user->{$key} . " => " . $value . "\n";
}
$content .= "\n"."\n"."Rechnungsadresse des Kunden vor der Änderung:"."\n";
$content .= $this->user ? 'Firma: '.$this->user->billing_company."\n" : '';
$content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation)." ";
$content .= $this->user->billing_firstname." ";
$content .= $this->user->billing_lastname."\n";
$content .= "\n" . "\n" . "Rechnungsadresse des Kunden vor der Änderung:" . "\n";
$content .= $this->user ? 'Firma: ' . $this->user->billing_company . "\n" : '';
$content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation) . " ";
$content .= $this->user->billing_firstname . " ";
$content .= $this->user->billing_lastname . "\n";
$content .= $this->user->billing_address;
$content .= $this->user->billing_address_2 ? '/ '.$this->user->billing_address_2."\n" : "\n";
$content .= $this->user->billing_zipcode." ";
$content .= $this->user->billing_city."\n";
$content .= $this->user->billing_email."\n";
$content .= $this->user->billing_phone."\n";
$content .= $this->user->billing_address_2 ? '/ ' . $this->user->billing_address_2 . "\n" : "\n";
$content .= $this->user->billing_zipcode . " ";
$content .= $this->user->billing_city . "\n";
$content .= $this->user->billing_email . "\n";
$content .= $this->user->billing_phone . "\n";
$content .= $this->user->billing_country->getLocated();
}
return $this->view('emails.info')->with([
@ -113,4 +114,4 @@ class MailInfo extends Mailable
'content' => $content,
]);
}
}
}

View file

@ -1,4 +1,5 @@
<?php
namespace App\Mail;
use App\User;
@ -24,35 +25,35 @@ class MailReleaseAccount extends Mailable
public function build()
{
$content = __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
if($this->user->account->phone){
$content = __(strtoupper($this->user->account->salutation)) . " ";
$content .= $this->user->account->first_name . " " . $this->user->account->last_name . "\n";
$content .= $this->user->account->address . "\n";
$content .= $this->user->account->zipcode . " " . $this->user->account->city . "\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de . "\n\n" : "\n\n";
if ($this->user->account->phone) {
$content .= "Telefon: ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone." " : " ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone . " " : " ";
$content .= $this->user->account->phone;
}
if($this->user->account->mobil){
if ($this->user->account->mobil) {
$content .= "Mobil: ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone." " : " ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone . " " : " ";
$content .= $this->user->account->mobil;
}
$content .= "E-Mail: ".$this->user->email;
$content .= "E-Mail: " . $this->user->email;
$copy1line = "Ein neuer Berater hat sich registriert und wartet auf die Überprüfung und Freigabe seiner Daten:"."\n";
$copy1line .= "+ Überprüfung der Ausweisdaten"."\n";
$copy1line .= "+ Überprüfung des Gewerbenachweises"."\n";
$copy1line .= "+ Eintrag Account ID"."\n";
$copy1line .= "+ Überprüfung / Kenntnisnahme Sponsor"."\n";
$copy1line .= "+ Überprüfung der Rechnungsdaten"."\n";
$copy1line .= 'Nach erfolgreicher Überprüfung mit dem Button „Daten vollständig => Berater freischalten“ den Berater freischalten.'."\n";
$copy1line .= 'Der Berater erhält eine Mail, dass sein Account freigeschaltet wurde. Der Vertrag wird automatisch mit den Daten des Vertriebspartners erstellt.'."\n";
$copy1line = "Ein neuer Berater hat sich registriert und wartet auf die Überprüfung und Freigabe seiner Daten:" . "\n";
$copy1line .= "+ Überprüfung der Ausweisdaten" . "\n";
$copy1line .= "+ Überprüfung des Gewerbenachweises" . "\n";
$copy1line .= "+ Eintrag Account ID" . "\n";
$copy1line .= "+ Überprüfung / Kenntnisnahme Sponsor" . "\n";
$copy1line .= "+ Überprüfung der Rechnungsdaten" . "\n";
$copy1line .= 'Nach erfolgreicher Überprüfung mit dem Button „Daten vollständig => Berater freischalten“ den Berater freischalten.' . "\n";
$copy1line .= 'Der Berater erhält eine Mail, dass sein Account freigeschaltet wurde. Der Vertrag wird automatisch mit den Daten des Vertriebspartners erstellt.' . "\n";
return $this->view('emails.info')->with([
'url' => config('app.url_crm') . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'url' => \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'title' => 'Berater Registrierung prüfen',
'button' => 'zur Berater Prüfung',
'copy1line' => $copy1line,
@ -60,4 +61,4 @@ class MailReleaseAccount extends Mailable
'content' => $content,
]);
}
}
}

View file

@ -1,4 +1,5 @@
<?php
namespace App\Mail;
use App\User;
@ -23,32 +24,32 @@ class MailReleaseDocument extends Mailable
public function build()
{
$content = __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
$content .= "E-Mail: ".$this->user->email;
$content = __(strtoupper($this->user->account->salutation)) . " ";
$content .= $this->user->account->first_name . " " . $this->user->account->last_name . "\n";
$content .= $this->user->account->address . "\n";
$content .= $this->user->account->zipcode . " " . $this->user->account->city . "\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de . "\n\n" : "\n\n";
$content .= "E-Mail: " . $this->user->email;
$copy1line = "Ein Berater hat Daten zum Gewerbenachweis geändert, bitte um Prüfung:"."\n\n";
$copy1line = "Ein Berater hat Daten zum Gewerbenachweis geändert, bitte um Prüfung:" . "\n\n";
$business_license_choose = $this->user->account->getNotice('business_license');
if($business_license_choose === 'now'){
$copy1line .= "+ Gewerbeschein jetzt zur Freigabe"."\n\n";
if ($business_license_choose === 'now') {
$copy1line .= "+ Gewerbeschein jetzt zur Freigabe" . "\n\n";
}
if($business_license_choose === 'later'){
$copy1line .= "+ Ich reiche meinen Gewerbeschein innerhalb der nächsten 4 Wochen nach"."\n\n";
if ($business_license_choose === 'later') {
$copy1line .= "+ Ich reiche meinen Gewerbeschein innerhalb der nächsten 4 Wochen nach" . "\n\n";
}
if($business_license_choose === 'non'){
$copy1line .= "+ Ich benötige keinen Gewerbeschein"."\n";
$copy1line .= "+ Begründung: ".$this->user->account->getNotice('business_license_reason')."\n\n";
if ($business_license_choose === 'non') {
$copy1line .= "+ Ich benötige keinen Gewerbeschein" . "\n";
$copy1line .= "+ Begründung: " . $this->user->account->getNotice('business_license_reason') . "\n\n";
}
$copy1line .= 'Bei fehlerhafter Angabe nimm bitte kontakt mit dem Berater auf.'."\n";
$copy1line .= 'Bei fehlerhafter Angabe nimm bitte kontakt mit dem Berater auf.' . "\n";
return $this->view('emails.info')->with([
'url' => config('app.url_crm') . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'url' => \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'title' => 'Berater Unterlagen prüfen',
'button' => 'zur Berater Prüfung',
'copy1line' => $copy1line,
@ -56,4 +57,4 @@ class MailReleaseDocument extends Mailable
'content' => $content,
]);
}
}
}

View file

@ -8,8 +8,6 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; // Wichtig!
/**
*
*
* @property int $id
* @property string|null $name
* @property string $email

View file

@ -0,0 +1,36 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Horizon\Horizon;
use Laravel\Horizon\HorizonApplicationServiceProvider;
class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
parent::boot();
// Horizon::routeSmsNotificationsTo('15556667777');
// Horizon::routeMailNotificationsTo('example@example.com');
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
}
/**
* Register the Horizon gate.
*
* This gate determines who can access Horizon in non-local environments.
*/
protected function gate(): void
{
Gate::define('viewHorizon', function ($user = null) {
return in_array(optional($user)->email, [
//
]);
});
}
}

View file

@ -58,7 +58,7 @@ class RouteServiceProvider extends ServiceProvider
/** @var DomainContext $context */
$context = app(DomainContext::class);
$this->loadSharedRoutes();
\Log::info('loadDomainAwareRoutes', ['context' => $context]);
match ($context->type) {
'main' => $this->loadDomainRoutes('main', 'main.php'),
'main-shop' => [