private void btnPickUp_Click(object sender, EventArgs e)
        {
            //Get order
            //set Mode = Pickup
            CustomerOrderTransaction cot = SalesOrderActions.GetCustomerOrder(this.SelectedSalesOrderId, this.SelectedOrderType, LSRetailPosis.Transaction.CustomerOrderMode.Pickup);

            SalesOrderActions.ShowOrderDetails(cot, OrderDetailsSelection.PickupOrder);
            SetSelectedOrderAndClose(cot);
        }
Exemple #2
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            //Get the order from the grid
            CustomerOrderTransaction cot = SalesOrderActions.GetCustomerOrder(this.SelectedSalesOrderId, this.SelectedOrderType, LSRetailPosis.Transaction.CustomerOrderMode.Edit);

            if (cot != null)
            {
                //Now get an invoice from the order
                cot = SalesOrderActions.ReturnOrderInvoices(cot);
                SetSelectedOrderAndClose(cot);
            }
        }
Exemple #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            // Get order
            CustomerOrderTransaction cot = SalesOrderActions.GetCustomerOrder(this.SelectedSalesOrderId, this.SelectedOrderType, LSRetailPosis.Transaction.CustomerOrderMode.Edit);

            if (cot != null)
            {
                if (SalesOrderActions.ShowOrderDetails(cot, OrderDetailsSelection.ViewDetails))
                {
                    SetSelectedOrderAndClose(cot);
                }
            }
        }
        private void ReturnItemsFromInvoice()
        {
            bool   retValue  = false;
            string comment   = string.Empty;
            string invoiceId = SelectedInvoiceId;
            CustomerOrderTransaction invoiceTransaction;
            DialogResult             results = DialogResult.None;

            try
            {
                // Construct a transaction from the given Invoice
                SalesOrder.GetSalesInvoiceTransaction(ref retValue, ref comment, invoiceId, out invoiceTransaction);

                if (retValue)
                {
                    ReturnTransactionConfirmation returnTransactionConfirmation = new ReturnTransactionConfirmation()
                    {
                        PosTransaction = invoiceTransaction,
                    };

                    InteractionRequestedEventArgs request = new InteractionRequestedEventArgs(returnTransactionConfirmation, () =>
                    {
                        if (returnTransactionConfirmation.Confirmed)
                        {
                            // The user selected to return items...
                            // Transfer the items to the posTranscation for the return
                            // Updates customer and calculates taxes based upon items and customer
                            SalesOrderActions.InsertReturnedItemsIntoTransaction(returnTransactionConfirmation.ReturnedLineNumbers, invoiceTransaction, this.Transaction);

                            // We only support returning a single-invoice at a time, so Close the form after processing the first one.
                            results = System.Windows.Forms.DialogResult.OK;
                            this.Close();
                        }
                    }
                                                                                              );

                    SalesOrder.InternalApplication.Services.Interaction.InteractionRequest(request);
                }
                else
                {
                    //An error occurred in the operation...
                    SalesOrder.InternalApplication.Services.Dialog.ShowMessage(10002, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                ApplicationExceptionHandler.HandleException(this.ToString(), ex);
            }

            this.DialogResult = results;
        }
        private void btnCancelOrder_Click(object sender, EventArgs e)
        {
            //Get order
            //set Mode = Cancel
            CustomerOrderTransaction cot = SalesOrderActions.GetCustomerOrder(this.SelectedSalesOrderId, this.SelectedOrderType, LSRetailPosis.Transaction.CustomerOrderMode.Cancel);

            if (cot.OrderStatus == SalesStatus.Processing)
            {
                //Order cannot be cancelled at this time from POS
                SalesOrder.InternalApplication.Services.Dialog.ShowMessage(56237, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            SalesOrderActions.ShowOrderDetails(cot, OrderDetailsSelection.CancelOrder);
            SetSelectedOrderAndClose(cot);
        }
Exemple #6
0
        internal static ICustomerOrderTransaction ShowOrderDetailsOptions(ICustomerOrderTransaction transaction)
        {
            using (formOrderDetailsSelection frm = new formOrderDetailsSelection())
            {
                ICustomerOrderTransaction result = transaction;
                POSFormsManager.ShowPOSForm(frm);
                if (frm.DialogResult == DialogResult.OK)
                {
                    // when in cancel mode, we only allow to enter view details, cancel or close order modes.
                    bool allowedOnCancelMode     = IsSelectionAllowedOnCancelOrderMode(frm.Selection);
                    CustomerOrderTransaction cot = transaction as CustomerOrderTransaction;

                    if (cot != null && cot.Mode == CustomerOrderMode.Cancel && !allowedOnCancelMode)
                    {
                        SalesOrder.InternalApplication.Services.Dialog.ShowMessage(4543);
                        return(result);
                    }

                    switch (frm.Selection)
                    {
                    case OrderDetailsSelection.ViewDetails:
                        SalesOrderActions.ShowOrderDetails(transaction, frm.Selection);
                        break;

                    case OrderDetailsSelection.CloseOrder:
                        CloseOrder(transaction);
                        break;

                    case OrderDetailsSelection.Recalculate:
                        RecalculatePrices(transaction);
                        break;

                    default:
                        break;
                    }
                }

                return(result);
            }
        }
Exemple #7
0
 public override void Refresh()
 {
     this.OrderList = SalesOrderActions.GetOrdersList(this.customerId, this.orderId, this.startDate, this.endDate, this.resultMaxCount);
 }
Exemple #8
0
 private void btnPrintPackSlip_Click(object sender, EventArgs e)
 {
     //to call pack Slip Method
     SalesOrderActions.TryPrintPackSlip(this.selectedOrderDocumentStatus, this.SelectedSalesOrderId);
 }
Exemple #9
0
 private void btnCreatePickList_Click(object sender, EventArgs e)
 {
     SalesOrderActions.TryCreatePickListForOrder(this.selectedOrderSalesStatus, this.SelectedSalesOrderId);
     RefreshGrid();
 }
Exemple #10
0
        /// <summary>
        /// Attempt to return invoices for the given order
        /// </summary>
        /// <param name="transaction"></param>
        /// <returns></returns>
        internal static CustomerOrderTransaction ReturnOrderInvoices(CustomerOrderTransaction transaction)
        {
            CustomerOrderTransaction result = null;

            try
            {
                if (transaction == null)
                {
                    // Operation not valid for this type of transaction
                    SalesOrder.InternalApplication.Services.Dialog.ShowMessage(3175, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(null);
                }

                if (transaction.OrderType != CustomerOrderType.SalesOrder)
                {
                    // Operation not valid for this type of transaction
                    SalesOrder.InternalApplication.Services.Dialog.ShowMessage(3175, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(null);
                }

                bool   retValue = false;
                string comment  = string.Empty;

                using (DataTable invoices = SalesOrder.GetSalesInvoiceList(ref retValue, ref comment, transaction.OrderId))
                {
                    if ((!retValue) || (invoices == null) || (invoices.Rows.Count == 0))
                    {
                        if (!retValue)
                        {
                            ApplicationLog.Log(SalesOrderActions.LogSource, comment, LogTraceLevel.Error);
                        }

                        // There are no sales orders in the database for this customer....
                        SalesOrder.InternalApplication.Services.Dialog.ShowMessage(56123, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return(null);
                    }

                    // Show the available sales orders for selection...
                    using (frmGetSalesInvoices dlg = new frmGetSalesInvoices(invoices, transaction))
                    {
                        SalesOrder.InternalApplication.ApplicationFramework.POSShowForm(dlg);

                        if (dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                        {
                            // Copy the transaction back from the 'return invoices' form
                            result = dlg.Transaction;

                            SalesOrderActions.ProcessReturnReasonCodes(result);
                        }
                    }
                }
            }
            catch (PosisException px)
            {
                POSFormsManager.ShowPOSErrorDialog(px);
                ApplicationExceptionHandler.HandleException(SalesOrderActions.LogSource, px);
            }
            catch (Exception x)
            {
                ApplicationExceptionHandler.HandleException(SalesOrderActions.LogSource, x);
                throw;
            }

            return(result);
        }
        internal override DataTable Refresh()
        {
            DataTable salesOrders = SalesOrderActions.GetOrdersList(this.customerId, this.orderId, this.startDate, this.endDate, this.resultMaxCount);

            return(salesOrders);
        }
 private void btnCreatePackSlip_Click(object sender, EventArgs e)
 {
     SalesOrderActions.TryCreatePackSlip(this.selectedOrderStatus, this.SelectedSalesOrderId);
     RefreshGrid();
     GetSelectedRow();  // to reload "selectedOrderStatus" object.
 }