fixed receipt header

This commit is contained in:
NyanLinHtut
2019-06-04 15:12:19 +06:30
parent be60470ba1
commit ae4af75f52
3 changed files with 23 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
class ReceiptBillStarPdf < Prawn::Document
include ActionView::Helpers::NumberHelper
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :margin_top, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
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,card_data,other_charges_amount,latest_order_no,card_balance_amount)
self.page_width = printer_settings.page_width
@@ -9,6 +9,7 @@ class ReceiptBillStarPdf < Prawn::Document
self.header_font_size = printer_settings.header_font_size.to_i
self.item_font_size = printer_settings.item_font_size.to_i
self.margin = 0
self.margin_top = 10
self.price_width = 60
self.qty_width = 20
self.total_width = 40
@@ -25,7 +26,7 @@ class ReceiptBillStarPdf < Prawn::Document
# @double = @qty_width * 1.3
# @half_qty = @qty_width / 2
#setting page margin and width
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
super(:margin => [self.margin_top, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
#precision checked
if printer_settings.precision.to_i > 2