add credit note payment process for online order

This commit is contained in:
phyusin
2018-09-17 11:15:34 +06:30
parent 07a6e45edc
commit 19fa2ecf54
12 changed files with 248 additions and 78 deletions

View File

@@ -64,6 +64,7 @@ class OrderReservation < ApplicationRecord
order_reservation.transaction_ref = order_reserve[:reference]
if order_reserve[:order_info]
order_reservation.item_count = order_reserve[:order_info][:items].count
order_reservation.payment_methods = order_reserve[:payment_info][:payment_methods].to_json
order_reservation.payment_type = order_reserve[:payment_info][:payment_type]
order_reservation.payment_status = order_reserve[:payment_info][:payment_status]
order_reservation.payment_ref = order_reserve[:payment_info][:payment_ref]
@@ -164,8 +165,12 @@ class OrderReservation < ApplicationRecord
#end rounding adjustment
sale_payment = SalePayment.new
sale_payment.process_payment(saleObj, current_user, saleObj.grand_total, "cash")
if(order.payment_type == "COD")
sale_payment.process_payment(saleObj, current_user, saleObj.grand_total, "cash")
else
remark = "credit payment for Receipt No #{saleObj.receipt_no}"
@status, @sale = sale_payment.process_payment(saleObj, current_user, saleObj.grand_total, "creditnote", remark)
end
#order status send to doemal
callback_response = send_status_to_ordering(order.callback_url,order.transaction_ref,DELIVERED)
#order reservation status updated