namespace WocaHelper { public class MyPipelineTask : IPipelineTask<PurchaseOrder> { public PipelineExecutionResult Execute(PurchaseOrder subject) { bool ExcludeVAT = false; if (!bool.TryParse(subject["ExcludeVAT"], out ExcludeVAT)) return PipelineExecutionResult.Success; if (ExcludeVAT) { // Find the price group - assume only one configured //PriceGroup priceGroup = PriceGroup.All().FirstOrDefault(x => !x.Deleted); // Find that configured price group decimal vatRate = 0; //priceGroup.VATRate; foreach (var orderLine in subject.OrderLines) { orderLine.VATRate = vatRate; // VAT is stored on a per unit basis orderLine.VAT = vatRate; // vatRate; //orderLine.Price * vatRate; orderLine.Save(); // Line totals and VAT totals are calculated by a different task } } return PipelineExecutionResult.Success; } } }
VAT Calculation
Trying to extend the basket pipeline to allow removal of VAT if certain criteries are met.
What i want to do:
If a customer types in a VAT number i want to remove vat from order.
Have tried http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/12407-Apply-Vat-on-cartaspx-page but think i have registred the pipeline wrong,
What i have so far:
ExcludeVAT.aspx
and in Basket.config
in my basket usercontrol (onTextChange event on vatnumber textBox
With this setup i get error:
Value cannot be null.
I ran into the same problem. I changed the pipeline task to point to the new entites "Entities2" and it worked.
change this line in basket.config
to this.
is working on a reply...