update rebate amount in payment
This commit is contained in:
@@ -28,9 +28,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
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
|
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 => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
@@ -38,11 +39,16 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
)
|
)
|
||||||
|
|
||||||
@balance = 0.00
|
@balance = 0.00
|
||||||
|
@accountable_type = ''
|
||||||
|
if response["data"]==true
|
||||||
response["data"].each do |res|
|
response["data"].each do |res|
|
||||||
if res["accountable_type"] == "RebateAccount"
|
if res["accountable_type"] == "RebateAccount"
|
||||||
@balance = res["balance"]
|
@balance = res["balance"]
|
||||||
|
@accountable_type = res["accountable_type"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#end customer amount
|
#end customer amount
|
||||||
|
|
||||||
@sale_data.sale_payments.each do |spay|
|
@sale_data.sale_payments.each do |spay|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
|
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
|
||||||
<td><strong>Points :</strong> <%= @balance %> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,6 +69,12 @@
|
|||||||
<td style="width:80%; text-align:left; border-top:none"><strong>Grand Total</strong></td>
|
<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>
|
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total rescue 0%></span></strong></td>
|
||||||
</tr>
|
</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>
|
</tfooter>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user