New feature: percentage addons (discounts etc)
This commit is contained in:
parent
eb55aa0eb5
commit
7c05b3108c
2 changed files with 60 additions and 31 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue