Skip to content

Commit

Permalink
Update - Ajout de vérification supplémentaire pour modifier la TVA
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmugnier committed Nov 9, 2020
1 parent 0d412ff commit 17d6cab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public async Task<Result<bool>> Handle(UpdateProductCommand request, Cancellatio
entity.SetVat(request.Vat);
entity.SetName(request.Name);
entity.SetDescription(request.Description);
entity.SetVat(request.Vat);
entity.SetWholeSalePricePerUnit(request.WholeSalePricePerUnit);
entity.SetReference(request.Reference);
entity.SetWeight(request.Weight);
Expand Down
2 changes: 1 addition & 1 deletion Sheaft.Domain/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void SetVat(decimal? newVat)
{
if (Producer.NotSubjectToVat)
newVat = 0;
else if(!newVat.HasValue)
else if(!newVat.HasValue || newVat == 0)
throw new ValidationException(MessageKind.Product_Vat_Required);

if (newVat < 0)
Expand Down
8 changes: 4 additions & 4 deletions Sheaft.Web.Manage/Views/Products/Add.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@{
ViewData["Title"] = "New Product";
var vats = new List<SelectListItem> {
new SelectListItem("0%", "0"),
new SelectListItem("5.5%", "5.5"),
new SelectListItem("10%", "10"),
new SelectListItem("20%", "20"),
new SelectListItem("0%", "0.00"),
new SelectListItem("5.5%", "5.50"),
new SelectListItem("10%", "10.00"),
new SelectListItem("20%", "20.00"),
};

var units = new List<SelectListItem> {
Expand Down
8 changes: 4 additions & 4 deletions Sheaft.Web.Manage/Views/Products/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@{
ViewData["Title"] = "Product details";
var vats = new List<SelectListItem> {
new SelectListItem("0%", "0"),
new SelectListItem("5.5%", "5.5"),
new SelectListItem("10%", "10"),
new SelectListItem("20%", "20"),
new SelectListItem("0%", "0.00"),
new SelectListItem("5.5%", "5.50"),
new SelectListItem("10%", "10.00"),
new SelectListItem("20%", "20.00"),
};

var units = new List<SelectListItem> {
Expand Down

0 comments on commit 17d6cab

Please sign in to comment.