public void LoadSelectedPurchaseOrder()
        {
            frmPurchaseOrder oPurchaseOrder = new frmPurchaseOrder();

            oPurchaseOrder.FormMode        = "Old";
            oPurchaseOrder.TxtOrderID.Text = PurchaseOrderID.ToString();
            oPurchaseOrder.Show();
        }
예제 #2
0
        /// <summary>
        /// Updates Total Amount of the Main Document
        /// </summary>
        private void UpdateTotal()
        {
            var oldTotal = _TotalAmount;

            _TotalAmount = decimal.Add(decimal.Multiply(UnitPrice, Quantity), TaxAmount);
            OnChanged("TotalAmount", oldTotal, _TotalAmount);
            if (!IsLoading && !IsSaving)
            {
                if (SalesOrderID != null)
                {
                    SalesOrderID.UpdateTotal(true);
                }
                else if (SalesQuoteID != null)
                {
                    SalesQuoteID.UpdateTotal(true);
                }
                else if (SalesInvoiceID != null)
                {
                    SalesInvoiceID.UpdateTotal(true);
                }
                else if (SalesDeliveryNoteID != null)
                {
                    SalesDeliveryNoteID.UpdateTotal(true);
                }
                else if (RMAID != null)
                {
                    RMAID.UpdateTotal(true);
                }
                else if (SalesCreditMemoID != null)
                {
                    SalesCreditMemoID.UpdateTotal(true);
                }
                else if (PurchaseOrderID != null)
                {
                    PurchaseOrderID.UpdateTotal(true);
                }
                else if (PurchaseQuoteID != null)
                {
                    PurchaseQuoteID.UpdateTotal(true);
                }
                else if (PurchaseInvoiceID != null)
                {
                    PurchaseInvoiceID.UpdateTotal(true);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// This method converts order lookup request to WMLookUpRequest
        /// </summary>
        /// <param name="request">orderlookuprequest</param>
        /// <returns>ordersummaryrequest</returns>

        //public static OrderSummaryRequest ToWmLookUpRequest(this OrderSummaryLookUpRequest request)
        //{
        //    var shipToList = new List<ShipTo>();
        //    shipToList.Add(GetDefaultShipTo(request.SAPOrderNumber));
        //    var result = new OrderSummaryRequest()
        //    {
        //        Header = new OrderLookUpHeader
        //        {
        //            VersionNumber = new VersionNumber()
        //            {
        //                Value = "001",
        //                Data = "001"
        //            },

        //            Sender = new OrderSender()
        //            {
        //                LogicalID = "SF",
        //                Task = "DisplayOrderSummary"
        //            }

        //        },
        //        Body = new OrderLookUpBody()
        //        {
        //            RequestHeader = new OrderSummaryRequestHeader()
        //            {
        //                ContactNameID = string.Empty,
        //                // SalesOrgID =string.Empty,
        //                DivisionID = "02",
        //                DistChannelID = "01",
        //                ToDateString = string.Empty,
        //                FromDateString = string.Empty,
        //                Language = request.Language,
        //                ShipToList = shipToList
        //            }

        //        },


        //    };

        //    return result;

        //}

        public static ShipTo GetDefaultShipTo(string sapOrderNumber)
        {
            ShipTo shipTo = new ShipTo {
                ShipToID = ""
            };
            PurchaseOrderID order = new PurchaseOrderID {
                Data = ""
            };
            List <PurchaseOrderID> poList = new List <PurchaseOrderID> {
                order
            };
            SellerOrderID sellerOrderId = new SellerOrderID {
                Data = sapOrderNumber
            };
            List <SellerOrderID> orderList = new List <SellerOrderID> {
                sellerOrderId
            };

            shipTo.SAPOrderList      = orderList;
            shipTo.PurchaseOrderList = poList;
            return(shipTo);
        }