public static Models.GetPurchaseOrders.PurchaseOrder ToQBPurchaseOrder(this Models.Services.QuickBooksOnlineServicesSdk.GetPurchaseOrders.PurchaseOrder purchaseOrder)
        {
            var qbPurchaseOrder = new Models.GetPurchaseOrders.PurchaseOrder
            {
                DocNumber   = purchaseOrder.DocNumber,
                PoStatus    = purchaseOrder.PoStatus.ToQBPurchaseOrderStatusEnum(),
                VendorName  = purchaseOrder.VendorName,
                VendorValue = purchaseOrder.VendorValue,
                TnxDate     = purchaseOrder.TnxDate,
                LineItems   = purchaseOrder.LineItems.ToQBPurchaseOrderLineItem(),
            };

            return(qbPurchaseOrder);
        }
        public static Models.Services.QuickBooksOnlineServicesSdk.GetPurchaseOrders.PurchaseOrder ToQBServicePurchaseOrder(this PurchaseOrder purchaseOrder)
        {
            var qbPurchaseOrder = new Models.Services.QuickBooksOnlineServicesSdk.GetPurchaseOrders.PurchaseOrder
            {
                Id          = purchaseOrder.Id,
                DocNumber   = purchaseOrder.DocNumber,
                TnxDate     = purchaseOrder.TxnDate,
                LineItems   = purchaseOrder.Line.ToList().Select(x => x.ToQBServicePurchaseOrderLineItem()).ToList(),
                SyncToken   = purchaseOrder.SyncToken,
                VendorName  = purchaseOrder.VendorRef.name,
                VendorValue = purchaseOrder.VendorRef.Value,
                PoStatus    = purchaseOrder.POStatus.ToQBServicePurchaseOrderStatusEnum()
            };

            return(qbPurchaseOrder);
        }
        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);
        }