Ejemplo n.º 1
0
        private void AddTender(long tnObjNum_, decimal?amount_ = null, string reference = null)
        {
            //LAB ARG {es-AR}: para los medios de pago se utiliza la de sistema (",")
            NumberFormatInfo nfi = System.Globalization.CultureInfo.CurrentCulture.NumberFormat;

            if (ConfigMgr.Instance.UseSimphonyDecimalSeparatorForTenders)
            {
                nfi = new NumberFormatInfo()
                {
                    CurrencyDecimalSeparator = OpsContext.CurrentDecimalSeparator,
                    CurrencyGroupSeparator   = "",
                    CurrencyGroupSizes       = new int[] { 0 },
                    NumberDecimalSeparator   = OpsContext.CurrentDecimalSeparator,
                    NumberGroupSeparator     = "",
                    NumberGroupSizes         = new int[] { 0 },
                };
            }

            List <OpsCommand> addTenderMacro = new List <OpsCommand>();

            if (amount_ != null)
            {
                addTenderMacro.Add(new OpsCommand(OpsCommandType.Payment)
                {
                    Number = tnObjNum_, Arguments = "Cash:Cash $ " + ((decimal)amount_).ToString("N", nfi)
                });
            }
            else
            {
                addTenderMacro.Add(new OpsCommand(OpsCommandType.Payment)
                {
                    Number = tnObjNum_, Arguments = "Cash:Cash * "
                });
            }

            if (reference != null)
            {
                addTenderMacro.Add(new OpsCommand(OpsCommandType.AsciiData)
                {
                    Text = reference
                });
                addTenderMacro.Add(new OpsCommand(OpsCommandType.EnterKey));
            }

            OpsCommand opsCmd = new OpsCommand(OpsCommandType.Macro)
            {
                Data = addTenderMacro
            };

            OpsCommandMgr.SendOpsCommand(OpsContext, opsCmd, () => { return(OpsContext.CheckIsOpen); });

            Thread.Sleep(100);
        }
Ejemplo n.º 2
0
        private void TransactionCancel()
        {
            List <OpsCommand> transactionCancelMacro = new List <OpsCommand>()
            {
                new OpsCommand(OpsCommandType.TransactionCancel)
                {
                },
                new OpsCommand(OpsCommandType.EnterKey),
            };

            OpsCommand opsCmd = new OpsCommand(OpsCommandType.Macro)
            {
                Data = transactionCancelMacro
            };

            OpsCommandMgr.SendOpsCommand(OpsContext, opsCmd, () => { return(true); });
        }