Promotion Product Bug Fix
This commit is contained in:
@@ -3,7 +3,7 @@ class Promotion < ApplicationRecord
|
||||
|
||||
has_many :promotion_products
|
||||
|
||||
accepts_nested_attributes_for :promotion_products , :allow_destroy => true
|
||||
accepts_nested_attributes_for :promotion_products , :allow_destroy => true , update_only: true
|
||||
|
||||
PROMO_TYPE1 = "Quantity"
|
||||
PROMO_TYPE2 = "Net_off" # 3000 => - 500 => 2500 [total]
|
||||
@@ -204,6 +204,6 @@ class Promotion < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.calculate_discount(total, discount)
|
||||
self (total.to_i * discount.to_i) / 100
|
||||
return (total.to_i * discount.to_i) / 100
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user