Hi all,
We've customized invoicelist.cshtml to include additional filtering based on custom data from Business Central, specifically using the ICC_filterCompletelyPaid property to filter whether invoices are paid or not.
The filtering itself is working fine, but we're running into an issue with pagination. The pagination logic currently looks like this:
This is designed to calculate the total number of pages based on all invoices, not just the filtered ones.
/Files/Templates/Designs/Swift/eCom/IntegrationCustomerCenter/CustomerCenterPagination.cshtml
var customerCenterPages = GetLoop("Ecom:IntegrationCustomerCenter.Paging.Pages");
//rest of code
// uses customerCenterPages.Count() aka all pages
@foreach (var trunkPage in GetTruncatedPagination(currentPageNumber, customerCenterPages.Count()))
{
}
Question:
How can we adjust or replace this logic so that it only counts and paginates the filtered invoices?
Any pointers or examples would be greatly appreciated!
Thanks in advance,