fix balancing and matrix since receive

This commit is contained in:
wvengen 2014-02-13 15:59:04 +01:00
parent 0128f72103
commit 2c85618284
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ class OrderMatrix < OrderPdf
a.article.unit,
a.price.unit_quantity,
number_with_precision(a.price.fc_price, precision: 2),
a.units_to_order]
a.units]
end
table order_articles_data, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|

View File

@ -124,7 +124,7 @@ class Order < ActiveRecord::Base
total = 0
if type == :net || type == :gross || type == :fc
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
when :net
total += quantity * oa.price.price