Use amount object directly internally,
instead of relying on operator overloading, but keep the ones where direct use would result in overly messy code.
This commit is contained in:
parent
58f49cbffb
commit
1661661ffd
3 changed files with 17 additions and 13 deletions
|
@ -128,14 +128,14 @@ sub as_loggable {
|
|||
my $description =
|
||||
$quantity == 1
|
||||
? $_->{description}
|
||||
: sprintf("%s [%sx %s]", $_->{description}, $quantity, abs($_->{amount}));
|
||||
: sprintf("%s [%sx %s]", $_->{description}, $quantity, $_->{amount}->abs);
|
||||
|
||||
push @s, sprintf(
|
||||
"%-12s %4s %3d %5s # %s",
|
||||
$_->{user},
|
||||
($total > 0 ? 'GAIN' : $total < 0 ? 'LOSE' : ''),
|
||||
($total->cents > 0 ? 'GAIN' : $total->cents < 0 ? 'LOSE' : ''),
|
||||
$quantity,
|
||||
abs($total),
|
||||
$total->abs,
|
||||
$description
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue