This commit is contained in:
@@ -1309,8 +1309,8 @@ namespace AyaNova.Biz
|
||||
else
|
||||
{
|
||||
await ct.WorkOrderState.AddAsync(newObject);
|
||||
var wo=await ct.WorkOrder.FirstOrDefaultAsync(x=>x.Id==newObject.WorkOrderId);
|
||||
wo.LastStatusId=newObject.WorkOrderStatusId;
|
||||
var wo = await ct.WorkOrder.FirstOrDefaultAsync(x => x.Id == newObject.WorkOrderId);
|
||||
wo.LastStatusId = newObject.WorkOrderStatusId;
|
||||
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.WorkOrderStatus, AyaEvent.Created), ct);
|
||||
@@ -2227,31 +2227,47 @@ namespace AyaNova.Biz
|
||||
o.TaxCodeViz = Tax.Name;
|
||||
|
||||
//Calculate totals and taxes
|
||||
o.TaxAViz = 0;
|
||||
o.TaxBViz = 0;
|
||||
|
||||
if (Tax != null)
|
||||
if (o.ChargeToCustomer)
|
||||
{
|
||||
if (Tax.TaxAPct != 0)
|
||||
o.TaxAViz = 0;
|
||||
o.TaxBViz = 0;
|
||||
|
||||
if (Tax != null)
|
||||
{
|
||||
o.TaxAViz = o.ChargeAmount * (Tax.TaxAPct / 100);
|
||||
}
|
||||
if (Tax.TaxBPct != 0)
|
||||
{
|
||||
if (Tax.TaxOnTax)
|
||||
if (Tax.TaxAPct != 0)
|
||||
{
|
||||
o.TaxBViz = (o.ChargeAmount + o.TaxAViz) * (Tax.TaxBPct / 100);
|
||||
o.TaxAViz = o.ChargeAmount * (Tax.TaxAPct / 100);
|
||||
}
|
||||
else
|
||||
if (Tax.TaxBPct != 0)
|
||||
{
|
||||
o.TaxBViz = o.ChargeAmount * (Tax.TaxBPct / 100);
|
||||
if (Tax.TaxOnTax)
|
||||
{
|
||||
o.TaxBViz = (o.ChargeAmount + o.TaxAViz) * (Tax.TaxBPct / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
o.TaxBViz = o.ChargeAmount * (Tax.TaxBPct / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
o.LineTotalViz = o.ChargeAmount + o.TaxAViz + o.TaxBViz;
|
||||
}else{
|
||||
o.LineTotalViz = o.ChargeAmount + o.TaxPaid;
|
||||
}
|
||||
}
|
||||
o.LineTotalViz = o.ChargeAmount + o.TaxAViz + o.TaxBViz;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
As of Alpha.109 "LineTotalViz" is derived incorrectly. It is presently looking like it uses TotalCost and "ChargeToCustomer"=true, instead needs to be based on ChargeAmount
|
||||
|
||||
IF "ChargeToCustomer" = true then do below to get "LineTotalViz": ,
|
||||
If "ChargeTaxCodeId" has a value, then "LineTotalViz": = ( "ChargeAmount" + ((TaxA% * "ChargeAmount") + (TaxB% * "ChargeAmount"))
|
||||
ELSE
|
||||
If "ChargeTaxCodeId" does NOT have a value then "LineTotalViz": = ( "ChargeAmount" + "TaxPaid")
|
||||
ELSE skip and "LineTotalViz" is empty
|
||||
|
||||
*/
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //BIZ ACTIONS
|
||||
// //
|
||||
|
||||
Reference in New Issue
Block a user