Ejemplo n.º 1
0
        public Sale Create(Models.Profiles.Profile profile, DateTime trDate)
        {
            var newSale = new Sale()
            {
                No              = this.NextNumber,
                ProfileGuid     = profile.Id,
                Profile         = profile,
                TransactionDate = trDate,
                CompanyProfile  = organization.SelfProfile,
                Status          = CommercialStatus.Open,
                CommercialItems = new HashSet <CommercialItem>(),
                TransactionType = this.transactionType,
            };

            newSale.AddCommercialTax(organization.TaxCodes.GetDefaultOuput);

            erpNodeDBContext.Sales.Add(newSale);
            erpNodeDBContext.SaveChanges();

            return(newSale);
        }