New feature: percentage addons (discounts etc)

This commit is contained in:
Juerd Waalboer 2023-01-05 19:10:40 +01:00
parent eb55aa0eb5
commit 7c05b3108c
2 changed files with 60 additions and 31 deletions

View file

@ -72,6 +72,17 @@ sub attribute($self, $key, $new = undef) {
return $$ref;
}
sub amount($self, $new = undef) {
my $ref = \$self->{amount};
if (defined $new) {
$new = RevBank::Amount->parse_string($new) if not ref $new;
$$ref = $new;
$self->attribute('changed', 1);
}
return $$ref;
}
sub quantity($self, $new = undef) {
my $ref = \$self->{quantity};
if (defined $new) {