Example #1
0
 public void AddPayment(PaymentType paymentType, Account account, decimal amount, decimal exchangeRate, int userId)
 {
     var transaction = TransactionDocument.AddNewTransaction(paymentType.AccountTransactionType, AccountTypeId, AccountId, account, amount, exchangeRate);
     var payment = new Payment { AccountTransaction = transaction, Amount = amount, Name = account.Name, PaymentTypeId = paymentType.Id };
     Payments.Add(payment);
     LastPaymentDate = DateTime.Now;
     RemainingAmount = GetRemainingAmount();
     if (RemainingAmount == 0)
     {
         PaidItems.Clear();
     }
 }
Example #2
0
 public void RemovePayment(Payment py)
 {
     Payments.Remove(py);
     TransactionDocument.AccountTransactions.Where(x => x.Id == py.AccountTransaction.Id).ToList().ForEach(x => TransactionDocument.AccountTransactions.Remove(x));
 }
Example #3
0
 public Payment AddPayment(DateTime date, decimal amount, PaymentType paymentType, int userId, int departmentId)
 {
     var result = new Payment { Amount = amount, Date = date, PaymentType = (int)paymentType, UserId = userId, DepartmentId = departmentId };
     DepartmentId = departmentId;
     Payments.Add(result);
     LastPaymentDate = DateTime.Now;
     RemainingAmount = GetRemainingAmount();
     if (RemainingAmount == 0)
     {
         PaidItems.Clear();
     }
     return result;
 }
Example #4
0
 public void AddPayment(PaymentType paymentType, Account account, decimal amount, decimal exchangeRate, int userId)
 {
     var transaction = TransactionDocument.AddNewTransaction(paymentType.AccountTransactionType, GetTicketAccounts(account), amount, exchangeRate);
     transaction.UpdateDescription(transaction.Name + " [" + account.Name + "]");
     var payment = new Payment { AccountTransaction = transaction, Amount = amount, Name = account.Name, PaymentTypeId = paymentType.Id, UserId = userId };
     Payments.Add(payment);
     LastPaymentDate = DateTime.Now;
     RemainingAmount = GetRemainingAmount();
 }
Example #5
0
        public void AddPayment(AccountTransactionTemplate transactionTemplate, Account account, decimal amount, int userId)
        {
            var transaction = AccountTransaction.Create(transactionTemplate);
            transaction.Amount = amount;
            transaction.SetTargetAccount(account.AccountTemplateId, account.Id);
            transaction.UpdateAccounts(AccountTemplateId, AccountId);
            AccountTransactions.AccountTransactions.Add(transaction);
            var payment = new Payment { AccountTransaction = transaction, Amount = amount, Name = account.Name };
            Payments.Add(payment);

            LastPaymentDate = DateTime.Now;
            RemainingAmount = GetRemainingAmount();
            if (RemainingAmount == 0)
            {
                PaidItems.Clear();
            }
        }
Example #6
0
 public PaymentViewModel(Payment model)
 {
     Model = model;
 }
Example #7
0
 public void RemovePayment(Payment py)
 {
     Payments.Remove(py);
     TransactionDocument.AccountTransactions.Where(x => x.Id == py.AccountTransaction.Id).ToList().ForEach(x => TransactionDocument.AccountTransactions.Remove(x));
 }