Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I would like to report bug in CalculateOrderLineTaxRateTask.
When price is equal to 0, this task throws DivideByZeroException.
I have fixed this issue by overriding this task as below, but I hope this will be fixed in following versions.
public class newCalculateOrderLineTaxRateTask : UCommerce.Pipelines.IPipelineTask<PurchaseOrder> { public PipelineExecutionResult Execute(PurchaseOrder subject) { foreach (OrderLine orderLine in (IEnumerable<OrderLine>)subject.OrderLines) { if (orderLine.Price == 0) { orderLine.VATRate = 0; } else { Decimal num = Decimal.Round(orderLine.VAT/orderLine.Price, 4); if (Math.Abs(orderLine.VATRate - num) > new Decimal(5, 0, 0, false, (byte) 3)) orderLine.VATRate = num; } } return PipelineExecutionResult.Success; } }
I'm using uCommere 7.0.0.16029
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
uCommerece: DivideByZeroException when price is equal to 0
Hi,
I would like to report bug in CalculateOrderLineTaxRateTask.
When price is equal to 0, this task throws DivideByZeroException.
I have fixed this issue by overriding this task as below, but I hope this will be fixed in following versions.
I'm using uCommere 7.0.0.16029
is working on a reply...