changing view for group_order_invoices
testing ui of goi restructuring
This commit is contained in:
parent
de6643722a
commit
90c5450525
52 changed files with 783 additions and 57 deletions
20
app/views/shared/_sepa_account_holder.html.haml
Normal file
20
app/views/shared/_sepa_account_holder.html.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
= f.simple_fields_for :sepa_account_holder, @ordergroup.sepa_account_holder || @ordergroup.build_sepa_account_holder do |sepa_f|
|
||||
= sepa_f.input :user_id, collection: f.object.users.map { |user| [user.name, user.id, { 'data-iban' => user.iban, 'data-bic' => user.bic }] }, selected: sepa_f.object.user_id, as: :select, label: 'SEPA Account Holder', include_blank: true, input_html: { id: 'user_id_select' }
|
||||
= sepa_f.hidden_field :group_id, value: @ordergroup.id
|
||||
= sepa_f.input :iban
|
||||
= sepa_f.input :bic
|
||||
= sepa_f.input :mandate_id
|
||||
= sepa_f.input :mandate_date_of_signature, as: :date_picker
|
||||
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
$('#user_id_select').on('change', function() {
|
||||
var selectedOption = $(this).find('option:selected');
|
||||
var iban = selectedOption.data('iban');
|
||||
var bic = selectedOption.data('bic');
|
||||
|
||||
$('#ordergroup_sepa_account_holder_attributes_iban').val(iban || ''); // Update the IBAN input field
|
||||
$('#ordergroup_sepa_account_holder_attributes_bic').val(bic || ''); // Update the BIC input field
|
||||
});
|
||||
});
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
= f.input :phone
|
||||
- if FoodsoftConfig[:use_iban]
|
||||
= f.input :iban
|
||||
= f.input :bic
|
||||
|
||||
- if local_assigns[:with_address] && (f.object.ordergroup || f.object.new_record?)
|
||||
= f.fields_for [:ordergroup, f.object.ordergroup || Ordergroup.new] do |ogf|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue