mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
feat(remission-data-access): enhance stock calculation to handle zero predefined quantities Improve calculateStockToRemit and getStockToRemit functions to properly distinguish between undefined and zero predefined return quantities. When predefinedReturnQuantity is undefined, the system now falls back to approximation calculation (availableStock minus remainingQuantityInStock). When predefinedReturnQuantity is explicitly set to 0, the system respects this backend-calculated value. Add comprehensive test coverage for edge cases including: - Zero predefined return quantities for both Pflicht and Abteilung types - Negative approximation calculations (clamped to 0) - Null/undefined remainingQuantityInStock handling - Missing returnItem scenarios for Abteilung type Ref: #5280