This commit is contained in:
2021-01-25 20:02:44 +00:00
parent 887dbe5dd8
commit c1cf1086fb
5 changed files with 15 additions and 7 deletions

View File

@@ -0,0 +1,3 @@
# INV-PART-SERIALS Placeholder
This is a placeholder page for sections that are not written yet

View File

@@ -0,0 +1,3 @@
# INV-PART-STOCK-LEVELS Placeholder
This is a placeholder page for sections that are not written yet

View File

@@ -61,6 +61,8 @@ nav:
- Inventory: - Inventory:
- 'Parts': 'form-inv-parts.md' - 'Parts': 'form-inv-parts.md'
- 'Part warehouses': 'form-inv-part-warehouses.md' - 'Part warehouses': 'form-inv-part-warehouses.md'
- 'Part serial numbers': 'form-inv-part-serials.md'
- 'Part stock levels': 'form-inv-part-stock-levels.md'
- 'Part assemblies': 'form-inv-part-assemblies.md' - 'Part assemblies': 'form-inv-part-assemblies.md'
- 'Part inventory': 'form-inv-part-inventory.md' - 'Part inventory': 'form-inv-part-inventory.md'
- 'Part requests': 'form-inv-part-requests.md' - 'Part requests': 'form-inv-part-requests.md'

View File

@@ -236,7 +236,7 @@ namespace AyaNova.Biz
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
//UPDATE STOCK LEVELS //UPDATE STOCK LEVELS
// //
internal async Task<List<String>> PutStockLevelsAsync(long id, List<PartStockLevel> putPartStockLevels) internal async Task<List<PartStockLevel>> PutStockLevelsAsync(long id, List<PartStockLevel> putPartStockLevels)
{ {
//Fixup serials //Fixup serials
@@ -247,7 +247,7 @@ namespace AyaNova.Biz
//Remove any that should not be there anymore //Remove any that should not be there anymore
foreach (PartStockLevel existingPS in ExistingStockLevels) foreach (PartStockLevel existingPS in ExistingStockLevels)
{ {
if (!putPartStockLevels.Any(z => z.PartWarehouseId==existingPS.PartWarehouseId)) if (!putPartStockLevels.Any(z => z.PartWarehouseId == existingPS.PartWarehouseId))
{ {
//no longer in the collection so ditch it //no longer in the collection so ditch it
ct.PartStockLevel.Remove(existingPS); ct.PartStockLevel.Remove(existingPS);
@@ -258,7 +258,7 @@ namespace AyaNova.Biz
//Add any new ones //Add any new ones
foreach (PartStockLevel putPS in putPartStockLevels) foreach (PartStockLevel putPS in putPartStockLevels)
{ {
if (!ExistingStockLevels.Any(z => z.PartWarehouseId==putPS.PartWarehouseId)) if (!ExistingStockLevels.Any(z => z.PartWarehouseId == putPS.PartWarehouseId))
{ {
ct.PartStockLevel.Add(new PartStockLevel() { PartWarehouseId = putPS.PartWarehouseId, PartId = id }); ct.PartStockLevel.Add(new PartStockLevel() { PartWarehouseId = putPS.PartWarehouseId, PartId = id });
nAdded++; nAdded++;
@@ -279,9 +279,9 @@ namespace AyaNova.Biz
return null; return null;
} }
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Modified, $"LT:PartSerialNumbersAvailable change (+{nAdded}, -{nRemoved})"), ct); await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Modified, $"LT:PartStockingLevels change (+{nAdded}, -{nRemoved})"), ct);
return await ct.PartSerial.Where(z => z.PartId == id).OrderBy(z => z.Serial).Select(z => z.Serial).ToListAsync(); return await ct.PartStockLevel.AsNoTracking().Where(z => z.PartId == id).OrderBy(z => z.PartWarehouseId).ToListAsync();
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -22,8 +22,8 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15; private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 700; internal const long EXPECTED_COLUMN_COUNT = 704;
internal const long EXPECTED_INDEX_COUNT = 122; internal const long EXPECTED_INDEX_COUNT = 124;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!