Esempio n. 1
0
        private void AddAccountingDocument(InvitemInfoDto invitemInfo, long invitmId)
        {
            var totalprice    = _invitemRepository.CalculateSumPrice(invitmId);
            var accountingDoc = _accountingDocument.GetByInvitemId(invitmId);

            if (accountingDoc is null)
            {
                var MaxdocNo = _accountingDocument.GetMaxdocNo();
                var docNo    = (Convert.ToInt64(MaxdocNo) + 1);

                var accountingDocument = _mapper.Map <AccountingDocument>(new AccountingDocDto
                {
                    DocNo = docNo.ToString(), Date = DateTime.Now, Price = totalprice, InvitemId = invitmId
                });
                _accountingDocument.Add(accountingDocument);
            }
            else
            {
                accountingDoc.Price = totalprice;
                _accountingDocument.Update(accountingDoc);
            }
        }
Esempio n. 2
0
 public void AddAccountingDo(AccountingDocument model)
 {
     _accountingDoc.Add(model);
 }