mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
fix(remission-helpers, remission-list-item): fix predefinedReturnQuantity handling and enhance stock validation Fix issue where predefinedReturnQuantity value of 0 was being treated differently from undefined in mandatory remission (Pflichtremission). Now both 0 and undefined are handled consistently by changing the initial value to undefined and using truthy check instead of strict undefined comparison. Additionally enhance hasStockToRemit validation by requiring both availableStock and stockToRemit to be greater than 0, preventing invalid remission states when no stock is available. Changes: - Change predefinedReturnQuantity initial value from 0 to undefined in getStockToRemit - Remove nullish coalescing operator that forced 0 default for predefinedReturnQuantity - Update calculateStockToRemit to use truthy check (!predefinedReturnQuantity) instead of strict undefined comparison - Enhance hasStockToRemit computed property to validate both availableStock > 0 and stockToRemit > 0 - Add comprehensive test coverage for all hasStockToRemit edge cases including negative values and zero combinations Ref: #5269