public AccountingPriceListMainIndicatorService(IAccountingPriceListRepository accountingPriceListRepository, IArticlePriceService articlePriceService, IArticleAvailabilityService articleAvailabilityService, IReceiptWaybillService receiptWaybillService) { this.accountingPriceListRepository = accountingPriceListRepository; this.articlePriceService = articlePriceService; this.articleAvailabilityService = articleAvailabilityService; this.receiptWaybillService = receiptWaybillService; }
public WriteoffWaybillService(ISettingRepository settingRepository, IWriteoffWaybillRepository writeoffWaybillRepository, IStorageRepository storageRepository, IUserRepository userRepository, IArticleMovementService articleMovementService, IArticlePriceService articlePriceService, IFactualFinancialArticleMovementService factualFinancialArticleMovementService, IArticleMovementOperationCountService articleMovementOperationCountService, IArticleAvailabilityService articleAvailabilityService, IReceiptWaybillService receiptWaybillService, IArticleRevaluationService articleRevaluationService) : base(articleAvailabilityService) { this.settingRepository = settingRepository; this.writeoffWaybillRepository = writeoffWaybillRepository; this.storageRepository = storageRepository; this.userRepository = userRepository; this.articleMovementService = articleMovementService; this.articlePriceService = articlePriceService; this.factualFinancialArticleMovementService = factualFinancialArticleMovementService; this.articleMovementOperationCountService = articleMovementOperationCountService; this.receiptWaybillService = receiptWaybillService; this.articleRevaluationService = articleRevaluationService; }
public ChangeOwnerWaybillService(ISettingRepository settingRepository, IChangeOwnerWaybillRepository changeOwnerWaybillRepository, IArticleRepository articleRepository, IStorageRepository storageRepository, IUserRepository userRepository, IArticlePriceService articlePriceService, IArticleAvailabilityService articleAvailabilityService, IArticleMovementService articleMovementService, IReceiptWaybillService receiptWaybillService, IArticleRevaluationService articleRevaluationService) : base(articleAvailabilityService) { this.settingRepository = settingRepository; this.changeOwnerWaybillRepository = changeOwnerWaybillRepository; this.articleRepository = articleRepository; this.storageRepository = storageRepository; this.userRepository = userRepository; this.articlePriceService = articlePriceService; this.articleMovementService = articleMovementService; this.receiptWaybillService = receiptWaybillService; this.articleRevaluationService = articleRevaluationService; articleMovementService.ChangeOwnerWaybillReadyToChangedOwner += new ChangeOwnerWaybillEvent(ChangeOwner); }
public void Init() { // инициализация IoC IoCInitializer.Init(); receiptWaybillRepository = Mock.Get(IoCContainer.Resolve <IReceiptWaybillRepository>()); receiptWaybillService = new ReceiptWaybillService(IoCContainer.Resolve <IArticleRepository>(), receiptWaybillRepository.Object, IoCContainer.Resolve <IMovementWaybillRepository>(), IoCContainer.Resolve <IExpenditureWaybillRepository>(), IoCContainer.Resolve <IStorageRepository>(), IoCContainer.Resolve <IUserRepository>(), IoCContainer.Resolve <IChangeOwnerWaybillRepository>(), IoCContainer.Resolve <IWriteoffWaybillRepository>(), IoCContainer.Resolve <IStorageService>(), IoCContainer.Resolve <IAccountOrganizationService>(), IoCContainer.Resolve <IProviderService>(), IoCContainer.Resolve <IProviderContractService>(), IoCContainer.Resolve <IValueAddedTaxService>(), IoCContainer.Resolve <IArticleMovementService>(), IoCContainer.Resolve <IArticlePriceService>(), IoCContainer.Resolve <IExactArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IArticleAccountingPriceIndicatorService>(), IoCContainer.Resolve <IArticleMovementOperationCountService>(), IoCContainer.Resolve <IOutgoingAcceptedFromExactArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IOutgoingAcceptedFromIncomingAcceptedArticleAvailabilityIndicatorService>(), IoCContainer.Resolve <IArticleMovementFactualFinancialIndicatorService>(), IoCContainer.Resolve <IFactualFinancialArticleMovementService>(), IoCContainer.Resolve <IAcceptedSaleIndicatorService>(), IoCContainer.Resolve <IShippedSaleIndicatorService>(), IoCContainer.Resolve <IReceiptedReturnFromClientIndicatorService>(), IoCContainer.Resolve <IAcceptedReturnFromClientIndicatorService>(), IoCContainer.Resolve <IReturnFromClientBySaleAcceptanceDateIndicatorService>(), IoCContainer.Resolve <IReturnFromClientBySaleShippingDateIndicatorService>(), IoCContainer.Resolve <IArticleRevaluationService>(), IoCContainer.Resolve <IArticlePurchaseService>(), IoCContainer.Resolve <IAcceptedPurchaseIndicatorService>(), IoCContainer.Resolve <IApprovedPurchaseIndicatorService>(), IoCContainer.Resolve <IArticleAvailabilityService>() ); var juridicalLegalForm = new LegalForm("ООО", EconomicAgentType.JuridicalPerson); var providerType = new ProviderType("Тестовый тип поставщика"); var articleGroup = new ArticleGroup("Бытовая техника", "Бытовая техника"); var measureUnit = new MeasureUnit("шт", "штука", "123", 0); var article = new Article("Пылесос", articleGroup, measureUnit, true) { Id = 1 }; priceLists = new List <ArticleAccountingPrice>() { new ArticleAccountingPrice(article, 100M) }; var provider = new Provider("Нейтральная организация", providerType, ProviderReliability.Medium, 5); var providerOrganization = new ProviderOrganization("Тестовое физическое лицо", "Тестовое физическое лицо", new JuridicalPerson(juridicalLegalForm)) { Id = 1 }; var accountOrganization = new AccountOrganization(@"ООО ""Юридическое лицо""", @"ООО ""Юридическое лицо""", new JuridicalPerson(juridicalLegalForm)) { Id = 2 }; provider.AddContractorOrganization(providerOrganization); var providerContract = new ProviderContract(accountOrganization, providerOrganization, "ABC", "123", DateTime.Now, DateTime.Today); provider.AddProviderContract(providerContract); role = new Role("Администратор"); role.AddPermissionDistribution(new PermissionDistribution(Permission.ReceiptWaybill_Delete_Row_Delete, PermissionDistributionType.All)); user = new User(new Employee("Иван", "Иванов", "Иванович", new EmployeePost("Менеджер"), null), "Иванов Иван", "ivanov", "pa$$w0rd", new Team("Тестовая команда", null), null); user.AddRole(role); createdBy = new User(new Employee("Олег", "Олегов", "Олегович", new EmployeePost("Менеджер"), null), "Олегов Олег", "olegov", "pa$$w0rd", new Team("Тестовая команда", null), null); createdBy.AddRole(role); acceptedBy = new User(new Employee("Петр", "Петров", "Петрович", new EmployeePost("Менеджер"), null), "Петров Петр", "petrov", "pa$$w0rd", new Team("Тестовая команда", null), null); acceptedBy.AddRole(role); receiptedBy = new User(new Employee("Николай", "Николаев", "Николаевия", new EmployeePost("Менеджер"), null), "Николаев Николай", "nikolaev", "pa$$w0rd", new Team("Тестовая команда", null), null); receiptedBy.AddRole(role); var customDeclarationNumber = new String('0', 25); receiptWaybill = new ReceiptWaybill("999999", DateTime.Today, new Storage("Третий склад", StorageType.DistributionCenter), accountOrganization, provider, 50, 0M, new ValueAddedTax("10%", 10), providerContract, customDeclarationNumber, user, createdBy, DateTime.Now); receiptWaybillRow = new ReceiptWaybillRow(article, 5, 50M, receiptWaybill.PendingValueAddedTax); receiptWaybill.AddRow(receiptWaybillRow); receiptWaybillList = new List <ReceiptWaybill> { receiptWaybill }; receiptWaybillRepository.Setup(x => x.Delete(It.IsAny <ReceiptWaybill>())).Callback <ReceiptWaybill>(waybill => receiptWaybillList.Remove(waybill)); }