fix toggle_all sepa_exported when only one is downloaded
This commit is contained in:
parent
24c25b5278
commit
fc46281de8
2 changed files with 14 additions and 5 deletions
|
@ -39,10 +39,19 @@ function doTheDownload(selectedGroupOrderIds, orderId, url, supplier, mode = "al
|
|||
var modalSelector = "#order_" + orderId + "_modal";
|
||||
|
||||
// Update the value attribute of checkboxes with IDs starting with "sepa_downloaded" to '1'
|
||||
if (selectedGroupOrderIds.length >= 1) {
|
||||
selectedGroupOrderIds.forEach(function (groupOrderId) {
|
||||
var modalSelector = "#group_order_" + groupOrderId;
|
||||
checkbox_element = $(modalSelector + ' input[id^="sepa_downloaded"]');
|
||||
checkbox_element.val('1');
|
||||
checkbox_element.prop('checked', true);
|
||||
});
|
||||
} else {
|
||||
$(modalSelector + ' input[id^="sepa_downloaded"]').each(function () {
|
||||
$(this).val('1');
|
||||
$(this).prop('checked', true);
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
// Handle error
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
%tbody
|
||||
- order.group_orders.includes([:group_order_invoice, :ordergroup]).each do |go|
|
||||
- if go.group_order_invoice
|
||||
%tr.order-row
|
||||
%tr.order-row{id: "group_order_#{go.id}"}
|
||||
%td= link_to go.ordergroup.name, edit_admin_ordergroup_path(go.ordergroup)
|
||||
%td
|
||||
.div{id: "paid_#{go.group_order_invoice.id}"}
|
||||
|
|
Loading…
Reference in a new issue