From 2c8561828426f64484e5815a35789c92540f10b0 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 13 Feb 2014 15:59:04 +0100 Subject: [PATCH] fix balancing and matrix since receive --- app/documents/order_matrix.rb | 2 +- app/models/order.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/documents/order_matrix.rb b/app/documents/order_matrix.rb index f43d490b..52270a12 100644 --- a/app/documents/order_matrix.rb +++ b/app/documents/order_matrix.rb @@ -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| diff --git a/app/models/order.rb b/app/models/order.rb index 087bf450..feb913ee 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -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