public async Task <PartialViewResult> CreateOrUpdateTeamMembersModal(long?id = null) { int? impersonatorTenantId; int value; string str; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } int num = value; IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdateInvoiceTeamMembersModalViewModel createOrUpdateInvoiceTeamMembersModalViewModel = new CreateOrUpdateInvoiceTeamMembersModalViewModel(await invoiceAppService.GetInvoiceTeamMembersForEdit(nullableIdInput)); CreateOrUpdateInvoiceTeamMembersModalViewModel createOrUpdateInvoiceTeamMembersModalViewModel1 = createOrUpdateInvoiceTeamMembersModalViewModel; long value1 = id.Value; createOrUpdateInvoiceTeamMembersModalViewModel1.InvoiceId = long.Parse(value1.ToString()); List <SelectListItem> selectListItems = new List <SelectListItem>(); ListResultDto <UserListDto> teamMembersByTenantId = await this._invoiceAppService.GetTeamMembersByTenantId(num, true); if (!teamMembersByTenantId.Items.Any <UserListDto>()) { this.ViewData["TeamMembers"] = null; } else { foreach (UserListDto item in teamMembersByTenantId.Items) { string name = item.Name; str = (item.Name.Length > 0 || item.Surname.Length > 0 ? " " : ""); string str1 = string.Concat(name, str, item.Surname); List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = str1, Value = item.Id.ToString(), Selected = false }; selectListItems1.Add(selectListItem); } this.ViewData["TeamMembers"] = selectListItems.AsEnumerable <SelectListItem>(); } IInvoiceAppService invoiceAppService1 = this._invoiceAppService; value1 = id.Value; Invoice invoice = await invoiceAppService1.GetInvoice(long.Parse(value1.ToString())); ((dynamic)this.ViewBag).InvoiceName = invoice.Label; return(this.PartialView("_CreateOrUpdateTeamMembersModal", createOrUpdateInvoiceTeamMembersModalViewModel)); }
public InvoiceInputViewModel(IInvoiceAppService appService, IPatientAppService patientApp, ICategoryAppService categoryApp, IEventAggregator eventAggregator, ISettingProvider setting, IExchangeRateAppService exchangeRateApp, IServiceProvider serviceProvider) { SettingProvider = setting; EventAggregator = eventAggregator; _serviceProvider = serviceProvider; PatientService = patientApp; AppService = appService; rateAppService = exchangeRateApp; CategoryService = categoryApp; CreateCommand = new DelegateCommand <ICloseable>(Create); AddPatientCommand = new DelegateCommand(CreatePatient); DeleteInvoiceLineCommand = new DelegateCommand(OnInvoiceLineDeleted); SelectedCommand = new DelegateCommand <object[]>(OnItemSelected); AddExamCommand = new DelegateCommand <ExamDto>(AddExam); Patients = new ObservableCollection <PatientDto>(); Patients.AddRange(PatientService.GetListAsync().Result); Currency = SettingProvider.GetOrNullAsync(FacCigoSettings.InvoiceCurrency).Result; Model = new InvoiceModel(); Model.ReferenceNo = AppService.NextReferenceNo(Model.InvoiceDate.Year).Result; Categories = new ObservableCollection <CategoryDto>(); Categories.AddRange(CategoryService.GetListAsync().Result); EventAggregator.GetEvent <PatientAddedEvent>().Subscribe(PatientAdded); ExchangeRate = rateAppService.CurrentExchangeRate().Result; }
public InvoiceController( IInvoiceAppService invoiceAppService, IBankAppService bankAppService) { _invoiceAppService = invoiceAppService; _bankAppService = bankAppService; }
public ReportsController(ISessionAppService sessionAppService, IInvoiceAppService invoiceAppService, ISalesmanAppService salesmanAppService ) { _sessionAppService = sessionAppService; _invoiceAppService = invoiceAppService; _salesmanAppService = salesmanAppService; }
public InvoiceController(IInvoiceAppService InvoiceAppService, ICustomerRepository ICustomerAppService , IProductRepository IProductRepository, IUnitRepository IUnitRepository , IHostingEnvironment hostingEnvironment) { _InvoiceAppService = InvoiceAppService; _CustomerAppService = ICustomerAppService; _ProductRepository = IProductRepository; _UnitRepository = IUnitRepository; _hostingEnvironment = hostingEnvironment; }
public InvoicesController(IInvoiceAppService invoiceAppService, ISupplierAppService supplierAppService, ICustomerAppService customerAppServer, IBinaryObjectManager binaryObjectManager, IProductAppService productAppService, ITitleAppService titleAppService, IRepository <PaymentSetting, long> paymentSettingRepository, IRepository <TenantPaymentSettings, long> tenantPaymentSettingsRepository) { this._invoiceAppService = invoiceAppService; this._supplierAppService = supplierAppService; this._customerAppServer = customerAppServer; this._binaryObjectManager = binaryObjectManager; this._titleAppService = titleAppService; this._tenantPaymentSettingsRepository = tenantPaymentSettingsRepository; this._productAppService = productAppService; this._paymentSettingRepository = paymentSettingRepository; }
public PayController(TenantSettingsAppService tenantSettingsAppService, IPayAppService paymentAppService, IInvoiceAppService invoiceAppService, ICustomerAppService customerAppService, IGenericAppService genericAppService, TenantManager tenantManager, IWebUrlService webUrlService, UserManager userManager, IUnitOfWorkManager unitOfWorkManager) { this._tenantSettingsAppService = tenantSettingsAppService; this._tenantManager = tenantManager; this._webUrlService = webUrlService; this._paymentAppService = paymentAppService; this._invoiceAppService = invoiceAppService; this._customerAppService = customerAppService; this._genericAppService = genericAppService; this._userManager = userManager; this._unitOfWorkManager = unitOfWorkManager; }
public InvoiceController(ISessionAppService sessionAppService, ICustomerAppService customerService, IProductAppService productService, IInvoiceAppService invoiceAppService, IInvoiceDetailsAppService invoiceDetailsAppService, IStockAppService stockService ) { _sessionAppService = sessionAppService; _customerService = customerService; _productService = productService; _invoiceAppService = invoiceAppService; _invoiceDetailsAppService = invoiceDetailsAppService; _stockService = stockService; }
public InvoicesViewModel(IInvoiceAppService appService, IServiceProvider serviceProvider, IEventAggregator eventAggregator) { AppService = appService; _serviceProvider = serviceProvider; EventAggregator = eventAggregator; SelectedCommand = new DelegateCommand <object[]>(OnItemSelected); CreateCommand = new DelegateCommand(Create); UpdateCommand = new DelegateCommand(Update); ImportCommand = new DelegateCommand(Print); DeleteCommand = new DelegateCommand(Delete); Items = new ObservableCollection <InvoiceDto>(); Items.AddRange(AppService.GetListAsync().Result.OrderByDescending(c => c.CreationTime)); EventAggregator.GetEvent <InvoiceUpdatedEvent>().Subscribe(OnInvoiceUpdated); EventAggregator.GetEvent <InvoiceDeletedEvent>().Subscribe(OnInvoiceDeleted); EventAggregator.GetEvent <InvoiceAddedEvent>().Subscribe(OnInvoiceAdded); // Document = new InvoiceDocument (); }
public async Task <PartialViewResult> CreateOrViewPaymentModal(long invoiceId, long?id = null, bool c = false) { int?impersonatorTenantId; int value; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrViewPaymentModalViewModel createOrViewPaymentModalViewModel = new CreateOrViewPaymentModalViewModel(await invoiceAppService.GetInvoicePaymentForCreateOrView(nullableIdInput)); if (createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId <= (long)0) { createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId = invoiceId; } IInvoiceAppService invoiceAppService1 = this._invoiceAppService; long num = createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId; Invoice invoice = await invoiceAppService1.GetInvoice(long.Parse(num.ToString())); Invoice invoice1 = invoice; createOrViewPaymentModalViewModel.InvoicePayment.Invoice = invoice1; Customer customerById = await this._customerAppServer.GetCustomerById(invoice1.CustomerId); createOrViewPaymentModalViewModel.InvoicePayment.Customer = customerById.MapTo <Customer>(); if (c) { ((dynamic)this.ViewBag).IsCustomer = true; } return(this.PartialView("_CreateOrViewPaymentModal", createOrViewPaymentModalViewModel)); }
public async Task <PartialViewResult> CreateOrUpdateResourcesModal(long?invoiceId = null, bool?reloadPartial = null) { PartialViewResult partialViewResult; IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = invoiceId }; GetInvoiceResourceForEditOutput invoiceResourcesForEdit = await invoiceAppService.GetInvoiceResourcesForEdit(nullableIdInput); CreateOrUpdateInvoiceResourcesModalViewModel createOrUpdateInvoiceResourcesModalViewModel = new CreateOrUpdateInvoiceResourcesModalViewModel(invoiceResourcesForEdit) { InvoiceId = invoiceId.Value }; Invoice invoice = await this._invoiceAppService.GetInvoice(invoiceId.Value); ((dynamic)this.ViewBag).InvoiceName = invoice.Label; partialViewResult = (!reloadPartial.HasValue || !bool.Parse(reloadPartial.ToString()) ? this.PartialView("_CreateOrUpdateResourcesModal", createOrUpdateInvoiceResourcesModalViewModel) : this.PartialView("_ListResourcesView", createOrUpdateInvoiceResourcesModalViewModel)); return(partialViewResult); }
public CreditMemoController(ISessionAppService sessionAppService, ICustomerAppService customerService, IProductAppService productService, ICreditMemoAppService creditMemoAppService, ICreditMemoDetailsAppService creditMemoDetailsAppService, IStockAppService stockService, IBadStockAppService badStockService, IInvoiceAppService invoiceAppService, ILocationSiteAppService locationSiteAppService ) { _sessionAppService = sessionAppService; _customerService = customerService; _productService = productService; _creditMemoAppService = creditMemoAppService; _creditMemoDetailsAppService = creditMemoDetailsAppService; _stockService = stockService; _badStockService = badStockService; _invoiceAppService = invoiceAppService; _locationSiteAppService = locationSiteAppService; }
public async Task <PartialViewResult> CopyModal(long invoiceId) { IInvoiceAppService invoiceAppService = this._invoiceAppService; IdInput <long> idInput = new IdInput <long>() { Id = invoiceId }; CopyInvoiceModalViewModel copyInvoiceModalViewModel = new CopyInvoiceModalViewModel(await invoiceAppService.GetInvoiceForCopy(idInput)); List <SelectListItem> selectListItems = new List <SelectListItem>(); foreach (Customer customersForBusiness in await this._customerAppServer.GetCustomersForBusiness()) { if (customersForBusiness.Id == copyInvoiceModalViewModel.Invoice.CustomerId) { continue; } List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = string.Concat(customersForBusiness.LastName, ", ", customersForBusiness.FirstName), Value = customersForBusiness.Id.ToString(), Disabled = false, Selected = false }; selectListItems1.Add(selectListItem); } List <SelectListItem> selectListItems2 = selectListItems; SelectListItem selectListItem1 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems2.Insert(0, selectListItem1); this.ViewData["Customers"] = selectListItems; return(this.PartialView("_CopyModal", copyInvoiceModalViewModel)); }
public InvoiceController(IInvoiceAppService invoiceAppService) { _invoiceAppService = invoiceAppService; }
public ChargeAppService(IInvoiceAppService invoiceAppService) { _invoiceAppService = invoiceAppService; }
public InvoiceItemController(IInvoiceAppService InvoiceItemAppService, IInvoiceAppService invoiceAppService) { _InvoiceAppService = InvoiceItemAppService; _invoiceAppService = invoiceAppService; }
public async Task <PartialViewResult> CreateOrUpdateModal(long?id = null) { int? impersonatorTenantId; int value; bool flag; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } int num = value; IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdateInvoiceModalViewModel createOrUpdateInvoiceModalViewModel = new CreateOrUpdateInvoiceModalViewModel(await invoiceAppService.GetInvoiceForEdit(nullableIdInput)); IRepository <TenantPaymentSettings, long> repository = this._tenantPaymentSettingsRepository; List <TenantPaymentSettings> allListAsync = await repository.GetAllListAsync((TenantPaymentSettings x) => x.TenantId == num); List <TenantPaymentSettings> tenantPaymentSettings = allListAsync; if (tenantPaymentSettings.Count == 1 && !string.IsNullOrEmpty(tenantPaymentSettings[0].DefaultPaymentTerm) && tenantPaymentSettings[0].DefaultPaymentTerm.Length > 0) { this.Session["DefaultTermType"] = tenantPaymentSettings[0].DefaultPaymentTerm; } List <SelectListItem> selectListItems = new List <SelectListItem>(); ListResultDto <ProductListDto> productsByTenantId = await this._productAppService.GetProductsByTenantId(num, true, ""); ListResultDto <ProductListDto> listResultDto = productsByTenantId; if (!listResultDto.Items.Any <ProductListDto>()) { this.ViewData["Products"] = null; } else { foreach (ProductListDto item in listResultDto.Items) { List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = item.Name, Value = item.Id.ToString(), Selected = false }; selectListItems1.Add(selectListItem); } this.ViewData["Products"] = selectListItems.AsEnumerable <SelectListItem>(); } List <SelectListItem> selectListItems2 = new List <SelectListItem>(); foreach (Customer customersForBusiness in await this._customerAppServer.GetCustomersForBusiness()) { List <SelectListItem> selectListItems3 = selectListItems2; SelectListItem selectListItem1 = new SelectListItem() { Text = string.Concat(customersForBusiness.LastName, ", ", customersForBusiness.FirstName), Value = customersForBusiness.Id.ToString(), Disabled = false, Selected = false }; selectListItems3.Add(selectListItem1); } List <SelectListItem> selectListItems4 = selectListItems2; SelectListItem selectListItem2 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems4.Insert(0, selectListItem2); this.ViewData["Customers"] = selectListItems2; List <SelectListItem> selectListItems5 = new List <SelectListItem>(); foreach (Lookup lookupItem in (new LookupFill("BillingTypes", num)).LookupItems) { SelectListItem selectListItem3 = new SelectListItem() { Text = lookupItem.Text, Value = lookupItem.Value, Disabled = lookupItem.Disabled, Selected = lookupItem.Selected }; selectListItems5.Add(selectListItem3); } SelectListItem selectListItem4 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems5.Insert(0, selectListItem4); this.ViewData["BillingTypes"] = selectListItems5; List <SelectListItem> selectListItems6 = new List <SelectListItem>(); LookupFill lookupFill = new LookupFill("PaymentTerms", num); IRepository <PaymentSetting, long> repository1 = this._paymentSettingRepository; List <PaymentSetting> paymentSettings = await repository1.GetAllListAsync((PaymentSetting x) => x.TenantId == num); List <PaymentSetting> paymentSettings1 = paymentSettings; if (paymentSettings1.Any <PaymentSetting>()) { foreach (PaymentSetting paymentSetting in paymentSettings1) { lookupFill.LookupItems.Add(LookupFill.CreateLookupFromString(paymentSetting.Setting.ToString(), num)); } } ICollection <Lookup> lookupItems = lookupFill.LookupItems; foreach (Lookup lookup in from x in lookupItems orderby x.Text select x) { if (lookup.Text == "< Add New >") { continue; } List <SelectListItem> selectListItems7 = selectListItems6; SelectListItem selectListItem5 = new SelectListItem() { Text = lookup.Text, Value = lookup.Value, Disabled = lookup.Disabled, Selected = lookup.Selected }; selectListItems7.Add(selectListItem5); } this.ViewData["TermTypes"] = selectListItems6; ((dynamic)this.ViewBag).InvoicePaidTotal = new decimal(0); if (createOrUpdateInvoiceModalViewModel.Invoice.Id.HasValue) { IInvoiceAppService invoiceAppService1 = this._invoiceAppService; long?nullable = createOrUpdateInvoiceModalViewModel.Invoice.Id; List <InvoicePaymentListDto> invoicePaymentsByInvoiceId = await invoiceAppService1.GetInvoicePaymentsByInvoiceId(nullable.Value); dynamic viewBag = this.ViewBag; flag = (invoicePaymentsByInvoiceId.Any <InvoicePaymentListDto>() ? true : false); viewBag.InvoiceHasPayments = flag; if (invoicePaymentsByInvoiceId.Any <InvoicePaymentListDto>()) { dynamic obj = this.ViewBag; List <InvoicePaymentListDto> invoicePaymentListDtos = invoicePaymentsByInvoiceId; obj.InvoicePaidTotal = invoicePaymentListDtos.Sum <InvoicePaymentListDto>((InvoicePaymentListDto s) => s.DollarAmount); } } return(this.PartialView("_CreateOrUpdateModal", createOrUpdateInvoiceModalViewModel)); }