v6.0.3: add warning for duplicates in revbank.products

This commit is contained in:
Juerd Waalboer 2024-02-07 23:15:57 +01:00
parent 4b6fa729ff
commit 1105fbc3b2
2 changed files with 15 additions and 11 deletions

View file

@ -91,16 +91,20 @@ sub read_products() {
next; next;
} }
} }
$products{$_} = { for my $id (@ids) {
id => $ids[0], warn "Product '$id' redefined at $filename line $linenr (original at line $products{$id}{line}).\n" if exists $products{$id};
price => $sign * $price,
percent => $percent, $products{$id} = {
description => $desc, id => $ids[0],
contra => $contra || $default_contra, price => $sign * $price,
_addon_ids => \@addon_ids, percent => $percent,
line => $linenr, description => $desc,
tags => \%tags, contra => $contra || $default_contra,
} for @ids; _addon_ids => \@addon_ids,
line => $linenr,
tags => \%tags,
};
}
} }
PRODUCT: for my $product (values %products) { PRODUCT: for my $product (values %products) {

View file

@ -16,7 +16,7 @@ use RevBank::Messages;
use RevBank::Cart; use RevBank::Cart;
use RevBank::Prompt; use RevBank::Prompt;
our $VERSION = "6.0.2"; our $VERSION = "6.0.3";
our %HELP1 = ( our %HELP1 = (
"abort" => "Abort the current transaction", "abort" => "Abort the current transaction",
); );