change order reservation

This commit is contained in:
phyusin
2018-04-27 13:47:54 +06:30
parent 172c2136cc
commit 11473c7fcd
9 changed files with 100 additions and 31 deletions

View File

@@ -29,9 +29,11 @@ class OrderReservation < ApplicationRecord
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]
order_reservation.taxes = order_reserve[:payment_info][:taxes]
order_reservation.total_amount = order_reserve[:payment_info][:sub_total]
order_reservation.total_tax = order_reserve[:payment_info][:total_tax]
order_reservation.discount_amount = order_reserve[:payment_info][:discount_amount]
order_reservation.convenience_charge = order_reserve[:payment_info][:convenience_charge]
order_reservation.grand_total = order_reserve[:payment_info][:grand_total]
order_reservation.order_remark = order_reserve[:order_info][:order_remark]
end
@@ -272,6 +274,10 @@ class OrderReservation < ApplicationRecord
order_reservation.save
end
def self.get_count_on_order
order_reservation = OrderReservation.select("COUNT(order_reservation_id) as count, status").group("status")
end
private
def generate_custom_id
self.order_reservation_id = SeedGenerator.generate_id(self.class.name, "ODRS")