add print action cable
This commit is contained in:
@@ -96,7 +96,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
if kbz_pay_status
|
||||
if printed_status == 'credit_payment'
|
||||
printed_status = 'Paid'
|
||||
end
|
||||
end
|
||||
kbzpay_qr_generator(printed_status, qr_code)
|
||||
end
|
||||
|
||||
@@ -444,7 +444,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
# sql = "SELECT SUM(payment_amount)
|
||||
# FROM sale_payments where payment_method='creditnote'
|
||||
# and sale_id='#{sale_data.sale_id}'"
|
||||
|
||||
|
||||
if printed_status == 'credit_payment'
|
||||
sale_payments = SalePayment.select(:payment_amount, :payment_method, :updated_at)
|
||||
.where("sale_id = '#{sale_data.sale_id}' AND payment_method != 'creditnote'")
|
||||
@@ -467,7 +467,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
|
||||
.group("payment_method")
|
||||
end
|
||||
|
||||
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
if payment.payment_method == "paypar"
|
||||
@@ -677,7 +677,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
query = sale_data.sale_payments
|
||||
.merge(SalePayment.where.not(payment_method: 'creditnote')
|
||||
.or(SalePayment.where.not(SalePayment.arel_table[:payment_amount].lteq(sale_data.sale_payments.joins(:sale_audit).sum(:payment_amount)))))
|
||||
|
||||
|
||||
query.each do |payment|
|
||||
if payment.payment_method == "creditnote"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user