From 7d5d88a490ec11c691d3f6840433d002e1c9bee8 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 27 Jun 2018 17:05:18 +0630 Subject: [PATCH] update receipt b9ll qty count with price 0 --- app/pdf/receipt_bill_a5_pdf.rb | 10 ++++++++-- app/pdf/receipt_bill_pdf.rb | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/pdf/receipt_bill_a5_pdf.rb b/app/pdf/receipt_bill_a5_pdf.rb index 707ecf00..4f6969c5 100644 --- a/app/pdf/receipt_bill_a5_pdf.rb +++ b/app/pdf/receipt_bill_a5_pdf.rb @@ -212,8 +212,14 @@ class ReceiptBillA5Pdf < Prawn::Document sub_total += item.price #(item.qty*item.unit_price) - comment for room charges if item.status != 'Discount' && item.qty > 0 - total_qty += item.qty - end + if !show_price.nil? && show_price.value.to_i > 0 && item.price == 0 + total_qty += item.qty + else + if item.price != 0 + total_qty += item.qty + end + end + end qty = item.qty total_price = item.price #item.qty*item.unit_price - comment for room charges price = item.unit_price diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 58c6727a..e9bf595c 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -204,7 +204,13 @@ class ReceiptBillPdf < Prawn::Document show_price = Lookup.find_by_lookup_type("show_price") if item.status != 'Discount' && item.qty > 0 - total_qty += item.qty + if !show_price.nil? && show_price.value.to_i > 0 && item.price == 0 + total_qty += item.qty + else + if item.price != 0 + total_qty += item.qty + end + end end product_name = item.product_name