Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -27,10 +27,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid}.to_json,
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
@@ -38,11 +39,16 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
)
|
||||
|
||||
@balance = 0.00
|
||||
response["data"].each do |res|
|
||||
if res["accountable_type"] == "RebateAccount"
|
||||
@balance = res["balance"]
|
||||
end
|
||||
@accountable_type = ''
|
||||
if response["data"]==true
|
||||
response["data"].each do |res|
|
||||
if res["accountable_type"] == "RebateAccount"
|
||||
@balance = res["balance"]
|
||||
@accountable_type = res["accountable_type"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#end customer amount
|
||||
|
||||
@sale_data.sale_payments.each do |spay|
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
|
||||
<td><strong>Points :</strong> <%= @balance %> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -70,6 +69,12 @@
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Grand Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total rescue 0%></span></strong></td>
|
||||
</tr>
|
||||
<%if @balance > 0%>
|
||||
</tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong><%= @accountable_type %></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@balance%></span></strong></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user