Developer forum

Forum » Swift » Reverse sorting of invoices

Reverse sorting of invoices

Caro De Weze
Reply

Hi,

How can I easily reverse the sorting of invoices? Now they are shown from oldest to newest, so the last page shows the latest invoice (in this case you have to go to tab 282):

Fyi, I have also seen that the link to an invoice detail page does not work. For this I made the following adjustment in InvoicesList.cshtml (/Swift/Files/Templates/Designs/Swift/eCom/IntegrationCustomerCenter/InvoicesList_Nussbaumer.cshtml):
string baseUrl = "/Default.aspx?ID=2234";
<a href="@baseUrl@GetString("Ecom:IntegrationCustomerCenter.Invoice.Link")&itemID=@orderId" class="btn btn-link p-0" title="@Translate("View details")"><span class="icon-2">@ReadFile(iconPath + "external-link.svg")</span></a>
<a href="@baseUrl@GetString("Ecom:IntegrationCustomerCenter.Invoice.Link")&itemID=@orderId" class="btn p-0 text-start" title="@Translate("View order")">@orderDate</a>
<a href="@baseUrl@GetString("Ecom:IntegrationCustomerCenter.Invoice.Link")&itemID=@orderId" class="btn p-0 text-start" title="@Translate("View order")">@Translate("No.") @orderId</a>

Kind regards,
Caro De Weze


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi,

to change the ordering you need to pass the following parameters to your request string for the GetList requests: ICCSortByField, ICCSortByDirection,
so smth the url needs to be like that:  http://website.com/Default.aspx?ID=1649&pn8703=1&ICCSortByField=&ICCSortByDirection=DESC
It can also be done inside the template used for the invoices list (usually called InvoicesList.html in the old Rapido templates):
<input type="hidden" name="ICCSortByField" value="" />
<input type="hidden" name="ICCSortByDirection" value="Desc" />

You can read more about possible values for those fields in this post:
https://doc.dynamicweb.com/forum/integration/integration/integration-customer-center-sort-order-new-fields
https://doc.dynamicweb.com/Default.aspx?ID=12877#22328

BR, Dmitrij

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Caro

The default sorting of this list should be as you expect in newer versions of the BC Code unit. Can you tell us what version you are using in which ERP?

BR Nicolai

 

You must be logged in to post in the forum