fix deposit is net value
This commit is contained in:
parent
f29ab603b6
commit
90e06a475f
10 changed files with 75 additions and 34 deletions
|
|
@ -6,6 +6,8 @@
|
|||
%th= t '.prices'
|
||||
- if order.stockit?
|
||||
%th= t '.units_ordered'
|
||||
- if FoodsoftConfig[:group_order_invoices]&.[](:separate_deposits)
|
||||
%th= t '.deposit'
|
||||
- else
|
||||
%th= 'Members'
|
||||
%th= t '.units_full'
|
||||
|
|
@ -19,7 +21,10 @@
|
|||
%td{:colspan => "9"}
|
||||
- order_articles.each do |order_article|
|
||||
- net_price = order_article.price.price
|
||||
- gross_price = order_article.price.gross_price
|
||||
- if FoodsoftConfig[:group_order_invoices]&.[](:separate_deposits)
|
||||
- gross_price = order_article.price.gross_price_without_deposit
|
||||
- else
|
||||
- gross_price = order_article.price.gross_price
|
||||
- unit_quantity = order_article.price.unit_quantity
|
||||
- units = order_article.units
|
||||
- total_net += units * unit_quantity * net_price
|
||||
|
|
@ -28,6 +33,8 @@
|
|||
%td.name=h order_article.article.name
|
||||
%td= order_article.article.unit
|
||||
%td= "#{number_to_currency(net_price)} / #{number_to_currency(gross_price)}"
|
||||
- if FoodsoftConfig[:group_order_invoices]&.[](:separate_deposits)
|
||||
%td= "#{number_to_currency(order_article.price.deposit)}"
|
||||
- if order.stockit?
|
||||
%td= units
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
= raw t '.description2',
|
||||
ordergroups: ordergroup_count(@order),
|
||||
article_count: @order.order_articles.ordered.count,
|
||||
net_sum: number_to_currency(@order.sum(:net)),
|
||||
gross_sum: number_to_currency(@order.sum(:gross))
|
||||
net_sum: number_to_currency(@order.sum(:net) + @order.sum(:net_deposit)),
|
||||
gross_sum: number_to_currency(@order.sum(:fc))
|
||||
|
||||
- unless @order.comments.blank?
|
||||
= link_to t('.comments_link'), '#comments'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue