From 3838ee29e04e03c707b66381b912dc868fbadada Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 17 May 2018 16:39:59 +0630 Subject: [PATCH] change func: for receipt bill --- app/pdf/receipt_bill_a5_pdf.rb | 4 +++- app/pdf/receipt_bill_pdf.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/pdf/receipt_bill_a5_pdf.rb b/app/pdf/receipt_bill_a5_pdf.rb index 78b27e3f..08caf1b8 100644 --- a/app/pdf/receipt_bill_a5_pdf.rb +++ b/app/pdf/receipt_bill_a5_pdf.rb @@ -207,7 +207,9 @@ class ReceiptBillA5Pdf < Prawn::Document # check for item not to show if item.price != 0 sub_total += item.price #(item.qty*item.unit_price) - comment for room charges - total_qty += item.qty + if item.status != 'Discount' && item.qty > 0 + total_qty += item.qty + 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 59e6a320..5c1f8c01 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -201,7 +201,9 @@ class ReceiptBillPdf < Prawn::Document # check for item not to show if item.price != 0 sub_total += item.price #(item.qty*item.unit_price) - comment for room charges - total_qty += item.qty + if item.status != 'Discount' && item.qty > 0 + total_qty += item.qty + end qty = item.qty total_price = item.price #item.qty*item.unit_price - comment for room charges price = item.unit_price