fix balancing and matrix since receive
This commit is contained in:
parent
0128f72103
commit
2c85618284
2 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ class OrderMatrix < OrderPdf
|
||||||
a.article.unit,
|
a.article.unit,
|
||||||
a.price.unit_quantity,
|
a.price.unit_quantity,
|
||||||
number_with_precision(a.price.fc_price, precision: 2),
|
number_with_precision(a.price.fc_price, precision: 2),
|
||||||
a.units_to_order]
|
a.units]
|
||||||
end
|
end
|
||||||
|
|
||||||
table order_articles_data, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|
|
table order_articles_data, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|
|
||||||
|
|
|
@ -124,7 +124,7 @@ class Order < ActiveRecord::Base
|
||||||
total = 0
|
total = 0
|
||||||
if type == :net || type == :gross || type == :fc
|
if type == :net || type == :gross || type == :fc
|
||||||
for oa in order_articles.ordered.includes(:article, :article_price)
|
for oa in order_articles.ordered.includes(:article, :article_price)
|
||||||
quantity = oa.units_to_order * oa.price.unit_quantity
|
quantity = oa.units * oa.price.unit_quantity
|
||||||
case type
|
case type
|
||||||
when :net
|
when :net
|
||||||
total += quantity * oa.price.price
|
total += quantity * oa.price.price
|
||||||
|
|
Loading…
Reference in a new issue