Beispiel #1
0
        private void buttonRePrint_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            string errorMessage = string.Empty;
            bool   flag         = SolFunctions.PrintReceipt(listView1, "", ref errorMessage, Properties.Settings.Default.BarcodeEncoding
                                                            , buttonSource
                                                            , securityCode
                                                            , totalSelectedOrders
                                                            );

            this.Cursor = Cursors.Default;
            if (!flag)
            {
                MessageBox.Show("There was a problem printing the receipt, please try again.\nError: " + errorMessage);
            }
        }
Beispiel #2
0
        private void buttonRePrint_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            string errorMessage = string.Empty;
            bool   flag         = SolFunctions.PrintReceipt(
                listView1, "paynow"
                , ref errorMessage, Properties.Settings.Default.BarcodeEncoding
                , "RePrint"
                , String.Empty
                , 0.0m
                );

            if (!flag)
            {
                MessageBox.Show("There was a problem printing the receipt, please try again.\nError: " + errorMessage);
            }

            this.Cursor = Cursors.Default;
        }
Beispiel #3
0
        private void buttonContinue_Click(object sender, EventArgs e)
        {
            //check max amount
            if (Main.Sol_ControlInfo.CashierMaxAmount > 0.00m)
            {
                if (Main.Sol_ControlInfo.CashierMaxAmount < totalSelectedOrders)
                {
                    if (!SolFunctions.PermisosConfirmar("The amount to pay is over the maximum allowed!", "Please provide password for Manager Override.", ""))
                    {
                        //MessageBox.Show("Sorry, you cannot void orders!");
                        return;
                    }
                }
            }


            //busy cursor
            this.Cursor = Cursors.WaitCursor;

            if (BottleDrop && !SaveOrderToBottleDrop())
            {
                return;
            }
            //update orders
            UpdateOrders();
            ordersProcessed = true;

            //print receipt
            //if (!onAccount)   ??? not sure

            if (!Main.Sol_ControlInfo.CashOutPrintingOverride && !BottleDrop)
            {
                string errorMessage = string.Empty;
                bool   flag         = SolFunctions.PrintReceipt(listView1, "", ref errorMessage, Properties.Settings.Default.BarcodeEncoding
                                                                , buttonSource
                                                                , securityCode
                                                                , totalSelectedOrders
                                                                );
                if (!flag)
                {
                    MessageBox.Show("There was a problem printing the receipt, please try again.\nError: " + errorMessage);
                }
            }

            //open drawer
            if (!onAccount)
            {
                //OpenDrawer();
                PrinterCommand.Send(Main.AssemblyProduct, Properties.Settings.Default.SettingsWsReceiptPrinter, Properties.Settings.Default.SettingsWsTicketOpenDrawer);

                //coin dispenser
                if (AxCoinUSB2 != null)
                {
                    //int iDecimalPart = (int)((totalPaidOrders - Math.Truncate(totalPaidOrders)) * 100);
                    //int iIntegerPart = (int)(totalPaidOrders) * 100;
                    //int iTotalPaidOrders = iIntegerPart+iDecimalPart;

                    //Cajero_Automatico.Calculate("ca", totalPaidOrders, ref Main.billsAndCoinsByCountry);
                    decimal totalCoins = 0;
                    decimal totalBills = 0;
                    Cajero_Automatico.Calculate(
                        "CA",
                        totalPaidOrders,
                        //ref Main.billsAndCoinsByCountry,
                        out totalCoins,
                        out totalBills);

                    int iCoins = (int)(totalCoins * 100);

                    if (iCoins > 0)
                    {
                        bool flag = Properties.Settings.Default.CoinDispenserEnabled;
                        if (flag)
                        {
                            switch (Properties.Settings.Default.CoinDispenserDevice)
                            {
                            case 0:     // tflex coin dispenser
                                decimal totalDiference = 0;

                                // We call a subroutine to dispense it.
                                DispenseByAmount(iCoins);

                                //if (iCoins >= AxCoinUSB2.DispenseBelowValue)
                                //{
                                //    totalDiference = totalCoins;
                                //    decimal dispenseBelowValue = (decimal)(AxCoinUSB2.DispenseBelowValue)/100;
                                //    decimal amountDispensed = totalCoins - dispenseBelowValue;
                                //    totalCoins = amountDispensed;
                                //    totalDiference -= totalCoins;
                                //}

                                // Get our status and show the user
                                UpdateCanisterStatus(true, iCoins, totalCoins, totalBills, totalDiference);
                                utilDelay(1);
                                break;

                            default:
                                MessageBox.Show("Invalid coin dispenser selection, please go to settings and fix this");
                                break;
                            }
                        }
                    }
                    else
                    {
                        // Show amount dispensed in the status bar
                        UpdateStatus(String.Format("Total Bills:" + SirLib.Funciones.Indent(18) + "{0,9:$##,##0.00}\r\nTotal Coins dispensed:" + SirLib.Funciones.Indent(1) + "{1,9:$##,##0.00}", totalBills, totalCoins));
                    }
                }
            }

            buttonContinue.Text        = "&Close";
            this.buttonContinue.Click -= new System.EventHandler(this.buttonContinue_Click);
            this.buttonContinue.Click += new System.EventHandler(this.Cancel_Click);
            buttonContinue.BackColor   = Color.FromArgb(241, 116, 85);
            buttonContinue.ForeColor   = SystemColors.Control;

            if (!BottleDrop)
            {
                buttonRePrint.Enabled      = true;
                buttonReOpenDrawer.Enabled = true;
            }
            //buttonViewReceipt.Enabled = false;
            Cancel.Visible = false;

            buttonSelectCustomer.Visible = false;

            this.Cursor = Cursors.Default;
        }