public BankTransaction(DateTime date, int accountID, decimal change, BankTransactionType type)
 {
     _date = date;
     _accountID = accountID;
     _change = change;
     _type = type;
     _id = 0;
 }
 public MaintBankTrans(PublicCorp corpData, BankTransactionType defaultType)
 {
     InitializeComponent();
     this.DialogResult = DialogResult.Cancel;
     _corpData = corpData;
     _defaultType = defaultType;
     _transactionData = new BankTransaction(corpData.BankAccountID, defaultType);
 }
 public BankTransaction(int accountID, BankTransactionType type)
 {
     _date = DateTime.Now;
     _accountID = accountID;
     _change = 0;
     _type = type;
     _id = 0;
 }
Пример #4
0
        public static BankTransactionType CreateBankTransactionType(string dataAreaId, string transactionTypeId)
        {
            BankTransactionType bankTransactionType = new BankTransactionType();

            bankTransactionType.dataAreaId        = dataAreaId;
            bankTransactionType.TransactionTypeId = transactionTypeId;
            return(bankTransactionType);
        }
 public BankTransaction(EMMADataSet.BankTransactionRow data)
 {
     _id = data.TransactionID;
     _date = data.DateTime;
     if (UserAccount.Settings.UseLocalTimezone)
     {
         _date = _date.AddHours(Globals.HoursOffset);
     }
     _accountID = data.AccountID;
     _change = data.Change;
     _type = (BankTransactionType)data.Type;
 }
Пример #6
0
 public BankTransaction Given_a_bank_transaction(BankTransactionType type)
 {
     return Api.Create(new BankTransaction
     {
         Type = type,
         Contact = new Contact { Name = "ABC Bank" },
         LineItems = new List<LineItem>
         {
             new LineItem
             {
                 Description = "Yearly Bank Account Fee",
                 Quantity = 1m,
                 UnitAmount = 20.00m,
                 AccountCode = "404"
             }
         },
         BankAccount = new Account { Id = FindBankAccountGuid() }
     });
 }
Пример #7
0
 public BankTransaction Given_an_overpayment(BankTransactionType type)
 {
     return Api.Create(new BankTransaction
     {
         Type = type,
         Contact = new Contact { Name = "ABC Bank" },
         LineAmountTypes = LineAmountType.NoTax,
         LineItems = new List<LineItem>
         {
             new LineItem
             {
                 Description = "Yearly Bank Account Fee",
                 UnitAmount = 20.00m,
                 AccountCode = "800"
             }
         },
         BankAccount = new Account { Id = FindBankAccountGuid() }
     });
 }
        private async Task <BankTransaction> ExistingTransaction(IContext context, BankTransaction groupTransaction,
                                                                 BankTransactionType existingGroup, Guid userId)
        {
            if (existingGroup == null)
            {
                return(null);
            }

            return(await context.BankTransactions.Where(t => t.BankTransactionType.Name == existingGroup.Name &&
                                                        t.Amount == groupTransaction.Amount &&
                                                        t.Currency == groupTransaction.Currency &&
                                                        t.Extensions == groupTransaction.Extensions &&
                                                        t.OperationDate == groupTransaction.OperationDate &&
                                                        t.Title == groupTransaction.Title &&
                                                        t.TransactionDate == groupTransaction.TransactionDate &&
                                                        t.User.Id == userId &&
                                                        t.BankTransactionType.Id == groupTransaction.BankTransactionType.Id &&
                                                        t.Bank.Id == groupTransaction.Bank.Id)
                   .SingleOrDefaultAsync());
        }
Пример #9
0
        private static BankTransaction ParseEntry(string entry)
        {
            BankTransaction transaction = new BankTransaction();

            string[] fields = entry.Split(',');
            if (fields.Length >= 4)
            {
                string key = fields[0].Trim();
                BankTransactionType tranType = (BankTransactionType)Enum.Parse(typeof(BankTransactionType), fields[1]);
                double   amount   = double.Parse(fields[2]);
                string   reason   = fields[3].Trim();
                DateTime dateTime = DateTime.Parse(fields[4]);

                transaction = new BankTransaction(tranType, amount, reason);
                transaction.SetKey(key);
                transaction.SetCreationTime(dateTime);
                transaction.Activate();
            }
            return(transaction);
        }
Пример #10
0
        public async Task<BankTransaction> Given_an_overpayment(BankTransactionType type)
        {
            var bankAccountId = await FindBankAccountGuid();

            return await Api.CreateAsync(new BankTransaction
            {
                Type = type,
                Contact = new Contact { Name = "ABC Bank" },
                LineAmountTypes = LineAmountType.NoTax,
                LineItems = new List<LineItem>
                {
                    new LineItem
                    {
                        Description = "Yearly Bank Account Fee",
                        UnitAmount = 20.00m,
                        AccountCode = "800"
                    }
                },
                BankAccount = new Account { Id = bankAccountId }
            });
        }
Пример #11
0
        public async Task<BankTransaction> Given_a_bank_transaction(BankTransactionType type)
        {
            var bankAccountId = await FindBankAccountGuid();

            return await Api.CreateAsync(new BankTransaction
            {
                Type = type,
                Contact = new Contact { Name = "ABC Bank" },
                LineItems = new List<LineItem>
                {
                    new LineItem
                    {
                        Description = "Yearly Bank Account Fee",
                        Quantity = 1m,
                        UnitAmount = 20.00m,
                        AccountCode = "404"
                    }
                },
                BankAccount = new Account { Id = bankAccountId }
            });
        }
Пример #12
0
 public BankTransaction Given_an_overpayment(BankTransactionType type)
 {
     return(Api.Create(new BankTransaction
     {
         Type = type,
         Contact = new Contact {
             Name = "ABC Bank"
         },
         LineAmountTypes = LineAmountType.NoTax,
         LineItems = new List <LineItem>
         {
             new LineItem
             {
                 Description = "Yearly Bank Account Fee",
                 UnitAmount = 20.00m,
                 AccountCode = "800"
             }
         },
         BankAccount = new Account {
             Id = FindBankAccountGuid()
         }
     }));
 }
Пример #13
0
 public BankTransaction Given_a_bank_transaction(BankTransactionType type)
 {
     return(Api.Create(new BankTransaction
     {
         Type = type,
         Contact = new Contact {
             Name = "ABC Bank"
         },
         LineItems = new List <LineItem>
         {
             new LineItem
             {
                 Description = "Yearly Bank Account Fee",
                 Quantity = 1m,
                 UnitAmount = 20.00m,
                 AccountCode = "404"
             }
         },
         BankAccount = new Account {
             Id = FindBankAccountGuid()
         }
     }));
 }
Пример #14
0
 public async Task <BankTransaction> Given_a_bank_transaction(BankTransactionType type, string accountCode = "404")
 {
     return(await Api.CreateAsync(new BankTransaction
     {
         Type = type,
         Contact = new Contact {
             Name = "ABC Bank"
         },
         LineItems = new List <LineItem>
         {
             new LineItem
             {
                 Description = "Yearly Bank Account Fee",
                 Quantity = 1m,
                 UnitAmount = 20.00m,
                 AccountCode = accountCode
             }
         },
         BankAccount = new Account {
             Id = await FindBankAccountGuid()
         }
     }));
 }
        public async Task <BankTransaction> Given_an_overpayment(BankTransactionType type)
        {
            var id = await FindBankAccountGuid();

            return(await Api.CreateAsync(new BankTransaction {
                Type = type,
                Contact = new Contact {
                    Name = "ABC Bank"
                },
                LineAmountTypes = LineAmountType.NoTax,
                LineItems = new List <LineItem>
                {
                    new LineItem
                    {
                        Description = "Yearly Bank Account Fee",
                        UnitAmount = 20.00m,
                        AccountCode = "800"
                    }
                },
                BankAccount = new Account {
                    Id = id
                }
            }));
        }
Пример #16
0
 public static decimal GetTotalTransactionIsk(int accountID, BankTransactionType type)
 {
     decimal? retVal = 9999999999999999.99m;
     bankTransactionTableAdapter.GetTotal(accountID, (short)type, ref retVal);
     return (retVal.HasValue ? (retVal.Value == 9999999999999999.99m ? 0 : retVal.Value) : 0);
 }
Пример #17
0
 public static string GetDescription(BankTransactionType type)
 {
     if (!_initalised) { Initalise(); }
     return _descriptions.Get((short)type);
 }
 private void NewTransaction(BankTransactionType defaultType)
 {
     MaintBankTrans maintTrans = new MaintBankTrans(_corp, defaultType);
     if (maintTrans.ShowDialog() == DialogResult.OK)
     {
         // clear and recalulate interest payments after the transaction that
         // has just been added.
         BankAccounts.RecalculateInterestAfter(_corp.BankAccountID, maintTrans.TransactionDate);
         DisplayData();
     }
 }
 public static bool IsOverpayment(this BankTransactionType bankTransactionType)
 {
     return(bankTransactionType == BankTransactionType.ReceiveOverpayment ||
            bankTransactionType == BankTransactionType.SpendOverpayment);
 }