Ejemplo n.º 1
0
        private void AddInvoiceTotalType(int qty, decimal unitPrice, string currencyCode, UPSTimeInTransit.TimeInTransitRequest request)
        {
            var invoiceType = new UPSTimeInTransit.InvoiceLineTotalType();

            invoiceType.CurrencyCode = currencyCode;
            int total = (int)(qty * unitPrice);

            if (total % 100 > 0)
            {
                total = total + (100 - total % 100);
            }
            invoiceType.MonetaryValue = total.ToString();
            request.InvoiceLineTotal  = invoiceType;
        }
 private void AddInvoiceTotalType(int qty, decimal unitPrice, string currencyCode, UPSTimeInTransit.TimeInTransitRequest request)
 {
     var invoiceType = new UPSTimeInTransit.InvoiceLineTotalType();
     invoiceType.CurrencyCode = currencyCode;
     int total = (int)(qty * unitPrice);
     if (total % 100 > 0)
         total = total + (100 - total % 100);
     invoiceType.MonetaryValue = total.ToString();
     request.InvoiceLineTotal = invoiceType;
 }