Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into august_spring
This commit is contained in:
@@ -55,7 +55,7 @@ class Settings::MenuItemInstancesController < ApplicationController
|
||||
sets = ItemSet.find(params[:menu_item_instance][:item_sets])
|
||||
|
||||
if sets.count > 0
|
||||
@settings_menu_item.item_sets = sets
|
||||
@settings_menu_item_instances.item_sets = sets
|
||||
end
|
||||
end
|
||||
|
||||
@@ -92,7 +92,7 @@ class Settings::MenuItemInstancesController < ApplicationController
|
||||
sets = ItemSet.find(params[:menu_item_instance][:item_sets])
|
||||
|
||||
if sets.count > 0
|
||||
@settings_menu_item.item_sets = sets
|
||||
@settings_menu_item_instances.item_sets = sets
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -132,6 +132,6 @@ class Settings::SetMenuItemsController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_menu_item_params
|
||||
params.require(:set_menu_item).permit(:item_code, :name, :alt_name, :type, :image_path, :menu_category_id,:account_id , :item_attributes, :item_options, :min_qty, :is_sub_item, :is_available, :created_by, :item_sets)
|
||||
params.require(:set_menu_item).permit(:item_code, :name, :alt_name, :type, :image_path, :menu_category_id,:account_id , :item_attributes, :item_options, :min_qty, :is_sub_item, :is_available, :created_by, :item_sets, :unit)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -154,6 +154,6 @@ class Settings::SimpleMenuItemsController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_menu_item_params
|
||||
params.require(:simple_menu_item).permit(:item_code, :name, :alt_name, :type, :image_path, :menu_category_id, :account_id, :item_attributes, :item_options, :min_qty, :is_sub_item, :is_available, :created_by, :item_sets)
|
||||
params.require(:simple_menu_item).permit(:item_code, :name, :alt_name, :type, :image_path, :menu_category_id, :account_id, :item_attributes, :item_options, :min_qty, :is_sub_item, :is_available, :created_by, :item_sets, :unit)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 10
|
||||
# self.price_width = self.p_width / 2
|
||||
self.price_width=80
|
||||
|
||||
@@ -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 = PrintSetting.where("name = ?","OrderItemPdf").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height
|
||||
self.page_width = print_settings.page_width
|
||||
self.page_height = print_settings.page_height
|
||||
self.margin = 0
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 40
|
||||
|
||||
@@ -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 = PrintSetting.where("name = ?","Order Summary").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height
|
||||
self.page_width = print_settings.page_width
|
||||
self.page_height = print_settings.page_height
|
||||
self.margin = 0
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 40
|
||||
|
||||
@@ -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 = PrintSetting.where("name = ?","Queue No").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 35
|
||||
self.qty_width = 20
|
||||
|
||||
@@ -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 = PrintSetting.where("name = ?","Receipt Bill").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 40
|
||||
self.qty_width = 20
|
||||
|
||||
@@ -35,6 +35,7 @@ json.account_id item.account_id
|
||||
json.min_qty item.min_qty
|
||||
json.is_available item.is_available
|
||||
json.is_sub_item item.is_sub_item
|
||||
json.unit item.unit
|
||||
json.item_sets item.item_sets
|
||||
json.attributes attr_format
|
||||
json.options item.item_options
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
transition: color 0.3s ease;
|
||||
line-height: 48px;
|
||||
/*line-height: 48px;*/
|
||||
}
|
||||
|
||||
.card .card-content {
|
||||
@@ -259,7 +259,7 @@
|
||||
border-radius: 0 0 2px 2px;
|
||||
background-clip: padding-box;
|
||||
box-sizing: border-box;
|
||||
height: 120px;
|
||||
/*height: 120px;*/
|
||||
transition: color 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -310,39 +310,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-primary btn-block">Add Order</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled>Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void</button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
|
||||
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block"> Void</button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-primary btn-block" >Add Order</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled>Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void </button>
|
||||
<% else %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block" >Charges</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block" > Void </button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
|
||||
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
|
||||
<% end %>
|
||||
</div>
|
||||
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -303,7 +303,6 @@
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<!-- <button type="button" class="btn btn-primary btn-block" >Add Order</button> -->
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
<%= f.input :is_sub_item, :class => "form-control" %>
|
||||
|
||||
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:class => "form-control" %>
|
||||
|
||||
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
|
||||
|
||||
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
|
||||
|
||||
@@ -16,13 +16,13 @@ $(function(){
|
||||
<%
|
||||
@settings_menu_item.item_sets.each do |set|
|
||||
%>
|
||||
$("#simple_menu_item_item_sets option[value='" + <%= set.id %> + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
$("#set_menu_item_item_sets option[value='" + <%= set.id %> + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
<%
|
||||
end
|
||||
%>
|
||||
|
||||
// After loaded
|
||||
$("#simple_menu_item_item_sets").on('click', 'option', function(e){
|
||||
$("#set_menu_item_item_sets").on('click', 'option', function(e){
|
||||
if($(this).attr("selected")){
|
||||
$(this).removeAttr("selected");
|
||||
$(this).css({'color':'#000','background':'#fff'});
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
<%= f.input :is_sub_item, :class => "form-control" %>
|
||||
|
||||
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:class => "form-control" %>
|
||||
|
||||
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
|
||||
|
||||
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
|
||||
|
||||
@@ -7,6 +7,7 @@ class CreateMenuItems < ActiveRecord::Migration[5.1]
|
||||
t.string :image_path
|
||||
t.text :description
|
||||
t.string :information
|
||||
t.string :unit
|
||||
t.string :type, :null => false, :default => "SimpleMenuItem"
|
||||
t.references :menu_category, foreign_key: true
|
||||
t.json :item_attributes
|
||||
|
||||
@@ -95,8 +95,12 @@ float_value = Lookup.create([{lookup_type:'float_value', name: '500', value: '50
|
||||
|
||||
# customer type
|
||||
customer_type = Lookup.create([{lookup_type:'customer_type', name: 'Dinein', value: 'Dinein'},
|
||||
{lookup_type:'customer_type', name: 'Takeaway', value: 'Takeaway'},
|
||||
{lookup_type:'customer_type', name: 'Delivery', value: 'Delivery'}])
|
||||
{lookup_type:'customer_type', name: 'Takeaway', value: 'Takeaway'},
|
||||
{lookup_type:'customer_type', name: 'Delivery', value: 'Delivery'}])
|
||||
|
||||
#unit
|
||||
units = Lookup.create([{lookup_type:'unit', name: 'PCS', value: 'pcs'},
|
||||
{lookup_type:'unit', name: 'KG', value: 'kg'}])
|
||||
|
||||
# Default CUSTOMER
|
||||
customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000",card_no:"000", customer_type:"Dinein", tax_profiles:["2", "1"]})
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.9 KiB |
Reference in New Issue
Block a user