public void Log(GlAccountManagement gl, decimal amount, TransactionType type)
        {
            var transaction = new TransactionsLog
            {
                Name                = gl.Name,
                Amount              = amount,
                Type                = type,
                AccountCode         = gl.AccCode,
                date                = DateTime.Now,
                MainAccountCategory = GetCategory(gl)
            };

            _context.Add(transaction);
            _context.Save(transaction);
        }
Exemplo n.º 2
0
        public void LogTransaction(GlAccount glAccount, decimal amount, TransactionType transactionType)//overload for gl accounts
        {
            var transaction = new TransactionLog()
            {
                Name                = glAccount.Name,
                Amount              = amount,
                Date                = DateTime.Now,
                TransactionType     = transactionType,
                AccountCode         = glAccount.AccountCode,
                MainAccountCategory = GetMainCategory(glAccount),
            };

            _db.Add(transaction);
            _db.Save(transaction);
        }
        public void InsertLogs(int itemId, int quantiy)
        {
            TransactionLogRepository transactionLogRepo = new TransactionLogRepository();

            TransactionLog transactionLog = new TransactionLog
            {
                ItemId = itemId,
                Quantity = quantiy,
                TransactionMethodId = (int)ETransactionMethod.ExcessPartsFromSet,
                CompanyId = Sessions.CompanyId.Value
            };

            transactionLogRepo.Add(transactionLog);
        }
        public void InsertLogs(int itemId, int quantiy, int companyId)
        {
            TransactionLogRepository transactionLogRepo = new TransactionLogRepository();

            TransactionLog transactionLog = new TransactionLog
            {
                ItemId              = itemId,
                Quantity            = quantiy,
                TransactionMethodId = (int)ETransactionMethod.StockTransfer_Company,
                CompanyId           = companyId,
                ItemTypeId          = itemRepo.GetItemType(itemId)
            };

            transactionLogRepo.Add(transactionLog);
        }
        public int InsertLogs(int itemId, int quantiy, DateTime dateReceived, int itemType)
        {
            TransactionLogRepository transactionLogRepo = new TransactionLogRepository();

            TransactionLog transactionLog = new TransactionLog
            {
                ItemId              = itemId,
                Quantity            = quantiy,
                TransactionMethodId = (int)ETransactionMethod.Receiving,
                CompanyId           = Sessions.CompanyId.Value,
                Date       = dateReceived,
                ItemTypeId = itemType
            };

            transactionLogRepo.Add(transactionLog);

            return(transactionLog.Id);
        }