diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 5424e3d5..59cee9a6 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -223,7 +223,7 @@ class SalePayment < ApplicationRecord membership_data = SalePayment.redeem(membership_setting.gateway_url,membership_setting.auth_token,customer_data.membership_id,self.received_amount,self.sale.sale_id) if membership_data["status"]==true - self.payment_method = "redeem" + self.payment_method = "paypar" self.payment_amount = self.received_amount self.payment_reference = self.voucher_no self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f @@ -307,7 +307,7 @@ class SalePayment < ApplicationRecord paypar = sObj.sale_payments payparcost = 0 paypar.each do |pp| - if pp.payment_method == "redeem" + if pp.payment_method == "paypar" payparcost = payparcost + pp.payment_amount end end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index db913c4a..4557eadd 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -233,9 +233,16 @@ class ReceiptBillPdf < Prawn::Document SalePayment.where('sale_id = ?', sale_data.sale_id).each do |payment| y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + if payment.payment_method == "paypar" + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Redeem Payment", :size => self.item_font_size,:align => :left + end + else + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left end + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "#{number_with_precision(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end @@ -368,8 +375,8 @@ class ReceiptBillPdf < Prawn::Document bounding_box([0, y_position], :width =>self.label_width, :height => self.item_height) do text "#{printed_status}", :size => self.item_font_size,:align => :left end - bounding_box([self.label_width,y_position], :width =>self.label_width, :height => self.item_height) do - text "Thank You! See you Again", :left_margin => -10, :size => self.item_font_size,:align => :right + bounding_box([self.item_description_width,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Thank You! See you Again", :left_margin => -10, :size => self.item_font_size,:align => :left end move_down 5