private void addRefundToDeposit(RefundTypeMapping mapping, EaglesoftRefund refund)
        {
            DepositConfiguration depositConfig = Configuration.getDepositConfig(mapping.QuickbooksPaytype);
            Deposit deposit = getDeposit(depositConfig, mapping.QuickbooksPaytype);

            deposit.addRefund(refund);
        }
        private Deposit getDeposit(DepositConfiguration depositConfig, QuickbooksPaytype qbPayType)
        {
            // Lets see if we already have that deposit.
            if (Deposits.ContainsKey(depositConfig))
            {
                // We already have that one, lets see if it is full or not.
                Stack <Deposit> stack      = Deposits[depositConfig];
                Deposit         topDeposit = stack.Peek();

                if (topDeposit.isFull(qbPayType))
                {
                    Deposit deposit = new Deposit(depositConfig);
                    stack.Push(deposit);
                    return(deposit);
                }
                else
                {
                    return(topDeposit);
                }
            }
            else
            {
                // Don't have this type of deposit. Lets create it.
                Deposit         newDeposit = new Deposit(depositConfig);
                Stack <Deposit> newStack   = new Stack <Deposit>();
                newStack.Push(newDeposit);
                Deposits[depositConfig] = newStack;
                return(newDeposit);
            }
        }
        public void addPayment(EaglesoftPayment p)
        {
            // First get the deposit configuration according to the Eaglesoft payment type. We use this to
            // determine which Quickbooks payment type to use.
            PaytypeMapping payType = Configuration.getPayTypeByEaglesoftPayType(p.EaglesoftPayType);

            // Find the deposit configuration for this quickbooks pay type.
            DepositConfiguration depositConfig = Configuration.getDepositConfig(payType.QuickbooksPayType);

            Deposit deposit = getDeposit(depositConfig, payType.QuickbooksPayType);

            deposit.addPayment(p);
        }
Exemple #4
0
 public Deposit(DepositConfiguration depositConfig)
 {
     _depositConfig = depositConfig;
     _lines         = new List <DepositLine>();
 }