Skip to content

Commit

Permalink
VCST-2182: The field Pack size take into negative value
Browse files Browse the repository at this point in the history
fix: The field Pack size take into negative value.
  • Loading branch information
OlegoO committed Oct 30, 2024
1 parent 1ef8a75 commit 2a6030b
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 158 deletions.
4 changes: 2 additions & 2 deletions src/VirtoCommerce.CatalogModule.Data/Model/ItemEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public virtual CatalogProduct ToModel(CatalogProduct product, bool convertChildr
product.MaxQuantity = (int)MaxQuantity;
product.MeasureUnit = MeasureUnit;
product.MinQuantity = (int)MinQuantity;
product.PackSize = PackSize;
product.PackSize = PackSize >= 1 ? PackSize : 1;
product.Name = Name;
product.PackageType = PackageType;
product.Priority = Priority;
Expand Down Expand Up @@ -264,7 +264,7 @@ public virtual ItemEntity FromModel(CatalogProduct product, PrimaryKeyResolvingM
MaxQuantity = product.MaxQuantity ?? 0;
MeasureUnit = product.MeasureUnit;
MinQuantity = product.MinQuantity ?? 0;
PackSize = product.PackSize;
PackSize = product.PackSize >= 1 ? PackSize : 1;
Name = product.Name;
PackageType = product.PackageType;
Priority = product.Priority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ angular.module('virtoCommerce.catalogModule')
return false;
}

if (minEmpty && maxEmpty) {
if (minEmpty && maxEmpty && packSizeEmpty) {
return true;
}

Expand Down
Loading

0 comments on commit 2a6030b

Please sign in to comment.