diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index f95b54a9..04711cf4 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -235,7 +235,7 @@ end id = @crm_customer.membership_id member_group_id = params[:member_group_id] - if id.nil? && !member_group_id.nil? + if !id.present? && !member_group_id.nil? membership = MembershipSetting.find_by_membership_type("paypar_url") memberaction = MembershipAction.find_by_membership_type("create_membership_customer") merchant_uid = memberaction.merchant_account_id.to_s @@ -277,8 +277,6 @@ end rescue SocketError response = { status: false} end - puts "ssssssss" - puts response.to_json customer = Customer.find(@crm_customer.customer_id) if response["status"] == true @@ -337,9 +335,6 @@ end rescue SocketError response = { status: false} end - - puts "ssssssss" - puts response.to_json if response["status"] == true customer = Customer.find(@crm_customer.customer_id) diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index 6d536ee7..254bb423 100755 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -22,7 +22,7 @@ authorize_resource :class => false @sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type) @tax_profiles = TaxProfile.order('order_by asc') -puts @sale_taxes.to_json +puts @sale_data.count puts "sssssss" puts @tax_profiles.to_json @from = from diff --git a/app/models/customer.rb b/app/models/customer.rb index 13e6c277..b30b51c6 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -184,12 +184,17 @@ class Customer < ApplicationRecord # Control for Paypar Cloud begin - response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,total_sale_transaction_amount: sObj.grand_total,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id, - receipt_no: receipt_no,auth_token:auth_token}.to_json, - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' - }, :timeout => 10) + response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id , + total_sale_transaction_amount: sObj.grand_total, + merchant_uid:merchant_uid, + total_amount: total_amount, + campaign_type_id: campaign_type_id, + receipt_no: receipt_no, + auth_token:auth_token}.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json; version=2' + }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": "Connect To" } @@ -201,7 +206,9 @@ class Customer < ApplicationRecord response = { "status": false, "message": "Can't connect server"} end - return response + return response + puts response.to_json + puts "ttttttttttttttttttttttt" end end end diff --git a/app/models/sale.rb b/app/models/sale.rb index 14ff6266..46f823d1 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -875,7 +875,7 @@ end # end def grand_total_after_rounding - return self.old_grand_total.to_f + self.rounding_adjustment.to_f + return self.grand_total.to_f + self.rounding_adjustment.to_f end def get_cash_amount diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 338aea1d..26ce197a 100755 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -77,7 +77,7 @@
- <% if @response["status"] == true %> + <% if @response["status"] == true && @response["data"].count > 0 %> <% @response["data"].each do |transaction| %>There is no transaction coz of <%=@response["data"]%> ...
+There is no transaction coz of <%=@response["message"]%> ...