/// <summary>
 /// Sets the passanger.
 /// </summary>
 public void SetFare(VolarisPassangerFare fare)
 {
     View.BasePrice      = fare.BasePrice.Total;
     View.PassangerCount = fare.Count.ToString(CultureInfo.InvariantCulture);
     View.Taxes          = fare.TotalTaxes;
     View.PassangerType  = fare.PassangerType;
     View.Total          = fare.Total;
 }
예제 #2
0
        /// <summary>
        /// Sets the passanger fare.
        /// TODO: Verificar los impuestos por pasajeros para internacionales y nacionales.
        /// </summary>
        /// <param name="itinerary"> </param>
        /// <param name="passangerFare">The passanger fare.</param>
        /// <param name="passangerType">Type of the passanger.</param>
        /// <param name="isInternational"> </param>
        private void SetPassangerFare(OTA_AirLowFareSearchRSPricedItinerary itinerary, VolarisPassangerFare passangerFare, string passangerType, bool isInternational)
        {
            var itineraryPricingInfo =
                itinerary.AirItineraryPricingInfo.FirstOrDefault(
                    itin => itin.PassengerTypeQuantity.Code.Equals(passangerType));

            if (itineraryPricingInfo != null)
            {
                passangerFare.Count = Convert.ToInt16(itineraryPricingInfo.PassengerTypeQuantity.Quantity);
                var ivaTaxCodes          = new[] { "MX" };
                var tuaTaxCodes          = new[] { "XV" };
                var montoiva11TaxCodes   = new[] { "SOV" };
                var iva11TaxCodes        = new[] { "SNV" };
                var montoiva16TaxesCodes = new[] { "SCV" };
                var iva16TaxCodes        = new[] { "SBV" };
                var taxCodeToIgnore      = new[] { "MX", "XV", "SOV", "SNV", "SCV", "SBV" };
                if (isInternational)
                {
                    ivaTaxCodes                   = new[] { "XO" };
                    tuaTaxCodes                   = new[] { "XD", "US2" };
                    montoiva11TaxCodes            = new[] { "SOV" };
                    iva11TaxCodes                 = new[] { "SNV" };
                    montoiva16TaxesCodes          = new[] { "SCV" };
                    iva16TaxCodes                 = new[] { "SBV" };
                    taxCodeToIgnore               = new[] { "XO", "XD", "US2", "SOV", "SNV", "SCV", "SBV" };
                    passangerFare.BasePrice.Total = Convert.ToDecimal(itineraryPricingInfo.ItinTotalFare.EquivFare.Amount) *
                                                    passangerFare.Count;
                }
                else
                {
                    passangerFare.BasePrice.Total = Convert.ToDecimal(itineraryPricingInfo.ItinTotalFare.BaseFare.Amount) *
                                                    passangerFare.Count;
                }
                var taxes = itineraryPricingInfo.ItinTotalFare.Taxes;
                passangerFare.Iva.Total        = GetTaxes(ivaTaxCodes, taxes) * passangerFare.Count;
                passangerFare.Tua.Total        = GetTaxes(tuaTaxCodes, taxes) * passangerFare.Count;
                passangerFare.Extra.Total      = GetExtraTax(taxCodeToIgnore, taxes) * passangerFare.Count;
                passangerFare.TotalTaxes       = taxes.Sum(tax => tax.Amount) * passangerFare.Count;
                passangerFare.MontoIVA11.Total = GetTaxes(montoiva11TaxCodes, taxes) * passangerFare.Count;
                passangerFare.IVA11.Total      = GetTaxes(iva11TaxCodes, taxes) * passangerFare.Count;
                passangerFare.MontoIVA16.Total = GetTaxes(montoiva16TaxesCodes, taxes) * passangerFare.Count;
                passangerFare.IVA16.Total      = GetTaxes(iva16TaxCodes, taxes) * passangerFare.Count;
                passangerFare.Total            = Convert.ToDecimal(itineraryPricingInfo.ItinTotalFare.TotalFare.Amount) *
                                                 passangerFare.Count;

                if (PassangerTypesContainer.ContainsKey(passangerType))
                {
                    passangerFare.PassangerType = PassangerTypesContainer[passangerType];
                }
            }
        }
예제 #3
0
 public void SetFare(VolarisPassangerFare fare)
 {
     _presenter.SetFare(fare);
 }