Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:36:47 +02:00
parent bfa3bb1df4
commit 9ae662f63e
243 changed files with 12580 additions and 12018 deletions

View file

@ -15,7 +15,8 @@ class SalesPointsVolumeHelper
line: nach reihenfolge sortiert,
*/
private static $business_users_line = [];
private static $totalcommission = [];
private static $totalpoints = [];
private static $cbot = null;
@ -36,7 +37,6 @@ class SalesPointsVolumeHelper
$deep = 0;
$ret = "";
foreach(self::$cbot->business_users as $business_user){
$ret .= self::addTableItemStructur($business_user, $deep);
}
return $ret;
@ -68,7 +68,7 @@ class SalesPointsVolumeHelper
<td><div class="no-line-break">'.$pp.'</div></td>
<td><span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span>'.$item->first_name.' '.$item->last_name.'
</td>
<td><div class="no-line-break">'.formatNumber($points, 0).' &euro;</span></td>
<td><div class="no-line-break">'.formatNumber($points, 0).'</span></td>
<td>'.formatNumber($margin, 1).' %</td>
<td><div class="no-line-break">'.formatNumber($commission, 2).' &euro;</span></td>
<td><span class="small">'.$item->user_level_name.'</span></td>
@ -84,10 +84,16 @@ class SalesPointsVolumeHelper
self::addTableItemLine($business_user, $deep);
}
foreach(self::$business_users_line as $deep => $items){
self::$totalcommission[$deep] = 0;
self::$totalpoints[$deep] = 0;
foreach($items as $item){
$ret .= self::setTableHTMLItemLine($item, $deep);
}
if($deep > 0){
$ret .= self::addTableHTMLTotalItemLine($deep, 'line');
}
}
$ret .= self::addTableHTMLTotalItemLine($deep, 'end');
return $ret;
}
@ -100,6 +106,39 @@ class SalesPointsVolumeHelper
}
}
}
private static function addTableHTMLTotalItemLine($deep, $type){
$points = 0;
$commission = 0;
if($type == 'end'){
$pp = '<div class=" line-height-1 my-2 badge badge-outline-success text-dark font-weight-bolder">'.__('team.PP').'</div>';
$style = ' style="background-color:#d7d700;"';
$text = __('order.total');
foreach(self::$totalpoints as $key => $value){
$points += $value;
$commission += self::$totalcommission[$key];
}
}else{
$pp = '<div class=" line-height-1 my-2 badge badge-outline-success text-dark font-weight-bolder">'.$deep.'. '.__('team.PP').'</div>';
$style = 'style="background-color:#e5e4e4"';
$text = __('order.sum');
$points = self::$totalpoints[$deep];
$commission = self::$totalcommission[$deep];
}
$ret = '<tr '.$style.'>
<td><div class="no-line-break">'.$pp.'</div></td>
<td><b>'.$text.'</b></td>
<td><div class="no-line-break"><b>'.formatNumber($points, 0).'</b></span></td>
<td>&nbsp;</td>
<td><div class="no-line-break"><b>'.formatNumber($commission, 2).' &euro;</b></span></td>
<td>&nbsp;</td>
</tr>';
return $ret;
}
private static function setTableHTMLItemLine($item, $deep){
@ -111,6 +150,8 @@ class SalesPointsVolumeHelper
$pp = '<div class=" line-height-1 my-2 badge badge-outline-success text-dark font-weight-bolder">'.$deep.'. '.__('team.PP').'</div>';
$margin = self::$cbot->getKeybyLine($deep, 'margin');
$commission = $points / 100 * $margin;
self::$totalcommission[$deep] += $commission;
self::$totalpoints[$deep] += $points;
}
//
/*
@ -121,11 +162,12 @@ class SalesPointsVolumeHelper
<th>{{__('tables.commission')}} &euro;</th>
<th>{{ __('tables.level') }}</th>
*/
$ret = '<tr>
<td><div class="no-line-break">'.$pp.'</div></td>
<td><span class="mr-1 ion ion-ios-contact '.($item->active_account ? 'text-primary' : 'text-danger').'"></span>'.$item->first_name.' '.$item->last_name.'
</td>
<td><div class="no-line-break">'.formatNumber($points, 0).' &euro;</span></td>
<td><div class="no-line-break">'.formatNumber($points, 0).'</span></td>
<td>'.formatNumber($margin, 1).' %</td>
<td><div class="no-line-break">'.formatNumber($commission, 2).' &euro;</span></td>
<td><span class="small">'.$item->user_level_name.'</span></td>