From eb51cf1646c9ee9cd89ae34aa58822c6b4dd85b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=ABl=20Mugnier?= Date: Thu, 5 Nov 2020 15:08:59 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20-=20Si=20la=20quantit=C3=A9=20per=20unit?= =?UTF-8?q?=20n'est=20pas=20renseign=C3=A9=20dans=20le=20fichier=20excel,?= =?UTF-8?q?=20mettre=20la=20property=20=C3=A0=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs b/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs index 574f7a403..c6fd42fc3 100644 --- a/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs +++ b/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs @@ -381,6 +381,9 @@ private async Task> CreateProductCommandFromRowData else createProductCommand.Vat = vat; + if (string.IsNullOrWhiteSpace(quantityPerUnitStr)) + quantityPerUnitStr = "1"; + if (!decimal.TryParse(quantityPerUnitStr, NumberStyles.Any, new CultureInfo("en-US"), out decimal qtyPerUnit)) return Failed(new ValidationException(MessageKind.CreateProduct_QtyPerUnit_Invalid_Line, i)); else