This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user