a5 print format done

This commit is contained in:
Yan
2018-01-09 15:58:37 +06:30
parent 11f3d2d03d
commit be6dd25a70
3 changed files with 10 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ class Origami::PaymentsController < BaseOrigamiController
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
# Print for First Bill to Customer
unique_code = "ReceiptBillPdf"
unique_code = "ReceiptBillA5Pdf"
#shop detail
shop_details = Shop::ShopDetail
# customer= Customer.where('customer_id=' +.customer_id)
@@ -106,7 +106,7 @@ class Origami::PaymentsController < BaseOrigamiController
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
# For Print
unique_code = "ReceiptBillPdf"
unique_code = "ReceiptBillA5Pdf"
customer= Customer.find(saleObj.customer_id)
# get member information
@@ -228,7 +228,7 @@ class Origami::PaymentsController < BaseOrigamiController
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
unique_code = "ReceiptBillPdf"
unique_code = "ReceiptBillA5Pdf"
customer= Customer.find(saleObj.customer_id)
#shop detail
@@ -285,7 +285,7 @@ class Origami::PaymentsController < BaseOrigamiController
# Re-call Sale Data
saleObj = Sale.find(sale_id)
unique_code = "ReceiptBillPdf"
unique_code = "ReceiptBillA5Pdf"
customer= Customer.find(saleObj.customer_id)
#shop detail

View File

@@ -70,7 +70,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
#Generate PDF
#Print
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance)
pdf = ReceiptBillA5Pdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance)
# print as print copies in printer setting
count = printer_settings.print_copies

View File

@@ -4,13 +4,13 @@ class ReceiptBillA5Pdf < Prawn::Document
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance)
self.page_width = printer_settings.page_width
self.page_height = printer_settings.page_height
self.margin = 20
self.margin = 15
self.price_width = 120
self.qty_width = 50
self.total_width = 120
self.item_width = self.page_width - ((self.qty_width + self.price_width + self.total_width))
self.item_height = 25
self.item_description_width = (self.page_width-20) / 2
self.item_description_width = (self.page_width-40) / 2
self.label_width = 150
self.description_width = 500
@@ -494,11 +494,11 @@ class ReceiptBillA5Pdf < Prawn::Document
move_down 10
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
bounding_box([0, y_position], :width =>self.item_description_width) do
text "#{printed_status}",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.description_width,y_position], :width =>self.description_width, :height => self.item_height) do
text "Thank You! See you Again", :left_margin => -5, :size => self.item_font_size,:align => :left
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 => -5, :size => self.item_font_size,:align => :right
end
move_down 10