change width for close cashier pdf

This commit is contained in:
phyusin
2017-11-29 16:04:31 +06:30
parent 31ec2f959b
commit fec318db07

View File

@@ -5,7 +5,7 @@ class CloseCashierPdf < Prawn::Document
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.price_width = 60
self.qty_width = 20
self.total_width = 40
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width))
@@ -145,7 +145,6 @@ class CloseCashierPdf < Prawn::Document
stroke_horizontal_rule
move_down 7
@total_payment = shift_sale.cash_sales + shift_sale.credit_sales
@total_foc = 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
@@ -165,7 +164,6 @@ class CloseCashierPdf < Prawn::Document
#start other payment details
if shift_sale.other_sales > 0
other_payment.each do |other|
@total_payment += other.mpu_amount + other.visa_amount + other.jcb_amount + other.master_amount + other.paypar_amount + other.foc_amount
@total_foc = other.foc_amount.round(2)
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
@@ -227,10 +225,10 @@ class CloseCashierPdf < Prawn::Document
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Total :", :style => :bold, :size => self.header_font_size, :align => :right
text "Total :", :style => :bold, :size => self.header_font_size - 1, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "#{@total_payment.round(2)}", :style => :bold, :size => self.header_font_size, :align => :right
text "#{shift_sale.grand_total.round(2)}", :style => :bold, :size => self.header_font_size - 1, :align => :right
end
# end other payment details
@@ -259,10 +257,10 @@ class CloseCashierPdf < Prawn::Document
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Net Sales :", :style => :bold, :size => self.header_font_size, :align => :right
text "Net Sales :", :style => :bold, :size => self.header_font_size - 1, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "#{shift_sale.nett_sales}", :style => :bold , :size => self.header_font_size, :align => :right
text "#{shift_sale.nett_sales}", :style => :bold , :size => self.header_font_size - 1, :align => :right
end
#end for service charges and commercial tax
#COMMENTED FOR NO NEED AND NOT CORRECT WHEN OTHER CHARGES