Merge branch 'r-1902001-01' of gitlab.com:code2lab/SXRestaurant into r-1902001-01

This commit is contained in:
Myat Zin Wai Maw
2019-05-08 18:01:52 +06:30
28 changed files with 7546 additions and 73 deletions

View File

@@ -368,4 +368,4 @@ RUBY VERSION
ruby 2.4.1p111 ruby 2.4.1p111
BUNDLED WITH BUNDLED WITH
1.16.4 2.0.1

View File

@@ -46,6 +46,7 @@ class Origami::OtherChargesController < BaseOrigamiController
sale_item = SaleItem.new sale_item = SaleItem.new
sale_item.sale_id = sale_id sale_item.sale_id = sale_id
sale_item.menu_category_code = "0.0"
sale_item.menu_category_name = "Other Charges" sale_item.menu_category_name = "Other Charges"
sale_item.product_code = "Other Charges" sale_item.product_code = "Other Charges"
sale_item.product_name = "*" + di["name"] sale_item.product_name = "*" + di["name"]

View File

@@ -30,6 +30,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
end end
def show def show
puts 'Catch me if you can.......................'
@table = DiningFacility.find(params[:table_id]) @table = DiningFacility.find(params[:table_id])
@membership = MembershipSetting::MembershipSetting @membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all @payment_methods = PaymentMethodSetting.all

View File

@@ -8,7 +8,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
end end
order_item = print_query('order_item', order_item_id) #OrderItem.find_by_item_code(item_code) order_item = print_query('order_item', order_item_id) #OrderItem.find_by_item_code(item_code)
options = order_item[0].options
# filename = "tmp/order_item_#{order_id}_#{order_item_id}" + ".pdf" # filename = "tmp/order_item_#{order_id}_#{order_item_id}" + ".pdf"
pdf = OrderItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty) pdf = OrderItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
@@ -34,7 +34,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
end end
end end
end end
# end # end
shop = Shop.first shop = Shop.first
directory_name = 'public/orders_'+shop.shop_code directory_name = 'public/orders_'+shop.shop_code
@@ -43,7 +43,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
filename = directory_name + "/order_item_#{order_id}_#{order_item_id}" + ".pdf" filename = directory_name + "/order_item_#{order_id}_#{order_item_id}" + ".pdf"
pdf.render_file filename pdf.render_file filename
if oqs.print_copy if oqs.print_copy
#no print in cloud server #no print in cloud server
if ENV["SERVER_MODE"] != "cloud" if ENV["SERVER_MODE"] != "cloud"

View File

@@ -42,6 +42,9 @@ class Printer::PrinterWorker
printer_destination = self.printer_destination printer_destination = self.printer_destination
end end
puts printer_destination
puts '........Printer Destination..........'
copy = self.print_copies copy = self.print_copies
#Print only when printer information is not null #Print only when printer information is not null
if !self.printer_destination.nil? if !self.printer_destination.nil?

View File

@@ -259,6 +259,7 @@ class Sale < ApplicationRecord
sale_item.menu_category_code = menu_category.code sale_item.menu_category_code = menu_category.code
sale_item.menu_category_name = menu_category.name sale_item.menu_category_name = menu_category.name
else else
sale_item.menu_category_code = '0'
sale_item.menu_category_name = "Product" sale_item.menu_category_name = "Product"
end end
sale_item.product_code = item.item_code sale_item.product_code = item.item_code

View File

@@ -180,10 +180,10 @@ class SaleItem < ApplicationRecord
def self.get_all_sale_items(sale_id) def self.get_all_sale_items(sale_id)
sale_items = SaleItem.select("sale_id,product_code,item_instance_code, sale_items = SaleItem.select("sale_id,product_code,item_instance_code,
product_name,product_alt_name,account_id,status,remark, product_name,product_alt_name,account_id,status,remark,
(CASE WHEN (qty > 0 AND remark IS NULL) OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(qty) ELSE qty END) as qty, (CASE WHEN (qty > 0 AND remark IS NULL) OR (qty < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(qty) ELSE qty END) as qty,
unit_price, unit_price,
taxable_price, taxable_price,
(CASE WHEN (price > 0 AND remark IS NULL) OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(price) ELSE price END) as price, (CASE WHEN (price > 0 AND remark IS NULL) OR (price < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(price) ELSE price END) as price,
is_taxable") is_taxable")
.where("sale_id = ?",sale_id) .where("sale_id = ?",sale_id)
.order("product_name asc") .order("product_name asc")

View File

@@ -106,9 +106,9 @@ class MoveTablePdf < Prawn::Document
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -118,9 +118,9 @@ class OrderItemCustomisePdf < Prawn::Document
if alt_name if alt_name
if order_item.alt_name if order_item.alt_name
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/Zawgyi-One.ttf") do
text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -117,9 +117,9 @@ class OrderItemPdf < Prawn::Document
if alt_name if alt_name
if order_item.alt_name if order_item.alt_name
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -116,14 +116,14 @@ class OrderItemSlimCustomisePdf < Prawn::Document
end end
# if alt_name if alt_name
# if order_item_slim.alt_name if order_item_slim.alt_name
# move_down 1 move_down 1
# font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
# text "(#{order_item_slim.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_item_slim.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
# end # end
# end end
# end end
if !options.empty? if !options.empty?
move_down 1 move_down 1

View File

@@ -88,7 +88,8 @@ class OrderItemSlimPdf < Prawn::Document
#Add Order Item #Add Order Item
add_order_items_slim(order_item_slim, options, alt_name, precision) add_order_items_slim(order_item_slim, options, alt_name, precision)
puts options
puts '............PDF OPTIONS...............'
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)
add_updated_qty_text(before_updated_qty, order_item_slim.qty, precision) add_updated_qty_text(before_updated_qty, order_item_slim.qty, precision)
@@ -117,9 +118,9 @@ class OrderItemSlimPdf < Prawn::Document
if alt_name if alt_name
if order_item_slim.alt_name if order_item_slim.alt_name
move_down 1 move_down 1
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_item_slim.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_item_slim.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -117,9 +117,9 @@ class OrderSetItemCustomisePdf < Prawn::Document
if alt_name if alt_name
if order_set_item.alt_name if order_set_item.alt_name
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_set_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_set_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -116,9 +116,9 @@ class OrderSetItemPdf < Prawn::Document
if alt_name if alt_name
if order_set_item.alt_name if order_set_item.alt_name
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_set_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{order_set_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -124,9 +124,9 @@ class OrderSummaryCustomisePdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -134,9 +134,9 @@ class OrderSummaryPdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -123,9 +123,9 @@ class OrderSummarySetCustomisePdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -133,9 +133,9 @@ class OrderSummarySetPdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 4 move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -126,9 +126,9 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 1 move_down 1
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -133,9 +133,9 @@ class OrderSummarySlimPdf < Prawn::Document
if alt_name if alt_name
if !(odi.alt_name).empty? if !(odi.alt_name).empty?
move_down 1 move_down 1
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end

View File

@@ -305,9 +305,9 @@ class ReceiptBillA5Pdf < Prawn::Document
if show_alt_name if show_alt_name
if !(item.product_alt_name).empty? if !(item.product_alt_name).empty?
move_down 2 move_down 2
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end
move_down line_move move_down line_move

View File

@@ -285,9 +285,9 @@ class ReceiptBillOrderPdf < Prawn::Document
if show_alt_name if show_alt_name
if !(item.product_alt_name).empty? if !(item.product_alt_name).empty?
move_down 2 move_down 2
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end
move_down line_move move_down line_move

View File

@@ -299,9 +299,9 @@ class ReceiptBillPdf < Prawn::Document
if show_alt_name if show_alt_name
if !(item.product_alt_name).empty? if !(item.product_alt_name).empty?
move_down 2 move_down 2
font("public/fonts/NotoSansCJKtc-Regular.ttf") do # font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true text "(#{item.product_alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end # end
end end
end end
move_down line_move move_down line_move

View File

@@ -0,0 +1,83 @@
# ## SQLIte3 --- Setup
#
# # SQLite version 3.x
# # gem install sqlite3
# #
# # Ensure the SQLite 3 gem is defined in your Gemfile
# # gem 'sqlite3'
# #
# default: &default
# adapter: sqlite3
# pool: 5
# timeout: 5000
#
# development:
# <<: *default
# database: db/development.sqlite3
#
# # Warning: The database defined as "test" will be erased and
# # re-generated from your development database when you run "rake".
# # Do not set this db to the same as development or production.
# test:
# <<: *default
# database: db/test.sqlite3
#
# production:
# <<: *default
# database: db/production.sqlite3
# Mysql --- Setup
# MySQL. Versions 5.0 and up are supported.
#
# Install the MySQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.7/en/old-client.html
#
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: root
socket: /tmp/mysql.sock
development:
<<: *default
database: SXRestaurants_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: SXRestaurants_test
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:
<<: *default
database: SXRestaurants_production
username: root
password: root

View File

@@ -20,11 +20,11 @@ class ActionController::Base
end end
else else
# check for license file # check for license file
# if check_license if check_license
# current_license(ENV["SX_PROVISION_URL"]) current_license(ENV["SX_PROVISION_URL"])
# else else
# redirect_to activate_path redirect_to activate_path
# end end
end end
end end

View File

@@ -1,15 +0,0 @@
iv_key: 0zVzQvzlcJhc1d1EuA2HRg==
shop_name: aungcafe
email: devops@code2lab.com
telephone:
fax:
address:
dbhost: NGg7s8bJBfbDrkIeQhV+obOyEtgxtI3Dvf+b+eBm0P+r3aT+dBqHnwVEaIwsafXPFNXavhR/C0iyni1Lszkfyw==
dbschema: X+F4yj1eQlGPiMtsgZQCqWi2NIdBLUCEj35vF4XQDZc=
dbusername: 5CSlQR48ZAiRwWlTxzOZcw==
dbpassword: uzPlzsPjbWhJHcbStJSS0A==
api_token: RaZKWQwnKpvbdJvyAiMGGZPUKuJkWbE
app_token: dCKGOGvdFsCzOUrvhdrFqoOaAUzwtEUC
plan_sku: Qy0IoCIrNawRA2WjS3aLPg==
renewable_date: vGwTpixrL9biHkxdRdGctA==
plan_name: E9Njdqdou4eMpPaWDevpT95fpksDti2xvY+0u3PzKp0=

View File

@@ -1,10 +1,10 @@
#application_path="#{File.expand_path("../..", __FILE__)}" application_path="#{File.expand_path("../..", __FILE__)}"
#directory application_path directory application_path
#environment ENV.fetch("RAILS_ENV") { "production" } #environment ENV.fetch("RAILS_ENV") { "production" }
#environment "production" environment "production"
#pidfile "#{application_path}/tmp/puma/pid" pidfile "#{application_path}/tmp/puma/pid"
#state_path "#{application_path}/tmp/puma/state" state_path "#{application_path}/tmp/puma/state"
#stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
#port ENV.fetch("PORT") { 62158 } port ENV.fetch("PORT") { 62158 }
#workers 2 workers 2
#preload_app! preload_app!

7398
install Normal file

File diff suppressed because it is too large Load Diff