Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix validation

  • Loading branch information...
commit a634c36ab781cc7b1fb81338a70d6cc5ff6a3501 1 parent 1e57af2
gerald authored March 27, 2012
2  app/models/finished_good_transaction.rb
@@ -72,7 +72,7 @@ def taken_bag_range
72 72
   
73 73
   def released_bag_range
74 74
     self.finished_good_transaction_items.each do |item|
75  
-      if item.transaction_type == "sub" && Bag.count(:include => [:finished_good_transaction_item], :conditions => ["removing_transaction_id IS NOT NULL AND bag_number >= ? AND bag_number <= ? AND finished_good_transaction_items.lot_number = ?", item.start_bag_number, item.end_bag_number, item.lot_number]) > 0
  75
+      if item.transaction_type == "sub" && Bag.count(:include => [:finished_good_transaction_item, :finished_good], :conditions => ["removing_transaction_id IS NOT NULL AND bag_number >= ? AND bag_number <= ? AND finished_good_transaction_items.lot_number = ? AND finished_goods.id = ?", item.start_bag_number, item.end_bag_number, item.lot_number, self.finished_good_id]) > 0
76 76
         self.errors.add(:base, "Current range will use bag numbers that have already been released") 
77 77
         return
78 78
       end

0 notes on commit a634c36

Please sign in to comment.
Something went wrong with that request. Please try again.