projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bessere Fehlerbehandlung, falls keine 'letter.tex' Druckvorlage gefunden wird
[kivitendo-erp.git]
/
SL
/
PriceSource.pm
diff --git
a/SL/PriceSource.pm
b/SL/PriceSource.pm
index
e7a5906
..
89dffba
100644
(file)
--- a/
SL/PriceSource.pm
+++ b/
SL/PriceSource.pm
@@
-35,15
+35,16
@@
sub available_prices {
}
sub available_discounts {
}
sub available_discounts {
+ return if $_[0]->record_item->part->not_discountable;
map { $_->available_discounts } $_[0]->all_price_sources;
}
sub best_price {
map { $_->available_discounts } $_[0]->all_price_sources;
}
sub best_price {
- min_by { $_->price } grep { $_->price > 0 } grep { $_ } map { $_->best_price } $_[0]->all_price_sources;
+ min_by { $_->price }
max_by { $_->priority }
grep { $_->price > 0 } grep { $_ } map { $_->best_price } $_[0]->all_price_sources;
}
sub best_discount {
}
sub best_discount {
- max_by { $_->discount } grep { $_->discount } grep { $_ } map { $_->best_discount } $_[0]->all_price_sources;
+ max_by { $_->discount }
max_by { $_->priority }
grep { $_->discount } grep { $_ } map { $_->best_discount } $_[0]->all_price_sources;
}
sub empty_price {
}
sub empty_price {