add printer brand and api and type

This commit is contained in:
Yan
2018-03-15 18:56:29 +06:30
parent fc3e1b2d60
commit c982da4264
12 changed files with 70 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ class ReceiptBillPdf < Prawn::Document
# @double = @qty_width * 1.3
# @half_qty = @qty_width / 2
#setting page margin and width
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin])
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
#precision checked
if printer_settings.precision.to_i > 2
@@ -121,15 +121,8 @@ class ReceiptBillPdf < Prawn::Document
end
move_down line_move
y_position = cursor
if sale_data.bookings[0].dining_facility_id.to_i > 0
bounding_box([0,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :left
end
end
bounding_box([self.label_width, y_position], :width =>self.label_width, :height => self.item_height) do
bounding_box([0, y_position], :width =>self.label_width, :height => self.item_height) do
text "W: #{sale_data.requested_by}" , :size => self.item_font_size, :align => :left
end
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
@@ -493,8 +486,8 @@ class ReceiptBillPdf < Prawn::Document
end
#individual payment per person
def individual_payment(sale_data, precision, delimiter)
per_person = sale_data.grand_total.to_i / sale_data.equal_persons.to_i
def individual_payment(sale_data, survey, precision, delimiter)
per_person = sale_data.grand_total.to_f / survey.total_customer.to_i
stroke_horizontal_rule
move_down line_move
y_position = cursor