Exemplo n.º 1
0
        public virtual TaxLine[] ToTaxLines(ShippingMethod shipmentMethod)
        {
            var retVal = new List <TaxLine>
            {
                new TaxLine(shipmentMethod.Currency)
                {
                    Id      = shipmentMethod.BuildTaxLineId(),
                    Code    = shipmentMethod.ShipmentMethodCode,
                    TaxType = shipmentMethod.TaxType,
                    Amount  = shipmentMethod.Total
                }
            };

            return(retVal.ToArray());
        }
Exemplo n.º 2
0
        public static TaxLine[] ToTaxLines(this ShippingMethod shipmentMethod)
        {
            var retVal = new List <TaxLine>
            {
                new TaxLine(shipmentMethod.Currency)
                {
                    Id      = shipmentMethod.BuildTaxLineId(),
                    Code    = shipmentMethod.ShipmentMethodCode,
                    TaxType = shipmentMethod.TaxType,
                    //Special case when shipment method have 100% discount and need to calculate tax for old value
                    Amount = shipmentMethod.Total.Amount > 0 ? shipmentMethod.Total : shipmentMethod.Price
                }
            };

            return(retVal.ToArray());
        }