This commit is contained in:
2021-05-26 23:22:41 +00:00
parent 24fb905180
commit 05938eb68f

View File

@@ -2396,6 +2396,7 @@ namespace AyaNova.Biz
return null;
else
{
await LoanBizActionsAsync(AyaEvent.Created, newObject, null, null);
//newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
//newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
await ct.WorkOrderItemLoan.AddAsync(newObject);
@@ -2442,6 +2443,7 @@ namespace AyaNova.Biz
await LoanValidateAsync(putObject, dbObject);
if (HasErrors) return null;
await LoanBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null);
ct.Replace(dbObject, putObject);
try
{
@@ -2541,11 +2543,11 @@ namespace AyaNova.Biz
//manual price overrides anything
o.PriceViz=o.ListPrice;
o.PriceViz = o.ListPrice;
if (o.PriceOverride != null)
o.PriceViz = (decimal)o.PriceOverride;
//Currently not contract discounted so no further calcs need apply to priceViz
//Calculate totals and taxes
//NET
o.NetViz = o.PriceViz * o.Quantity;
@@ -2578,7 +2580,7 @@ namespace AyaNova.Biz
//BIZ ACTIONS
//
//
private async Task LoanUnitBizActionsAsync(AyaEvent ayaEvent, WorkOrderItemLoan newObj, WorkOrderItemLoan oldObj, IDbContextTransaction transaction)
private async Task LoanBizActionsAsync(AyaEvent ayaEvent, WorkOrderItemLoan newObj, WorkOrderItemLoan oldObj, IDbContextTransaction transaction)
{
//automatic actions on record change, called AFTER validation
@@ -2593,8 +2595,8 @@ namespace AyaNova.Biz
if (ayaEvent == AyaEvent.Modified)
{
//If it wasn't a complete part change there is no need to set pricing
if (newObj.LoanUnitId == oldObj.LoanUnitId && newObj.Rate == oldObj.Rate)
SnapshotPricing = false;
if (newObj.LoanUnitId == oldObj.LoanUnitId && newObj.Rate == oldObj.Rate)
SnapshotPricing = false;
}
//Pricing