This commit is contained in:
2021-06-02 22:59:46 +00:00
parent b70df41b11
commit 693aa33a3a
2 changed files with 39 additions and 3 deletions

2
.vscode/launch.json vendored
View File

@@ -53,7 +53,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -1960,7 +1960,7 @@ namespace AyaNova.Biz
ct.Replace(dbObject, putObject);
try
{
await ct.SaveChangesAsync();
await ct.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
@@ -3333,7 +3333,43 @@ namespace AyaNova.Biz
{
//automatic actions on record change, called AFTER validation
//currently no processing required except for created or modified at this time
//### TODO: make this work with inventory, also check if delete entire workorder will still call this (or delete woitem)
// if delete wo doesn't call this, it will need to
if (AyaNova.Util.ServerGlobalBizSettings.UseInventory)
{
//Get inventory object for updating
PartInventoryBiz pib = new PartInventoryBiz(ct, UserId, UserTranslationId, CurrentUserRoles);
//DELETED HANDLE INVENTORY / RETURN SERIALS
this was copied from purchase order just to show the requirements
//It's a new receipt with received amounts - add to inventory
dtPOPartInventory i = new dtPOPartInventory();
i.PartId = newItem.PartId;
i.PartWarehouseId = newItem.PartWarehouseId;
i.Quantity = newItem.QuantityReceived;
i.SourceType = AyaType.PurchaseOrder;
i.SourceId = newObj.Id;
i.Description = await Translate("PurchaseOrder") + $" {newObj.Serial} " + await Translate("PurchaseOrderItem") + " " + await Translate("EventCreated");
if (await pib.CreateAsync(i) == null)
{
AddError(ApiErrorCode.API_SERVER_ERROR, "generalerror", $"Error updating inventory ({i.Description}):{pib.GetErrorsAsString()}");
return;
}
//CREATED HANDLE INVENTORY / CONSUME SERIALS
//UPDATED HANDLE INVENTORY / UPDATE SERIALS EITHER WAY
}
//SNAPSHOT PRICING IF NECESSARY
if (ayaEvent != AyaEvent.Created && ayaEvent != AyaEvent.Modified)
return;