req bill bugs fixing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width
|
||||
def initialize(printer_settings, sale_items,sale, sale_data)
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name)
|
||||
self.p_width = 200
|
||||
self.page_height = 1450
|
||||
self.margin = 10
|
||||
@@ -23,7 +23,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
header( printer_settings.printer_name, printer_settings.name)
|
||||
stroke_horizontal_rule
|
||||
cashier_info(sale.receipt_no,sale.customer, sale.receipt_date)
|
||||
cashier_info(sale_data, customer_name)
|
||||
line_items(sale_items)
|
||||
all_total(sale_data)
|
||||
|
||||
@@ -41,7 +41,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
end
|
||||
|
||||
def cashier_info(receipt_no, customer, receipt_date)
|
||||
def cashier_info(sale_data, customer_name)
|
||||
move_down 5
|
||||
move_down 2
|
||||
y_position = cursor
|
||||
@@ -50,7 +50,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
bounding_box([self.price_width, y_position], :width =>self.receipt_width) do
|
||||
text "#{receipt_no}" , :size => self.item_font_size, :align => :left
|
||||
text "#{sale_data.receipt_no}" , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
move_down 5
|
||||
|
||||
@@ -59,7 +59,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "Customer:", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.price_width,y_position], :width =>self.price_width) do
|
||||
text "#{customer}" , :size => self.item_font_size,:align => :left
|
||||
text "#{customer_name}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
move_down 5
|
||||
|
||||
@@ -68,7 +68,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "Date:", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.price_width,y_position], :width =>self.price_width) do
|
||||
text "#{receipt_date}" , :size => self.item_font_size,:align => :left
|
||||
text "#{sale_data.receipt_date.strftime('%Y %m %d %h:%m')}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
# stroke_horizontal_rule
|
||||
move_down 5
|
||||
@@ -139,7 +139,6 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
def all_total(sale_data)
|
||||
|
||||
move_down 5
|
||||
y_position =cursor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user