From 167050f80b423451fd9dd0b5d0d147f30e2bb321 Mon Sep 17 00:00:00 2001 From: Worktree Fix Verifier Date: Mon, 10 Aug 2026 20:14:42 +0200 Subject: [PATCH] fix(pleno-vue): sort OpenCustomerInvoiceTable flattened orders by id ASC OpenCustomerInvoiceTable.getOrders concatenates orders across the customer's open_invoices entries without sorting. The downstream InvoiceOrderTable renders the resulting array in whatever order the parent arrived in, so the rendered transaction table is non-deterministic across page loads. Add a defensive ascending sort by id before returning the list. --- .../superuser/tables/OpenCustomerInvoiceTable.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/displays/superuser/tables/OpenCustomerInvoiceTable.vue b/src/components/displays/superuser/tables/OpenCustomerInvoiceTable.vue index 5fcb7035..8b9426d0 100644 --- a/src/components/displays/superuser/tables/OpenCustomerInvoiceTable.vue +++ b/src/components/displays/superuser/tables/OpenCustomerInvoiceTable.vue @@ -50,7 +50,16 @@ const getOrders = (object) => { let invoice_orders = invoice.objects; orders = orders.concat(invoice_orders); } - return orders; + return orders + .slice() + .sort((left, right) => { + const leftId = Number.parseInt(String(left?.id ?? ""), 10); + const rightId = Number.parseInt(String(right?.id ?? ""), 10); + if (Number.isInteger(leftId) && Number.isInteger(rightId)) { + return leftId - rightId; + } + return String(left?.id ?? "").localeCompare(String(right?.id ?? "")); + }); } getDepartments();