public async Task CreateTransaction(Transaction transaction) { // calc A/R Or A/P if (transaction.DrTransactionEntryValue > transaction.CrTransactionEntryValue) { // A/P transaction.AccountPyable = transaction.DrTransactionEntryValue - transaction.CrTransactionEntryValue; } else { // A/R transaction.AccountReceivable = transaction.CrTransactionEntryValue - transaction.DrTransactionEntryValue; } //TODO Add 10% revenue from goods if (transaction.CrTransactionEntry == PossibleTransactions.Goods) { await incomeStatmentService.updateincomestatmentWithRevenue(transaction.CrTransactionEntryValue); } transaction.Date = DateTime.Now; await transactionRepo.Create(transaction); //Update IncomeStatment //Update Balance Sheet await balanceService.UpdateLastBalance(transaction); // Add To database }