public static Models.Services.QuickBooksOnlineServicesSdk.UpdatePurchaseOrders.PurchaseOrder ToQBInternalPurchaseOrder(this Models.Services.QuickBooksOnlineServicesSdk.GetPurchaseOrders.PurchaseOrder purchaseOrder)
        {
            var qbPurchaseOrder = new Models.Services.QuickBooksOnlineServicesSdk.UpdatePurchaseOrders.PurchaseOrder
            {
                DocNumber   = purchaseOrder.DocNumber,
                Id          = purchaseOrder.Id,
                SyncToken   = purchaseOrder.SyncToken,
                LineItems   = purchaseOrder.LineItems.Select(x => x.ToQBInternalPurchaseOrderLineItem()),
                POStatus    = ( QBInternalPurchaseOrderStatusEnum )Enum.Parse(typeof(Models.Services.QuickBooksOnlineServicesSdk.GetPurchaseOrders.QBPurchaseOrderStatusEnum), purchaseOrder.PoStatus.ToString()),
                VendorValue = purchaseOrder.VendorValue,
                VendorName  = purchaseOrder.VendorName,
            };

            return(qbPurchaseOrder);
        }
        public static PurchaseOrder ToIppPurchaseOrder(this Models.Services.QuickBooksOnlineServicesSdk.UpdatePurchaseOrders.PurchaseOrder purchaseOrder)
        {
            var qbPurchaseOrder = new PurchaseOrder
            {
                DocNumber         = purchaseOrder.DocNumber,
                Id                = purchaseOrder.Id,
                SyncToken         = purchaseOrder.SyncToken,
                Line              = purchaseOrder.LineItems.Select(x => x.ToIppPurchaseOrderLineItem()).ToArray(),
                POStatus          = purchaseOrder.POStatus.ToIppPurchaseOrderStatusEnum(),
                POStatusSpecified = true,
                VendorRef         = new ReferenceType
                {
                    name  = purchaseOrder.VendorName,
                    Value = purchaseOrder.VendorValue,
                }
            };

            return(qbPurchaseOrder);
        }