From a0c9fb2a4c6a1fe857c1e23aa6b0e0e1e87c3338 Mon Sep 17 00:00:00 2001 From: Leandro Hernan Rojas Date: Fri, 23 May 2025 12:27:56 -0300 Subject: [PATCH] Add OfferDays, Payment Condition --- Core/Interfaces/ILookUpDom.cs | 2 +- Core/Services/LookupService .cs | 3 + Documents/Templates/Quotes/Template_v1.cshtml | 3 + Domain/Dtos/QuoteDto.cs | 31 +++++--- Domain/Entities/EPaymentTerm.cs | 26 +++++++ Domain/Entities/EQuoteHeader.cs | 25 +++++-- Models/Interfaces/IPhSLookUpRepository.cs | 1 + Models/Models/PhSPaymentTerm.cs | 32 ++++++++ Models/Models/PhSQuoteHeader.cs | 12 +++ .../Models/PhronCareOperationsHubContext.cs | 39 ++++++++++ Models/Repositories/PhSLookUpRepository.cs | 14 ++++ Models/Repositories/PhSQuoteRepository.cs | 18 +++-- .../Controllers/Sales/LookUpController.cs | 3 + .../obj/Debug/net8.0/ApiEndpoints.json | 20 +++++ .../Pages/Sales/Quotes/QuoteCreate.razor | 74 ++++++++++++------- .../Services/Lookups/ISalesLookupService .cs | 1 + .../Services/Lookups/SalesLookupService.cs | 7 +- 17 files changed, 259 insertions(+), 52 deletions(-) create mode 100644 Domain/Entities/EPaymentTerm.cs create mode 100644 Models/Models/PhSPaymentTerm.cs diff --git a/Core/Interfaces/ILookUpDom.cs b/Core/Interfaces/ILookUpDom.cs index 2e6e6b1..222b8aa 100644 --- a/Core/Interfaces/ILookUpDom.cs +++ b/Core/Interfaces/ILookUpDom.cs @@ -11,6 +11,6 @@ namespace Core.Interfaces Task> PeopleListAsync(string filter, int limit = 10); Task> BussinessUnitsListAsync(string filter, int limit = 10); Task> ProductsListAsync(string filter, int limit = 10); - + Task> PaymentTermsListAsync(string filter, int limit = 10); } } diff --git a/Core/Services/LookupService .cs b/Core/Services/LookupService .cs index cda0caf..cec140c 100644 --- a/Core/Services/LookupService .cs +++ b/Core/Services/LookupService .cs @@ -22,6 +22,9 @@ namespace Core.Services public Task> BussinessUnitsListAsync(string filter, int limit = 10) => _repository.BussinessUnitsListAsync(filter); public Task> ProductsListAsync(string filter, int limit = 10) => _repository.ProductsListAsync(filter); + public Task> PaymentTermsListAsync(string filter, int limit = 10) + => _repository.PaymentTermsListAsync(filter, limit); + #endregion } } diff --git a/Documents/Templates/Quotes/Template_v1.cshtml b/Documents/Templates/Quotes/Template_v1.cshtml index fafc163..1985b71 100644 --- a/Documents/Templates/Quotes/Template_v1.cshtml +++ b/Documents/Templates/Quotes/Template_v1.cshtml @@ -127,6 +127,9 @@

Nombre: @Model.Customer.Name

Domicilio: @Model.Customer.Address

Condición IVA: @Model.Customer.IvaCondition

+

Condición de pago: @Model.PaymentTermDescription

+

Validez de la oferta: @((Model.OfferValidityDays.HasValue ? $"{Model.OfferValidityDays} días" : "—"))

+ @if (Model.Customer.Documents != null && Model.Customer.Documents.Any()) {

Documentos:

diff --git a/Domain/Dtos/QuoteDto.cs b/Domain/Dtos/QuoteDto.cs index 28d4094..4f09d69 100644 --- a/Domain/Dtos/QuoteDto.cs +++ b/Domain/Dtos/QuoteDto.cs @@ -10,7 +10,7 @@ /// /// Número de presupuesto (ej. "Q-00000001"). /// - public string Quotenumber { get; set; } = ""; + public string Quotenumber { get; set; } = String.Empty; /// /// Fecha de emisión del presupuesto. @@ -25,32 +25,43 @@ /// /// Nombre completo del cliente asociado. /// - public string CustomerName { get; set; } = ""; + public string CustomerName { get; set; } = String.Empty; /// /// Nombre completo del médico responsable. /// - public string ProfessionalName { get; set; } = ""; + public string ProfessionalName { get; set; } = String.Empty; /// /// Nombre de la institución u hospital. /// - public string InstitutionName { get; set; } = ""; + public string InstitutionName { get; set; } = String.Empty; /// /// Nombre completo del paciente. /// - public string PatientName { get; set; } = ""; + public string PatientName { get; set; } = String.Empty; + + /// + /// Días de validez del presupuesto (desde la fecha de emisión). + /// + public int? OfferValidityDays { get; set; } + + /// + /// Descripción de la condición de pago (ej. "Contado", "30 días"). + /// + public string? PaymentTermDescription { get; set; } = String.Empty; + /// /// Nombre de la unidad de negocio. /// - public string BusinessUnitName { get; set; } = ""; + public string BusinessUnitName { get; set; } = String.Empty; /// /// Moneda del presupuesto (ej. "ARS", "USD"). /// - public string Currency { get; set; } = ""; + public string Currency { get; set; } = String.Empty; /// /// Importe total final (incluye impuestos y ajustes). @@ -60,16 +71,16 @@ /// /// Estado actual del presupuesto ("Pendiente", "Aprobado", etc.). /// - public string Status { get; set; } = ""; + public string Status { get; set; } = String.Empty; /// /// Nombre del vendedor o ejecutivo de ventas. /// - public string SalespersonName { get; set; } = ""; + public string SalespersonName { get; set; } = String.Empty; /// /// Nombre del vendedor o ejecutivo de ventas. /// - public string Observations { get; set; } = ""; + public string Observations { get; set; } = String.Empty; /// /// Detalle de los ítems o productos cotizados. diff --git a/Domain/Entities/EPaymentTerm.cs b/Domain/Entities/EPaymentTerm.cs new file mode 100644 index 0000000..5346c1a --- /dev/null +++ b/Domain/Entities/EPaymentTerm.cs @@ -0,0 +1,26 @@ + +namespace Domain.Entities +{ + public class EPaymentTerm + { + /// + /// Identificador único de la condición de pago. + /// + public int Id { get; set; } + + /// + /// Descripción de la condición de pago (ej: Contado, 30 días, etc.). + /// + public string Description { get; set; } = null!; + + /// + /// Cantidad de días establecidos para el pago. Contado = 0, 30 días = 30, etc. + /// + public int Days { get; set; } + + /// + /// Indica si el término de pago está activo (1) o no (0). + /// + public bool Isactive { get; set; } + } +} diff --git a/Domain/Entities/EQuoteHeader.cs b/Domain/Entities/EQuoteHeader.cs index 9483c16..251af19 100644 --- a/Domain/Entities/EQuoteHeader.cs +++ b/Domain/Entities/EQuoteHeader.cs @@ -1,6 +1,4 @@ -using System.Text.Json.Serialization; - -namespace Domain.Entities +namespace Domain.Entities { /// /// Tabla de cabeceras de presupuestos @@ -21,7 +19,6 @@ namespace Domain.Entities /// /// Número visible del presupuesto /// - public string Quotenumber { get; set; } = String.Empty; /// @@ -54,20 +51,30 @@ namespace Domain.Entities /// public DateTime? Estimateddate { get; set; } + /// + /// Días de validez de la oferta. Indica cuántos días estará vigente el presupuesto desde su fecha de emisión. + /// + public int? Offervaliditydays { get; set; } + + /// + /// Condición de pago seleccionada para el presupuesto. + /// + public int? PaymenttermId { get; set; } + /// /// Código de moneda pactada (ISO 4217). Ej: ARS, USD /// - public string Currency { get; set; }= String.Empty; + public string Currency { get; set; } = String.Empty; /// /// Tipo de cambio pactado para conversión a pesos argentinos /// - public decimal Exchangerate { get; set; } + public decimal? Exchangerate { get; set; } /// /// Importe neto antes de aplicar impuestos, expresado en la moneda pactada del presupuesto /// - public decimal Netamount { get; set; } + public decimal? Netamount { get; set; } /// /// Importe total del presupuesto expresado en la moneda pactada (extranjera), incluyendo impuestos y ajustes comerciales @@ -118,9 +125,13 @@ namespace Domain.Entities /// Fecha de modificación /// public DateTime? Modifiedat { get; set; } + public virtual ICollection PhSQuoteAdjustments { get; set; } = new List(); + public virtual ICollection PhSQuoteDetails { get; set; } = new List(); + public virtual ICollection PhSQuoteRoles { get; set; } = new List(); + public virtual ICollection PhSQuoteTaxes { get; set; } = new List(); } } diff --git a/Models/Interfaces/IPhSLookUpRepository.cs b/Models/Interfaces/IPhSLookUpRepository.cs index 616419d..708b4ec 100644 --- a/Models/Interfaces/IPhSLookUpRepository.cs +++ b/Models/Interfaces/IPhSLookUpRepository.cs @@ -11,5 +11,6 @@ namespace Models.Interfaces Task> PeopleListAsync(string filter, int limit = 10); Task> BussinessUnitsListAsync(string filter, int limit = 10); Task> ProductsListAsync(string filter, int limit = 10); + Task> PaymentTermsListAsync(string filter, int limit = 10); } } \ No newline at end of file diff --git a/Models/Models/PhSPaymentTerm.cs b/Models/Models/PhSPaymentTerm.cs new file mode 100644 index 0000000..1f834b3 --- /dev/null +++ b/Models/Models/PhSPaymentTerm.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace Models.Models; + +/// +/// Tabla de condiciones o términos de pago aplicables a los presupuestos. +/// +public partial class PhSPaymentTerm +{ + /// + /// Identificador único de la condición de pago. + /// + public int Id { get; set; } + + /// + /// Descripción de la condición de pago (ej: Contado, 30 días, etc.). + /// + public string Description { get; set; } = null!; + + /// + /// Cantidad de días establecidos para el pago. Contado = 0, 30 días = 30, etc. + /// + public int Days { get; set; } + + /// + /// Indica si el término de pago está activo (1) o no (0). + /// + public bool Isactive { get; set; } + + public virtual ICollection PhSQuoteHeaders { get; set; } = new List(); +} diff --git a/Models/Models/PhSQuoteHeader.cs b/Models/Models/PhSQuoteHeader.cs index 5f51ead..c793250 100644 --- a/Models/Models/PhSQuoteHeader.cs +++ b/Models/Models/PhSQuoteHeader.cs @@ -53,6 +53,16 @@ public partial class PhSQuoteHeader /// public DateTime? Estimateddate { get; set; } + /// + /// Días de validez de la oferta. Indica cuántos días estará vigente el presupuesto desde su fecha de emisión. + /// + public int? Offervaliditydays { get; set; } + + /// + /// Condición de pago seleccionada para el presupuesto. + /// + public int? PaymenttermId { get; set; } + /// /// Código de moneda pactada (ISO 4217). Ej: ARS, USD /// @@ -118,6 +128,8 @@ public partial class PhSQuoteHeader /// public DateTime? Modifiedat { get; set; } + public virtual PhSPaymentTerm? Paymentterm { get; set; } + public virtual ICollection PhSQuoteAdjustments { get; set; } = new List(); public virtual ICollection PhSQuoteDetails { get; set; } = new List(); diff --git a/Models/Models/PhronCareOperationsHubContext.cs b/Models/Models/PhronCareOperationsHubContext.cs index 6420040..fafebe7 100644 --- a/Models/Models/PhronCareOperationsHubContext.cs +++ b/Models/Models/PhronCareOperationsHubContext.cs @@ -49,6 +49,8 @@ public partial class PhronCareOperationsHubContext : DbContext public virtual DbSet PhSPatients { get; set; } + public virtual DbSet PhSPaymentTerms { get; set; } + public virtual DbSet PhSPeopleGroups { get; set; } public virtual DbSet PhSPeople { get; set; } @@ -501,6 +503,8 @@ public partial class PhronCareOperationsHubContext : DbContext entity.ToTable("PhS_Institutions"); + entity.HasIndex(e => e.Name, "IDX_PhS_Institutions_Name"); + entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.City) .HasMaxLength(100) @@ -587,6 +591,28 @@ public partial class PhronCareOperationsHubContext : DbContext .HasConstraintName("FK_Patients_DocumentTypes"); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PK__PhS_Paym__3213E83F53A19842"); + + entity.ToTable("PhS_PaymentTerms", tb => tb.HasComment("Tabla de condiciones o términos de pago aplicables a los presupuestos.")); + + entity.Property(e => e.Id) + .HasComment("Identificador único de la condición de pago.") + .HasColumnName("id"); + entity.Property(e => e.Days) + .HasComment("Cantidad de días establecidos para el pago. Contado = 0, 30 días = 30, etc.") + .HasColumnName("days"); + entity.Property(e => e.Description) + .HasMaxLength(100) + .HasComment("Descripción de la condición de pago (ej: Contado, 30 días, etc.).") + .HasColumnName("description"); + entity.Property(e => e.Isactive) + .HasDefaultValue(true) + .HasComment("Indica si el término de pago está activo (1) o no (0).") + .HasColumnName("isactive"); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("PK__PhS_Peop__3213E83F8005BEA1"); @@ -906,6 +932,8 @@ public partial class PhronCareOperationsHubContext : DbContext entity.ToTable("PhS_QuoteHeaders", tb => tb.HasComment("Tabla de cabeceras de presupuestos")); + entity.HasIndex(e => e.PaymenttermId, "ix_quoteheaders_paymenttermid"); + entity.Property(e => e.Id) .HasComment("ID interno") .HasColumnName("id"); @@ -961,9 +989,15 @@ public partial class PhronCareOperationsHubContext : DbContext entity.Property(e => e.Observations) .HasComment("Observaciones internas") .HasColumnName("observations"); + entity.Property(e => e.Offervaliditydays) + .HasComment("Días de validez de la oferta. Indica cuántos días estará vigente el presupuesto desde su fecha de emisión.") + .HasColumnName("offervaliditydays"); entity.Property(e => e.OutOfTown) .HasComment("Indica si la cirugía se realizará fuera de la ciudad/localidad habitual (“out of town”)") .HasColumnName("out_of_town"); + entity.Property(e => e.PaymenttermId) + .HasComment("Condición de pago seleccionada para el presupuesto.") + .HasColumnName("paymentterm_id"); entity.Property(e => e.PeopleId) .HasDefaultValue(1) .HasComment("Identificador único del vendedor") @@ -993,6 +1027,11 @@ public partial class PhronCareOperationsHubContext : DbContext .HasComment("Importe total del presupuesto expresado en la moneda pactada (extranjera), incluyendo impuestos y ajustes comerciales") .HasColumnType("decimal(18, 2)") .HasColumnName("total_foreign"); + + entity.HasOne(d => d.Paymentterm).WithMany(p => p.PhSQuoteHeaders) + .HasForeignKey(d => d.PaymenttermId) + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_quoteheaders_paymenttermid"); }); modelBuilder.Entity(entity => diff --git a/Models/Repositories/PhSLookUpRepository.cs b/Models/Repositories/PhSLookUpRepository.cs index 6d2faa3..415b066 100644 --- a/Models/Repositories/PhSLookUpRepository.cs +++ b/Models/Repositories/PhSLookUpRepository.cs @@ -78,6 +78,20 @@ namespace Models.Repositories .Select(c => new EProductLookupItem { Id = c.Id, Code=c.Businessunits.Code, Description = c.Description , UnitPrice= c.Baseprice }) .Take(limit) .ToListAsync(); + public async Task> PaymentTermsListAsync(string filter = "", int limit = 10) + { + var query = _context.PhSPaymentTerms + .Where(p => p.Isactive); + + if (!string.IsNullOrWhiteSpace(filter)) + query = query.Where(p => p.Description.Contains(filter)); + + return await query + .OrderBy(p => p.Days) + .Select(p => new ELookUpItem { Id = p.Id, Nombre = p.Description }) + .Take(limit) + .ToListAsync(); + } } } diff --git a/Models/Repositories/PhSQuoteRepository.cs b/Models/Repositories/PhSQuoteRepository.cs index 853eab5..0e53dcb 100644 --- a/Models/Repositories/PhSQuoteRepository.cs +++ b/Models/Repositories/PhSQuoteRepository.cs @@ -228,7 +228,7 @@ namespace Models.Repositories // Cargar Customer completo con documentos y tipos var customer = await _context.PhSCustomers .Include(c => c.PhSCustomerDocuments) - .ThenInclude(d => d.Documenttypes) // ✅ CORRECTO + .ThenInclude(d => d.Documenttypes) .Include(c => c.PhSCustomerAddresses) .Include(c => c.TaxCondition) .FirstOrDefaultAsync(c => c.Id == header.CustomerId); @@ -244,16 +244,21 @@ namespace Models.Repositories Quotenumber = header.Quotenumber, IssueDate = header.Issuedate, EstimatedDate = header.Estimateddate, + OfferValidityDays = header.Offervaliditydays, + PaymentTermDescription = _context.PhSPaymentTerms + .Where(p => p.Id == header.PaymenttermId) + .Select(p => p.Description) + .FirstOrDefault() ?? "", + BusinessUnitName = _context.PhSBusinessUnits + .Where(b => b.Id == header.BusinessunitId) + .Select(b => b.Code) + .FirstOrDefault() ?? "", Currency = header.Currency, Total = header.Total.GetValueOrDefault(0m), Status = header.Status.Trim(), Observations = header.Observations ?? "", CustomerName = customer?.Name ?? "", - BusinessUnitName = _context.PhSBusinessUnits - .Where(b => b.Id == header.BusinessunitId) - .Select(b => b.Code) - .FirstOrDefault() ?? "", ProfessionalName = header.PhSQuoteRoles .Where(r => r.Entitytype == PhSEntityTypes.Professional) @@ -329,11 +334,12 @@ namespace Models.Repositories Documents = customer?.PhSCustomerDocuments .Select(d => new QuoteCustomerDocumentDto { - DocumentType = d.Documenttypes.Name, // ✅ correcto + DocumentType = d.Documenttypes.Name, Number = d.DocumentNumber }).ToList() ?? new() } }; + return dto; } diff --git a/phronCare.API/Controllers/Sales/LookUpController.cs b/phronCare.API/Controllers/Sales/LookUpController.cs index 25c71e5..eae4f69 100644 --- a/phronCare.API/Controllers/Sales/LookUpController.cs +++ b/phronCare.API/Controllers/Sales/LookUpController.cs @@ -34,5 +34,8 @@ namespace phronCare.API.Controllers.Sales public Task> Products([FromQuery] string q) => _lookup.ProductsListAsync(q); + [HttpGet("paymentterms")] + public Task> PaymentTerms() + => _lookup.PaymentTermsListAsync(""); // o sin parámetro si lo hacés opcional } } diff --git a/phronCare.API/obj/Debug/net8.0/ApiEndpoints.json b/phronCare.API/obj/Debug/net8.0/ApiEndpoints.json index 348da42..f82d4f7 100644 --- a/phronCare.API/obj/Debug/net8.0/ApiEndpoints.json +++ b/phronCare.API/obj/Debug/net8.0/ApiEndpoints.json @@ -862,6 +862,26 @@ } ] }, + { + "ContainingType": "phronCare.API.Controllers.Sales.LookUpController", + "Method": "PaymentTerms", + "RelativePath": "api/LookUp/paymentterms", + "HttpMethod": "GET", + "IsController": true, + "Order": 0, + "Parameters": [], + "ReturnTypes": [ + { + "Type": "System.Collections.Generic.IEnumerable\u00601[[Domain.Entities.ELookUpItem, Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]", + "MediaTypes": [ + "text/plain", + "application/json", + "text/json" + ], + "StatusCode": 200 + } + ] + }, { "ContainingType": "phronCare.API.Controllers.Sales.LookUpController", "Method": "People", diff --git a/phronCare.UIBlazor/Pages/Sales/Quotes/QuoteCreate.razor b/phronCare.UIBlazor/Pages/Sales/Quotes/QuoteCreate.razor index 2dd3d1f..e7241d1 100644 --- a/phronCare.UIBlazor/Pages/Sales/Quotes/QuoteCreate.razor +++ b/phronCare.UIBlazor/Pages/Sales/Quotes/QuoteCreate.razor @@ -114,7 +114,25 @@ - + +
+
+ + + + @foreach (var term in _paymentTerms) + { + + } + +
+
+ + +
+
+ +
@@ -155,11 +173,9 @@
Productos Cotizados
- -
@@ -313,9 +329,15 @@ @code { - private EQuoteHeader _quoteModel = new(); + private EQuoteHeader _quoteModel = new() + { + Offervaliditydays = 15, + Estimateddate = DateTime.Today, + Currency="ARS" + }; + private ELookUpItem? _selectedCustomer, _selectedProfessional, _selectedInstitution, _selectedPatient, _selectedPerson; - private List _businessUnits = new(); + private List _businessUnits = new(), _paymentTerms = new(); private EExchangeRateHistory? YesterdayRate; private string returnUrl = "quotes/"; private decimal _netAmount = 0, _taxAmount = 0, _grandTotal = 0; @@ -336,11 +358,13 @@ } // 2. Asignamos al modelo si aún no tiene valor - if (YesterdayRate != null && _quoteModel.Exchangerate == 0) + if (YesterdayRate != null) { _quoteModel.Exchangerate = YesterdayRate.Salerate; } _businessUnits = (await SalesLookupService.SearchBussinessUnitsAsync(string.Empty)).ToList(); + _paymentTerms = (await SalesLookupService.GetPaymentTermsAsync()).ToList(); + } private async Task AddNewProduct() { @@ -365,6 +389,24 @@ _quoteModel.PhSQuoteDetails.Add(newDetail); } } + private async Task AddNewTax() + { + var parameters = new ModalParameters(); + parameters.Add(nameof(QuoteTaxQuickAddModal.NetAmount), _netAmount); + var options = new ModalOptions + { + HideHeader = true, + Size = ModalSize.Small + }; + var modal = Modal.Show("", parameters, options); + var result = await modal.Result; + + if (!result.Cancelled && result.Data is EQuoteTax newTax) + { + _quoteModel.PhSQuoteTaxes.Add(newTax); + RecalculateTotals(); + } + } private async Task AddNewPatient() { var options = new ModalOptions() @@ -379,7 +421,6 @@ _selectedPatient = nuevo; } } - private async Task AddNewProfessional() { var options = new ModalOptions() @@ -427,25 +468,6 @@ toastService.ShowToast(_parameters); Navigation.NavigateTo(returnUrl); } - - private async Task AddNewTax() - { - var parameters = new ModalParameters(); - parameters.Add(nameof(QuoteTaxQuickAddModal.NetAmount), _netAmount); - var options = new ModalOptions - { - HideHeader = true, - Size = ModalSize.Small - }; - var modal = Modal.Show("", parameters, options); - var result = await modal.Result; - - if (!result.Cancelled && result.Data is EQuoteTax newTax) - { - _quoteModel.PhSQuoteTaxes.Add(newTax); - RecalculateTotals(); - } - } private Task OnCustomerSelected(ELookUpItem item) => SetLookupSelection(item, sel => _selectedCustomer = sel, id => _quoteModel.CustomerId = id); private Task OnPersonSelected(ELookUpItem item) diff --git a/phronCare.UIBlazor/Services/Lookups/ISalesLookupService .cs b/phronCare.UIBlazor/Services/Lookups/ISalesLookupService .cs index ba876ea..5e50c93 100644 --- a/phronCare.UIBlazor/Services/Lookups/ISalesLookupService .cs +++ b/phronCare.UIBlazor/Services/Lookups/ISalesLookupService .cs @@ -13,5 +13,6 @@ namespace phronCare.UIBlazor.Services.Lookups Task> SearchProductsAsync(string filtro); Task> GetAdjustmentReasonsAsync(); Task> GetTaxTypesAsync(); + Task> GetPaymentTermsAsync(); } } diff --git a/phronCare.UIBlazor/Services/Lookups/SalesLookupService.cs b/phronCare.UIBlazor/Services/Lookups/SalesLookupService.cs index 826437e..59edd2f 100644 --- a/phronCare.UIBlazor/Services/Lookups/SalesLookupService.cs +++ b/phronCare.UIBlazor/Services/Lookups/SalesLookupService.cs @@ -54,7 +54,10 @@ namespace phronCare.UIBlazor.Services.Lookups var items = await _http.GetFromJsonAsync("api/taxtype/getall"); return items ?? Array.Empty(); } - - + public async Task> GetPaymentTermsAsync() + { + var items = await _http.GetFromJsonAsync("api/lookup/paymentterms?q="); + return items ?? Array.Empty(); + } } }