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 <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2023-11-14 14:52:51 +00:00 committed by Katrin Fischer
parent f4498d54ac
commit a2fb53a719
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 12 additions and 4 deletions

View File

@ -114,7 +114,13 @@
"searchable": true,
"orderable": true,
"render": function(data, type, row, meta) {
return '<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid="'+row.vendor_id+'>'+row.vendor.name+'</a>';
let link;
if ( row.vendor ) {
link = '<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid='+row.vendor_id+'">'+row.vendor.name+'</a>';
} else {
link = '<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid='+row.vendor_id+'">'+row.vendor_id+'</a>';
}
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 '<a href="/cgi-bin/koha/acqui/basket.pl?basketno='+row.basked_id+'">Basket: '+row.basket_id+'</a>';
if ( row.basket_id ) {
rendered = '<a href="/cgi-bin/koha/acqui/basket.pl?basketno='+row.basket_id+'">Basket: '+row.basket_id+'</a>';
}
} else {
return '<a href="/cgi-bin/koha/acqui/invoices.pl?message_id='+row.id+'&op=do_search">Invoices</a>';
rendered = '<a href="/cgi-bin/koha/acqui/invoices.pl?message_id='+row.id+'&op=do_search">Invoices</a>';
}
return rendered;
}
},
{