assign table ,membership transaction and queue

This commit is contained in:
Aung Myo
2017-06-21 16:22:53 +06:30
parent 6c4c817453
commit 7c5456d712
16 changed files with 502 additions and 311 deletions

View File

@@ -47,14 +47,7 @@ class Crm::CustomersController < BaseCrmController
#get customer amount
@customer = Customer.find(params[:id])
response = Customer.get_member_account(@customer)
if(response["status"] == true)
@membership = response["data"]
else
@membership = 0
end
@response = Customer.get_membership_transactions(@customer)
#end customer amount
end
@@ -180,7 +173,7 @@ end
else
flash[:errors] = @crm_customers.errors
flash[:errors] = @crm_customer.errors
format.html { redirect_to crm_customers_path}
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
end

View File

@@ -84,12 +84,15 @@ class Crm::DiningQueuesController < BaseCrmController
queue = DiningQueue.find(params[:id])
table_id = params[:table_id]
queue.update_attributes(dining_facility_id: table_id,status:"Assign")
DiningFacility.find(table_id).update_attributes(status: "occupied")
respond_to do |format|
format.html { redirect_to crm_dining_queues_path, notice: 'Table was successfully assigned.' }
format.json { head :no_content }
end
status = queue.update_attributes(dining_facility_id: table_id,status:"Assign")
status = DiningFacility.find(table_id).update_attributes(status: "occupied")
if status == true
render json: JSON.generate({:status => true , notice: 'Dining queue was successfully assigned .'})
else
render json: JSON.generate({:status => false, :error_message => "Record not found"})
end
end