change tax profile overide
This commit is contained in:
@@ -96,6 +96,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
cash = params[:cash]
|
||||
sale_id = params[:sale_id]
|
||||
member_info = nil
|
||||
type = params[:type]
|
||||
tax_type = params[:tax_type]
|
||||
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
@@ -298,11 +300,18 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
# accounts = @customer.tax_profiles
|
||||
accounts = TaxProfile.where("group_type = ?",@cashier_type).order("order_by ASC")
|
||||
@account_arr =[]
|
||||
@tax_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc.id)
|
||||
@account_arr.push(account.name)
|
||||
# @account_arr.push(account)
|
||||
@tax_arr.push(account.name)
|
||||
end
|
||||
sale_taxes = SaleTax.where("sale_id = ?", saleObj.sale_id)
|
||||
if !sale_taxes.empty?
|
||||
sale_taxes.each do |sale_tax|
|
||||
@account_arr.push(sale_tax)
|
||||
end
|
||||
end
|
||||
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
# get member information
|
||||
if @customer.membership_id != nil && rebate
|
||||
@@ -571,4 +580,15 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
render :json => result.to_json
|
||||
# render :json => {status: true}
|
||||
end
|
||||
|
||||
#changable tax for sale
|
||||
def change_tax
|
||||
sale_id = params[:sale_id]
|
||||
order_source = params[:cashier_type]
|
||||
tax_type = params[:tax_type]
|
||||
sale = Sale.find(sale_id)
|
||||
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount,nil,order_source,tax_type)
|
||||
|
||||
render json: JSON.generate({:status => true})
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user