This commit is contained in:
Kevin Adametz 2024-08-05 12:05:24 +02:00
parent 04d677d37a
commit bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions

View file

@ -31,6 +31,7 @@ class TreeCalcBot
$this->date->start_date = $date->format('Y-m-d H:i:s');
$this->date->end_date = $date->endOfMonth()->format('Y-m-d H:i:s');
$this->init_from = $init_from;
}
public function initStructureAdmin($check = true)
@ -63,14 +64,12 @@ class TreeCalcBot
if(isset($this->business_users[0]) && $this->business_users[0]->sponsor){
$this->readStoredSponsorUser($this->business_users[0]->sponsor->user_id);
}
}else{
$this->readParentsUsers();
$this->readSponsorUser($user_id);
}
}
public function initBusinesslUserDetail($user)
{
$this->business_user = new BusinessUserItem($this->date);
@ -253,6 +252,7 @@ class TreeCalcBot
$ret = '<ol class="dd-list">';
foreach($this->business_users as $business_user){
$ret .= $this->addItem($business_user, $deep);
}
$ret .= '</ol>';
return $ret;
@ -269,7 +269,7 @@ class TreeCalcBot
data-back=""
data-modal="modal-xl"
data-init_from="'.$this->init_from .'"
data-route="'.route('modal_load').'"><span class="far fa-calculator"></span></button>';
data-route="'.route('modal_load').'"><span class="fa fa-calculator"></span></button>';
}
return '<li class="dd-item dd-nodrag" data-id="'.$item->user_id.'">'.
'<div class="dd-handle">
@ -279,15 +279,20 @@ class TreeCalcBot
</div>
<div class="media-body ml-2">
<span class="'.($item->active_account ? '' : 'text-muted').'">
<span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span>
<strong>'.$item->first_name.' '.$item->last_name.'</strong> <a href="mailto: '.$item->email.'">'.$item->email.'</a> <span class="badge badge-outline-default '.($item->active_account ? '' : 'text-muted').'">'.$item->user_level_name.' | '.$item->m_account.'</span>
<a href="#" class="text-black" data-toggle="modal" data-target="#modals-load-content" data-id="'.$item->user_id.'" data-action="business-user-show" data-back="" data-modal="modal-md" data-init_from="'.$this->init_from .'" data-route="'.route('modal_load').'">
<span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span> <strong>'.$item->first_name.' '.$item->last_name.'</strong>
</a>
<a href="mailto: '.$item->email.'">'.$item->email.'</a>
'.($item->user_birthday ? ' | <i class="ion ion-ios-gift text-primary"></i> '.$item->user_birthday : '').'
'.($item->user_phone ? ' | <i class="ion ion-ios-call text-primary"></i> '.$item->user_phone : '').'
<span class="badge badge-outline-default '.($item->active_account ? '' : 'text-muted').'">'.\App\Services\TranslationHelper::transUserLevelName($item->user_level_name).' | '.$item->m_account.'</span>
<br><span class="small">'.
($item->active_account ?
'<strong>Gesamte Points: '.$item->sales_volume_points_sum.'</strong> | E: '.$item->sales_volume_KP_points.' | S: '.$item->sales_volume_points_shop.' <strong>
| Umsatz netto: '.formatNumber($item->sales_volume_total_sum).' &euro;</strong> | E: '.formatNumber($item->sales_volume_total).' &euro; | S: '.formatNumber($item->sales_volume_total_shop).' &euro;'.
'<strong>'.__('team.total_points').': '.$item->sales_volume_points_KP_sum.'</strong> | '.__('team.e').': '.$item->sales_volume_KP_points.' | '.__('team.s').': '.$item->sales_volume_points_shop.' <strong>
| '.__('team.net_turnover').': '.formatNumber($item->sales_volume_total_sum).' &euro;</strong> | '.__('team.e').': '.formatNumber($item->sales_volume_total).' &euro; | '.__('team.s').': '.formatNumber($item->sales_volume_total_shop).' &euro;'.
$button
:
'Account bis: '.$item->payment_account_date).
__('team.account_to').': '.$item->payment_account_date).
'</span>
</span>
</div>
@ -323,20 +328,25 @@ class TreeCalcBot
$ret .= '<li class="dd-item dd-nodrag" data-id="'.$item->user_id.'">'.
'<div class="dd-handle">
<span class="'.($item->active_account ? '' : 'text-muted').'">
<span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span>
<strong>'.$item->first_name.' '.$item->last_name.'</strong> <a href="mailto: '.$item->email.'">'.$item->email.'</a> <span class="badge badge-outline-default '.($item->active_account ? '' : 'text-muted').'">'.$item->user_level_name.' | '.$item->m_account.'</span>
<a href="#" class="text-black" data-toggle="modal" data-target="#modals-load-content" data-id="'.$item->user_id.'" data-action="business-user-show" data-back="" data-modal="modal-md" data-init_from="'.$this->init_from .'" data-route="'.route('modal_load').'">
<span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span> <strong>'.$item->first_name.' '.$item->last_name.'</strong>
</a>
<a href="mailto: '.$item->email.'">'.$item->email.'</a>
'.($item->user_birthday ? ' | <i class="ion ion-ios-gift text-primary"></i> '.$item->user_birthday : '').'
'.($item->user_phone ? ' | <i class="ion ion-ios-call text-primary"></i> '.$item->user_phone : '').'
<span class="badge badge-outline-default '.($item->active_account ? '' : 'text-muted').'">'.\App\Services\TranslationHelper::transUserLevelName($item->user_level_name).' | '.$item->m_account.'</span>
<br><span class="small">'.
($item->active_account ?
'<strong>Gesamte Points: '.$item->sales_volume_points_sum.'</strong> | E: '.$item->sales_volume_KP_points.' | S: '.$item->sales_volume_points_shop.' <strong>
| Umsatz netto: '.formatNumber($item->sales_volume_total_sum).' &euro;</strong> | E: '.formatNumber($item->sales_volume_total).' &euro; | S: '.formatNumber($item->sales_volume_total_shop).' &euro;'.
'<strong>'.__('team.total_points').': '.$item->sales_volume_points_KP_sum.'</strong> | '.__('team.e').': '.$item->sales_volume_KP_points.' | '.__('team.s').': '.$item->sales_volume_points_shop.' <strong>
| '.__('team.net_turnover').': '.formatNumber($item->sales_volume_total_sum).' &euro;</strong> | '.__('team.e').': '.formatNumber($item->sales_volume_total).' &euro; | '.__('team.s').': '.formatNumber($item->sales_volume_total_shop).' &euro;'.
' | <button type="button" class="btn icon-btn btn-xs btn-secondary" data-toggle="modal" data-target="#modals-load-content"
data-id="'.$item->user_id.'"
data-action="business-user-detail"
data-back=""
data-modal="modal-xl"
data-route="'.route('modal_load').'"><span class="far fa-calculator"></span></button>'
data-route="'.route('modal_load').'"><span class="fa fa-calculator"></span></button>'
:
'Account bis: '.$item->payment_account_date).
__('team.account_to').' '.$item->payment_account_date).
'<br>'.$item->m_sponsor_name.
'</span>
</span>
@ -349,20 +359,25 @@ class TreeCalcBot
public function makeSponsorHtml(){
if($this->sponsor){
//' | <a href="' . route('admin_business_user_detail', [$this->sponsor->id]) . '" class="btn icon-btn btn-xs btn-secondary"><span class="far fa-calculator"></span></a>'
//' | <a href="' . route('admin_business_user_detail', [$this->sponsor->id]) . '" class="btn icon-btn btn-xs btn-secondary"><span class="fa fa-calculator"></span></a>'
$ret = '<li class="dd-item dd-nodrag" data-id="">'.
'<div class="dd-handle">
<span class="'.($this->sponsor->active_account ? '' : 'text-muted').'">
<span class="mr-1 ion ion-ios-contact '.($this->sponsor->active_account ? 'text-primary' : 'text-danger').'"></span>
<strong>'.$this->sponsor->first_name.' '.$this->sponsor->last_name.'</strong> <a href="mailto: '.$this->sponsor->email.'">'.$this->sponsor->email.'</a> <span class="badge badge-outline-default '.($this->sponsor->active_account ? '' : 'text-muted').'">'.$this->sponsor->user_level_name.' | '.$this->sponsor->m_account.'</span>';
<a href="#" class="text-black" data-toggle="modal" data-target="#modals-load-content" data-id="'.$this->sponsor->user_id.'" data-action="business-user-show" data-back="" data-init_from="'.$this->init_from .'" data-modal="modal-md" data-route="'.route('modal_load').'">
<span class="mr-1 ion ion-ios-contact '.($this->sponsor->active_account ? 'text-primary' : 'text-danger').'"></span> <strong>'.$this->sponsor->first_name.' '.$this->sponsor->last_name.'</strong>
</a>
<a href="mailto: '.$this->sponsor->email.'">'.$this->sponsor->email.'</a>
'.($this->sponsor->user_birthday ? ' | <i class="ion ion-ios-gift text-primary"></i> '.$this->sponsor->user_birthday : '').'
'.($this->sponsor->user_phone ? ' | <i class="ion ion-ios-call text-primary"></i> '.$this->sponsor->user_phone : '').'
<span class="badge badge-outline-default '.($this->sponsor->active_account ? '' : 'text-muted').'">'.\App\Services\TranslationHelper::transUserLevelName($this->sponsor->user_level_name).' | '.$this->sponsor->m_account.'</span>';
if($this->init_from === 'admin'){
$ret .= '<br><span class="small">'.
($this->sponsor->active_account ?
'<strong>Gesamte Points: '.$this->sponsor->sales_volume_points_sum.'</strong> | E: '.$this->sponsor->sales_volume_KP_points.' | S: '.$this->sponsor->sales_volume_points_shop.' <strong>
| Umsatz netto: '.formatNumber($this->sponsor->sales_volume_total_sum).' &euro;</strong> | E: '.formatNumber($this->sponsor->sales_volume_total).' &euro; | S: '.formatNumber($this->sponsor->sales_volume_total_shop).' &euro;'
'<strong>'.__('team.total_points').': '.$this->sponsor->sales_volume_points_KP_sum.'</strong> | '.__('team.e').': '.$this->sponsor->sales_volume_KP_points.' | '.__('team.s').': '.$this->sponsor->sales_volume_points_shop.' <strong>
| '.__('team.net_turnover').': '.formatNumber($this->sponsor->sales_volume_total_sum).' &euro;</strong> | '.__('team.e').': '.formatNumber($this->sponsor->sales_volume_total).' &euro; | '.__('team.s').': '.formatNumber($this->sponsor->sales_volume_total_shop).' &euro;'
:
'Account bis: '.$this->sponsor->payment_account_date).
__('team.account_to').' '.$this->sponsor->payment_account_date).
'</span>';
}
$ret .= '</span>
@ -371,9 +386,7 @@ class TreeCalcBot
return $ret;
}
return 'Keinen Sponsor zugewiesen';
return __('team.no_sponsor_assigned');
}
}