finished customer to sale assign in crm

This commit is contained in:
Aung Myo
2017-06-08 13:41:11 +06:30
parent 7f8d3381b2
commit 8a5fcadb69
11 changed files with 190 additions and 39 deletions

View File

@@ -10,17 +10,31 @@ class Crm::HomeController < BaseCrmController
end
#print for crm
def print
def print_order
@booking = Booking.find(params[:id])
unique_code="CrmOrderPdf"
#print_settings = PrintSetting.find_by_unique_code(unique_code)
print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new()
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_crm_order(@booking)
printer.print_crm_order(@booking,print_settings)
end
def update_sale_by_customer
sale = Sale.find(params[:sale_id])
status = sale.update_attributes(customer_id: params[:customer_id])
if status == true
render json: JSON.generate({:status => true})
else
render json: JSON.generate({:status => false, :error_message => "Record not found"})
end
end
end