Skip to content

Commit

Permalink
PT-9349: Fulfillment Center amount to 0 it does not get updated (#98)
Browse files Browse the repository at this point in the history
* fix: Fulfillment Center amount to 0 it does not get updated
  • Loading branch information
OlegoO committed Oct 19, 2022
1 parent 072dd71 commit 6d85864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions VirtoCommerce.CatalogCsvImportModule.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29728.190
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F53AF5F4-4125-4EB9-AD5A-4E646064CC2E}"
EndProject
Expand Down
Expand Up @@ -331,7 +331,7 @@ private void MergeCsvProductComplexObjects(List<CsvProduct> csvProducts, string

private static Property GetMergedProperty(IGrouping<string, Property> propertyGroup)
{
var result = propertyGroup.FirstOrDefault();
var result = propertyGroup.First();

foreach (var property in propertyGroup.Skip(1))
{
Expand Down Expand Up @@ -543,9 +543,7 @@ private async Task SaveProductInventories(IList<CsvProduct> products, Fulfillmen
inventory.AllowPreorder = exitsInventory.AllowPreorder;
inventory.BackorderAvailabilityDate = exitsInventory.BackorderAvailabilityDate;
inventory.BackorderQuantity = exitsInventory.BackorderQuantity;
inventory.InTransit = exitsInventory.InTransit;

inventory.InStockQuantity = inventory.InStockQuantity == 0 ? exitsInventory.InStockQuantity : inventory.InStockQuantity;
inventory.InTransit = exitsInventory.InTransit;
}
}
await _inventoryService.SaveChangesAsync(inventories);
Expand Down Expand Up @@ -733,7 +731,7 @@ private async Task LoadProductDependencies(IEnumerable<CsvProduct> csvProducts,
// Combining multiple values ​​into one for non-multivalued properties
else if (property.Values.Count > 1)
{
var propertyValue = property.Values.FirstOrDefault();
var propertyValue = property.Values.First();
propertyValue.Value = string.Join(CsvReaderExtension.Delimiter, property.Values.Select(x => x.Value));
property.Values = new List<PropertyValue> { propertyValue };
}
Expand Down

0 comments on commit 6d85864

Please sign in to comment.