|
|
|
@ -30,9 +30,10 @@ public class UpdateOffersAction {
|
|
|
|
|
public List<ArticleOffer> finish() {
|
|
|
|
|
HashMap<ArticleIdentifier, ArticleOffer> availableOffers = mapOffers();
|
|
|
|
|
|
|
|
|
|
// Reset all advertise-flags first. They are set again below.
|
|
|
|
|
// Reset all advertise-flags and supplier relations first. They are set again below.
|
|
|
|
|
for (ArticleOffer offer : availableOffers.values()) {
|
|
|
|
|
offer.shouldBeAdvertised = false;
|
|
|
|
|
offer.cheapestSupplier = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (Entry<ArticleIdentifier, Offer> cheapestOffer : cheapestOffer.entrySet()) {
|
|
|
|
@ -47,7 +48,10 @@ public class UpdateOffersAction {
|
|
|
|
|
}
|
|
|
|
|
Article currentOfferedArticle = cheapestOffer.getValue().apiSupplier.findArticle(manufacturer,
|
|
|
|
|
articleNumber);
|
|
|
|
|
currentOffer.title = currentOfferedArticle.title;
|
|
|
|
|
currentOffer.vatPercent = currentOfferedArticle.vatPercent;
|
|
|
|
|
currentOffer.cheapestSupplier = cheapestOffer.getValue().dbSupplier;
|
|
|
|
|
currentOffer.pricePerUnitNet = currentOfferedArticle.pricePerUnitNet;
|
|
|
|
|
|
|
|
|
|
// Set advertise-flag if any supplier wants it to be set
|
|
|
|
|
if (currentOfferedArticle.shouldBeAdvertised) {
|
|
|
|
|