Revize 903a758d
Přidáno uživatelem Filip Miškařík před téměř 5 roky(ů)
application/helpers/callback.php | ||
---|---|---|
* @param $item
|
||
* @param $name
|
||
*/
|
||
public static function amount_after_transfer_field($item, $name , $args = array())
|
||
public static function amount_after_transfer_field($item, $name)
|
||
{
|
||
static $tm = null;
|
||
|
||
if ($tm == null)
|
||
{
|
||
$tm = new Transfer_Model();
|
||
}
|
||
|
||
if (!isset($args[0]))
|
||
{
|
||
return;
|
||
}
|
||
|
||
$sum = $tm->sum_transfers_to_id($args[0], $item->id);
|
||
|
||
if ($sum > 0)
|
||
if ($item->subtotal > 0)
|
||
{
|
||
echo '<span style="color:green">'
|
||
. number_format((float)$sum, 2, ',', ' ')
|
||
. number_format((float)$item->subtotal, 2, ',', ' ')
|
||
. '</span>';
|
||
}
|
||
else if ($sum < 0)
|
||
else if ($item->subtotal < 0)
|
||
{
|
||
echo '<span style="color:red">'
|
||
. number_format((float)$sum, 2, ',', ' ')
|
||
. number_format((float)$item->subtotal, 2, ',', ' ')
|
||
. '</span>';
|
||
}
|
||
else
|
||
{
|
||
echo $sum;
|
||
echo $item->subtotal;
|
||
}
|
||
}
|
||
|
Také k dispozici: Unified diff
refs #1129: Repair and speed-up of counting subtotal of transfers. Changes in tranfers controller and tranfer model.