commission in sale edit

This commit is contained in:
Zin Lin Phyo
2017-08-25 13:44:22 +06:30
parent 283c59c5dc
commit b4eb27b8a9
16 changed files with 417 additions and 422 deletions

View File

@@ -5,6 +5,7 @@ class SaleItem < ApplicationRecord
before_create :generate_custom_id
belongs_to :sale
has_many :product_commissions
#compute items - discount, tax, price_change
def compute_item
@@ -80,7 +81,7 @@ class SaleItem < ApplicationRecord
account_price[:amount] = account_price[:amount] + si.price
price = price + si.price
end
end
rebate_arr.push(account_price)
end