From a2fb53a719f46bd58f23812f16b3d379178f219d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 14 Nov 2023 14:52:51 +0000 Subject: [PATCH] Bug 30070: (follow-up) Further javascript fixes This fixes an issue with the datatables when a message file is found to be missing the linked vendor or basket details. This removes the datatables error: DataTables warning: table id=edi_msgs - Requested unknown parameter '4' for row 12, column 4. Signed-off-by: Katrin Fischer --- .../prog/en/modules/acqui/edifactmsgs.tt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt index 7ce04d7704..dcc1143dc8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -114,7 +114,13 @@ "searchable": true, "orderable": true, "render": function(data, type, row, meta) { - return ''+row.vendor.name+''; + let link; + if ( row.vendor ) { + link = ''+row.vendor.name+''; + } else { + link = ''+row.vendor_id+''; + } + return link; } }, { @@ -122,13 +128,15 @@ "searchable": false, "orderable": false, "render": function(data, type, row, meta) { + let rendered = ''; if ( row.type == 'QUOTE' || row.type == 'ORDERS' ) { - if ( row.basked_id ) { - return 'Basket: '+row.basket_id+''; + if ( row.basket_id ) { + rendered = 'Basket: '+row.basket_id+''; } } else { - return 'Invoices'; + rendered = 'Invoices'; } + return rendered; } }, { -- 2.39.5