update report

This commit is contained in:
Aung Myo
2017-11-28 19:11:19 +06:30
parent 20d580b2ab
commit 900efb3fa6
7 changed files with 25 additions and 23 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -77,7 +77,7 @@
</tr>
</thead>
<tbody>
<% if @response["status"] == true %>
<% if @response["status"] == true && @response["data"].count > 0 %>
<% @response["data"].each do |transaction| %>
<tr>
<td><%= transaction["date"]%></td>
@@ -101,7 +101,7 @@
<%end%>
<%else%>
<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>
</tr>
<% end %>

View File

@@ -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[: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[: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[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%></td>
</tr>
<% count = count + 1 %>
<% 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",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",old_grand_total), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%></td>
</tr>
<% total_tax = 0 %>

View File

@@ -90,7 +90,7 @@
<td><%= tax.tax_payable_amount rescue '-' %></td>
<%end%>
<td><%= result.old_grand_total %></td>
<td><%= result.grand_total %></td>
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
</tr>
@@ -103,9 +103,9 @@
<% @sale_taxes.each do |tax| %>
<td><b><%= tax.st_amount.round(2) %></b></td>
<% 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><%= old_grand_total.to_f.round + rounding_adj %></b></td>
<td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>