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]

View File

@@ -411,7 +411,6 @@ class SalePayment < ApplicationRecord
end
rebate_arr.push(data)
end
total_amount = rebate_prices - payparcost - overall_dis
@@ -454,7 +453,6 @@ class SalePayment < ApplicationRecord
response = { "status": false, "message": "Can't connect server"}
end
return response
end
else
response = { "status": "no_member", "message": "Not membership"}