move automatic invoices to plugin

changes on deposit calculation

tiny changes on group order invoice pdf
This commit is contained in:
viehlieb 2023-10-10 23:11:34 +02:00
parent 42a1773a87
commit e78d1ad072
67 changed files with 5579 additions and 69 deletions

View file

@ -8,6 +8,7 @@ class Finance::BalancingController < Finance::BaseController
flash.now.alert = t('.alert') if @order.closed?
@comments = @order.comments
@articles = @order.order_articles.ordered_or_member.includes(:article, :article_price,
group_order_articles: { group_order: :ordergroup })
@ -24,7 +25,6 @@ class Finance::BalancingController < Finance::BaseController
else
@articles
end
render layout: false if request.xhr?
end

View file

@ -0,0 +1 @@
= render partial: 'finance/balancing/edit_results_by_articles', locals: {order: @order, articles: @articles, comments: @comments }

View file

@ -36,28 +36,28 @@
%th= heading_helper Article, :tax
%th= heading_helper Article, :deposit
%th{:colspan => "2"}
- unless @order.closed?
- unless order.closed?
.btn-group
= link_to t('.add_article'), new_order_order_article_path(@order), remote: true,
= link_to t('.add_article'), new_order_order_article_path(order), remote: true,
class: 'btn btn-small'
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-small dropdown-toggle' do
%span.caret
%ul.dropdown-menu
%li= link_to t('.add_article'), new_order_order_article_path(@order), remote: true
%li= link_to t('.edit_transport'), edit_transport_finance_order_path(@order), remote: true
%li= link_to t('.add_article'), new_order_order_article_path(order), remote: true
%li= link_to t('.edit_transport'), edit_transport_finance_order_path(order), remote: true
%tbody.list#result_table
- for order_article in @articles.select { |oa| oa.units > 0 }
- for order_article in articles.select { |oa| oa.units > 0 }
= render :partial => "order_article_result", :locals => {:order_article => order_article}
%tr
%td{ colspan: 10 } The following were not ordered
- for order_article in @articles.select { |oa| oa.units == 0 }
- for order_article in articles.select { |oa| oa.units == 0 }
= render :partial => "order_article_result", :locals => {:order_article => order_article}
- if @order.transport
- if order.transport
%tr
%td{ colspan: 5 }= heading_helper Order, :transport
%td{ colspan: 3, data: {value: @order.transport} }= number_to_currency(@order.transport)
%td= link_to t('ui.edit'), edit_transport_finance_order_path(@order), remote: true,
%td{ colspan: 3, data: {value: order.transport} }= number_to_currency(order.transport)
%td= link_to t('ui.edit'), edit_transport_finance_order_path(order), remote: true,
class: 'btn btn-mini' unless order_article.order.closed?

View file

@ -1,6 +1,7 @@
%td.closed.name
= link_to order_article.article.name, '#', 'data-toggle-this' => "#group_order_articles_#{order_article.id}"
%td= order_article.article.order_number
-# :plain => true destroys deface functionality
%td{title: units_history_line(order_article, :plain => true)}
= order_article.units
= pkg_helper order_article.article_price
@ -22,6 +23,6 @@
%td
= link_to t('ui.edit'), edit_order_order_article_path(order_article.order, order_article), remote: true,
class: 'btn btn-mini' unless order_article.order.closed?
%td
%td.end
= link_to t('ui.delete'), order_order_article_path(order_article.order, order_article), method: :delete,
remote: true, data: {confirm: t('.confirm')}, class: 'btn btn-danger btn-mini' unless order_article.order.closed?

View file

@ -6,7 +6,7 @@
%tr
%td= t('.net_amount')
%td.numeric= number_to_currency(order.sum(:net))
%tr
%tr.gross-amount
%td= t('.gross_amount')
%td.numeric= number_to_currency(order.sum(:gross))
%tr

View file

@ -77,5 +77,6 @@
remote: true
%section#results
= render 'edit_results_by_articles'
= render partial: 'article_results', locals: { order: @order, articles: @articles, comments: @comments }
%p= link_to_top

View file

@ -1 +1 @@
= render 'form'
= render 'form'

View file

@ -35,9 +35,8 @@
%td= "#{order_article.quantity} + #{order_article.tolerance}"
- else
%td= "#{order_article.quantity}"
%td{title: units_history_line(order_article, plain: true)}
= units
= pkg_helper order_article.price
= render "units_history", order_article: order_article, units: units
%p
= t '.prices_sum'
= "#{number_to_currency(total_net)} / #{number_to_currency(total_gross)}"

View file

@ -0,0 +1,3 @@
%td{title: units_history_line(order_article, plain: true)}
= units
= pkg_helper order_article.price