FIX_LIB 2
This commit is contained in:
parent
f1c074e1b5
commit
5dd51f0a97
@ -221,30 +221,31 @@ public static function agentPayoutColumnFromPartnerRr($raw, float $partnerRr): s
|
||||
$base = self::toFloat($raw);
|
||||
if ($base === null || $base <= 0) return '-';
|
||||
|
||||
$result = $base - $partnerRr;
|
||||
// Formula: RR − base (e.g. RR=1.0, comp=7.2 → 1.0 - 7.2 = -6.2)
|
||||
$result = $partnerRr - $base;
|
||||
|
||||
if ($result <= 0) return '-';
|
||||
return self::formatGridNumericDisplay($result);
|
||||
}
|
||||
|
||||
public static function applyManagerAccountsDisplayToRows(array $rows): array
|
||||
{
|
||||
foreach ($rows as &$row) {
|
||||
if (array_key_exists('comp', $row)) $row['comp'] = self::gridPayoutDisplayManagerAccounts($row['comp'] ?? null);
|
||||
if (array_key_exists('tp', $row)) $row['tp'] = self::gridPayoutDisplayManagerAccounts($row['tp'] ?? null);
|
||||
if (array_key_exists('od', $row)) $row['od'] = self::gridPayoutDisplayManagerAccounts($row['od'] ?? null);
|
||||
}
|
||||
unset($row);
|
||||
return $rows;
|
||||
private static function formatGridNumericDisplay(float $v): string
|
||||
{
|
||||
if (abs($v - round($v)) < 0.00001) {
|
||||
return (string) (int) round($v);
|
||||
}
|
||||
return rtrim(rtrim(number_format($v, 2, '.', ''), '0'), '.');
|
||||
}
|
||||
|
||||
// public static function applyManagerAccountsDisplayToRows(array $rows): array
|
||||
// {
|
||||
// foreach ($rows as &$row) {
|
||||
// if (array_key_exists('comp', $row)) $row['comp'] = self::gridPayoutDisplayManagerAccounts($row['comp'] ?? null);
|
||||
// if (array_key_exists('tp', $row)) $row['tp'] = self::gridPayoutDisplayManagerAccounts($row['tp'] ?? null);
|
||||
// if (array_key_exists('od', $row)) $row['od'] = self::gridPayoutDisplayManagerAccounts($row['od'] ?? null);
|
||||
// }
|
||||
// unset($row);
|
||||
// return $rows;
|
||||
// }
|
||||
|
||||
private static function formatGridNumericDisplay(float $v): string
|
||||
{
|
||||
if (abs($v - round($v)) < 0.00001) {
|
||||
return (string) (int) round($v);
|
||||
}
|
||||
return rtrim(rtrim(number_format($v, 2, '.', ''), '0'), '.');
|
||||
}
|
||||
|
||||
private static function retentionMapFromPrrRows(array $prrRows): array
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user