More compact display for repeated products
Might revert later
This commit is contained in:
parent
fefa371e18
commit
ef5babd3df
1 changed files with 6 additions and 5 deletions
|
@ -93,12 +93,15 @@ sub contras($self) {
|
|||
|
||||
sub as_printable($self) {
|
||||
my @s;
|
||||
push @s, $self->{quantity} . "x {" if $self->multiplied;
|
||||
|
||||
# Normally, the implied sign is "+", and an "-" is only added for negative
|
||||
# numbers. Here, the implied sign is "-", and a "+" is only added for
|
||||
# positive numbers.
|
||||
push @s, sprintf "%8s %s", $self->{amount}->string_flipped, $self->{description};
|
||||
my $q = $self->{quantity};
|
||||
push @s, sprintf "%s%6s %s",
|
||||
($q > 1 ? "${q}x" . " " x (3 - length $q) : " " x 4),
|
||||
$self->{amount}->string_flipped,
|
||||
$self->{description};
|
||||
|
||||
for my $c (@{ $self->{contras} }) {
|
||||
my $description;
|
||||
|
@ -121,14 +124,12 @@ sub as_printable($self) {
|
|||
$description = $fromto;
|
||||
}
|
||||
push @s, sprintf(
|
||||
"%11s %s",
|
||||
"%13s %s",
|
||||
($self->{amount} > 0 ? $c->{amount}->string_flipped("") : $c->{amount}->string),
|
||||
$description
|
||||
);
|
||||
}
|
||||
|
||||
push @s, "}" if $self->multiplied;
|
||||
|
||||
return @s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue