add print action cable
This commit is contained in:
@@ -597,7 +597,8 @@ class CloseCashierPdf < Prawn::Document
|
||||
def other_charges_detail(total_other_charges)
|
||||
total_charges = 0
|
||||
total_charges_items = 0
|
||||
|
||||
p "total other charges<========================="
|
||||
p total_other_charges
|
||||
unless total_other_charges.nil?
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.page_width - 10, :height => 20) do
|
||||
@@ -611,6 +612,7 @@ class CloseCashierPdf < Prawn::Document
|
||||
|
||||
total_other_charges.each do |charges|
|
||||
move_down 3
|
||||
p charges['product_name']
|
||||
add_item_line(charges['product_name'], charges['unit_price'].to_i, charges['total_item'].to_i, charges['grand_total'].to_i)
|
||||
|
||||
total_charges_items += charges['total_item'].to_i
|
||||
|
||||
@@ -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