api discount and change tax
This commit is contained in:
16
app/controllers/api/change_tax_controller.rb
Normal file
16
app/controllers/api/change_tax_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Api::ChangeTaxController < Api::ApiController
|
||||
|
||||
def index
|
||||
sale_id = params[:sale_id]
|
||||
group_type = params[:group_type]
|
||||
tax_type = params[:tax_type].present? ? params[:tax_type] : "no_tax"
|
||||
|
||||
sale = Sale.find(sale_id)
|
||||
|
||||
sale.compute_by_sale_items(sale.total_discount, nil, group_type, tax_type)
|
||||
|
||||
remark = "Change tax to #{tax_type} for Sale ID #{sale_id} By #{current_login_employee.name}"
|
||||
SaleAudit.record_audit_change_tax(sale_id,remark,current_login_employee.name)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user