update report
This commit is contained in:
@@ -235,7 +235,7 @@ end
|
|||||||
id = @crm_customer.membership_id
|
id = @crm_customer.membership_id
|
||||||
member_group_id = params[:member_group_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")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
|
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
|
||||||
merchant_uid = memberaction.merchant_account_id.to_s
|
merchant_uid = memberaction.merchant_account_id.to_s
|
||||||
@@ -277,8 +277,6 @@ end
|
|||||||
rescue SocketError
|
rescue SocketError
|
||||||
response = { status: false}
|
response = { status: false}
|
||||||
end
|
end
|
||||||
puts "ssssssss"
|
|
||||||
puts response.to_json
|
|
||||||
customer = Customer.find(@crm_customer.customer_id)
|
customer = Customer.find(@crm_customer.customer_id)
|
||||||
|
|
||||||
if response["status"] == true
|
if response["status"] == true
|
||||||
@@ -337,9 +335,6 @@ end
|
|||||||
rescue SocketError
|
rescue SocketError
|
||||||
response = { status: false}
|
response = { status: false}
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "ssssssss"
|
|
||||||
puts response.to_json
|
|
||||||
|
|
||||||
if response["status"] == true
|
if response["status"] == true
|
||||||
customer = Customer.find(@crm_customer.customer_id)
|
customer = Customer.find(@crm_customer.customer_id)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ authorize_resource :class => false
|
|||||||
@sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type)
|
@sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type)
|
||||||
@tax_profiles = TaxProfile.order('order_by asc')
|
@tax_profiles = TaxProfile.order('order_by asc')
|
||||||
|
|
||||||
puts @sale_taxes.to_json
|
puts @sale_data.count
|
||||||
puts "sssssss"
|
puts "sssssss"
|
||||||
puts @tax_profiles.to_json
|
puts @tax_profiles.to_json
|
||||||
@from = from
|
@from = from
|
||||||
|
|||||||
@@ -184,12 +184,17 @@ class Customer < ApplicationRecord
|
|||||||
|
|
||||||
# Control for Paypar Cloud
|
# Control for Paypar Cloud
|
||||||
begin
|
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,
|
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,
|
||||||
receipt_no: receipt_no,auth_token:auth_token}.to_json,
|
total_sale_transaction_amount: sObj.grand_total,
|
||||||
:headers => {
|
merchant_uid:merchant_uid,
|
||||||
'Content-Type' => 'application/json',
|
total_amount: total_amount,
|
||||||
'Accept' => 'application/json; version=2'
|
campaign_type_id: campaign_type_id,
|
||||||
}, :timeout => 10)
|
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
|
rescue Net::OpenTimeout
|
||||||
response = { "status": false , "message": "Connect To" }
|
response = { "status": false , "message": "Connect To" }
|
||||||
|
|
||||||
@@ -201,7 +206,9 @@ class Customer < ApplicationRecord
|
|||||||
response = { "status": false, "message": "Can't connect server"}
|
response = { "status": false, "message": "Can't connect server"}
|
||||||
|
|
||||||
end
|
end
|
||||||
return response
|
return response
|
||||||
|
puts response.to_json
|
||||||
|
puts "ttttttttttttttttttttttt"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -875,7 +875,7 @@ end
|
|||||||
# end
|
# end
|
||||||
|
|
||||||
def grand_total_after_rounding
|
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
|
end
|
||||||
|
|
||||||
def get_cash_amount
|
def get_cash_amount
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if @response["status"] == true %>
|
<% if @response["status"] == true && @response["data"].count > 0 %>
|
||||||
<% @response["data"].each do |transaction| %>
|
<% @response["data"].each do |transaction| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= transaction["date"]%></td>
|
<td><%= transaction["date"]%></td>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<%end%>
|
<%end%>
|
||||||
<%else%>
|
<%else%>
|
||||||
<tr style="border-top:2px solid #666;">
|
<tr style="border-top:2px solid #666;">
|
||||||
<td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["data"]%> ...</p>
|
<td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["message"]%> ...</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -90,9 +90,9 @@
|
|||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% count = count + 1 %>
|
<% count = count + 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td>
|
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% total_tax = 0 %>
|
<% total_tax = 0 %>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
<td><%= result.old_grand_total %></td>
|
<td><%= result.grand_total %></td>
|
||||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -103,9 +103,9 @@
|
|||||||
<% @sale_taxes.each do |tax| %>
|
<% @sale_taxes.each do |tax| %>
|
||||||
<td><b><%= tax.st_amount.round(2) %></b></td>
|
<td><b><%= tax.st_amount.round(2) %></b></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
<td><b><%= grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
<td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"> </td>
|
<td colspan="2"> </td>
|
||||||
|
|||||||
Reference in New Issue
Block a user