Exemplo n.º 1
0
 public TenderEntryForm(TenderTypes tendType)
 {
     InitializeComponent();
     TenderEntry            = new TenderEntryVO();
     TenderEntry.TenderType = tendType;
     IsValid = false;
 }
        private bool findRefundAmountByTenderType(TenderTypes tType, string cardTypeString, out List <TenderEntryVO> entries, out decimal amount)
        {
            entries = null;
            amount  = 0.0M;
            decimal existingRefundTender = 0.0M;
            decimal refundAmtForTender   = 0.0M;

            //Find entries in the original tender
            entries = this.GetTenderList.FindAll(x => x.TenderType == tType && x.CardTypeString.ToUpper() == cardTypeString.ToUpper());
            if (CollectionUtilities.isEmpty(entries))
            {
                return(false);
            }
            //Find entries already refunded
            var existRefundEntries = this.partialRefundTenderList.FindAll(y => y.TenderType == tType && y.CardTypeString.ToUpper() == cardTypeString.ToUpper());

            if (!CollectionUtilities.isEmpty(existRefundEntries))
            {
                existingRefundTender = existRefundEntries.Sum(y => y.Amount);
            }

            //Find entries in the tender currently refunded
            var refundEntries = this.GetRefundTenderList.FindAll(y => y.TenderType == tType && y.CardTypeString.ToUpper() == cardTypeString.ToUpper());

            if (!CollectionUtilities.isEmpty(refundEntries))
            {
                refundAmtForTender = refundEntries.Sum(y => y.Amount);
            }

            //If entries found, compute sum
            //The sum allowed will be the sum of amounts tendered at the time of sale minus the amounts selected for refund
            //for the same tender type
            amount = entries.Sum(x => x.Amount) - (refundAmtForTender + existingRefundTender);

            return(true);
        }
Exemplo n.º 3
0
        public static bool GetTenderAndCardTypeFromOpCode(
            string opCode,
            out TenderTypes tType,
            out CreditCardTypes cType,
            out DebitCardTypes dType,
            out bool isInbound)
        {
            tType     = TenderTypes.CASHIN;
            cType     = CreditCardTypes.VISA;
            dType     = DebitCardTypes.VISA;
            isInbound = true;

            if (string.IsNullOrEmpty(opCode))
            {
                return(false);
            }

            if (opCode == "RDEBIT")
            {
                tType     = TenderTypes.CASHOUT;
                isInbound = false;
            }
            else if (opCode == "RCREDIT")
            {
                tType = TenderTypes.CASHIN;
            }
            else if (opCode == "PCOUT")
            {
                tType     = TenderTypes.CHECK;
                isInbound = false;
            }
            else if (opCode == "DCIN")
            {
                tType = TenderTypes.DEBITCARD;
                dType = DebitCardTypes.OTHER;
            }
            else if (opCode == "DCOUT")
            {
                tType     = TenderTypes.DEBITCARD;
                dType     = DebitCardTypes.OTHER;
                isInbound = false;
            }
            else if (opCode == "AMEXCCOUT")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.AMEX;
                isInbound = false;
            }
            else if (opCode == "VSCCOUT")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.VISA;
                isInbound = false;
            }
            else if (opCode == "MCCCOUT")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.MASTERCARD;
                isInbound = false;
            }
            else if (opCode == "DSCCOUT")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.DISCOVER;
                isInbound = false;
            }
            else if (opCode == "VSDCOUT")
            {
                tType     = TenderTypes.DEBITCARD;
                dType     = DebitCardTypes.VISA;
                isInbound = false;
            }
            else if (opCode == "MCDCOUT")
            {
                tType     = TenderTypes.DEBITCARD;
                dType     = DebitCardTypes.MASTERCARD;
                isInbound = false;
            }
            else if (opCode == "CDOUT")
            {
                tType     = TenderTypes.COUPON;
                isInbound = false;
            }
            else if (opCode == "PPOUT")
            {
                tType     = TenderTypes.PAYPAL;
                isInbound = false;
            }
            else if (opCode == "PCIN")
            {
                tType     = TenderTypes.CHECK;
                isInbound = true;
            }
            else if (opCode == "AMEXCCIN")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.AMEX;
                isInbound = true;
            }
            else if (opCode == "VSCCIN")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.VISA;
                isInbound = true;
            }
            else if (opCode == "MCCCIN")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.MASTERCARD;
                isInbound = true;
            }
            else if (opCode == "DSCCIN")
            {
                tType     = TenderTypes.CREDITCARD;
                cType     = CreditCardTypes.DISCOVER;
                isInbound = true;
            }
            else if (opCode == "VSDCIN")
            {
                tType     = TenderTypes.DEBITCARD;
                dType     = DebitCardTypes.VISA;
                isInbound = true;
            }
            else if (opCode == "MCDCIN")
            {
                tType     = TenderTypes.DEBITCARD;
                dType     = DebitCardTypes.MASTERCARD;
                isInbound = true;
            }
            else if (opCode == "CDIN")
            {
                tType     = TenderTypes.COUPON;
                isInbound = true;
            }
            else if (opCode == "PPIN")
            {
                tType     = TenderTypes.PAYPAL;
                isInbound = true;
            }
            else if (opCode == "SCIN")
            {
                tType     = TenderTypes.STORECREDIT;
                isInbound = false;
            }
            else if (opCode == "SCOUT")
            {
                tType     = TenderTypes.STORECREDIT;
                isInbound = true;
            }
            else
            {
                return(false);
            }

            return(true);
        }