summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2024-08-26 18:07:50 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2024-08-26 18:07:50 +0300
commit97d601999c0d6ff16e3cd93c8ee0f6d4756bb60d (patch)
treeb43ef5e7833ffd6b1041e613d7c57b2132bc37eb
parentae7d81e95f8cc84230f6591f59348bbccb333112 (diff)
Fix actual price list parsing
-rw-r--r--RhSolutions.Api/Services/ClosedXMLParser.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/RhSolutions.Api/Services/ClosedXMLParser.cs b/RhSolutions.Api/Services/ClosedXMLParser.cs
index 2c614e0..81dccf5 100644
--- a/RhSolutions.Api/Services/ClosedXMLParser.cs
+++ b/RhSolutions.Api/Services/ClosedXMLParser.cs
@@ -31,9 +31,14 @@ namespace RhSolutions.Api.Services
{
var firstCellAddress = ws.Search("Программа", System.Globalization.CompareOptions.IgnoreCase)
.First()
+ .CellLeft()
.Address;
- var lastCellAddress = ws.LastCellUsed().Address;
+ var lastCellAddress = ws.Search("Цена брутто", System.Globalization.CompareOptions.IgnoreCase)
+ .First()
+ .WorksheetColumn()
+ .LastCellUsed()
+ .Address;
return ws.Range(firstCellAddress, lastCellAddress).AsTable();
}
@@ -89,16 +94,16 @@ namespace RhSolutions.Api.Services
productWarehouseCount = 0.0;
}
- string onWarehouseField = row.Field("Складская программа")
+ string onWarehouseField = row.Field(0)
.GetString();
bool IsOnWarehouse;
switch (onWarehouseField)
{
- case "x":
+ case "N":
IsOnWarehouse = true;
break;
- case "под заказ":
+ case "Z":
IsOnWarehouse = false;
break;
default: