fix for member

This commit is contained in:
Yan
2017-07-31 15:49:36 +06:30
parent bc5a7d01f7
commit a57831a3fc
3 changed files with 211 additions and 185 deletions

View File

@@ -150,7 +150,11 @@ class Crm::CustomersController < BaseCrmController
# When paypar account no not exist in paypar
if response["message"] == "Account has not exist."
customer.destroy
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer cannot created.' + response["message"]}
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer cannot created.' + response["message"]}
else
format.html { redirect_to crm_customers_path, notice: 'Customer cannot created.' + response["message"] }
end
end
if params[:sale_id]