-
-
diff --git a/app/views/origami/home/index_old.html.erb b/app/views/origami/home/index_old.html.erb
new file mode 100644
index 00000000..d480cf8d
--- /dev/null
+++ b/app/views/origami/home/index_old.html.erb
@@ -0,0 +1,328 @@
+
+
+
diff --git a/app/views/origami/card_payments/index.html.erb b/app/views/origami/others_payments/index.html.erb
similarity index 100%
rename from app/views/origami/card_payments/index.html.erb
rename to app/views/origami/others_payments/index.html.erb
diff --git a/app/views/origami/request_bills/show.html.erb b/app/views/origami/payments/show.html.erb
similarity index 88%
rename from app/views/origami/request_bills/show.html.erb
rename to app/views/origami/payments/show.html.erb
index 573a63f4..ccd9fd77 100644
--- a/app/views/origami/request_bills/show.html.erb
+++ b/app/views/origami/payments/show.html.erb
@@ -4,12 +4,10 @@
@@ -89,7 +87,7 @@
-
CARD
+
OTHERS PAYMENT
0.0
@@ -152,8 +150,8 @@
@@ -174,6 +172,7 @@ $(document).on('click', '.cashier_number', function(event){
original_value = $('#cash').text();
var input_type = $(this).attr("data-type");
+
switch (input_type) {
case 'num':
var input_value = $(this).attr("data-value");
@@ -193,6 +192,10 @@ $(document).on('click', '.cashier_number', function(event){
update_balance();
break;
+ case 'clr':
+ $('#cash').text("0.0");
+ update_balance();
+ break;
}
event.handled = true;
} else {
@@ -209,16 +212,28 @@ $( document ).ready(function() {
$('#card_payment').click(function() {
var sale_id = $('#sale_id').text();
- window.location.href = '/origami/sale/'+ sale_id + "/payment/card_payment"
+ window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
return false;
});
$('#pay').click(function() {
- console.log("pay")
- if($('#amount_due').text() > 0){
- console.log("greater")
+
+ if($('#balance').text() > 0){
+ alert(" Insufficient Amount!")
}else{
- console.log("less")
+ // payment
+ var cash = $('#cash').text();
+ var credit = $('#credit').text();
+ var card = $('#card').text();
+ var sale_id = $('#sale_id').text();
+ $.ajax({type: "POST",
+ url: "<%= origami_payment_process_path %>",
+ data: "cash="+ cash + "&sale_id=" + sale_id,
+ success:function(result){
+ alert("THANK YOU")
+ }
+ });
+
}
});
diff --git a/app/views/settings/menu_item_options/show.html.erb b/app/views/settings/menu_item_options/show.html.erb
index fdcb9d09..611f3165 100644
--- a/app/views/settings/menu_item_options/show.html.erb
+++ b/app/views/settings/menu_item_options/show.html.erb
@@ -2,8 +2,7 @@
diff --git a/app/views/settings/set_menu_items/_form.html.erb b/app/views/settings/set_menu_items/_form.html.erb
index bdf0e97e..aeae0f5c 100644
--- a/app/views/settings/set_menu_items/_form.html.erb
+++ b/app/views/settings/set_menu_items/_form.html.erb
@@ -6,6 +6,7 @@
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :type %>
+ <%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
<%= f.input :menu_item_id, :label => "Parent Menu Item", :collection => MenuItem.collection %>
<%= f.input :min_qty %>
diff --git a/app/views/settings/set_menu_items/show.html.erb b/app/views/settings/set_menu_items/show.html.erb
index 0082c819..ba23771f 100644
--- a/app/views/settings/set_menu_items/show.html.erb
+++ b/app/views/settings/set_menu_items/show.html.erb
@@ -19,6 +19,7 @@
Name |
Alt name |
Type |
+
Account Type |
Menu category |
Menu item |
Min qty |
@@ -35,6 +36,7 @@
<%= @settings_menu_item.name rescue "-" %> |
<%= @settings_menu_item.alt_name %> |
<%= @settings_menu_item.type %> |
+
<%= @settings_menu_item.account.title %> |
<%= @settings_menu_item.menu_category_id %> |
<%= @settings_menu_item.menu_item_id %> |
<%= @settings_menu_item.min_qty %> |
diff --git a/app/views/settings/simple_menu_items/_form.html.erb b/app/views/settings/simple_menu_items/_form.html.erb
index 885f725e..01c5b482 100644
--- a/app/views/settings/simple_menu_items/_form.html.erb
+++ b/app/views/settings/simple_menu_items/_form.html.erb
@@ -6,6 +6,7 @@
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :type %>
+ <%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
<%= f.input :menu_item_id, :label => "Parent Menu Item", :collection => MenuItem.collection %>
<%= f.input :min_qty %>
<%= f.input :min_selectable_item %>
diff --git a/app/views/settings/simple_menu_items/show.html.erb b/app/views/settings/simple_menu_items/show.html.erb
index d2d93e0e..11620acd 100644
--- a/app/views/settings/simple_menu_items/show.html.erb
+++ b/app/views/settings/simple_menu_items/show.html.erb
@@ -21,6 +21,7 @@
Name |
Alt name |
Type |
+
Accout |
Menu category |
Menu item |
Min qty |
@@ -37,6 +38,7 @@
<%= @settings_menu_item.name rescue "-" %> |
<%= @settings_menu_item.alt_name %> |
<%= @settings_menu_item.type %> |
+
<%= @settings_menu_item.account.title %> |
<%= @settings_menu_item.menu_category_id %> |
<%= @settings_menu_item.menu_item_id %> |
<%= @settings_menu_item.min_qty %> |
diff --git a/config/routes.rb b/config/routes.rb
index 64b5feeb..b988579d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -68,14 +68,19 @@ Rails.application.routes.draw do
namespace :origami do
root "home#index"
get "/:booking_id" => "home#show" do #origami/:booking_id will show
- resources :payments, only: [:index, :new, :create ] #add payment by payment_method
resources :discounts, only: [:index,:new, :create ] #add discount type
resources :customers, only: [:index,:new, :create ] #add customer type
end
- # resources :request_bills, only: [:show]
- get 'sale/:sale_id/payment' => 'request_bills#show'
+
+
+ get "/request_bills/:id" => "request_bills#print"
+
+ get 'sale/:sale_id/payment' => 'payments#show'
+ post 'payment_process' => 'payments#create'
+
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
- get 'sale/:sale_id/payment/card_payment' => "card_payments#index"
+ get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
+
end
#--------- Waiter/Ordering Station ------------#
diff --git a/db/migrate/20170324135138_create_zones.rb b/db/migrate/20170324135138_create_zones.rb
index 30a92048..00139170 100644
--- a/db/migrate/20170324135138_create_zones.rb
+++ b/db/migrate/20170324135138_create_zones.rb
@@ -1,4 +1,4 @@
-class CreateZones < ActiveRecord::Migration[5.0]
+class CreateZones < ActiveRecord::Migration[5.1]
def change
create_table :zones do |t|
t.string :name, :null => false
diff --git a/db/migrate/20170325111608_create_menus.rb b/db/migrate/20170325111608_create_menus.rb
index a542de50..84efdf2d 100644
--- a/db/migrate/20170325111608_create_menus.rb
+++ b/db/migrate/20170325111608_create_menus.rb
@@ -1,4 +1,4 @@
-class CreateMenus < ActiveRecord::Migration[5.0]
+class CreateMenus < ActiveRecord::Migration[5.1]
def change
create_table :menus do |t|
t.string :name
diff --git a/db/migrate/20170327152733_create_menu_categories.rb b/db/migrate/20170327152733_create_menu_categories.rb
index 9315e61e..59e3a8c9 100644
--- a/db/migrate/20170327152733_create_menu_categories.rb
+++ b/db/migrate/20170327152733_create_menu_categories.rb
@@ -1,4 +1,4 @@
-class CreateMenuCategories < ActiveRecord::Migration[5.0]
+class CreateMenuCategories < ActiveRecord::Migration[5.1]
def change
create_table :menu_categories do |t|
t.references :menu, foreign_key: true
diff --git a/db/migrate/20170602101727_create_accounts.rb b/db/migrate/20170331024747_create_accounts.rb
similarity index 100%
rename from db/migrate/20170602101727_create_accounts.rb
rename to db/migrate/20170331024747_create_accounts.rb
diff --git a/db/migrate/20170331024749_create_menu_items.rb b/db/migrate/20170331024749_create_menu_items.rb
index f61a9172..a67156c5 100644
--- a/db/migrate/20170331024749_create_menu_items.rb
+++ b/db/migrate/20170331024749_create_menu_items.rb
@@ -1,4 +1,4 @@
-class CreateMenuItems < ActiveRecord::Migration[5.0]
+class CreateMenuItems < ActiveRecord::Migration[5.1]
def change
create_table :menu_items do |t|
t.string :item_code, :null => false
@@ -10,6 +10,7 @@ class CreateMenuItems < ActiveRecord::Migration[5.0]
t.string :type, :null => false, :default => "SimpleMenuItem"
t.references :menu_category, foreign_key: true
t.references :menu_item, foreign_key: true
+ t.references :account, foreign_key: true
t.integer :min_qty, :null => false, :default => 1
t.boolean :taxable, :null => false, :default => true
t.integer :min_selectable_item, :null => false, :default => 1
diff --git a/db/migrate/20170402083337_create_menu_item_attributes.rb b/db/migrate/20170402083337_create_menu_item_attributes.rb
index b2c3b0fd..302202a6 100644
--- a/db/migrate/20170402083337_create_menu_item_attributes.rb
+++ b/db/migrate/20170402083337_create_menu_item_attributes.rb
@@ -1,4 +1,4 @@
-class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
+class CreateMenuItemAttributes < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_attributes do |t|
t.string :attribute_type, :null => false
diff --git a/db/migrate/20170402083525_create_menu_item_options.rb b/db/migrate/20170402083525_create_menu_item_options.rb
index a9e9734a..841b66a0 100644
--- a/db/migrate/20170402083525_create_menu_item_options.rb
+++ b/db/migrate/20170402083525_create_menu_item_options.rb
@@ -1,4 +1,4 @@
-class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
+class CreateMenuItemOptions < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_options do |t|
t.string :name, :null => false
diff --git a/db/migrate/20170402084230_create_menu_item_instances.rb b/db/migrate/20170402084230_create_menu_item_instances.rb
index d5effcbf..c79cb322 100644
--- a/db/migrate/20170402084230_create_menu_item_instances.rb
+++ b/db/migrate/20170402084230_create_menu_item_instances.rb
@@ -1,4 +1,4 @@
-class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
+class CreateMenuItemInstances < ActiveRecord::Migration[5.1]
def change
create_table :menu_item_instances do |t|
t.references :menu_item, :foreign_key => true, :null => false
diff --git a/db/migrate/20170403135121_create_customers.rb b/db/migrate/20170403135121_create_customers.rb
index 8094f035..318e7bf1 100644
--- a/db/migrate/20170403135121_create_customers.rb
+++ b/db/migrate/20170403135121_create_customers.rb
@@ -1,10 +1,10 @@
-class CreateCustomers < ActiveRecord::Migration[5.0]
+class CreateCustomers < ActiveRecord::Migration[5.1]
def change
create_table :customers, :id => false do |t|
t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
t.string :name, :null => false
t.string :company
- t.string :contact_no
+ t.string :contact_no, :unique => true
t.string :email
t.date :date_of_birth
t.string :membership_id
diff --git a/db/migrate/20170403135934_create_orders.rb b/db/migrate/20170403135934_create_orders.rb
index a80e2760..4439bdba 100644
--- a/db/migrate/20170403135934_create_orders.rb
+++ b/db/migrate/20170403135934_create_orders.rb
@@ -1,4 +1,4 @@
-class CreateOrders < ActiveRecord::Migration[5.0]
+class CreateOrders < ActiveRecord::Migration[5.1]
def change
create_table :orders, :id => false do |t|
t.string :order_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
diff --git a/db/migrate/20170403140820_create_order_items.rb b/db/migrate/20170403140820_create_order_items.rb
index 32760907..b0f43c32 100644
--- a/db/migrate/20170403140820_create_order_items.rb
+++ b/db/migrate/20170403140820_create_order_items.rb
@@ -1,4 +1,4 @@
-class CreateOrderItems < ActiveRecord::Migration[5.0]
+class CreateOrderItems < ActiveRecord::Migration[5.1]
def change
create_table :order_items, :id => false do |t|
t.string :order_items_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403142424_create_dining_facilities.rb b/db/migrate/20170403142424_create_dining_facilities.rb
index 788747d8..599151c6 100644
--- a/db/migrate/20170403142424_create_dining_facilities.rb
+++ b/db/migrate/20170403142424_create_dining_facilities.rb
@@ -1,4 +1,4 @@
-class CreateDiningFacilities < ActiveRecord::Migration[5.0]
+class CreateDiningFacilities < ActiveRecord::Migration[5.1]
def change
create_table :dining_facilities do |t|
t.references :zone, foreign_key: true
diff --git a/db/migrate/20170403151731_create_order_queue_stations.rb b/db/migrate/20170403151731_create_order_queue_stations.rb
index f5c84269..6ad93bb1 100644
--- a/db/migrate/20170403151731_create_order_queue_stations.rb
+++ b/db/migrate/20170403151731_create_order_queue_stations.rb
@@ -1,4 +1,4 @@
-class CreateOrderQueueStations < ActiveRecord::Migration[5.0]
+class CreateOrderQueueStations < ActiveRecord::Migration[5.1]
def change
create_table :order_queue_stations do |t|
t.string :station_name, :null => false
diff --git a/db/migrate/20170403152600_create_order_queue_process_by_zones.rb b/db/migrate/20170403152600_create_order_queue_process_by_zones.rb
index d6b7d207..8f0ee73c 100644
--- a/db/migrate/20170403152600_create_order_queue_process_by_zones.rb
+++ b/db/migrate/20170403152600_create_order_queue_process_by_zones.rb
@@ -1,4 +1,4 @@
-class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.0]
+class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.1]
def change
create_table :order_queue_process_by_zones do |t|
t.references :order_queue_station, :null => false
diff --git a/db/migrate/20170403153001_create_payment_method_settings.rb b/db/migrate/20170403153001_create_payment_method_settings.rb
index 2fea9098..981d42d3 100644
--- a/db/migrate/20170403153001_create_payment_method_settings.rb
+++ b/db/migrate/20170403153001_create_payment_method_settings.rb
@@ -1,4 +1,4 @@
-class CreatePaymentMethodSettings < ActiveRecord::Migration[5.0]
+class CreatePaymentMethodSettings < ActiveRecord::Migration[5.1]
def change
create_table :payment_method_settings do |t|
t.string :payment_method, :null => false
diff --git a/db/migrate/20170403155230_create_employees.rb b/db/migrate/20170403155230_create_employees.rb
index a283ec95..c4bf65ac 100644
--- a/db/migrate/20170403155230_create_employees.rb
+++ b/db/migrate/20170403155230_create_employees.rb
@@ -1,4 +1,4 @@
-class CreateEmployees < ActiveRecord::Migration[5.0]
+class CreateEmployees < ActiveRecord::Migration[5.1]
def change
create_table :employees do |t|
t.string :name, :null => false
diff --git a/db/migrate/20170403155500_create_cashier_terminals.rb b/db/migrate/20170403155500_create_cashier_terminals.rb
index dc5a5eb5..274c7914 100644
--- a/db/migrate/20170403155500_create_cashier_terminals.rb
+++ b/db/migrate/20170403155500_create_cashier_terminals.rb
@@ -1,4 +1,4 @@
-class CreateCashierTerminals < ActiveRecord::Migration[5.0]
+class CreateCashierTerminals < ActiveRecord::Migration[5.1]
def change
create_table :cashier_terminals do |t|
t.string :name, :null => false
diff --git a/db/migrate/20170403155531_create_cashier_login_logs.rb b/db/migrate/20170403155531_create_cashier_login_logs.rb
index 176c5cae..0887f3bd 100644
--- a/db/migrate/20170403155531_create_cashier_login_logs.rb
+++ b/db/migrate/20170403155531_create_cashier_login_logs.rb
@@ -1,4 +1,4 @@
-class CreateCashierLoginLogs < ActiveRecord::Migration[5.0]
+class CreateCashierLoginLogs < ActiveRecord::Migration[5.1]
def change
create_table :cashier_login_logs, :id => false, :primary_key => :cashier_login_log_id do |t|
t.string :cashier_login_log_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403160742_create_sales.rb b/db/migrate/20170403160742_create_sales.rb
index c2bb718a..7e4850f1 100644
--- a/db/migrate/20170403160742_create_sales.rb
+++ b/db/migrate/20170403160742_create_sales.rb
@@ -1,4 +1,4 @@
-class CreateSales < ActiveRecord::Migration[5.0]
+class CreateSales < ActiveRecord::Migration[5.1]
def change
create_table :sales, :id => false do |t|
t.string :sale_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403161857_create_sale_items.rb b/db/migrate/20170403161857_create_sale_items.rb
index aaf1dac3..cb07db08 100644
--- a/db/migrate/20170403161857_create_sale_items.rb
+++ b/db/migrate/20170403161857_create_sale_items.rb
@@ -1,4 +1,4 @@
-class CreateSaleItems < ActiveRecord::Migration[5.0]
+class CreateSaleItems < ActiveRecord::Migration[5.1]
def change
create_table :sale_items, :id => false do |t|
t.string :sale_item_id, :limit => 16, :primary_key => true#custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403163219_create_sale_taxes.rb b/db/migrate/20170403163219_create_sale_taxes.rb
index 3d28381a..ef52c9dc 100644
--- a/db/migrate/20170403163219_create_sale_taxes.rb
+++ b/db/migrate/20170403163219_create_sale_taxes.rb
@@ -1,4 +1,4 @@
-class CreateSaleTaxes < ActiveRecord::Migration[5.0]
+class CreateSaleTaxes < ActiveRecord::Migration[5.1]
def change
create_table :sale_taxes, :id => false do |t|
t.string :sale_tax_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403163734_create_sale_payments.rb b/db/migrate/20170403163734_create_sale_payments.rb
index 3badca93..0e2f308a 100644
--- a/db/migrate/20170403163734_create_sale_payments.rb
+++ b/db/migrate/20170403163734_create_sale_payments.rb
@@ -1,4 +1,4 @@
-class CreateSalePayments < ActiveRecord::Migration[5.0]
+class CreateSalePayments < ActiveRecord::Migration[5.1]
def change
create_table :sale_payments, :id => false do |t|
t.string :sale_payment_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403174029_create_sale_orders.rb b/db/migrate/20170403174029_create_sale_orders.rb
index 3da13e60..e2b3fe40 100644
--- a/db/migrate/20170403174029_create_sale_orders.rb
+++ b/db/migrate/20170403174029_create_sale_orders.rb
@@ -1,4 +1,4 @@
-class CreateSaleOrders < ActiveRecord::Migration[5.0]
+class CreateSaleOrders < ActiveRecord::Migration[5.1]
def change
create_table :sale_orders, :id => false do |t|
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170403174111_create_sale_audits.rb b/db/migrate/20170403174111_create_sale_audits.rb
index ae6ba3f4..e1dcfffd 100644
--- a/db/migrate/20170403174111_create_sale_audits.rb
+++ b/db/migrate/20170403174111_create_sale_audits.rb
@@ -1,4 +1,4 @@
-class CreateSaleAudits < ActiveRecord::Migration[5.0]
+class CreateSaleAudits < ActiveRecord::Migration[5.1]
def change
create_table :sale_audits, :id => false do |t|
t.string :sale_audit_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
@@ -7,8 +7,8 @@ class CreateSaleAudits < ActiveRecord::Migration[5.0]
t.string :action, :null => false
t.datetime :action_at, :null => false
t.string :action_by, :null => false
- t.string :approved_by, :null => false
- t.datetime :approved_by, :null => false
+ t.string :approved_by, :null => true
+ t.datetime :approved_at, :null => true
t.string :remark
t.timestamps
end
diff --git a/db/migrate/20170403174309_create_lookups.rb b/db/migrate/20170403174309_create_lookups.rb
index a825cc8f..2fbd3fa7 100644
--- a/db/migrate/20170403174309_create_lookups.rb
+++ b/db/migrate/20170403174309_create_lookups.rb
@@ -1,4 +1,4 @@
-class CreateLookups < ActiveRecord::Migration[5.0]
+class CreateLookups < ActiveRecord::Migration[5.1]
def change
create_table :lookups do |t|
t.string :lookup_type, :null => false
diff --git a/db/migrate/20170403183755_create_tax_profiles.rb b/db/migrate/20170403183755_create_tax_profiles.rb
index 7f9893d5..1f9dfceb 100644
--- a/db/migrate/20170403183755_create_tax_profiles.rb
+++ b/db/migrate/20170403183755_create_tax_profiles.rb
@@ -1,4 +1,4 @@
-class CreateTaxProfiles < ActiveRecord::Migration[5.0]
+class CreateTaxProfiles < ActiveRecord::Migration[5.1]
def change
create_table :tax_profiles do |t|
t.string :name, :null => false
diff --git a/db/migrate/20170404034234_create_bookings.rb b/db/migrate/20170404034234_create_bookings.rb
index f41e8fb4..89795a83 100644
--- a/db/migrate/20170404034234_create_bookings.rb
+++ b/db/migrate/20170404034234_create_bookings.rb
@@ -1,4 +1,4 @@
-class CreateBookings < ActiveRecord::Migration[5.0]
+class CreateBookings < ActiveRecord::Migration[5.1]
def change
create_table :bookings, :id => false do |t|
t.string :booking_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170408105938_create_seed_generators.rb b/db/migrate/20170408105938_create_seed_generators.rb
index eb58749a..14e62fe1 100644
--- a/db/migrate/20170408105938_create_seed_generators.rb
+++ b/db/migrate/20170408105938_create_seed_generators.rb
@@ -1,4 +1,4 @@
-class CreateSeedGenerators < ActiveRecord::Migration[5.0]
+class CreateSeedGenerators < ActiveRecord::Migration[5.1]
def change
create_table :seed_generators do |t|
t.string :model, :null => false, :default => "sale"
diff --git a/db/migrate/20170414071634_create_membership_settings.rb b/db/migrate/20170414071634_create_membership_settings.rb
index e15bf082..fca5cce4 100644
--- a/db/migrate/20170414071634_create_membership_settings.rb
+++ b/db/migrate/20170414071634_create_membership_settings.rb
@@ -1,4 +1,4 @@
-class CreateMembershipSettings < ActiveRecord::Migration[5.0]
+class CreateMembershipSettings < ActiveRecord::Migration[5.1]
def change
create_table :membership_settings do |t|
t.string :membership_type, :null => false, :default => "internal"
diff --git a/db/migrate/20170414090001_create_assigned_order_items.rb b/db/migrate/20170414090001_create_assigned_order_items.rb
index 02b95017..3eaf58cf 100644
--- a/db/migrate/20170414090001_create_assigned_order_items.rb
+++ b/db/migrate/20170414090001_create_assigned_order_items.rb
@@ -1,4 +1,4 @@
-class CreateAssignedOrderItems < ActiveRecord::Migration[5.0]
+class CreateAssignedOrderItems < ActiveRecord::Migration[5.1]
def change
create_table :assigned_order_items, :id => false do |t|
t.string :assigned_order_item_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170414110918_create_booking_orders.rb b/db/migrate/20170414110918_create_booking_orders.rb
index e9bf7cc0..25e24b43 100644
--- a/db/migrate/20170414110918_create_booking_orders.rb
+++ b/db/migrate/20170414110918_create_booking_orders.rb
@@ -1,4 +1,4 @@
-class CreateBookingOrders < ActiveRecord::Migration[5.0]
+class CreateBookingOrders < ActiveRecord::Migration[5.1]
def change
create_table :booking_orders, :id => false do |t|
#t.string :booking_order_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
diff --git a/db/migrate/20170421171849_add_company_address_email.rb b/db/migrate/20170421171849_add_company_address_email.rb
index fb0e81f1..81667406 100644
--- a/db/migrate/20170421171849_add_company_address_email.rb
+++ b/db/migrate/20170421171849_add_company_address_email.rb
@@ -1,4 +1,4 @@
-class AddCompanyAddressEmail < ActiveRecord::Migration[5.0]
+class AddCompanyAddressEmail < ActiveRecord::Migration[5.1]
def change
end
end
diff --git a/db/migrate/20170507045043_order_items_completed_by.rb b/db/migrate/20170507045043_order_items_completed_by.rb
index a00fdbb4..c6c791c0 100644
--- a/db/migrate/20170507045043_order_items_completed_by.rb
+++ b/db/migrate/20170507045043_order_items_completed_by.rb
@@ -1,4 +1,4 @@
-class OrderItemsCompletedBy < ActiveRecord::Migration[5.0]
+class OrderItemsCompletedBy < ActiveRecord::Migration[5.1]
def change
add_column :order_items, :completed_by, :string
add_column :order_items, :completed_at, :datetime
diff --git a/db/migrate/20170530072247_create_shops.rb b/db/migrate/20170530072247_create_shops.rb
index 25de6c6a..4f07d5c4 100644
--- a/db/migrate/20170530072247_create_shops.rb
+++ b/db/migrate/20170530072247_create_shops.rb
@@ -9,7 +9,7 @@ class CreateShops < ActiveRecord::Migration[5.1]
t.string :state, :null => false
t.string :country, :null => false
t.string :phone_no, :null => false
- t.string :reserviation_no, :null => false
+ t.string :reservation_no, :null => false
t.string :license, :null => false
t.datetime :activated_at, :null => false
t.text :license_data, :null => false
diff --git a/db/seeds.rb b/db/seeds.rb
index 4d7799db..fd9a9e96 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -75,9 +75,8 @@ account_type = Lookup.create([{lookup_type:'account_type', name: 'Income', value
{lookup_type:'account_type', name: 'Expense', value: 'expense'}])
#WALK CUSTOMER - Default CUSTOMER (take key 1)
-customer = Customer.create({id:1, name:"WALK-IN", contact_no:"000000000"})
-customer = Customer.create({id:2, name:"TAKEAWAY", contact_no:"000000000"})
-
+customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000"})
+customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111"})
#Default ZOne
zone = Zone.create({id:1, name: "Default Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
@@ -90,6 +89,9 @@ room = Room.create({name:"Default Room", zone: zone2, status:"available", seater
#Tax Profile
tax_profiles = TaxProfile.create({id:1, name: "Commerical Tax", rate:5.0, order_by:1, created_by:"SYSTEM DEFAULT"})
+#Account for Menu Item Type (eg: Food, Beverage)
+food = Account.create({title: "Food", account_type: "0"})
+beverage = Account.create({title: "Beverage", account_type: "1"})
#Default menu
menu = Menu.create({name: "Default Menu", is_active: true, created_by: "SYSTEM DEFAULT"})
@@ -104,17 +106,17 @@ menu_category3 = MenuCategory.create({menu: menu, code:"C006", name: "Sample Men
menu_category4 = MenuCategory.create({menu: menu, code:"C006", name: "Sample Menu Category 4", alt_name: "Sample Alternate Category 4", order_by: 1, menu_category_id: menu_category3.id, created_by: "SYSTEM DEFAULT"})
#Default Menu items
-menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"01001", name: "Default Menu Item Name 0", alt_name: "Alternate Menu Item Name 0",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1 })
+menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"01001", name: "Default Menu Item Name 0", alt_name: "Alternate Menu Item Name 0",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food })
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"half portion",item_instance_code:"01001-1", menu_item: menu_category1_menu_item0, price:12.00, is_on_promotion:false}])
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"full portion",item_instance_code:"01001-2", menu_item: menu_category1_menu_item0, price:18.00, is_on_promotion:false}])
-menu_category1_menu_item1 = SetMenuItem.create({item_code:"I004", name: "Default Menu Item Name 1", alt_name: "Alternate Menu Item Name 1",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1 })
-menu_category1_menu_item2 = SetMenuItem.create({item_code:"I005", name: "Default Menu Item Name 2",parent: menu_category1_menu_item1, alt_name: "Alternate Menu Item Name 2", min_selectable_item: 1, max_selectable_item:1 })
-menu_category1_menu_item3 = SetMenuItem.create({item_code:"I006", name: "Default Menu Item Name 3",parent: menu_category1_menu_item1, alt_name: "Alternate Menu Item Name 3", min_selectable_item: 1, max_selectable_item:1 })
+menu_category1_menu_item1 = SetMenuItem.create({item_code:"I004", name: "Default Menu Item Name 1", alt_name: "Alternate Menu Item Name 1",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1 , account: food})
+menu_category1_menu_item2 = SetMenuItem.create({item_code:"I005", name: "Default Menu Item Name 2",parent: menu_category1_menu_item1, alt_name: "Alternate Menu Item Name 2", min_selectable_item: 1, max_selectable_item:1 , account: food})
+menu_category1_menu_item3 = SetMenuItem.create({item_code:"I006", name: "Default Menu Item Name 3",parent: menu_category1_menu_item1, alt_name: "Alternate Menu Item Name 3", min_selectable_item: 1, max_selectable_item:1 , account: food})
-menu_category2_menu_item0 = SimpleMenuItem.create({item_code:"I007", name: "Default Menu Item Name 0", alt_name: "Alternate Menu Item Name 0",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 2 })
-menu_category2_menu_item1 = SimpleMenuItem.create({item_code:"I008", name: "Default Menu Item Name 1", alt_name: "Alternate Menu Item Name 1",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 2 })
-menu_category2_menu_item2 = SimpleMenuItem.create({item_code:"I009", name: "Default Menu Item Name 2", alt_name: "Alternate Menu Item Name 2",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 3 })
+menu_category2_menu_item0 = SimpleMenuItem.create({item_code:"I007", name: "Default Menu Item Name 0", alt_name: "Alternate Menu Item Name 0",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 2 , account: food})
+menu_category2_menu_item1 = SimpleMenuItem.create({item_code:"I008", name: "Default Menu Item Name 1", alt_name: "Alternate Menu Item Name 1",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 2 , account: food})
+menu_category2_menu_item2 = SimpleMenuItem.create({item_code:"I009", name: "Default Menu Item Name 2", alt_name: "Alternate Menu Item Name 2",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 3 , account: food})
menu_item_attribute_size_small = MenuItemAttribute.create({attribute_type:"size", name: "Small", value: "small"})
menu_item_attribute_size_medium = MenuItemAttribute.create({attribute_type:"size",name: "Medium", value: "medium"})
@@ -137,3 +139,10 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator",
#Account for Menu Item Type (eg: Food, Beverage)
food = Account.create({title: "Food", account_type: "0"})
beverage = Account.create({title: "Beverage", account_type: "1"})
+
+shop = Shop.create(
+ {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
+ country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",
+ activated_at: "2017-06-06", license_data: "license_data", base_currency: "Ks", id_prefix: "abc"}
+ )
+