|
Lines 229-234
Link Here
|
| 229 |
"title": _("Booking ID"), |
229 |
"title": _("Booking ID"), |
| 230 |
"visible": false |
230 |
"visible": false |
| 231 |
}, |
231 |
}, |
|
|
232 |
{ |
| 233 |
data: "", |
| 234 |
title: __("Status"), |
| 235 |
name: "status", |
| 236 |
searchable: true, |
| 237 |
orderable: true, |
| 238 |
visible: false, |
| 239 |
render: function (data, type, row, meta) { |
| 240 |
let is_expired = dayjs(row.end_date).isBefore(new Date()); |
| 241 |
if (is_expired) { |
| 242 |
return '<span class="badge rounded-pill bg-secondary">' + __("Expired") + '</span>'; |
| 243 |
} |
| 244 |
|
| 245 |
return '<span class="badge rounded-pill bg-success">' + __("Active") + '</span>'; |
| 246 |
} |
| 247 |
}, |
| 232 |
{ |
248 |
{ |
| 233 |
"data": "item.external_id", |
249 |
"data": "item.external_id", |
| 234 |
"title": _("Item"), |
250 |
"title": _("Item"), |
|
Lines 309-315
Link Here
|
| 309 |
filter_expired = true; |
325 |
filter_expired = true; |
| 310 |
$(this).html('<i class="fa fa-bars"></i> '+txtActivefilter); |
326 |
$(this).html('<i class="fa fa-bars"></i> '+txtActivefilter); |
| 311 |
} |
327 |
} |
| 312 |
bookings_table.DataTable().draw(); |
328 |
|
|
|
329 |
bookings_table.DataTable().ajax.reload(() => { |
| 330 |
bookings_table |
| 331 |
.DataTable() |
| 332 |
.column("status:name") |
| 333 |
.visible(!filter_expired, false); |
| 334 |
}); |
| 313 |
$(this).toggleClass('filtered'); |
335 |
$(this).toggleClass('filtered'); |
| 314 |
}); |
336 |
}); |
| 315 |
|
337 |
|