Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant into adminbsb_material_ui
This commit is contained in:
@@ -11,26 +11,26 @@ class SeedGenerator < ApplicationRecord
|
|||||||
seed.save
|
seed.save
|
||||||
else
|
else
|
||||||
next_no = seed.next
|
next_no = seed.next
|
||||||
# current_no = seed.next
|
current_no = seed.next
|
||||||
# seed.next = seed.next + seed.increase_by
|
seed.next = seed.next + seed.increase_by
|
||||||
# seed.current = current_no
|
seed.current = current_no
|
||||||
# seed.save
|
seed.save
|
||||||
cur_val, next_val = self.update_seed(model, seed.next, seed.increase_by)
|
# cur_val, next_val = self.update_seed(model, seed.next, seed.increase_by)
|
||||||
|
|
||||||
if next_no == cur_val
|
# if next_no == cur_val
|
||||||
puts "SSS"
|
# puts "SSS"
|
||||||
puts next_val
|
# puts next_val
|
||||||
cur_val2, next_val2 = self.update_seed(model, next_val, seed.increase_by)
|
# cur_val2, next_val2 = self.update_seed(model, next_val, seed.increase_by)
|
||||||
puts next_val2
|
# puts next_val2
|
||||||
padding_len = 15 - prefix.length
|
# padding_len = 15 - prefix.length
|
||||||
saleOrderId = prefix +"-"+ cur_val2.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
# saleOrderId = prefix +"-"+ cur_val2.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
||||||
puts saleOrderId
|
# puts saleOrderId
|
||||||
return saleOrderId
|
# return saleOrderId
|
||||||
end
|
# end
|
||||||
|
|
||||||
padding_len = 15 - prefix.length
|
# padding_len = 15 - prefix.length
|
||||||
saleOrderId = prefix +"-"+ cur_val.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
# saleOrderId = prefix +"-"+ cur_val.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
||||||
return saleOrderId
|
# return saleOrderId
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -100,7 +100,6 @@ class SeedGenerator < ApplicationRecord
|
|||||||
select_result = ActiveRecord::Base.connection.execute(select_sql);
|
select_result = ActiveRecord::Base.connection.execute(select_sql);
|
||||||
|
|
||||||
select_result.each do |row|
|
select_result.each do |row|
|
||||||
p row
|
|
||||||
cur_val = row [3]
|
cur_val = row [3]
|
||||||
next_val = row[4]
|
next_val = row[4]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,22 +17,26 @@ class OrderItemPdf < Prawn::Document
|
|||||||
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||||
|
|
||||||
# db font setup
|
# db font setup
|
||||||
# if print_settings.font != ""
|
if print_settings.font != ""
|
||||||
# font_families.update("#{print_settings.font}" => {
|
font_families.update("#{print_settings.font}" => {
|
||||||
# :normal => "public/fonts/#{print_settings.font}.ttf",
|
:normal => "public/fonts/#{print_settings.font}.ttf",
|
||||||
# :italic => "public/fonts/#{print_settings.font}.ttf",
|
:italic => "public/fonts/#{print_settings.font}.ttf",
|
||||||
# :bold => "public/fonts/#{print_settings.font}.ttf",
|
:bold => "public/fonts/#{print_settings.font}.ttf",
|
||||||
# :bold_italic => "public/fonts/#{print_settings.font}.ttf"
|
:bold_italic => "public/fonts/#{print_settings.font}.ttf"
|
||||||
# })
|
})
|
||||||
|
|
||||||
# font "#{print_settings.font}"
|
font "#{print_settings.font}"
|
||||||
# fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
||||||
# end
|
|
||||||
|
self.header_font_size = 11
|
||||||
|
self.item_font_size = 9
|
||||||
|
else
|
||||||
|
self.header_font_size = 12
|
||||||
|
self.item_font_size = 10
|
||||||
|
end
|
||||||
# font "public/fonts/Zawgyi-One.ttf"
|
# font "public/fonts/Zawgyi-One.ttf"
|
||||||
# font "public/fonts/padauk.ttf"
|
# font "public/fonts/padauk.ttf"
|
||||||
#font "public/fonts/Chinese.ttf"
|
#font "public/fonts/Chinese.ttf"
|
||||||
self.header_font_size = 12
|
|
||||||
self.item_font_size = 10
|
|
||||||
|
|
||||||
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
|
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
@@ -42,7 +46,7 @@ class OrderItemPdf < Prawn::Document
|
|||||||
order_info(order_item.order_id, order_item.order_by,order_item.order_at)
|
order_info(order_item.order_id, order_item.order_by,order_item.order_at)
|
||||||
|
|
||||||
# order items
|
# order items
|
||||||
order_items(order_item, options, alt_name, print_settings.precision,print_settings.font)
|
order_items(order_item, options, alt_name, print_settings.precision)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write Order Information to PDF
|
# Write Order Information to PDF
|
||||||
@@ -70,11 +74,11 @@ class OrderItemPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Write Order items to PDF
|
# Write Order items to PDF
|
||||||
def order_items(order_item, options, alt_name, precision, font)
|
def order_items(order_item, options, alt_name, precision)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
#Add Order Item
|
#Add Order Item
|
||||||
add_order_items(order_item, options, alt_name, precision, font)
|
add_order_items(order_item, options, alt_name, precision)
|
||||||
|
|
||||||
dash(1, :space => 1, :phase => 1)
|
dash(1, :space => 1, :phase => 1)
|
||||||
stroke_horizontal_line 0, (self.page_width - self.margin)
|
stroke_horizontal_line 0, (self.page_width - self.margin)
|
||||||
@@ -82,19 +86,7 @@ class OrderItemPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Add order items under order info
|
# Add order items under order info
|
||||||
def add_order_items(order_item, options, alt_name, precision, font)
|
def add_order_items(order_item, options, alt_name, precision)
|
||||||
# db font setup
|
|
||||||
if font != ""
|
|
||||||
font_families.update("#{font}" => {
|
|
||||||
:normal => "public/fonts/#{font}.ttf",
|
|
||||||
:italic => "public/fonts/#{font}.ttf",
|
|
||||||
:bold => "public/fonts/#{font}.ttf",
|
|
||||||
:bold_italic => "public/fonts/#{font}.ttf"
|
|
||||||
})
|
|
||||||
|
|
||||||
font "#{font}"
|
|
||||||
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
|
||||||
end
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|||||||
@@ -15,10 +15,27 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
|
|
||||||
super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||||
|
|
||||||
# font "public/fonts/Zawgyi-One.ttf"
|
# db font setup
|
||||||
# font "public/fonts/padauk.ttf"
|
if print_settings.font != ""
|
||||||
|
font_families.update("#{print_settings.font}" => {
|
||||||
|
:normal => "public/fonts/#{print_settings.font}.ttf",
|
||||||
|
:italic => "public/fonts/#{print_settings.font}.ttf",
|
||||||
|
:bold => "public/fonts/#{print_settings.font}.ttf",
|
||||||
|
:bold_italic => "public/fonts/#{print_settings.font}.ttf"
|
||||||
|
})
|
||||||
|
|
||||||
|
font "#{print_settings.font}"
|
||||||
|
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
||||||
|
|
||||||
|
self.header_font_size = 11
|
||||||
|
self.item_font_size = 9
|
||||||
|
else
|
||||||
self.header_font_size = 12
|
self.header_font_size = 12
|
||||||
self.item_font_size = 10
|
self.item_font_size = 10
|
||||||
|
end
|
||||||
|
|
||||||
|
# font "public/fonts/Zawgyi-One.ttf"
|
||||||
|
# font "public/fonts/padauk.ttf"
|
||||||
|
|
||||||
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
|
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
@@ -29,9 +46,9 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
|
|
||||||
# order items
|
# order items
|
||||||
if order_items == nil
|
if order_items == nil
|
||||||
order_items(order, alt_name, print_settings.precision,print_settings.font)
|
order_items(order, alt_name, print_settings.precision)
|
||||||
else
|
else
|
||||||
order_items(order_items, alt_name, print_settings.precision,print_settings.font)
|
order_items(order_items, alt_name, print_settings.precision)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -60,7 +77,7 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Write Order items to PDF
|
# Write Order items to PDF
|
||||||
def order_items(order_item, alt_name, precision,font)
|
def order_items(order_item, alt_name, precision)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
@@ -75,24 +92,12 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
#Add Order Item
|
#Add Order Item
|
||||||
add_order_items(order_item, alt_name, precision, font)
|
add_order_items(order_item, alt_name, precision)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add order items under order info
|
# Add order items under order info
|
||||||
def add_order_items(order_item, alt_name, precision, font)
|
def add_order_items(order_item, alt_name, precision)
|
||||||
# db font setup
|
|
||||||
if font != ""
|
|
||||||
font_families.update("#{font}" => {
|
|
||||||
:normal => "public/fonts/#{font}.ttf",
|
|
||||||
:italic => "public/fonts/#{font}.ttf",
|
|
||||||
:bold => "public/fonts/#{font}.ttf",
|
|
||||||
:bold_italic => "public/fonts/#{font}.ttf"
|
|
||||||
})
|
|
||||||
|
|
||||||
font "#{font}"
|
|
||||||
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
|
||||||
end
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||||
|
|
||||||
# db font setup
|
# db font setup
|
||||||
if printer_settings.font != nil
|
if printer_settings.font != ""
|
||||||
font_families.update("#{printer_settings.font}" => {
|
font_families.update("#{printer_settings.font}" => {
|
||||||
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
||||||
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
||||||
|
|||||||
Reference in New Issue
Block a user