From 003b10ec0f3161afce9aee4913efe692139b5d59 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 10 Mar 2020 16:03:50 -0300 Subject: [PATCH] Bug 20212: Use API to render orders datatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes the pending orders datatable render using the API instead of hte old controller script. It implements native server-side pagination thanks to the API and the datatables wrapper. On polishing it, we found that data can contain many null values, and it got dirtier in the process. This code with all the checks that are done on the data is the result of testing this dev with real-life production databases, huge ones with thousands of orderlines. To test: 1. You should compare the behaviour between this table, and the original one in master. Signed-off-by: Séverine QUEUNE Signed-off-by: Andrew Fuerste-Henry --- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 664 ++++++++++++++------- 1 file changed, 432 insertions(+), 232 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 5ed19898a7..0899a4fdbf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -39,16 +39,16 @@
- [% IF ( receive_error ) %] -
-

Error adding items:

-
    - [% FOREACH error_loo IN error_loop %] -
  • [% error_loo.error_param | html %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %]
  • - [% END %] -
-
- [% END %] + [% IF ( receive_error ) %] +
+

Error adding items:

+
    + [% FOREACH error_loo IN error_loop %] +
  • [% error_loo.error_param | html %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %]
  • + [% END %] +
+
+ [% END %]

[% IF ( invoiceclosedate ) %] Receipt summary for [% name | html %] [% IF ( invoice ) %] [ [% invoice | html %] ] [% END %] @@ -60,12 +60,12 @@ [% IF ( success_delorder ) %]
The order has been successfully canceled.
[% ELSE %] - [% IF ( error_delitem ) %] -
The order has been canceled, although one or more items could not have been deleted.
- [% END %] - [% IF ( error_delbiblio ) %] -
The order has been canceled, although the record has not been deleted.
- [% END %] + [% IF ( error_delitem ) %] +
The order has been canceled, although one or more items could not have been deleted.
+ [% END %] + [% IF ( error_delbiblio ) %] +
The order has been canceled, although the record has not been deleted.
+ [% END %] [% END %] [% IF (error_cancelling_receipt) %] @@ -97,124 +97,30 @@

Invoice number: [% invoice | html %] Shipment date: [% shipmentdate | $KohaDates %]

[% UNLESS (invoiceclosedate) %] - + + + [% ELSE %]

Invoice is closed, so you can't receive orders anymore. @@ -372,12 +278,12 @@ [% END %] - [% END %] - + [% END %] + - [% ELSE %]There are no received orders.[% END %] + [% ELSE %]There are no received orders.[% END %]