Esempio n. 1
0
        public static SalesReceipt ToQBSalesReceipt(this Intuit.Ipp.Data.SalesReceipt salesReceipt)
        {
            var qbSalesReceipt = new SalesReceipt
            {
                Id                   = salesReceipt.Id,
                DocNumber            = salesReceipt.DocNumber,
                Currency             = salesReceipt.CurrencyRef != null ? salesReceipt.CurrencyRef.Value : PredefinedValues.NotAvailable,
                TotalAmt             = salesReceipt.TotalAmt,
                SyncToken            = salesReceipt.SyncToken,
                Balance              = salesReceipt.Balance,
                Line                 = salesReceipt.Line.Select(x => x.ToQBAccessSalesReceiptLine()).ToList(),
                PONumber             = salesReceipt.PONumber,
                ShipCity             = salesReceipt.ShipAddr != null ? salesReceipt.ShipAddr.City : PredefinedValues.NotAvailable,
                ShipCountry          = salesReceipt.ShipAddr != null ? salesReceipt.ShipAddr.Country : PredefinedValues.NotAvailable,
                ShipCountryCode      = salesReceipt.ShipAddr != null ? salesReceipt.ShipAddr.CountryCode : PredefinedValues.NotAvailable,
                ShipPostalCode       = salesReceipt.ShipAddr != null ? salesReceipt.ShipAddr.PostalCode : PredefinedValues.NotAvailable,
                ShipPostalCodeSuffix = salesReceipt.ShipAddr != null ? salesReceipt.ShipAddr.PostalCodeSuffix : PredefinedValues.NotAvailable,
                ShipDate             = salesReceipt.ShipDate,
                CreateTime           = salesReceipt.MetaData.CreateTime,
                TrackingNum          = salesReceipt.TrackingNum,
                CustomerName         = (salesReceipt.CustomerRef != null) ? salesReceipt.CustomerRef.name : null,
                CustomerValue        = (salesReceipt.CustomerRef != null) ? salesReceipt.CustomerRef.Value : null,
                PrivateNote          = salesReceipt.PrivateNote,
            };

            return(qbSalesReceipt);
        }
Esempio n. 2
0
        public static Order ToQBOrder(this SalesReceipt source)
        {
            var qbOrder = new Order
            {
                OrderType            = OrderType.SalesReceipt,
                OrderId              = source.Id,
                Balance              = source.Balance,
                Currency             = source.Currency,
                DocNumber            = source.DocNumber,
                ShipCity             = source.ShipCity,
                ShipCountry          = source.ShipCountry,
                ShipCountryCode      = source.ShipCountryCode,
                ShipPostalCode       = source.ShipPostalCode,
                ShipPostalCodeSuffix = source.ShipPostalCodeSuffix,
                SyncToken            = source.SyncToken,
                TrackingNum          = source.TrackingNum,
                Line          = source.Line.ToQBOrderLine(),
                ShipDate      = source.ShipDate,
                TotalAmt      = source.TotalAmt,
                CreateTime    = source.CreateTime,
                CustomerName  = source.CustomerName,
                CustomerValue = source.CustomerValue,
                PrivateNote   = source.PrivateNote,
            };

            return(qbOrder);
        }