public bool Settle(decimal price, Resources quota, DateTime now, TransactionReason reason) { var returnValue = Subject.Settle(price, quota, LastSettled, now, reason); LastSettled = now; return(returnValue); }
private static void AddAdjustmentChild(Transaction parent, Transactions availableTransactions, decimal amount , TransactionReason transactionReason, string adjustmentTag) { ImportInfo matcherImportInfo; if (availableTransactions.HasImportInfo(ImportInfoId)) { matcherImportInfo = availableTransactions.GetImportInfo(ImportInfoId); } else { matcherImportInfo = new ImportInfo(ImportInfoId, ImportInfoId, null, null, ImportInfoId, null); //TODO: how can we accomodate manufatured import? } AccountInfo accountInfo = availableTransactions.GetAccountInfo(parent.AccountId); if (amount != 0) { var tx = new Transaction(matcherImportInfo.Id, accountInfo, new Transaction.ImportedValues() { Amount = amount, EntityName = "{0} - {1}".FormatEx(adjustmentTag, parent.EntityName), EntityNameNormalized = "{0} - {1}".FormatEx(adjustmentTag, parent.EntityName), InstituteReference = "{0}.{1}".FormatEx(adjustmentTag, parent.InstituteReference), RequiresParent = true, SubAccountName = parent.SubAccountName, TransactionDate = parent.TransactionDate, TransactionReason = transactionReason, LineNumber = null }); availableTransactions.AddNew(tx, accountInfo, matcherImportInfo, false); availableTransactions.RelateParentChild(parent.Id, tx.Id); } }
private void OnTransactionReasonAdd(object sender, TransactionReason e) { _manager.AddReason(e); (this.View as Form).Close(); GlobalSettings.Instance.TransactionReasons = _manager.GetReasons(); }
public UserTransaction(Guid id, DateTime time, decimal amount, TransactionReason reason, User?payer, User receiver) { Id = id; Time = time; Amount = amount; Reason = reason; Payer = payer; Receiver = receiver; }
private TransactionReason CreateReason() { TransactionReason r = new TransactionReason { ShortDesctiption = ShortDescriptionTextBox.Text, LongDesctiption = LongDescriptionTextBox.Text }; return(r); }
public bool TrySettle(BillingCycleEntry entry, TransactionReason reason) { // if the entry is a social project, use its resources instead of quota var quota = entry.Subject.Project != null && entry.Subject.Project.Domain.Id == Shared.Constants.SocialDomainId ? entry.Subject.Project.Resources : entry.Quota; // if the entry is a UserProjectAssignment, the price should always to zero var price = entry.SubjectType == SubjectType.UserProjectAssignment ? 0 : CalculatePrice(quota); return(entry.Settle(price, quota, DateTime.UtcNow, reason)); }
private void AddTransaction(AccountId accountId, double amount, TransactionReason reason, DateTimeOffset occurred) { var account = _collection.Find(_ => _.Id == accountId).SingleOrDefault(); if (account != null) { account.Transactions.Add(new Transaction { Amount = amount, Reason = reason, Occurred = occurred }); _collection.ReplaceOne(_ => _.Id == accountId, account); } }
private void AddToTotalByReason(TransactionReason transactionReason, decimal amount) { var current = this.totalsByReason.GetValueOrDefault(transactionReason); this.totalsByReason[transactionReason] = current + amount; }
bool IBillingCycleSubject.Settle(decimal price, Resources quota, DateTime lastSettled, DateTime now, TransactionReason reason) { return(BillingCycleSubject.Settle(price, quota, lastSettled, now, reason)); }
public OrgTransaction Receive(IPayer from, User fromUser, decimal amount, TransactionReason reason, DateTime time) { return(Receiver.Receive(from, fromUser, amount, reason, time)); }
public OrgTransaction Pay(IReceiver receiver, decimal amount, TransactionReason reason, DateTime time) { return(Payer.Pay(receiver, amount, reason, time)); }
public bool RecordTransaction(long CustomerID, float Amount, TransactionType Type, TransactionReason Reason) { return false; }
public void AddReason(TransactionReason r) { _repo.AddReason(r); }
public Task <bool> AboutTransactionAsync(TransactionReason reason, string email, Transactions transaction) => _notifyAboutTransaction[reason].Invoke(email, transaction);