예제 #1
0
 public VatsController(
     IVatService vatService,
     IResponseDTO response,
     IHttpContextAccessor httpContextAccessor) : base(response, httpContextAccessor)
 {
     _vatService = vatService;
 }
예제 #2
0
 public CustomerRegisteredCommandHandler(
     IGenericAttributeService genericAttributeService,
     IVatService checkVatService,
     IWorkflowMessageService workflowMessageService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IAddressService addressService,
     ICustomerService customerService,
     ICustomerActionEventService customerActionEventService,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     CustomerSettings customerSettings,
     LocalizationSettings localizationSettings)
 {
     _genericAttributeService       = genericAttributeService;
     _checkVatService               = checkVatService;
     _workflowMessageService        = workflowMessageService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _addressService             = addressService;
     _customerService            = customerService;
     _customerActionEventService = customerActionEventService;
     _dateTimeSettings           = dateTimeSettings;
     _taxSettings          = taxSettings;
     _customerSettings     = customerSettings;
     _localizationSettings = localizationSettings;
 }
예제 #3
0
        public void TestInitialize()
        {
            //plugin initialization
            new Services.Tests.ServiceTest().PluginInitializator();
            var serviceProvider = new Mock <IServiceProvider>();

            serviceProvider.Setup(x => x.GetService(typeof(FixedRateTestTaxProvider))).Returns(new FixedRateTestTaxProvider());
            _serviceProvider = serviceProvider.Object;

            _pluginFinder = new PluginFinder(_serviceProvider);
            _taxSettings  = new TaxSettings();
            _taxSettings.ActiveTaxProviderSystemName = "FixedTaxRateTest";
            _workContext      = null;
            _addressService   = new Mock <IAddressService>().Object;
            _geoLookupService = new Mock <IGeoLookupService>().Object;
            _countryService   = new Mock <ICountryService>().Object;
            _customerSettings = new CustomerSettings();
            _addressSettings  = new AddressSettings();
            _logger           = new NullLogger();

            _taxService = new TaxService(_addressService, _workContext,
                                         _pluginFinder, _geoLookupService, _countryService, _logger,
                                         _taxSettings, _customerSettings, _addressSettings);

            _vatService = new VatService(_taxSettings);
        }
 public CustomerRegisteredCommandHandler(
     IUserFieldService userFieldService,
     IVatService checkVatService,
     IMessageProviderService messageProviderService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IAddressAttributeService addressAttributeService,
     ICountryService countryService,
     ICustomerService customerService,
     ICustomerActionEventService customerActionEventService,
     TaxSettings taxSettings,
     CustomerSettings customerSettings,
     AddressSettings addressSettings,
     LanguageSettings languageSettings)
 {
     _userFieldService              = userFieldService;
     _checkVatService               = checkVatService;
     _messageProviderService        = messageProviderService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _addressAttributeService       = addressAttributeService;
     _countryService             = countryService;
     _customerService            = customerService;
     _customerActionEventService = customerActionEventService;
     _taxSettings      = taxSettings;
     _customerSettings = customerSettings;
     _addressSettings  = addressSettings;
     _languageSettings = languageSettings;
 }
예제 #5
0
        public void TestInitialize()
        {
            var serviceProvider = new Mock <IServiceProvider>();

            serviceProvider.Setup(x => x.GetService(typeof(FixedRateTestTaxProvider))).Returns(new FixedRateTestTaxProvider());
            _serviceProvider = serviceProvider.Object;

            _taxProviderSettings = new TaxProviderSettings();
            _taxProviderSettings.ActiveTaxProviderSystemName = "test-provider";

            _taxSettings      = new TaxSettings();
            _workContext      = null;
            _geoLookupService = new Mock <IGeoLookupService>().Object;
            _countryService   = new Mock <ICountryService>().Object;
            _customerSettings = new CustomerSettings();
            _addressSettings  = new AddressSettings();
            _groupServiceMock = new Mock <IGroupService>();
            _loggerMock       = new Mock <ILogger>();
            var providers = new List <ITaxProvider>();

            providers.Add(new FixedRateTestTaxProvider());
            _taxService = new TaxService(_workContext, _groupServiceMock.Object,
                                         _geoLookupService, _countryService, providers, _loggerMock.Object,
                                         _taxSettings, _taxProviderSettings, _customerSettings, _addressSettings);

            _vatService = new VatService(_taxSettings);
        }
예제 #6
0
 public UpdateCustomerInfoCommandHandler(
     ICustomerRegistrationService customerRegistrationService,
     IGrandAuthenticationService authenticationService,
     IGenericAttributeService genericAttributeService,
     IVatService checkVatService,
     IWorkflowMessageService workflowMessageService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     DateTimeSettings dateTimeSettings,
     CustomerSettings customerSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     ForumSettings forumSettings)
 {
     _customerRegistrationService   = customerRegistrationService;
     _authenticationService         = authenticationService;
     _genericAttributeService       = genericAttributeService;
     _checkVatService               = checkVatService;
     _workflowMessageService        = workflowMessageService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _dateTimeSettings              = dateTimeSettings;
     _customerSettings              = customerSettings;
     _taxSettings          = taxSettings;
     _localizationSettings = localizationSettings;
     _forumSettings        = forumSettings;
 }
        public CreateEstablishmentValidator(IShortCodeService shortCodeService, IVatService vatService)
        {
            _shortCodeService = shortCodeService;
            _vatService       = vatService;

            CreateRules();
        }
예제 #8
0
        public Vat_List()
        {
            VatService = DependencyResolver.Kernel.Get <IVatService>();

            InitializeComponent();

            this.DataContext = this;
        }
예제 #9
0
 public VatPartDriver(
     IVatService vatService,
     IOrchardServices services
     )
 {
     _vatService = vatService;
     Services    = services;
     T           = NullLocalizer.Instance;
 }
        public VatPopup()
        {
            vatService = DependencyResolver.Kernel.Get <IVatService>();

            InitializeComponent();

            // MVVM Data binding
            (this.Content as FrameworkElement).DataContext = this;

            AddHandler(Keyboard.PreviewKeyDownEvent, (KeyEventHandler)HandleKeyDownEvent);
        }
예제 #11
0
        public Vat_AddEdit(VatViewModel VatViewModel, bool isCreateProcess, bool isPopup = false)
        {
            VatService = DependencyResolver.Kernel.Get <IVatService>();

            InitializeComponent();

            this.DataContext = this;

            CurrentVat      = VatViewModel;
            IsCreateProcess = isCreateProcess;
            IsPopup         = isPopup;
        }
예제 #12
0
 public OrderService(IOrderAmountFactory orderAmountFactory,
                     IOrderAmountValidator orderAmountValidator,
                     IVatService vatService,
                     IConfigurationsHandler configurations,
                     IOrderRepository orderRepository)
 {
     this.orderAmountFactory   = orderAmountFactory;
     this.orderAmountValidator = orderAmountValidator;
     this.vatService           = vatService;
     this.configurations       = configurations;
     this.orderRepository      = orderRepository;
 }
예제 #13
0
        public VatPartHandler(
            IVatService vatService,
            IRepository<VatPartRecord> repository
            )
        {
            _vatService = vatService;

            Filters.Add(StorageFilter.For(repository));

            OnActivated<VatPart>((context, part) => {
                part._vatRate.Loader(rate => part.VatRateId > 0 ? _vatService.GetVatRate(part.VatRateId) : null);
                part._vatRate.Setter(rate => {
                    part.VatRateId = rate != null && rate.ContentItem != null ? rate.Id : 0;
                    return rate;
                });
            });
        }
예제 #14
0
 public ProductController(IProductService productService, IVatCategoryService vatCategoryService, IVatService vatService, IUnitOfMeasureTypeService unitOfMeasureTypeService, IUnitOfMeasureService unitOfMeasureService,
                          ISubCategoryService subCategoryService, ICategoryService categoryService, IPackagingTypeService packagingTypeService,
                          IPackagingService packagingService, ISubBrandService subBrandService, IBrandService brandService, IOptions <AppConfig> appConfig)
 {
     _appConfig                = appConfig;
     _productService           = productService;
     _brandService             = brandService;
     _subBrandService          = subBrandService;
     _packagingService         = packagingService;
     _packagingTypeService     = packagingTypeService;
     _categoryService          = categoryService;
     _subCategoryService       = subCategoryService;
     _unitOfMeasureService     = unitOfMeasureService;
     _unitOfMeasureTypeService = unitOfMeasureTypeService;
     _vatCategoryService       = vatCategoryService;
     _vatService               = vatService;
 }
예제 #15
0
        public VatPartHandler(
            IVatService vatService,
            IRepository <VatPartRecord> repository
            )
        {
            _vatService = vatService;

            Filters.Add(StorageFilter.For(repository));

            OnActivated <VatPart>((context, part) => {
                part._vatRate.Loader(() => part.VatRateId > 0 ? _vatService.GetVatRate(part.VatRateId) : null);
                part._vatRate.Setter(rate => {
                    part.VatRateId = rate != null && rate.ContentItem != null ? rate.Id : 0;
                    return(rate);
                });
            });
        }
예제 #16
0
        public VatListViewModel(double amount, int units, IVatService vatService = null)
        {
            Amount = amount;
            Units  = units;

            _vatService = vatService ?? Locator.Current.GetService <IVatService>();

            Vats = new ReactiveList <VatInfo>();

            // TODO incluir this.WhenActivated para la carga inicial¿?
            LoadData(_amount * _units);

            // Command
            this.LoadVats = ReactiveCommand.Create <double>((totalAmount) => LoadData(totalAmount)).DisposeWith(this.Disposables);

            // Handle erros
            this.LoadVats.ThrownExceptions
            .Subscribe((obj) => this.LogException(obj, "Error computing vats"))
            .DisposeWith(this.Disposables);

            // Al modificar Amount ¿Como paso total (amount * units)? ¿como actualizo el label?
            // this.WhenAnyValue(x => x.Amount, x => x.Units)

            // Al modificar Amount. Funciona.
            this.WhenAnyValue(x => x.Amount)
            .Select(x => x)
            .DistinctUntilChanged()
            .ObserveOn(RxApp.MainThreadScheduler)
            .InvokeCommand(LoadVats)
            .DisposeWith(this.Disposables);

            // Al modificar Units, llamar al método. ¿cómo?
            //this.WhenAnyValue(x => x.Units)
            //    .Select(x => x)
            //    .DistinctUntilChanged()
            //    .ObserveOn(RxApp.MainThreadScheduler)
            //    .InvokeCommand(LoadVats)
            //    .DisposeWith(this.Disposables);

            // TODO selección del elemento del listview
            // Selected Item and navigation
            //this.WhenAnyValue(x => x.SelectedItem)
            //    .Where(x => x != null)
            //    .Subscribe(x => NavigateToDetailPage(x))
            //    .DisposeWith(this.Disposables);
        }
 public UpdateCustomerInfoCommandHandler(
     ICustomerManagerService customerManagerService,
     IGrandAuthenticationService authenticationService,
     IUserFieldService userFieldService,
     IVatService checkVatService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICustomerService customerService,
     IMediator mediator,
     CustomerSettings customerSettings,
     TaxSettings taxSettings)
 {
     _customerManagerService        = customerManagerService;
     _authenticationService         = authenticationService;
     _userFieldService              = userFieldService;
     _checkVatService               = checkVatService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _customerService               = customerService;
     _mediator         = mediator;
     _customerSettings = customerSettings;
     _taxSettings      = taxSettings;
 }
예제 #18
0
 public VatController(IVatService vatService)
 {
     _vatService = vatService;
 }
예제 #19
0
 public VatController(IVatService vatService, IResultPublisher resultPublisher)
 {
     _vatService      = vatService;
     _resultPublisher = resultPublisher;
 }
        public void Sync(IVatService vatService, Action <int, int> callback = null)
        {
            try
            {
                SyncVatRequest request = new SyncVatRequest();
                request.CompanyId     = MainWindow.CurrentCompanyId;
                request.LastUpdatedAt = GetLastUpdatedAt(MainWindow.CurrentCompanyId);

                int toSync      = 0;
                int syncedItems = 0;

                VatListResponse response = vatService.Sync(request);
                if (response.Success)
                {
                    toSync = response?.Vats?.Count ?? 0;
                    List <VatViewModel> vatsFromDB = response.Vats;

                    using (SqliteConnection db = new SqliteConnection("Filename=SirmiumERPGFC.db"))
                    {
                        db.Open();
                        using (var transaction = db.BeginTransaction())
                        {
                            SqliteCommand deleteCommand = db.CreateCommand();
                            deleteCommand.CommandText = "DELETE FROM Vats WHERE Identifier = @Identifier";

                            SqliteCommand insertCommand = db.CreateCommand();
                            insertCommand.CommandText = SqlCommandInsertPart;

                            foreach (var vat in vatsFromDB)
                            {
                                deleteCommand.Parameters.AddWithValue("@Identifier", vat.Identifier);
                                deleteCommand.ExecuteNonQuery();
                                deleteCommand.Parameters.Clear();

                                if (vat.IsActive)
                                {
                                    vat.IsSynced = true;

                                    insertCommand = AddCreateParameters(insertCommand, vat);
                                    insertCommand.ExecuteNonQuery();
                                    insertCommand.Parameters.Clear();

                                    syncedItems++;
                                    callback?.Invoke(syncedItems, toSync);
                                }
                            }

                            transaction.Commit();
                        }
                        db.Close();
                    }
                }
                else
                {
                    throw new Exception(response.Message);
                }
            }
            catch (Exception ex)
            {
                MainWindow.ErrorMessage = ex.Message;
            }
        }
예제 #21
0
        public Home()
        {
            businessPartnerService            = DependencyResolver.Kernel.Get <IBusinessPartnerService>();
            businessPartnerTypeService        = DependencyResolver.Kernel.Get <IBusinessPartnerTypeService>();
            businessPartnerBankService        = DependencyResolver.Kernel.Get <IBusinessPartnerBankService>();
            businessPartnerDocumentService    = DependencyResolver.Kernel.Get <IBusinessPartnerDocumentService>();
            businessPartnerInstitutionService = DependencyResolver.Kernel.Get <IBusinessPartnerInstitutionService>();
            businessPartnerLocationService    = DependencyResolver.Kernel.Get <IBusinessPartnerLocationService>();
            businessPartnerNoteService        = DependencyResolver.Kernel.Get <IBusinessPartnerNoteService>();
            //businessPartnerOrganizationUnitService = DependencyResolver.Kernel.Get<IBusinessPartnerOrganizationUnitService>();
            businessPartnerPhoneService = DependencyResolver.Kernel.Get <IBusinessPartnerPhoneService>();


            employeeService           = DependencyResolver.Kernel.Get <IEmployeeService>();
            employeeProfessionService = DependencyResolver.Kernel.Get <IEmployeeProfessionService>();
            employeeNoteService       = DependencyResolver.Kernel.Get <IEmployeeNoteService>();
            employeeLicenceService    = DependencyResolver.Kernel.Get <IEmployeeLicenceService>();
            employeeItemService       = DependencyResolver.Kernel.Get <IEmployeeItemService>();
            employeeDocumentService   = DependencyResolver.Kernel.Get <IEmployeeDocumentService>();
            employeeCardService       = DependencyResolver.Kernel.Get <IEmployeeCardService>();

            licenceTypeService  = DependencyResolver.Kernel.Get <ILicenceTypeService>();
            familyMemberService = DependencyResolver.Kernel.Get <IFamilyMemberService>();

            physicalPersonService           = DependencyResolver.Kernel.Get <IPhysicalPersonService>();
            physicalPersonProfessionService = DependencyResolver.Kernel.Get <IPhysicalPersonProfessionService>();
            physicalPersonNoteService       = DependencyResolver.Kernel.Get <IPhysicalPersonNoteService>();
            physicalPersonLicenceService    = DependencyResolver.Kernel.Get <IPhysicalPersonLicenceService>();
            physicalPersonItemService       = DependencyResolver.Kernel.Get <IPhysicalPersonItemService>();
            physicalPersonDocumentService   = DependencyResolver.Kernel.Get <IPhysicalPersonDocumentService>();
            physicalPersonCardService       = DependencyResolver.Kernel.Get <IPhysicalPersonCardService>();


            outputInvoiceService = DependencyResolver.Kernel.Get <IOutputInvoiceService>();
            inputInvoiceService  = DependencyResolver.Kernel.Get <IInputInvoiceService>();

            countryService      = DependencyResolver.Kernel.Get <ICountryService>();
            regionService       = DependencyResolver.Kernel.Get <IRegionService>();
            municipalityService = DependencyResolver.Kernel.Get <IMunicipalityService>();
            cityService         = DependencyResolver.Kernel.Get <ICityService>();

            sectorService     = DependencyResolver.Kernel.Get <ISectorService>();
            professionService = DependencyResolver.Kernel.Get <IProfessionService>();
            bankService       = DependencyResolver.Kernel.Get <IBankService>();
            agencyService     = DependencyResolver.Kernel.Get <IAgencyService>();

            constructionSiteService            = DependencyResolver.Kernel.Get <IConstructionSiteService>();
            constructionSiteDocumentService    = DependencyResolver.Kernel.Get <IConstructionSiteDocumentService>();
            constructionSiteCalculationService = DependencyResolver.Kernel.Get <IConstructionSiteCalculationService>();
            constructionSiteNoteService        = DependencyResolver.Kernel.Get <IConstructionSiteNoteService>();


            //employeeByBusinessPartnerService = DependencyResolver.Kernel.Get<IEmployeeByBusinessPartnerService>(); //radnici po firmama?
            //employeeByConstructionSiteService = DependencyResolver.Kernel.Get<IEmployeeByConstructionSiteService>(); // radnici po gradilistu
            //businessPartnerByConstructionSiteService = DependencyResolver.Kernel.Get<IBusinessPartnerByConstructionSiteService>(); //firme po gradilistu

            taxAdministrationService = DependencyResolver.Kernel.Get <ITaxAdministrationService>();

            limitationService      = DependencyResolver.Kernel.Get <ILimitationService>();
            userService            = DependencyResolver.Kernel.Get <IUserService>();
            vatService             = DependencyResolver.Kernel.Get <IVatService>();
            discountService        = DependencyResolver.Kernel.Get <IDiscountService>();
            serviceDeliveryService = DependencyResolver.Kernel.Get <IServiceDeliveryService>();
            statusService          = DependencyResolver.Kernel.Get <IStatusService>();
            shipmentService        = DependencyResolver.Kernel.Get <IShipmentService>();

            toDoService = DependencyResolver.Kernel.Get <IToDoService>();

            phonebookService  = DependencyResolver.Kernel.Get <IPhonebookService>();
            callCentarService = DependencyResolver.Kernel.Get <ICallCentarService>();

            employeeByConstructionSiteService        = DependencyResolver.Kernel.Get <IEmployeeByConstructionSiteService>();
            businessPartnerByConstructionSiteService = DependencyResolver.Kernel.Get <IBusinessPartnerByConstructionSiteService>();
            employeeByBusinessPartnerService         = DependencyResolver.Kernel.Get <IEmployeeByBusinessPartnerService>();

            documentFolderService = DependencyResolver.Kernel.Get <IDocumentFolderService>();
            documentFileService   = DependencyResolver.Kernel.Get <IDocumentFileService>();

            InitializeComponent();

            this.DataContext = this;

            var resp = new CompanyUserSQLiteRepository().GetCompanyUser(MainWindow.CurrentCompanyId, MainWindow.CurrentUser?.Identifier ?? Guid.Empty);

            if (resp.Success)
            {
                var userRoles = resp.CompanyUser?.UserRoles ?? new List <UserRoleViewModel>();
                if (userRoles.Any(x => x.Name == "CallCentar") || userRoles.Any(x => x.Name == "Admin"))
                {
                    CallCentarList.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    CallCentarList.Visibility = System.Windows.Visibility.Collapsed;
                }
            }
        }
 public OrdinalTaxService(IVatService vatService)
 {
     _vatService = vatService;
 }
 public VatController(IServiceProvider provider)
 {
     VatService = provider.GetRequiredService <IVatService>();
 }
예제 #24
0
 public VatCategoryController(IVatCategoryService vatCategoryService, IVatService vatService, IOptions <AppConfig> appConfig)
 {
     _appConfig          = appConfig;
     _vatCategoryService = vatCategoryService;
     _vatService         = vatService;
 }