fix shift_sale double update

This commit is contained in:
Thein Lin Kyaw
2020-06-23 10:29:46 +06:30
parent 3e27990ac4
commit 276e437a07
4 changed files with 19 additions and 34 deletions

View File

@@ -39,15 +39,13 @@ class Transactions::ShiftSalesController < ApplicationController
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
#other payment details for mpu or visa like card
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
@other_payment = ShiftSale.get_by_shift_other_payment(@shift).first
@payment_methods = PaymentMethodSetting.where(is_active: true).pluck(:payment_method)
# Calculate price_by_accounts
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @shift }