From 5c70eb11e3fb79df9d8d9dca2d7d9cd0ddb1a05d 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 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. --- .../prog/en/modules/acqui/parcel.tt | 665 ++++++++++++------ 1 file changed, 433 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 d23ab7a4f62..967043f6078 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -34,16 +34,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 datereceived %] Receipt summary for [% name | html %] [% IF ( invoice ) %] [ [% invoice | html %] ] [% END %] on [% datereceived | $KohaDates %] @@ -55,12 +55,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) %] @@ -92,124 +92,30 @@

Invoice number: [% invoice | html %] Received by: [% logged_in_user.userid | html %] On: [% datereceived | $KohaDates %]

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

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