Skip to content

Commit

Permalink
Implement default payment term pre-selection for the 'Create Invoice'…
Browse files Browse the repository at this point in the history
… form, ensuring seamless data flow from the server to the view.
  • Loading branch information
denys-olleik committed Dec 11, 2024
1 parent a55bfb8 commit 92a4d92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Accounting/Controllers/InvoiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ private async Task<CreateInvoiceViewModel> InitializeCreateInvoiceViewModel()
{
int orgId = GetOrganizationId();

var paymentTerms = await GetAllPaymentTerms();
var defaultPaymentTerm = paymentTerms.FirstOrDefault();

var model = new CreateInvoiceViewModel
{
Customers = await GetAllCustomersWithAddresses(),
PaymentTerms = await GetAllPaymentTerms(),
PaymentTerms = paymentTerms,
SelectedPaymentTerm = defaultPaymentTerm,
InvoiceDate = DateTime.UtcNow,
InvoiceStatuses = Invoice.InvoiceStatusConstants.All.ToList(),
ProductsAndServices = await GetAllProductsAndServices(orgId),
Expand Down

0 comments on commit 92a4d92

Please sign in to comment.