/// <summary> /// Update Order Total /// </summary> public void UpdateOrderTotal() { //debug info var totalQv = 0m; var totalCv = 0m; //reset the value, in case other place can call this multiple time resulting in the amounts updated more than needed _subTotal = 0m; _orderNet = 0m; _totalDiscount = 0m; _orderQv = 0m; _orderCv = 0m; _totalAmt = 0m; if (this._productsList.Count > 0) { for (int i = 0; i < this._productsList.Count; i++) { ProductOrder po = (ProductOrder)_productsList[i]; _subTotal += po.GetSubtotal(po.PriceType); _orderNet += po.GetSubTotalAfterDiscount(); _totalDiscount += po.LineItemTotalDiscount(); _orderQv += po.GetSubtotalQvAfterDiscount(); //cart plan only discount QV _orderCv += po.GetSubtotalCv(); //debug info totalQv += po.GetSubtotalQv(); totalCv += po.GetSubtotalCv(); } } _totalAmt = _orderNet + _freightAmt; Console.WriteLine("Subtotal : " + _subTotal); Console.WriteLine("Order Net : " + _orderNet); Console.WriteLine("Total Discount " + _totalDiscount); Console.WriteLine("Total " + _totalAmt); Console.WriteLine("Total discounted Qv: " + _orderQv); Console.WriteLine("Total discounted Cv: " + _orderCv); Console.WriteLine("Total Qv : " + totalQv); Console.WriteLine("Total Cv : " + totalCv); }
public void AddToProductList(ProductOrder po) { _productsList.Add(po); }