#1788 keine Rücklage Filialentnahme ohne Bestand

This commit is contained in:
Lorenz Hilpert
2021-05-11 13:33:03 +02:00
parent 9eacd1fba2
commit 62634d231c

View File

@@ -62,11 +62,12 @@ export class DomainAvailabilityService {
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map(([response, supplier, branch]) => {
const stockInfo = response.result.find((si) => si.branchId === branch.id);
const inStock = stockInfo?.inStock ?? 0;
const availability: AvailabilityDTO = {
availabilityType: quantity > stockInfo?.inStock ? 1 : 1024, // 1024 (=Available)
inStock: stockInfo?.inStock,
ssc: quantity > stockInfo?.inStock ? '' : '999',
sscText: quantity > stockInfo?.inStock ? '' : 'Filialentnahme',
availabilityType: quantity <= inStock ? 1024 : 1, // 1024 (=Available)
inStock: inStock,
ssc: quantity <= inStock ? '999' : '',
sscText: quantity <= inStock ? 'Filialentnahme' : '',
price: item?.price,
supplier: { id: supplier?.id },
};