fixed conflictsale item order order item

This commit is contained in:
Aung Myo
2017-06-04 16:51:38 +06:30
61 changed files with 455 additions and 137 deletions

View File

@@ -1,10 +1,14 @@
class SaleItem < ApplicationRecord
#primary key - need to be unique generated for multiple shops
before_create :generate_custom_id
belongs_to :sale
#compute items - discount, tax, price_change
def compute_item
end
def self.get_order_items_details(sale_id)
sale_orders = SaleOrder.where("sale_id=?",sale_id)
if sale_orders
@@ -17,5 +21,10 @@ class SaleItem < ApplicationRecord
else
return false
end
private
def generate_custom_id
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
end
end