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
|
|
@ -14,15 +14,15 @@
|
|||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{:class => cycle("even","odd", :name => "order")}
|
||||
%tr{:class => cycle("even","odd", :name => "order"), 'data-order_id' => order.id}
|
||||
%td= link_to truncate(order.name), new_finance_order_path(order_id: order.id)
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
%td= order.closed? ? t('.cleared', amount: number_to_currency(order.foodcoop_result)) : t('.ended')
|
||||
%td= show_user(order.updated_by)
|
||||
%td{id: "generate-invoice#{order.id}"}
|
||||
%td{id: "group-order-invoices-for-order-#{order.id}", class: 'expand-trigger'}
|
||||
- if order.closed?
|
||||
-if FoodsoftConfig[:contact][:tax_number] && order.ordergroups.present?
|
||||
= render :partial => 'group_order_invoices/links', locals:{order: order}
|
||||
= link_to I18n.t('activerecord.attributes.group_order_invoice.open_details_modal'), "#", remote: true, class: 'btn btn-small'
|
||||
-else
|
||||
= I18n.t('activerecord.attributes.group_order_invoice.tax_number_not_set')
|
||||
- else
|
||||
|
|
@ -35,5 +35,22 @@
|
|||
- else
|
||||
= link_to t('orders.index.action_receive'), '#', class: 'btn btn-small disabled'
|
||||
= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-small btn-primary'
|
||||
%tr{:class => 'expanded-row', :id => "expanded-row-#{order.id}", :style => 'display: none;'}
|
||||
%td{:colspan => '6'}
|
||||
= render partial: 'group_order_invoices/modal', locals: { order: order }
|
||||
- else
|
||||
%i= t('.no_closed_orders')
|
||||
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
$('.expand-trigger').click(function() {
|
||||
var orderId = $(this).closest('tr').data('order_id');
|
||||
var expandedRow = $('#expanded-row-' + orderId);
|
||||
|
||||
// Toggle visibility of the expanded row
|
||||
expandedRow.slideToggle();
|
||||
|
||||
return false; // Prevent the default behavior of the link
|
||||
});
|
||||
});
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
- if FinancialTransactionType.has_multiple_types
|
||||
%p
|
||||
%b= heading_helper FinancialTransaction, :financial_transaction_type
|
||||
= select_tag :type, options_for_select(FinancialTransactionType.order(:name).map { |t| [ t.name, t.id ] })
|
||||
= select_tag :type, options_for_select(FinancialTransactionType.order(:name).map { |t| [ t.name, t.id ] }, selected: FoodsoftConfig[:group_order_invoices]&.[](:payment_method))
|
||||
%table.table.table-striped{:style => "width:35em"}
|
||||
- for group_order in @order.group_orders
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue