merge with august_spring
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
class CloseCashierPdf < Prawn::Document
|
||||
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,:text_width
|
||||
def initialize(printer_settings, shift_sale,shop_details,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount)
|
||||
self.page_width = 210
|
||||
self.page_height = 7000
|
||||
|
||||
def initialize(printer_settings, shift_sale,shop_details,sale_taxes)
|
||||
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 40
|
||||
self.qty_width = 20
|
||||
@@ -170,11 +171,9 @@ class CloseCashierPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||
text "#{shift_sale.credit_sales}", :size => self.item_font_size, :align => :right
|
||||
end
|
||||
#start other payment details
|
||||
#start other payment details
|
||||
if shift_sale.other_sales > 0
|
||||
|
||||
other_payment.each do |other|
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||
text "Other Payment Details", :size => self.item_font_size, :align => :right
|
||||
@@ -232,9 +231,7 @@ class CloseCashierPdf < Prawn::Document
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||
text "Other Payment :", :size => self.item_font_size, :align => :right
|
||||
@@ -242,15 +239,14 @@ class CloseCashierPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||
text "#{shift_sale.other_sales}", :size => self.item_font_size, :align => :right
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# end other payment details
|
||||
move_down -5
|
||||
stroke_horizontal_rule
|
||||
move_down 7
|
||||
#start total amount by Account Like Food / Beverage /..
|
||||
total_amount_by_account.each do |amount|
|
||||
|
||||
total_amount_by_account.each do |amount|
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||
text "Total #{amount.account_name} Amount:", :size => self.item_font_size, :align => :right
|
||||
@@ -381,8 +377,6 @@ class CloseCashierPdf < Prawn::Document
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down 5
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user