Free Shipping, Business Levels correction, Products Buying, Fonts
This commit is contained in:
parent
3f2fbd6d5b
commit
0341c9c189
197 changed files with 9161 additions and 329 deletions
|
|
@ -78,8 +78,8 @@ class KasController extends Controller
|
|||
]);
|
||||
$this->CredentialToken = $SoapLogon->KasAuth(json_encode(array(
|
||||
'KasUser' => $this->kas_user,
|
||||
'KasAuthType' => 'sha1',
|
||||
'KasPassword' => sha1($this->kas_pass),
|
||||
'KasAuthType' => 'plain',
|
||||
'KasPassword' => $this->kas_pass,
|
||||
'SessionLifeTime' => $this->session_lifetime,
|
||||
'SessionUpdateLifeTime' => $this->session_update_lifetime
|
||||
)));
|
||||
|
|
|
|||
|
|
@ -55,18 +55,18 @@ diQ860kC4h++erAa8dvB1DUG5oldYYPiEKOyyyn+tNU298QcEkLrG1JcLuUXpfTg
|
|||
8dPIr+VpGomsvpwGTfJFjlE=
|
||||
-----END PRIVATE KEY-----";
|
||||
private static $ssl_certificate_sni_crt = "-----BEGIN CERTIFICATE-----
|
||||
MIIGLzCCBRegAwIBAgIRAJ6HzyfKXWCtRn3q9gGkgYEwDQYJKoZIhvcNAQELBQAw
|
||||
MIIGMTCCBRmgAwIBAgIRANRDAE1KIec3seJ9ed+Qy4UwDQYJKoZIhvcNAQELBQAw
|
||||
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
|
||||
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
|
||||
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
|
||||
QTAeFw0yMTA3MjIwMDAwMDBaFw0yMjA3MjIyMzU5NTlaMBgxFjAUBgNVBAMMDSou
|
||||
QTAeFw0yMjA3MTIwMDAwMDBaFw0yMzA4MTIyMzU5NTlaMBgxFjAUBgNVBAMMDSou
|
||||
bWl2aXRhLmNhcmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVOhtO
|
||||
TJBn5V9SmHmo/EawNiO0VwHOVnnrfnaPD2A1DeKqHmAfMTaybHaCfi+mufV8veem
|
||||
fY1j6rXq7RFU46SMBbFlfZqKS/3zb2d3yRT7OBU83PV5P8JXHrqEArlmKiOZcPoj
|
||||
86TTAbq5wwxjFXkePzJSdOdUN/Z1E1tI8ieUQC40tpMsRvf5XOzQZousXBT1P6F9
|
||||
Q2FbUKEfiEBJ0wjnz74a73U7DebuYGEFPSjVjrkVB11+55y1MBkwg/6JIro+BlXo
|
||||
rW6Xaifb1PKFbTFQnlC4BAKyPHxNKWZCSHgw/C3A7fBQKHM1wVhZo2BZrumdE+X1
|
||||
FOScWlN+M/+TyUybAgMBAAGjggL6MIIC9jAfBgNVHSMEGDAWgBSNjF7EVK2K4Xfp
|
||||
FOScWlN+M/+TyUybAgMBAAGjggL8MIIC+DAfBgNVHSMEGDAWgBSNjF7EVK2K4Xfp
|
||||
m/mbBeG4AY1h4TAdBgNVHQ4EFgQUCS0Y1v7p19isO7cTuP3YrKVr2OcwDgYDVR0P
|
||||
AQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG
|
||||
AQUFBwMCMEkGA1UdIARCMEAwNAYLKwYBBAGyMQECAgcwJTAjBggrBgEFBQcCARYX
|
||||
|
|
@ -74,21 +74,21 @@ aHR0cHM6Ly9zZWN0aWdvLmNvbS9DUFMwCAYGZ4EMAQIBMIGEBggrBgEFBQcBAQR4
|
|||
MHYwTwYIKwYBBQUHMAKGQ2h0dHA6Ly9jcnQuc2VjdGlnby5jb20vU2VjdGlnb1JT
|
||||
QURvbWFpblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcnQwIwYIKwYBBQUHMAGG
|
||||
F2h0dHA6Ly9vY3NwLnNlY3RpZ28uY29tMCUGA1UdEQQeMByCDSoubWl2aXRhLmNh
|
||||
cmWCC21pdml0YS5jYXJlMIIBfAYKKwYBBAHWeQIEAgSCAWwEggFoAWYAdQBGpVXr
|
||||
dfqRIDC1oolp9PN9ESxBdL79SbiFq/L8cP5tRwAAAXrNeYDBAAAEAwBGMEQCIFzd
|
||||
+zLvEGolSmSaa7vaQxv63DuX5vHQggER6/Dh+jZGAiAcUn8AZjF7GQOd4LTzGMhU
|
||||
KsGNyn6d3n4cJ9fy9BzRxAB1AEHIyrHfIkZKEMahOglCh15OMYsbA+vrS8do8JBi
|
||||
lgb2AAABes15gIYAAAQDAEYwRAIgE0NFzvN7qEre8Bc1C8EsMHD+5PDyQHZRBJkN
|
||||
OdxsH9MCIDBSFFZTheD2+nzbHm5WLvAI75xyUvyBx/LEy3XBtjulAHYAKXm+8J45
|
||||
OSHwVnOfY6V35b5XfZxgCvj5TV0mXCVdx4QAAAF6zXmAWwAABAMARzBFAiAbRPVk
|
||||
w3AIzVF7gE0R3ZJgou7P4o9KL2yRgAaeGbbClgIhAPL86sD0GwPZ9ZsL31q07Y/S
|
||||
1kq5ohBt907fOisMwI0HMA0GCSqGSIb3DQEBCwUAA4IBAQAaYeV2NtUM2HkxWbfd
|
||||
3jVAs1PdBIYtktBpx7UwNphylqF4qlsZwV5XZxeD/K7mTW5tgNaHHrEjaOME/y1s
|
||||
rWTIt1D+UUmDdiSgKfVF5gfajPFVepOcb5OC+ielevvnVJn/6Tqa/RNz0GstwMnB
|
||||
3lBaoP7oGuBy2Ow3LG0+yO4Q0j82gIkOM15CsjY9ZK540HAXllxKGN29Yf+RDkqE
|
||||
zRk4TE12MEW+Ugw6RxDSUCfKmev4iUAT9vq790OESAfOKY1zg/6hIF3noH1IFt1d
|
||||
e0wVWz58KTXBqHsmxX3F1PUuT6NY+wRsVfnc8hR8mfJibJ0VL8wxjzScDXyHpZr/
|
||||
o3I7
|
||||
cmWCC21pdml0YS5jYXJlMIIBfgYKKwYBBAHWeQIEAgSCAW4EggFqAWgAdQCt9776
|
||||
fP8QyIudPZwePhhqtGcpXc+xDCTKhYY069yCigAAAYHxRovYAAAEAwBGMEQCIA3z
|
||||
UR5BFV7bwBcdRhS8mru20uq36DNz3ILivZh9yl4CAiAUjDxqZBW0Po/0Rm0gumI1
|
||||
VBZfqMSDiA7Cr1peGN8B8wB3AHoyjFTYty22IOo44FIe6YQWcDIThU070ivBOlej
|
||||
UutSAAABgfFGi6UAAAQDAEgwRgIhAN9s3/v2ygh1tfPQ8iX2dLZdOVxyuvC7bf15
|
||||
KP4NQyabAiEAz88hRBxRu3FifpLaYNjwxy1fRUc2luWfDdw+f31TOfoAdgDoPtDa
|
||||
PvUGNTLnVyi8iWvJA9PL0RFr7Otp4Xd9bQa9bgAAAYHxRot7AAAEAwBHMEUCIQCQ
|
||||
RYqkeiRlStQacqUjuw5435NqNDqDlydAVYgywX05pwIgdcFtcLMGevO/KRyUeuWw
|
||||
8hYY6y1S7VYVdcFIuZVp5mswDQYJKoZIhvcNAQELBQADggEBAA0eEYSKcbgEPczo
|
||||
ABXpVsfbmaZqPhAKqcqKeGUcmFo7JHVPRUyck8RAF+SravyaHhilygU727QG4oUt
|
||||
riCewV39cKD2m7CO24WHe5+Fw8eslsJE+DBq/2WpLRJIGSWLl1r7WUELKQhqEYkr
|
||||
DCpkDXpG+lsDIfc5DC4dPLSWc9ezObsS4KEMCMDw+bj5GMGV6dHQZxAnbyqi71+v
|
||||
4+AOHpcYfe6v63w82M0YN5oTnaOukLVDgMXJ7WZP2op7atojB7DeM7k3+fj79kVJ
|
||||
jUGlvHLdN9jsczEZGGxL3w5oIjC4HMK1U5kyzEFWpc8ZLg+YPvF8w15lbhIXG94l
|
||||
JscmCFU=
|
||||
-----END CERTIFICATE-----";
|
||||
private static $ssl_certificate_sni_bundle = "-----BEGIN CERTIFICATE-----
|
||||
MIIGEzCCA/ugAwIBAgIQfVtRJrR2uhHbdBYLvFMNpzANBgkqhkiG9w0BAQwFADCB
|
||||
|
|
|
|||
169
app/Http/Controllers/BusinessCommissionController.php
Normal file
169
app/Http/Controllers/BusinessCommissionController.php
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use Carbon;
|
||||
use Request;
|
||||
use App\Services\Payment;
|
||||
use App\Models\UserInvoice;
|
||||
use App\Models\UserBusiness;
|
||||
use App\Services\HTMLHelper;
|
||||
use App\Models\UserSalesVolume;
|
||||
use App\Services\BusinessPlan\SalesPointsVolume;
|
||||
|
||||
class BusinessCommissionController extends Controller
|
||||
{
|
||||
|
||||
private $filter_show = [1 => 'nur Provisionen', 2 => 'alle'];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$filter_members = UserBusiness::join('users', 'user_id', '=', 'users.id')
|
||||
->groupBy('user_id')->join('user_accounts', 'account_id', '=', 'user_accounts.id')
|
||||
->select('users.id', 'users.email', 'user_accounts.first_name', 'user_accounts.last_name')->get();
|
||||
|
||||
|
||||
$this->setFilterVars();
|
||||
$data = [
|
||||
'filter_months' => HTMLHelper::$months,
|
||||
'filter_years' => HTMLHelper::getYearRange(),
|
||||
'filter_members' => $filter_members,
|
||||
'filter_show' => $this->filter_show,
|
||||
|
||||
];
|
||||
return view('admin.business.commissions', $data);
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$data = Request::all();
|
||||
|
||||
dd($data);
|
||||
|
||||
return redirect(route('admin_business_commissions'));
|
||||
}
|
||||
|
||||
|
||||
private function setFilterVars(){
|
||||
|
||||
if(!session('commissions_filter_month')){
|
||||
session(['commissions_filter_month' => intval(date('m'))]);
|
||||
}
|
||||
if(!session('commissions_filter_year')){
|
||||
session(['commissions_filter_year' => intval(date('Y'))]);
|
||||
}
|
||||
if(!session('commissions_filter_show')){
|
||||
session(['commissions_filter_show' => 1]);
|
||||
}
|
||||
|
||||
session(['commissions_filter_member_id' => Request::get('commissions_filter_member_id')]);
|
||||
|
||||
if(Request::get('commissions_filter_month')){
|
||||
session(['commissions_filter_month' => Request::get('commissions_filter_month')]);
|
||||
}
|
||||
if(Request::get('commissions_filter_year')){
|
||||
session(['commissions_filter_year' => Request::get('commissions_filter_year')]);
|
||||
}
|
||||
if(Request::get('commissions_filter_show')){
|
||||
session(['commissions_filter_show' => Request::get('commissions_filter_show')]);
|
||||
}
|
||||
}
|
||||
|
||||
private function initSearch()
|
||||
{
|
||||
$this->setFilterVars();
|
||||
|
||||
$query = UserBusiness::select('user_businesses.*')
|
||||
->where('user_businesses.month', '=', Request::get('commissions_filter_month'))
|
||||
->where('user_businesses.year', '=', Request::get('commissions_filter_year'));
|
||||
|
||||
if(intval(Request::get('commissions_filter_show')) === 1){
|
||||
$query->where(function($q) {
|
||||
return $q->where('user_businesses.commission_team_total', '>', 0)
|
||||
->orWhere('user_businesses.commission_shop_sales', '>', 0);
|
||||
});
|
||||
}
|
||||
|
||||
if(Request::get('commissions_filter_member_id')){
|
||||
$query->where('user_businesses.user_id', '=', Request::get('commissions_filter_member_id'));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function datatable(){
|
||||
|
||||
$query = $this->initSearch();
|
||||
return \DataTables::eloquent($query)
|
||||
/* ->addColumn('id', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<button type="button" class="btn btn-xs btn-secondary" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="'.$UserSalesVolume->id.'"
|
||||
data-action="edit_user_sales_volume"
|
||||
data-back=""
|
||||
data-modal="modal-xl"
|
||||
data-init_from="user"
|
||||
data-route="'.route('modal_load').'"><span class="far fa-eye"></span></button>';
|
||||
})*/
|
||||
|
||||
|
||||
->addColumn('commission_total', function (UserBusiness $UserBusiness) {
|
||||
$commission_total = $UserBusiness->commission_team_total + $UserBusiness->commission_shop_sales;
|
||||
return $commission_total > 0 ?
|
||||
'<span class="badge badge-outline-info">'.formatNumber($commission_total).' €</span>'
|
||||
: $commission_total.' €';
|
||||
})
|
||||
->addColumn('commission_team_total', function (UserBusiness $UserBusiness) {
|
||||
return $UserBusiness->commission_team_total > 0 ?
|
||||
'<span class="badge badge-outline-success">'.formatNumber($UserBusiness->commission_team_total).' €</span>'
|
||||
: $UserBusiness->commission_team_total.' €';
|
||||
})
|
||||
->addColumn('commission_shop_sales', function (UserBusiness $UserBusiness) {
|
||||
return $UserBusiness->commission_shop_sales > 0 ?
|
||||
'<span class="badge badge-outline-success">'.formatNumber($UserBusiness->commission_shop_sales).' €</span>'
|
||||
: $UserBusiness->commission_shop_sales.' €';
|
||||
})
|
||||
->addColumn('active_account', function (UserBusiness $userBusiness) {
|
||||
return get_active_badge($userBusiness->active_account);
|
||||
})
|
||||
->addColumn('payment_account_date', function (UserBusiness $userBusiness) {
|
||||
return $userBusiness->active_date ? formatDate($userBusiness->active_date) : "-";
|
||||
})
|
||||
|
||||
/* ->filterColumn('m_account', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("m_account LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('first_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("first_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('last_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("last_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("email LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})*/
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('commission_team_total', 'commission_team_total $1')
|
||||
->orderColumn('commission_shop_sales', 'commission_shop_sales $1')
|
||||
->orderColumn('email', 'users.email $1')
|
||||
->orderColumn('m_account', 'm_account $1')
|
||||
->orderColumn('first_name', 'first_name $1')
|
||||
->orderColumn('last_name', 'last_name $1')
|
||||
->rawColumns(['id', 'commission_total', 'commission_team_total', 'commission_shop_sales', 'active_account'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ class BusinessController extends Controller
|
|||
{
|
||||
|
||||
private $filter_active = [1 => 'aktiv', 2 => 'nicht aktiv', 3 => 'alle'];
|
||||
private $month;
|
||||
private $year;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
|
|
@ -170,11 +173,11 @@ class BusinessController extends Controller
|
|||
})
|
||||
->addColumn('sales_volume_points', function (UserBusiness $userBusiness) {
|
||||
return '<div class="no-line-break">'.$userBusiness->sales_volume_points_sum.'</div>'.
|
||||
'<span class="small no-line-break">B: '.$userBusiness->sales_volume_points.' | S: '.$userBusiness->sales_volume_points_shop.'</span>';
|
||||
'<span class="small no-line-break">E: '.$userBusiness->sales_volume_points.' | S: '.$userBusiness->sales_volume_points_shop.'</span>';
|
||||
})
|
||||
->addColumn('sales_volume_total', function (UserBusiness $userBusiness) {
|
||||
return '<div class="no-line-break">'.formatNumber($userBusiness->sales_volume_total_sum).' €</div>'.
|
||||
'<span class="small no-line-break">B: '.formatNumber($userBusiness->sales_volume_total).' | S: '.formatNumber($userBusiness->sales_volume_total_shop).'</span>';
|
||||
'<span class="small no-line-break">E: '.formatNumber($userBusiness->sales_volume_total).' | S: '.formatNumber($userBusiness->sales_volume_total_shop).'</span>';
|
||||
})
|
||||
->addColumn('email', function (UserBusiness $userBusiness) {
|
||||
return $userBusiness->email;
|
||||
|
|
@ -214,7 +217,34 @@ class BusinessController extends Controller
|
|||
->addColumn('payment_account_date', function (UserBusiness $userBusiness) {
|
||||
return $userBusiness->active_date ? formatDate($userBusiness->active_date) : "-";
|
||||
})
|
||||
|
||||
|
||||
->filterColumn('m_account', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("m_account LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('first_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("first_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('last_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("last_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("email LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('m_account', 'm_account $1')
|
||||
->orderColumn('email', 'email $1')
|
||||
->orderColumn('first_name', 'first_name $1')
|
||||
->orderColumn('last_name', 'last_name $1')
|
||||
->orderColumn('active_account', 'payment_account $1')
|
||||
->rawColumns(['id', 'is_qual_kp', 'sales_volume_points', 'sales_volume_total', 'sponsor', 'active_account'])
|
||||
->make(true);
|
||||
|
|
@ -224,13 +254,16 @@ class BusinessController extends Controller
|
|||
{
|
||||
$this->setFilterVars();
|
||||
|
||||
$query = User::with('account')->select('users.*')
|
||||
->where('users.deleted_at', '=', null)
|
||||
->where('users.id', '!=', 1)
|
||||
->where('users.admin', "<", 4)
|
||||
->where('users.m_level', "!=", null)
|
||||
->where('users.payment_account', "!=", null);
|
||||
$query = User::join('user_accounts', 'account_id', '=', 'user_accounts.id')
|
||||
->select('users.*', 'user_accounts.m_account', 'user_accounts.first_name', 'user_accounts.last_name')
|
||||
->where('users.deleted_at', '=', null)
|
||||
->where('users.id', '!=', 1)
|
||||
->where('users.admin', "<", 4)
|
||||
->where('users.m_level', "!=", null)
|
||||
->where('users.payment_account', "!=", null);
|
||||
|
||||
// $query = User::with('account')->select('users.*')
|
||||
|
||||
if(Request::get('business_user_filter_active')){
|
||||
if(Request::get('business_user_filter_active') == 1){
|
||||
$query->where('users.payment_account', ">=", now());
|
||||
|
|
@ -256,8 +289,8 @@ class BusinessController extends Controller
|
|||
data-back=""
|
||||
data-modal="modal-xl"
|
||||
data-init_from="admin"
|
||||
data-route="'.route('modal_load').'"><span class="far fa-calculator"></span></button>'
|
||||
.'<a href="' . route('admin_business_user_detail', [$user->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far fa-calculator"></span></a>';
|
||||
data-route="'.route('modal_load').'"><span class="far fa-calculator"></span></button>';
|
||||
//.'<a href="' . route('admin_business_user_detail', [$user->id]) . '" class="btn icon-btn btn-sm btn-info"><span class="far fa-calculator"></span></a>';
|
||||
})
|
||||
->addColumn('m_account', function (User $user) {
|
||||
return $user->account ? $user->account->m_account : '';
|
||||
|
|
@ -276,11 +309,11 @@ class BusinessController extends Controller
|
|||
})
|
||||
->addColumn('sales_volume_points', function (User $user) {
|
||||
return '<div class="no-line-break">'.$user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_points_sum').'</div>'.
|
||||
'<span class="small no-line-break">B: '.$user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_points').' | S: '.$user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_points_shop').'</span>';
|
||||
'<span class="small no-line-break">E: '.$user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_points').' | S: '.$user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_points_shop').'</span>';
|
||||
})
|
||||
->addColumn('sales_volume_total', function (User $user) {
|
||||
return '<div class="no-line-break">'.formatNumber($user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_total_sum')).' €</div>'.
|
||||
'<span class="small no-line-break">B: '.formatNumber($user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_total')).' | S: '.formatNumber($user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_total_shop')).'</span>';
|
||||
'<span class="small no-line-break">E: '.formatNumber($user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_total')).' | S: '.formatNumber($user->getUserSalesVolumeBy($this->month, $this->year, 'sales_volume_total_shop')).'</span>';
|
||||
})
|
||||
->addColumn('email', function (User $user) {
|
||||
return $user->email;
|
||||
|
|
@ -321,7 +354,32 @@ class BusinessController extends Controller
|
|||
->addColumn('payment_account_date', function (User $user) {
|
||||
return $user->payment_account ? $user->getPaymentAccountDateFormat(false) : "-";
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
|
||||
->filterColumn('m_account', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("m_account LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('first_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("first_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('last_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("last_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("email LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->orderColumn('id', 'm_account $1')
|
||||
->orderColumn('m_account', 'm_account $1')
|
||||
->orderColumn('first_name', 'first_name $1')
|
||||
->orderColumn('email', 'email $1')
|
||||
->orderColumn('last_name', 'last_name $1')
|
||||
->orderColumn('active_account', 'payment_account $1')
|
||||
->rawColumns(['id', 'is_qual_kp', 'sales_volume_points', 'sales_volume_total', 'sponsor', 'active_account'])
|
||||
->make(true);
|
||||
|
|
|
|||
|
|
@ -13,14 +13,9 @@ use App\Services\BusinessPlan\SalesPointsVolume;
|
|||
class BusinessPointsController extends Controller
|
||||
{
|
||||
|
||||
private $startYear;
|
||||
private $endYear;
|
||||
private $rangeYears;
|
||||
private $activeYear;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
|
@ -68,34 +63,6 @@ class BusinessPointsController extends Controller
|
|||
dd($data);
|
||||
|
||||
return redirect(route('admin_business_points'));
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
/*
|
||||
$add_credit_error = false;
|
||||
if(!isset($data['member_id']) || !$user = User::find($data['member_id'])){
|
||||
$add_credit_error = 'Vertriebspartner nicht gefunden';
|
||||
}
|
||||
if(!isset($data['credit'])){
|
||||
$add_credit_error = 'Bitte Betrag eingeben';
|
||||
}
|
||||
if(!isset($data['message'])){
|
||||
$add_credit_error = 'Bitte Mitteilung eingeben';
|
||||
}
|
||||
if($add_credit_error){
|
||||
$data = $this->makeData();
|
||||
$data['add_credit_error'] = $add_credit_error;
|
||||
return view('admin.payment.credit.index', $data);
|
||||
}
|
||||
|
||||
// $credit = Util::reFormatNumber($data['credit']);
|
||||
//$credit = number_format($credit, 2, '.', '');
|
||||
|
||||
//Payment::addUserCreditMargin($user, $credit, 3, $data['message']);
|
||||
\Session()->flash('alert-success', "Guthaben hinzugefügt");
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -107,9 +74,9 @@ class BusinessPointsController extends Controller
|
|||
if(!session('points_filter_year')){
|
||||
session(['points_filter_year' => intval(date('Y'))]);
|
||||
}
|
||||
if(Request::get('points_filter_member_id')){
|
||||
session(['points_filter_member_id' => Request::get('points_filter_member_id')]);
|
||||
}
|
||||
|
||||
session(['points_filter_member_id' => Request::get('points_filter_member_id')]);
|
||||
|
||||
if(Request::get('points_filter_month')){
|
||||
session(['points_filter_month' => Request::get('points_filter_month')]);
|
||||
}
|
||||
|
|
@ -122,19 +89,15 @@ class BusinessPointsController extends Controller
|
|||
{
|
||||
$this->setFilterVars();
|
||||
|
||||
$query = UserSalesVolume::with('user', 'user.account')->with('shopping_order')->select('user_sales_volumes.*')
|
||||
//$query = UserSalesVolume::with('user', 'user.account')->with('shopping_order')->select('user_sales_volumes.*')
|
||||
$query = UserSalesVolume::join('users', 'user_id', '=', 'users.id')->join('user_accounts', 'account_id', '=', 'user_accounts.id')
|
||||
->select('user_sales_volumes.*', 'users.email', 'user_accounts.m_account', 'user_accounts.first_name', 'user_accounts.last_name')
|
||||
->where('user_sales_volumes.month', '=', Request::get('points_filter_month'))
|
||||
->where('user_sales_volumes.year', '=', Request::get('points_filter_year'));
|
||||
|
||||
if(Request::get('points_filter_member_id')){
|
||||
$query->where('user_sales_volumes.user_id', '=', Request::get('points_filter_member_id'));
|
||||
}
|
||||
|
||||
//->orderBy('created_at', 'DESC');
|
||||
/* $query = FlexHour::leftJoin("flex_hour_items", function($join) {
|
||||
$join->on("flex_hour_items.flex_hour_id","=","flex_hours.id");
|
||||
$join->where("flex_hour_items.date","=", FlexHourItemBot::$date);
|
||||
})*/
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
|
@ -165,28 +128,48 @@ class BusinessPointsController extends Controller
|
|||
->addColumn('total_net', function (UserSalesVolume $UserSalesVolume) {
|
||||
return formatNumber($UserSalesVolume->total_net).' €';
|
||||
})
|
||||
->addColumn('first_name', function (UserSalesVolume $UserSalesVolume) {
|
||||
return isset($UserSalesVolume->user) ? $UserSalesVolume->user->account->first_name : '';
|
||||
})
|
||||
->addColumn('last_name', function (UserSalesVolume $UserSalesVolume) {
|
||||
return isset($UserSalesVolume->user) ? $UserSalesVolume->user->account->last_name : '';
|
||||
})
|
||||
->addColumn('email', function (UserSalesVolume $UserSalesVolume) {
|
||||
return isset($UserSalesVolume->user) ? $UserSalesVolume->user->email : '';
|
||||
})
|
||||
->addColumn('status', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<span class="badge badge-pill badge-'.$UserSalesVolume->getStatusColor().'">'.$UserSalesVolume->getStatusType().'</span>';
|
||||
})
|
||||
->addColumn('message', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<span class="no-line-break">'.$UserSalesVolume->message.'</span>';
|
||||
})
|
||||
|
||||
->addColumn('info', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<span class="no-line-break">'.$UserSalesVolume->info.'</span>';
|
||||
})
|
||||
|
||||
->filterColumn('m_account', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("m_account LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('first_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("first_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('last_name', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("last_name LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("email LIKE ?", '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('order', 'order $1')
|
||||
->orderColumn('status', 'status $1')
|
||||
->orderColumn('message', 'message $1')
|
||||
|
||||
->rawColumns(['id', 'order', 'status', 'message', 'total_net'])
|
||||
->orderColumn('info', 'info $1')
|
||||
->orderColumn('total_net', 'total_net $1')
|
||||
->orderColumn('email', 'email $1')
|
||||
->orderColumn('m_account', 'm_account $1')
|
||||
->orderColumn('first_name', 'first_name $1')
|
||||
->orderColumn('last_name', 'last_name $1')
|
||||
->rawColumns(['id', 'order', 'status', 'message', 'info', 'total_net'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ class CronController extends Controller
|
|||
|
||||
public function action($action = false, $key = false){
|
||||
|
||||
if($key !== 'key'){
|
||||
if($key !== 'CqZHL79FwUCcy9pjvi'){
|
||||
abort(404);
|
||||
}
|
||||
if($action === 'check_payments_account'){
|
||||
|
|
@ -269,4 +269,15 @@ class CronController extends Controller
|
|||
}
|
||||
|
||||
|
||||
public function runCron($key)
|
||||
{
|
||||
if($key !== 'G8ZvEbnP8fEPfnWX4L'){
|
||||
abort(404);
|
||||
}
|
||||
exec("/bin/bash ../cron_script.sh 2>&1", $out, $result);
|
||||
echo "Returncode: " .$result ."<br>";
|
||||
echo "Ausgabe des Scripts: " ."<br>";
|
||||
echo "<pre>"; print_r($out);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -113,12 +113,15 @@ class CustomerController extends Controller
|
|||
}
|
||||
|
||||
$shopping_user = ShoppingUser::findOrFail($id);
|
||||
$data['has_buyed'] = true;
|
||||
$data['subscribed'] = true;
|
||||
if($shopping_user->auth_user_id > 0){
|
||||
$data['has_buyed'] = isset($data['has_buyed']) ? true : false;
|
||||
$data['subscribed'] = isset($data['subscribed']) ? true : false;
|
||||
//subscribed can only true when has_buyed ist active
|
||||
$data['subscribed'] = $data['has_buyed'] ? $data['subscribed'] : false;
|
||||
|
||||
/* if($shopping_user->auth_user_id > 0){
|
||||
$data['has_buyed'] = true;
|
||||
$data['subscribed'] = false;
|
||||
}
|
||||
}*/
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
|
||||
$data['shipping_country_id'] = isset($data['shipping_country_id']) ? $data['shipping_country_id'] : $data['billing_country_id'];
|
||||
CustomerPriority::checkChangeOne($shopping_user, $data, true);
|
||||
|
|
@ -174,7 +177,7 @@ class CustomerController extends Controller
|
|||
data-modal="modal-xl"
|
||||
data-route="'.route('modal_load').'"><span class="fa fa-edit"></span> Berater zuordnen</button>';
|
||||
}
|
||||
if($ShoppingUser->member_id){
|
||||
if($ShoppingUser->member){
|
||||
return '<a href="'.route('admin_lead_edit', [$ShoppingUser->member_id]).'">'.$ShoppingUser->member->getFullName().'</a>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ class SalesController extends Controller
|
|||
})
|
||||
->addColumn('member_id', function (ShoppingOrder $ShoppingOrder) {
|
||||
if($ShoppingOrder->member_id) {
|
||||
return $ShoppingOrder->member_id ? '<a href="' . route('admin_lead_edit', [$ShoppingOrder->member_id]) . '">' . $ShoppingOrder->member->getFullName() . '</a>' : '';
|
||||
return $ShoppingOrder->member ? '<a href="' . route('admin_lead_edit', [$ShoppingOrder->member_id]) . '">' . $ShoppingOrder->member->getFullName() . '</a>' : 'gelöscht';
|
||||
}
|
||||
if($ShoppingOrder->shopping_user && $ShoppingOrder->shopping_user->is_like){
|
||||
return '<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
|
||||
|
|
@ -291,11 +291,9 @@ class SalesController extends Controller
|
|||
}
|
||||
return '';
|
||||
})
|
||||
|
||||
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
|
||||
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('txaction', 'txaction $1')
|
||||
->orderColumn('user_shop_id', 'user_shop_id $1')
|
||||
|
|
@ -372,9 +370,6 @@ class SalesController extends Controller
|
|||
return redirect(route('admin_sales_customers_detail', [$shopping_order->id]));
|
||||
}
|
||||
return redirect(route('admin_sales_users_detail', [$shopping_order->id]));
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use App\Services\SyS\DomainSSL;
|
|||
use App\Services\SyS\Correction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\SyS\ShoppingOrders;
|
||||
use App\Services\SyS\BuyingsProducts;
|
||||
use App\Services\SyS\BusinessStructur;
|
||||
|
||||
class SysController extends Controller
|
||||
|
|
@ -33,6 +34,10 @@ class SysController extends Controller
|
|||
{
|
||||
switch ($serve) {
|
||||
|
||||
|
||||
case 'buyings_products':
|
||||
return BuyingsProducts::show();
|
||||
break;
|
||||
case 'business_structur':
|
||||
return BusinessStructur::show();
|
||||
break;
|
||||
|
|
@ -61,11 +66,12 @@ class SysController extends Controller
|
|||
abort(403, 'not found tool');
|
||||
}
|
||||
|
||||
|
||||
public function store($serve)
|
||||
{
|
||||
switch ($serve) {
|
||||
|
||||
case 'buyings_products':
|
||||
return BuyingsProducts::store();
|
||||
break;
|
||||
case 'business_structur':
|
||||
return BusinessStructur::show();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -105,30 +105,41 @@ class CustomerController extends Controller
|
|||
return view('user.customer.add', $data);
|
||||
}
|
||||
|
||||
private function checkShoppingUsersEmail($data){
|
||||
private function checkShoppingUsersEmail($email = 'email', $action = 'return', $id=null){
|
||||
|
||||
$rules = array(
|
||||
'email' => 'required|string|email|max:255|unique:shopping_users,billing_email',
|
||||
$email => 'required|string|email|max:255|unique:shopping_users,billing_email',
|
||||
);
|
||||
$messages = [
|
||||
'unique' => __('validation.custom.unique_email_client'),
|
||||
];
|
||||
$validator = Validator::make(Request::all(), $rules, $messages);
|
||||
if ($validator->fails()) {
|
||||
\Session()->flash('alert-error', __('validation.custom.unique_email_client'));
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
|
||||
$rules = array(
|
||||
'email' => 'required|string|email|max:255|unique:users,email',
|
||||
$email => 'required|string|email|max:255|unique:users,email',
|
||||
);
|
||||
$messages = [
|
||||
'unique' => __('validation.custom.unique_email_member'),
|
||||
];
|
||||
$validator = Validator::make(Request::all(), $rules, $messages);
|
||||
if ($validator->fails()) {
|
||||
\Session()->flash('alert-error', __('validation.custom.unique_email_member'));
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
if($action === 'return'){
|
||||
return back()->withInput(Request::all());
|
||||
}
|
||||
|
||||
return back()->withInput(Request::all());
|
||||
if($action === 'save'){
|
||||
$shopping_user = ShoppingUser::findOrFail($id);
|
||||
$shopping_user->faker_mail = false;
|
||||
$shopping_user->billing_email = Request::get($email);
|
||||
$shopping_user->save();
|
||||
return redirect(route('user_customer_detail', [$shopping_user->id]));
|
||||
}
|
||||
}
|
||||
|
||||
public function store($id)
|
||||
|
|
@ -136,12 +147,20 @@ class CustomerController extends Controller
|
|||
$data = Request::all();
|
||||
|
||||
if($id === 'new' && $data['action'] === 'add_customer_with_email'){
|
||||
return $this->checkShoppingUsersEmail($data);
|
||||
return $this->checkShoppingUsersEmail('email', 'return');
|
||||
}
|
||||
if($id === 'new' && $data['action'] === 'add_customer_without_email'){
|
||||
return back()->withInput(Request::all());
|
||||
}
|
||||
|
||||
if($id === 'new' && $data['action'] === ''){
|
||||
return back()->withInput(Request::all());
|
||||
}
|
||||
|
||||
if($id !== 'new' && $data['action'] === 'add-mail-shopping-user-store'){
|
||||
return $this->checkShoppingUsersEmail('new_email_address', 'save', $id);
|
||||
}
|
||||
|
||||
if($data['action'] === 'shopping-user-store-new' || $data['action']==='shopping-user-store'){
|
||||
$rules = array(
|
||||
'billing_salutation' => 'required',
|
||||
|
|
|
|||
|
|
@ -288,7 +288,15 @@ class OrderController extends Controller
|
|||
public function datatable(){
|
||||
|
||||
if(Request::get('shipping_is_for') === 'me'){
|
||||
$query = Product::select('products.*')->where('active', true)->whereJsonContains('show_on', '2');
|
||||
// $query = Product::with('product_buyings')->select('products.*')->where('active', true)->whereJsonContains('show_on', '2');
|
||||
|
||||
|
||||
$query = Product::with('product_buyings')
|
||||
->select('products.*')->where('products.active', true)
|
||||
->whereJsonContains('products.show_on', '2')
|
||||
->whereDoesntHave('product_buyings', function ($q){
|
||||
$q->where('product_buyings.user_id', '=', \Auth::user()->id);
|
||||
});
|
||||
}else{
|
||||
$query = Product::select('products.*')->where('active', true)->whereJsonContains('show_on', '3');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class TeamController extends Controller
|
|||
//$TreeCalcBot->initUser(56);
|
||||
$data = [
|
||||
'filter_months' => HTMLHelper::$months,
|
||||
'filter_years' => HTMLHelper::getYearRange(date('Y')),
|
||||
'filter_years' => HTMLHelper::getYearRange(2022),
|
||||
'TreeCalcBot' => $TreeCalcBot,
|
||||
];
|
||||
return view('user.team.structure', $data);
|
||||
|
|
@ -58,7 +58,7 @@ class TeamController extends Controller
|
|||
$data = [
|
||||
'userSalesVolume' => $userSalesVolume,
|
||||
'filter_months' => HTMLHelper::$months,
|
||||
'filter_years' => HTMLHelper::getYearRange(date('Y')),
|
||||
'filter_years' => HTMLHelper::getYearRange(2022),
|
||||
];
|
||||
return view('user.team.points', $data);
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ class TeamController extends Controller
|
|||
if(Request::get('team_user_filter_month')){
|
||||
session(['team_user_filter_month' => Request::get('team_user_filter_month')]);
|
||||
}
|
||||
if(Request::get('team_user_points_filter_year')){
|
||||
session(['team_user_points_filter_year' => Request::get('team_user_points_filter_year')]);
|
||||
if(Request::get('team_user_filter_year')){
|
||||
session(['team_user_filter_year' => Request::get('team_user_filter_year')]);
|
||||
}
|
||||
|
||||
if(Request::get('team_user_points_filter_month')){
|
||||
|
|
@ -135,13 +135,17 @@ class TeamController extends Controller
|
|||
->addColumn('message', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<span class="no-line-break">'.$UserSalesVolume->message.'</span>';
|
||||
})
|
||||
->addColumn('info', function (UserSalesVolume $UserSalesVolume) {
|
||||
return '<span class="no-line-break">'.$UserSalesVolume->info.'</span>';
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('order', 'order $1')
|
||||
->orderColumn('status', 'status $1')
|
||||
->orderColumn('message', 'message $1')
|
||||
->orderColumn('info', 'info $1')
|
||||
|
||||
->rawColumns(['id', 'order', 'status', 'message', 'total_net'])
|
||||
->rawColumns(['id', 'order', 'status', 'message', 'info', 'total_net'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class CardController extends Controller
|
|||
if($product->images->count()){
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), false, false, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission]);
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), false, false, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission, 'no_free_shipping' => $product->no_free_shipping]);
|
||||
if(Yard::instance('shopping')->getUserTaxFree()){
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}else{
|
||||
|
|
@ -59,7 +59,7 @@ class CardController extends Controller
|
|||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$quantity = Request::get('quantity') ? Request::get('quantity') : 1;
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), false, false, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission]);
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), false, false, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission, 'no_free_shipping' => $product->no_free_shipping]);
|
||||
if(Yard::instance('shopping')->getUserTaxFree()){
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -289,7 +289,6 @@ class CheckoutController extends Controller
|
|||
|
||||
//check credit Card
|
||||
if(Request::get('payment_method')){
|
||||
|
||||
$ret = [];
|
||||
//Rechnungskauf ohne PAYONE
|
||||
if(Request::get('payment_method') === 'fnc#MIV'){
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ class HomepartyController extends Controller
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
public function detail($token = null, $gid = null)
|
||||
{
|
||||
if(!$token){
|
||||
|
|
@ -60,7 +59,6 @@ class HomepartyController extends Controller
|
|||
'homeparty_host' => $homeparty->homeparty_host,
|
||||
'mivita_member' => $homeparty->auth_user
|
||||
];
|
||||
|
||||
return view('user.homeparty.self_guest_detail', $data);
|
||||
}
|
||||
|
||||
|
|
@ -75,8 +73,6 @@ class HomepartyController extends Controller
|
|||
abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$rules = array(
|
||||
'billing_salutation' => 'required',
|
||||
'billing_firstname' => 'required',
|
||||
|
|
@ -88,6 +84,7 @@ class HomepartyController extends Controller
|
|||
'checkbox_datenverarbeitung' => 'required',
|
||||
'checkbox_daten_completely' => 'required'
|
||||
);
|
||||
|
||||
if (!Request::get('same_as_billing')) {
|
||||
$rules = array_merge($rules, [
|
||||
'shipping_firstname' => 'required',
|
||||
|
|
@ -99,10 +96,12 @@ class HomepartyController extends Controller
|
|||
'shipping_country_id' => 'required'
|
||||
]);
|
||||
}
|
||||
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
|
||||
if($gid === null){
|
||||
$homeparty_user = HomepartyUser::create([
|
||||
'homeparty_id' => $homeparty->id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue