Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring

This commit is contained in:
Phyo
2017-08-14 15:33:28 +06:30
12 changed files with 39 additions and 52 deletions

View File

@@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def print_setting_params
params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
end
end

View File

@@ -41,8 +41,8 @@ class Ability
can :index, :void_sale
can :get_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
can :index, :other_charge
can :create, :other_charge
@@ -57,7 +57,7 @@ class Ability
can :reprint, :payment
can :rounding_adj, :payment
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -71,14 +71,14 @@ class Ability
can :overall_void, :void
elsif user.role == "cashier"
# can :overall_void, :void
can :read, Order
can :update, Order
can :read, Sale
can :update, Sale
can :read, Sale
can :update, Sale
can :get_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
@@ -97,7 +97,7 @@ class Ability
can :reprint, :payment
can :rounding_adj, :payment
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -108,7 +108,7 @@ class Ability
can :reprint, :payment
can :manage, DiningQueue
elsif user.role == "account"
can :index, :dailysale
@@ -128,6 +128,13 @@ class Ability
can :apply_void, :sale_edit
can :overall_void, :void
can :first_bill, :payment
can :citem_edit, :sale_edit
can :item_void_cancel, :sale_edit
can :cancel_all_void, :sale_edit
can :apply_void, :sale_edit
can :overall_void, :void
can :first_bill, :payment
can :create, :payment
can :show, :payment

View File

@@ -1,8 +1,8 @@
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)
self.page_width = 210
self.page_height = 7000
self.page_width = PrintSetting.where("name = ?","Close Cashier").first.page_width
self.page_height = PrintSetting.where("name = ?","Close Cashier").first.page_height
self.margin = 5
self.price_width = 40
self.qty_width = 20

View File

@@ -1,8 +1,8 @@
class CrmOrderPdf < Prawn::Document
attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width
def initialize(booking,order_items,printer_settings)
self.p_width = 200
self.page_height = 1450
self.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width
self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height
self.margin = 10
# self.price_width = self.p_width / 2
self.price_width=80

View File

@@ -2,8 +2,8 @@ class OrderItemPdf < Prawn::Document
include ActionView::Helpers::NumberHelper
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
def initialize(print_settings,order_item, print_status, options, alt_name)
self.page_width = 185
self.page_height = 1450
self.page_width = PrintSetting.where("name = ?","OrderItemPdf").first.page_width
self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height
self.margin = 0
self.price_width = 40 # No Need for item
self.qty_width = 40

View File

@@ -2,8 +2,8 @@ class OrderSummaryPdf < Prawn::Document
include ActionView::Helpers::NumberHelper
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
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
self.page_width = 190
self.page_height = 1450
self.page_width = PrintSetting.where("name = ?","Order Summary").first.page_width
self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height
self.margin = 0
self.price_width = 40 # No Need for item
self.qty_width = 40

View File

@@ -1,8 +1,8 @@
class QueueNoPdf < 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
def initialize(printer_settings, queue)
self.page_width = 210
self.page_height = 1450
self.page_width = PrintSetting.where("name = ?","Queue No").first.page_width
self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height
self.margin = 5
self.price_width = 35
self.qty_width = 20

View File

@@ -2,8 +2,8 @@ class ReceiptBillPdf < Prawn::Document
include ActionView::Helpers::NumberHelper
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, :description_width, :price_num_width
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status)
self.page_width = 210
self.page_height = 1450
self.page_width = PrintSetting.where("name = ?","Receipt Bill").first.page_width
self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height
self.margin = 5
self.price_width = 40
self.qty_width = 20

View File

@@ -5,10 +5,6 @@
<%= f.input :name %>
<%= f.input :unique_code %>
<%= f.input :template %>
<%= f.input :db_name %>
<%= f.input :db_type %>
<%= f.input :db_username %>
<%= f.input :db_password %>
<%= f.input :printer_name %>
<%= f.input :api_settings %>
<%= f.input :page_width %>

View File

@@ -16,11 +16,7 @@
<tr>
<th>Name</th>
<th>Unique code</th>
<!--<th>Template</th>
<th>Db name</th>
<th>Db type</th>
<th>Db username</th>
<th>Db password</th> -->
<th>Template</th>
<th>Printer name</th>
<th>Api settings</th>
<th>Page width</th>
@@ -38,11 +34,7 @@
<tr>
<td><%= print_setting.name %></td>
<td><%= print_setting.unique_code %></td>
<!--<td><%= print_setting.template %></td>
<td><%= print_setting.db_name %></td>
<td><%= print_setting.db_type %></td>
<td><%= print_setting.db_username %></td>
<td><%= print_setting.db_password %></td> -->
<td><%= print_setting.template %></td>
<td><%= print_setting.printer_name %></td>
<td><%= print_setting.api_settings %></td>
<td><%= print_setting.page_width %></td>

View File

@@ -29,22 +29,6 @@
<th>Template</th>
<td><%= @print_setting.template %></td>
</tr>
<tr>
<th>Db name</th>
<td><%= @print_setting.db_name %></td>
</tr>
<tr>
<th>Db type</th>
<td><%= @print_setting.db_type %></td>
</tr>
<tr>
<th>Db username</th>
<td><%= @print_setting.db_username %></td>
</tr>
<tr>
<th>Db password</th>
<td><%= @print_setting.db_password %></td>
</tr>
<tr>
<th>Printer name</th>
<td><%= @print_setting.printer_name %></td>

View File

@@ -0,0 +1,8 @@
class RemoveDBcolsFromPrintSettings < ActiveRecord::Migration[5.1]
def change
remove_column :print_settings, :db_name, :string
remove_column :print_settings, :db_type, :string
remove_column :print_settings, :db_username, :string
remove_column :print_settings, :db_password, :string
end
end