fix rake shop:create
This commit is contained in:
@@ -4,11 +4,11 @@ namespace :shop do
|
|||||||
|
|
||||||
ActiveRecord::Base.connection.execute("INSERT INTO shops (logo, name, shop_code, subdomain, client_name, client_code, address, township, city, state, country, phone_no, reservation_no, license, activated_at, license_data, base_currency, cloud_url, cloud_token, owner_token, id_prefix, is_rounding_adj, quick_sale_summary, calc_tax_order, show_account_info, note, created_at, updated_at)
|
ActiveRecord::Base.connection.execute("INSERT INTO shops (logo, name, shop_code, subdomain, client_name, client_code, address, township, city, state, country, phone_no, reservation_no, license, activated_at, license_data, base_currency, cloud_url, cloud_token, owner_token, id_prefix, is_rounding_adj, quick_sale_summary, calc_tax_order, show_account_info, note, created_at, updated_at)
|
||||||
VALUES (NULL, '#{args.name}', '#{args.shop_code}', '#{args.subdomain}', '#{args.client_name}', '#{args.client_code}', '#{args.address}', '', '', '', '', '#{args.phone_no}', '111', '', CURRENT_TIMESTAMP(), 'test', '111', NULL, NULL, NULL, '111', 0, 0, 0, 1, '',CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP())")
|
VALUES (NULL, '#{args.name}', '#{args.shop_code}', '#{args.subdomain}', '#{args.client_name}', '#{args.client_code}', '#{args.address}', '', '', '', '', '#{args.phone_no}', '111', '', CURRENT_TIMESTAMP(), 'test', '111', NULL, NULL, NULL, '111', 0, 0, 0, 1, '',CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP())")
|
||||||
logger.info " Shop created for #{args.name}-#{args.shop_code}"
|
Rails.logger.info " Shop created for #{args.name}-#{args.shop_code}"
|
||||||
|
|
||||||
gateway_communication_type =Lookup.create([{lookup_type:'gateway_communication_type',name: 'API',value: 'api',shop_code: args.shop_code},
|
gateway_communication_type =Lookup.create([{lookup_type:'gateway_communication_type',name: 'API',value: 'api',shop_code: args.shop_code},
|
||||||
{lookup_type:'gateway_communication_type',name: 'USB',value: 'usb',shop_code: args.shop_code}])
|
{lookup_type:'gateway_communication_type',name: 'USB',value: 'usb',shop_code: args.shop_code}])
|
||||||
puts " Finished gateway_communication_type Set Up Data"
|
Rails.logger.info " Finished gateway_communication_type Set Up Data"
|
||||||
|
|
||||||
|
|
||||||
payment_methods = Lookup.create([{lookup_type:'payment_methods',name: 'Cash',value: 'cash',shop_code: args.shop_code},
|
payment_methods = Lookup.create([{lookup_type:'payment_methods',name: 'Cash',value: 'cash',shop_code: args.shop_code},
|
||||||
@@ -20,57 +20,57 @@ namespace :shop do
|
|||||||
{lookup_type:'payment_methods',name: 'Card - MPU',value: 'jcb',shop_code: args.shop_code},
|
{lookup_type:'payment_methods',name: 'Card - MPU',value: 'jcb',shop_code: args.shop_code},
|
||||||
{lookup_type:'payment_methods',name: 'Vochure',value: 'vochure',shop_code: args.shop_code},
|
{lookup_type:'payment_methods',name: 'Vochure',value: 'vochure',shop_code: args.shop_code},
|
||||||
{lookup_type:'payment_methods',name: 'Giftcard',value: 'gift',shop_code: args.shop_code}])
|
{lookup_type:'payment_methods',name: 'Giftcard',value: 'gift',shop_code: args.shop_code}])
|
||||||
puts " Finished payment_methods Set Up Data"
|
Rails.logger.info " Finished payment_methods Set Up Data"
|
||||||
|
|
||||||
payment_status = Lookup.create([{lookup_type:'payment_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
payment_status = Lookup.create([{lookup_type:'payment_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
||||||
{lookup_type:'payment_status',name: 'paid',value: 'paid',shop_code: args.shop_code},
|
{lookup_type:'payment_status',name: 'paid',value: 'paid',shop_code: args.shop_code},
|
||||||
{lookup_type:'payment_status',name: 'Fail',value: 'fail',shop_code: args.shop_code},
|
{lookup_type:'payment_status',name: 'Fail',value: 'fail',shop_code: args.shop_code},
|
||||||
{lookup_type:'payment_status',name: 'Outstanding',value: 'outstanding',shop_code: args.shop_code}])
|
{lookup_type:'payment_status',name: 'Outstanding',value: 'outstanding',shop_code: args.shop_code}])
|
||||||
puts " Finished payment_status Set Up Data"
|
Rails.logger.info " Finished payment_status Set Up Data"
|
||||||
|
|
||||||
sales_status = Lookup.create([{lookup_type:'sales_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
sales_status = Lookup.create([{lookup_type:'sales_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
||||||
{lookup_type:'sales_status',name: 'Void',value: 'void',shop_code: args.shop_code},
|
{lookup_type:'sales_status',name: 'Void',value: 'void',shop_code: args.shop_code},
|
||||||
{lookup_type:'sales_status',name: 'Completed',value: 'completed',shop_code: args.shop_code}])
|
{lookup_type:'sales_status',name: 'Completed',value: 'completed',shop_code: args.shop_code}])
|
||||||
puts " Finished sales_status Set Up Data"
|
Rails.logger.info " Finished sales_status Set Up Data"
|
||||||
|
|
||||||
order_status = Lookup.create([{lookup_type:'order_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
order_status = Lookup.create([{lookup_type:'order_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_status',name: 'Completed',value: 'completed',shop_code: args.shop_code}])
|
{lookup_type:'order_status',name: 'Completed',value: 'completed',shop_code: args.shop_code}])
|
||||||
puts " Finished order_status Set Up Data"
|
Rails.logger.info " Finished order_status Set Up Data"
|
||||||
|
|
||||||
order_item_status = Lookup.create([{lookup_type:'order_item_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
order_item_status = Lookup.create([{lookup_type:'order_item_status',name: 'New',value: 'new',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_item_status',name: 'Processing',value: 'processing',shop_code: args.shop_code},
|
{lookup_type:'order_item_status',name: 'Processing',value: 'processing',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_item_status',name: 'Served',value: 'served',shop_code: args.shop_code},
|
{lookup_type:'order_item_status',name: 'Served',value: 'served',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_item_status',name: 'BIlled',value: 'billed',shop_code: args.shop_code}])
|
{lookup_type:'order_item_status',name: 'BIlled',value: 'billed',shop_code: args.shop_code}])
|
||||||
puts " Finished order_item_status Set Up Data"
|
Rails.logger.info " Finished order_item_status Set Up Data"
|
||||||
|
|
||||||
#order_source [tablet,order_station,emenu,api]
|
#order_source [tablet,order_station,emenu,api]
|
||||||
order_source = Lookup.create([{lookup_type:'order_source',name: 'API',value: 'api',shop_code: args.shop_code},
|
order_source = Lookup.create([{lookup_type:'order_source',name: 'API',value: 'api',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_source',name: 'Tablet',value: 'tablet',shop_code: args.shop_code},
|
{lookup_type:'order_source',name: 'Tablet',value: 'tablet',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_source',name: 'EMenu',value: 'emenu',shop_code: args.shop_code},
|
{lookup_type:'order_source',name: 'EMenu',value: 'emenu',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_source',name: 'Order Station',value: 'order_station',shop_code: args.shop_code}])
|
{lookup_type:'order_source',name: 'Order Station',value: 'order_station',shop_code: args.shop_code}])
|
||||||
puts " Finished order_source Set Up Data"
|
Rails.logger.info " Finished order_source Set Up Data"
|
||||||
|
|
||||||
#order_type [dine-in,takeaway,delivery]
|
#order_type [dine-in,takeaway,delivery]
|
||||||
order_type = Lookup.create([{lookup_type:'order_type',name: 'Dine-in',value: 'dine-in',shop_code: args.shop_code},
|
order_type = Lookup.create([{lookup_type:'order_type',name: 'Dine-in',value: 'dine-in',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_type',name: 'Takeaway',value: 'takeaway',shop_code: args.shop_code},
|
{lookup_type:'order_type',name: 'Takeaway',value: 'takeaway',shop_code: args.shop_code},
|
||||||
{lookup_type:'order_type',name: 'Delivery',value: 'delivery',shop_code: args.shop_code}])
|
{lookup_type:'order_type',name: 'Delivery',value: 'delivery',shop_code: args.shop_code}])
|
||||||
puts " Finished order_type Set Up Data"
|
Rails.logger.info " Finished order_type Set Up Data"
|
||||||
|
|
||||||
#menu_item_type:[simple| set| DIY]
|
#menu_item_type:[simple| set| DIY]
|
||||||
menu_item_type = Lookup.create([{lookup_type:'menu_item_type',name: 'SIMPLE',value: 'simpleItem',shop_code: args.shop_code},
|
menu_item_type = Lookup.create([{lookup_type:'menu_item_type',name: 'SIMPLE',value: 'simpleItem',shop_code: args.shop_code},
|
||||||
{lookup_type:'menu_item_type',name: 'Set Menu',value: 'setMenu',shop_code: args.shop_code},
|
{lookup_type:'menu_item_type',name: 'Set Menu',value: 'setMenu',shop_code: args.shop_code},
|
||||||
{lookup_type:'menu_item_type',name: 'DIY',value: 'diy',shop_code: args.shop_code}])
|
{lookup_type:'menu_item_type',name: 'DIY',value: 'diy',shop_code: args.shop_code}])
|
||||||
puts " Finished menu_item_type Set Up Data"
|
Rails.logger.info " Finished menu_item_type Set Up Data"
|
||||||
|
|
||||||
member_group_type = Lookup.create([{lookup_type:'member_group_type',name: 'Normal',value: '1',shop_code: args.shop_code},
|
member_group_type = Lookup.create([{lookup_type:'member_group_type',name: 'Normal',value: '1',shop_code: args.shop_code},
|
||||||
{lookup_type:'member_group_type',name: 'Platinum',value: '5',shop_code: args.shop_code},
|
{lookup_type:'member_group_type',name: 'Platinum',value: '5',shop_code: args.shop_code},
|
||||||
{lookup_type:'member_group_type',name: 'Silver',value: '4',shop_code: args.shop_code},
|
{lookup_type:'member_group_type',name: 'Silver',value: '4',shop_code: args.shop_code},
|
||||||
{lookup_type:'member_group_type',name: 'Gold',value: '3',shop_code: args.shop_code}])
|
{lookup_type:'member_group_type',name: 'Gold',value: '3',shop_code: args.shop_code}])
|
||||||
puts " Finished member_group_type Set Up Data"
|
Rails.logger.info " Finished member_group_type Set Up Data"
|
||||||
|
|
||||||
#menu_item_attribute:[size|]
|
#menu_item_attribute:[size|]
|
||||||
menu_item_attribute_type = Lookup.create([{lookup_type:'menu_item_attribute_type',name: 'Size',value: 'size',shop_code: args.shop_code}])
|
menu_item_attribute_type = Lookup.create([{lookup_type:'menu_item_attribute_type',name: 'Size',value: 'size',shop_code: args.shop_code}])
|
||||||
puts " Finished menu_item_attribute_type Set Up Data"
|
Rails.logger.info " Finished menu_item_attribute_type Set Up Data"
|
||||||
|
|
||||||
#Employee Roles
|
#Employee Roles
|
||||||
employee_roles = Lookup.create([{lookup_type:'employee_roles',name: 'Cashier',value: 'cashier',shop_code: args.shop_code},
|
employee_roles = Lookup.create([{lookup_type:'employee_roles',name: 'Cashier',value: 'cashier',shop_code: args.shop_code},
|
||||||
@@ -80,7 +80,7 @@ namespace :shop do
|
|||||||
{lookup_type:'employee_roles',name: 'Accountant',value: 'account',shop_code: args.shop_code},
|
{lookup_type:'employee_roles',name: 'Accountant',value: 'account',shop_code: args.shop_code},
|
||||||
{lookup_type:'employee_roles',name: 'Administrator',value: 'administrator',shop_code: args.shop_code},
|
{lookup_type:'employee_roles',name: 'Administrator',value: 'administrator',shop_code: args.shop_code},
|
||||||
{lookup_type:'employee_roles',name: 'Application',value: 'application',shop_code: args.shop_code}])
|
{lookup_type:'employee_roles',name: 'Application',value: 'application',shop_code: args.shop_code}])
|
||||||
puts " Finished employee_roles Set Up Data"
|
Rails.logger.info " Finished employee_roles Set Up Data"
|
||||||
|
|
||||||
#booking_status
|
#booking_status
|
||||||
booking_status = Lookup.create([{lookup_type:'booking_status',name: 'Available',value: 'available',shop_code: args.shop_code},
|
booking_status = Lookup.create([{lookup_type:'booking_status',name: 'Available',value: 'available',shop_code: args.shop_code},
|
||||||
@@ -88,91 +88,91 @@ namespace :shop do
|
|||||||
{lookup_type:'booking_status',name: 'Occupied',value: 'occupied',shop_code: args.shop_code},
|
{lookup_type:'booking_status',name: 'Occupied',value: 'occupied',shop_code: args.shop_code},
|
||||||
{lookup_type:'booking_status',name: 'Cleaning',value: 'cleaning',shop_code: args.shop_code},
|
{lookup_type:'booking_status',name: 'Cleaning',value: 'cleaning',shop_code: args.shop_code},
|
||||||
{lookup_type:'booking_status',name: 'Moved',value: 'moved',shop_code: args.shop_code}])
|
{lookup_type:'booking_status',name: 'Moved',value: 'moved',shop_code: args.shop_code}])
|
||||||
puts " Finished booking_status Set Up Data"
|
Rails.logger.info " Finished booking_status Set Up Data"
|
||||||
|
|
||||||
#account_type
|
#account_type
|
||||||
account_type = Lookup.create([{lookup_type:'account_type',name: 'Income',value: '0',shop_code: args.shop_code},
|
account_type = Lookup.create([{lookup_type:'account_type',name: 'Income',value: '0',shop_code: args.shop_code},
|
||||||
{lookup_type:'account_type',name: 'Expense',value: '1',shop_code: args.shop_code}])
|
{lookup_type:'account_type',name: 'Expense',value: '1',shop_code: args.shop_code}])
|
||||||
puts " Finished account_type Set Up Data"
|
Rails.logger.info " Finished account_type Set Up Data"
|
||||||
|
|
||||||
# sale void reason
|
# sale void reason
|
||||||
void_reason = Lookup.create([{lookup_type:'void_reason',name: 'Approve By Manager',value: 'Approve By Manager',shop_code: args.shop_code},
|
void_reason = Lookup.create([{lookup_type:'void_reason',name: 'Approve By Manager',value: 'Approve By Manager',shop_code: args.shop_code},
|
||||||
{lookup_type:'void_reason',name: 'Customer Mistake',value: 'Customer Mistake',shop_code: args.shop_code},
|
{lookup_type:'void_reason',name: 'Customer Mistake',value: 'Customer Mistake',shop_code: args.shop_code},
|
||||||
{lookup_type:'void_reason',name: 'Cashier Mistake',value: 'Cashier Mistake',shop_code: args.shop_code},
|
{lookup_type:'void_reason',name: 'Cashier Mistake',value: 'Cashier Mistake',shop_code: args.shop_code},
|
||||||
{lookup_type:'void_reason',name: 'Waiter Mistake',value: 'Waiter Mistake',shop_code: args.shop_code}])
|
{lookup_type:'void_reason',name: 'Waiter Mistake',value: 'Waiter Mistake',shop_code: args.shop_code}])
|
||||||
puts " Finished void_reason Set Up Data"
|
Rails.logger.info " Finished void_reason Set Up Data"
|
||||||
|
|
||||||
# float_value
|
# float_value
|
||||||
float_value = Lookup.create([{lookup_type:'float_value',name: '500',value: '500',shop_code: args.shop_code},
|
float_value = Lookup.create([{lookup_type:'float_value',name: '500',value: '500',shop_code: args.shop_code},
|
||||||
{lookup_type:'float_value',name: '1000',value: '1000',shop_code: args.shop_code},
|
{lookup_type:'float_value',name: '1000',value: '1000',shop_code: args.shop_code},
|
||||||
{lookup_type:'float_value',name: '5000',value: '5000',shop_code: args.shop_code},
|
{lookup_type:'float_value',name: '5000',value: '5000',shop_code: args.shop_code},
|
||||||
{lookup_type:'float_value',name: '10000',value: '10000',shop_code: args.shop_code}])
|
{lookup_type:'float_value',name: '10000',value: '10000',shop_code: args.shop_code}])
|
||||||
puts " Finished float_value Set Up Data"
|
Rails.logger.info " Finished float_value Set Up Data"
|
||||||
|
|
||||||
# customer type
|
# customer type
|
||||||
customer_type = Lookup.create([{lookup_type:'customer_type',name: 'Dinein',value: 'Dinein',shop_code: args.shop_code},
|
customer_type = Lookup.create([{lookup_type:'customer_type',name: 'Dinein',value: 'Dinein',shop_code: args.shop_code},
|
||||||
{lookup_type:'customer_type',name: 'FoodCourt',value: 'FoodCourt',shop_code: args.shop_code},
|
{lookup_type:'customer_type',name: 'FoodCourt',value: 'FoodCourt',shop_code: args.shop_code},
|
||||||
{lookup_type:'customer_type',name: 'Takeaway',value: 'Takeaway',shop_code: args.shop_code},
|
{lookup_type:'customer_type',name: 'Takeaway',value: 'Takeaway',shop_code: args.shop_code},
|
||||||
{lookup_type:'customer_type',name: 'Delivery',value: 'Delivery',shop_code: args.shop_code}])
|
{lookup_type:'customer_type',name: 'Delivery',value: 'Delivery',shop_code: args.shop_code}])
|
||||||
puts " Finished customer_type Set Up Data"
|
Rails.logger.info " Finished customer_type Set Up Data"
|
||||||
|
|
||||||
#unit
|
#unit
|
||||||
units = Lookup.create([{lookup_type:'unit',name: 'PCS',value: 'pcs',shop_code: args.shop_code},
|
units = Lookup.create([{lookup_type:'unit',name: 'PCS',value: 'pcs',shop_code: args.shop_code},
|
||||||
{lookup_type:'unit',name: 'KG',value: 'kg',shop_code: args.shop_code}])
|
{lookup_type:'unit',name: 'KG',value: 'kg',shop_code: args.shop_code}])
|
||||||
|
|
||||||
puts " Finished units Set Up Data"
|
Rails.logger.info " Finished units Set Up Data"
|
||||||
|
|
||||||
# Country
|
# Country
|
||||||
countries = Lookup.create({lookup_type:'country',name: 'Japan',value: 'Japan',shop_code: args.shop_code})
|
countries = Lookup.create({lookup_type:'country',name: 'Japan',value: 'Japan',shop_code: args.shop_code})
|
||||||
puts " Finished countries Set Up Data"
|
Rails.logger.info " Finished countries Set Up Data"
|
||||||
|
|
||||||
# number formats
|
# number formats
|
||||||
number_formats = Lookup.create([{lookup_type: 'number_format',name: 'precision',value: '2',shop_code: args.shop_code},
|
number_formats = Lookup.create([{lookup_type: 'number_format',name: 'precision',value: '2',shop_code: args.shop_code},
|
||||||
{lookup_type: 'number_format',name: 'delimiter',value:',',shop_code: args.shop_code},
|
{lookup_type: 'number_format',name: 'delimiter',value:',',shop_code: args.shop_code},
|
||||||
{lookup_type: 'number_format',name: 'strip_insignificant_zeros',value:'0',shop_code: args.shop_code}])
|
{lookup_type: 'number_format',name: 'strip_insignificant_zeros',value:'0',shop_code: args.shop_code}])
|
||||||
puts " Finished number_formats Set Up Data"
|
Rails.logger.info " Finished number_formats Set Up Data"
|
||||||
|
|
||||||
# checkin_time_limit
|
# checkin_time_limit
|
||||||
checkin_time_limit = Lookup.create([{lookup_type: 'checkin_time_limit',name: 'CheckinTimeLimit',value: '48',shop_code: args.shop_code}])
|
checkin_time_limit = Lookup.create([{lookup_type: 'checkin_time_limit',name: 'CheckinTimeLimit',value: '48',shop_code: args.shop_code}])
|
||||||
puts " Finished checkin_time_limit Set Up Data"
|
Rails.logger.info " Finished checkin_time_limit Set Up Data"
|
||||||
|
|
||||||
# display_type
|
# display_type
|
||||||
display_type = Lookup.create({lookup_type:'display_type',name: 'Display Type',value: '2',shop_code: args.shop_code})
|
display_type = Lookup.create({lookup_type:'display_type',name: 'Display Type',value: '2',shop_code: args.shop_code})
|
||||||
puts " Finished display_type Set Up Data"
|
Rails.logger.info " Finished display_type Set Up Data"
|
||||||
|
|
||||||
# show_total_before_tax
|
# show_total_before_tax
|
||||||
show_total_before_tax = Lookup.create({lookup_type:'show_total_before_tax',name: 'Show Total Before Tax',value: '0',shop_code: args.shop_code})
|
show_total_before_tax = Lookup.create({lookup_type:'show_total_before_tax',name: 'Show Total Before Tax',value: '0',shop_code: args.shop_code})
|
||||||
puts " Finished show_total_before_tax Set Up Data"
|
Rails.logger.info " Finished show_total_before_tax Set Up Data"
|
||||||
|
|
||||||
# tax_profiles
|
# tax_profiles
|
||||||
tax_profiles = Lookup.create([{lookup_type:'tax_profiles',name: 'Cashier',value: 'cashier',shop_code: args.shop_code},
|
tax_profiles = Lookup.create([{lookup_type:'tax_profiles',name: 'Cashier',value: 'cashier',shop_code: args.shop_code},
|
||||||
{lookup_type:'tax_profiles',name: 'FoodCourt',value: 'food_court',shop_code: args.shop_code},
|
{lookup_type:'tax_profiles',name: 'FoodCourt',value: 'food_court',shop_code: args.shop_code},
|
||||||
{lookup_type:'tax_profiles',name: 'Online Order',value: 'online_order',shop_code: args.shop_code}])
|
{lookup_type:'tax_profiles',name: 'Online Order',value: 'online_order',shop_code: args.shop_code}])
|
||||||
puts " Finished tax_profiles Set Up Data"
|
Rails.logger.info " Finished tax_profiles Set Up Data"
|
||||||
|
|
||||||
# changable_tax
|
# changable_tax
|
||||||
changable_tax = Lookup.create([{lookup_type:'changable_tax',name: 'change',value: '1',shop_code: args.shop_code}])
|
changable_tax = Lookup.create([{lookup_type:'changable_tax',name: 'change',value: '1',shop_code: args.shop_code}])
|
||||||
|
|
||||||
puts " Finished changable_tax Set Up Data"
|
Rails.logger.info " Finished changable_tax Set Up Data"
|
||||||
|
|
||||||
# expity_time
|
# expity_time
|
||||||
expity_time = Lookup.create([{lookup_type:'expiry_time',name: 'login',value: '{30}',shop_code: args.shop_code}])
|
expity_time = Lookup.create([{lookup_type:'expiry_time',name: 'login',value: '{30}',shop_code: args.shop_code}])
|
||||||
puts " Finished expity_time Set Up Data"
|
Rails.logger.info " Finished expity_time Set Up Data"
|
||||||
|
|
||||||
#foodcourt use
|
#foodcourt use
|
||||||
foodcourt = Lookup.create([{lookup_type:'food_court',name: 'FoodCourt',value: '1',shop_code: args.shop_code}])
|
foodcourt = Lookup.create([{lookup_type:'food_court',name: 'FoodCourt',value: '1',shop_code: args.shop_code}])
|
||||||
puts " Finished foodcourt Set Up Data"
|
Rails.logger.info " Finished foodcourt Set Up Data"
|
||||||
|
|
||||||
# Tax Profile FoodCourt
|
# Tax Profile FoodCourt
|
||||||
commercial_taxes_food_court = TaxProfile.create({name: "Commercial Tax",group_type: "food_court",rate:5.0,order_by:2,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
commercial_taxes_food_court = TaxProfile.create({name: "Commercial Tax",group_type: "food_court",rate:5.0,order_by:2,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
||||||
service_charges_food_court = TaxProfile.create({name: "Service Charges",group_type: "food_court",rate:0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
service_charges_food_court = TaxProfile.create({name: "Service Charges",group_type: "food_court",rate:0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
||||||
puts " Finished Tax Profile FoodCourt Set Up Data"
|
Rails.logger.info " Finished Tax Profile FoodCourt Set Up Data"
|
||||||
|
|
||||||
#Tax Profile Online Order
|
#Tax Profile Online Order
|
||||||
commercial_taxes_online_order = TaxProfile.create({name: "Commercial Tax",group_type: "online_order",rate:5.0,order_by:2,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
commercial_taxes_online_order = TaxProfile.create({name: "Commercial Tax",group_type: "online_order",rate:5.0,order_by:2,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
||||||
service_charges_online_order = TaxProfile.create({name: "Service Charges",group_type: "online_order",rate:0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
service_charges_online_order = TaxProfile.create({name: "Service Charges",group_type: "online_order",rate:0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
||||||
convenience_charges_online_order= TaxProfile.create({name: "Convenience Charges",group_type: "online_order",rate:5.0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
convenience_charges_online_order= TaxProfile.create({name: "Convenience Charges",group_type: "online_order",rate:5.0,order_by:1,created_by:"SYSTEM DEFAULT",shop_code: args.shop_code})
|
||||||
puts " Finished Tax Profile Online Order Set Up Data"
|
Rails.logger.info " Finished Tax Profile Online Order Set Up Data"
|
||||||
|
|
||||||
tax_ids =[]
|
tax_ids =[]
|
||||||
tax_ids << "#{commercial_taxes_food_court.id}"
|
tax_ids << "#{commercial_taxes_food_court.id}"
|
||||||
@@ -180,16 +180,16 @@ namespace :shop do
|
|||||||
takeaway_tax =["#{service_charges_food_court.id}"]
|
takeaway_tax =["#{service_charges_food_court.id}"]
|
||||||
# # Default CUSTOMER
|
# # Default CUSTOMER
|
||||||
ActiveRecord::Base.connection.execute("INSERT INTO customers(customer_id,name,email,contact_no,customer_type,tax_profiles,shop_code) VALUES ('CUS-L#{args.shop_code}00000001','WALK-IN','cus1@customer.com','000000000','Dinein','#{tax_ids}','#{args.shop_code}'),('CUS-L#{args.shop_code}00000002','TAKEAWAY','cus2@customer.com','111111111','Takeaway','#{takeaway_tax}','#{args.shop_code}');")
|
ActiveRecord::Base.connection.execute("INSERT INTO customers(customer_id,name,email,contact_no,customer_type,tax_profiles,shop_code) VALUES ('CUS-L#{args.shop_code}00000001','WALK-IN','cus1@customer.com','000000000','Dinein','#{tax_ids}','#{args.shop_code}'),('CUS-L#{args.shop_code}00000002','TAKEAWAY','cus2@customer.com','111111111','Takeaway','#{takeaway_tax}','#{args.shop_code}');")
|
||||||
puts " Finished Default CUSTOMER Set Up Data"
|
Rails.logger.info " Finished Default CUSTOMER Set Up Data"
|
||||||
|
|
||||||
#seed_generators
|
#seed_generators
|
||||||
ActiveRecord::Base.connection.execute("INSERT INTO seed_generators(model,current,next,shop_code,created_at,updated_at) VALUES ('Customer',3,4,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('TableBooking',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Order',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('OrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('AssignedOrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('sale',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleOrder',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleAudit',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SalePayment',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleTax',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Reservation',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP());")
|
ActiveRecord::Base.connection.execute("INSERT INTO seed_generators(model,current,next,shop_code,created_at,updated_at) VALUES ('Customer',3,4,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('TableBooking',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Order',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('OrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('AssignedOrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('sale',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleOrder',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleAudit',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SalePayment',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleTax',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Reservation',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP());")
|
||||||
puts " Finished seed_generators Set Up Data"
|
Rails.logger.info " Finished seed_generators Set Up Data"
|
||||||
|
|
||||||
|
|
||||||
#Create Adminstrator employee
|
#Create Adminstrator employee
|
||||||
ActiveRecord::Base.connection.execute("INSERT INTO employees(name,role,password_digest,emp_id,created_by,shop_code,created_at,updated_at,app_id,app_token) VALUES ('Administrator','administrator','$2a$10$OKFA4b4yh0xCJNmzjMMijusnO712LUSEL4/y56p2XmdKBRPWgXwDa','999','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Cashier','cashier','$2a$10$rXWBQro.YqUu5klH9oxqA.vcdq7webHm75FeXylY4uoJlek82luOq','333','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Manager','manager','$2a$10$JmzePPoejam8alpR6hrjr.8jIe/pm36IhErtoP4WwK788x2JfHUL2','777','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Application','application','$2a$12$Kzr5OIFb7B7KU52iKNoeSu5LnXtfJx0YX3s3d.HHJzxeodCv31Ehm','444','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(), '#{SecureRandom.urlsafe_base64(nil, false)}', '#{SecureRandom.hex(10)}');")
|
ActiveRecord::Base.connection.execute("INSERT INTO employees(name,role,password_digest,emp_id,created_by,shop_code,created_at,updated_at,app_id,app_token) VALUES ('Administrator','administrator','$2a$10$OKFA4b4yh0xCJNmzjMMijusnO712LUSEL4/y56p2XmdKBRPWgXwDa','999','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Cashier','cashier','$2a$10$rXWBQro.YqUu5klH9oxqA.vcdq7webHm75FeXylY4uoJlek82luOq','333','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Manager','manager','$2a$10$JmzePPoejam8alpR6hrjr.8jIe/pm36IhErtoP4WwK788x2JfHUL2','777','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Application','application','$2a$12$Kzr5OIFb7B7KU52iKNoeSu5LnXtfJx0YX3s3d.HHJzxeodCv31Ehm','444','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(), '#{SecureRandom.urlsafe_base64(nil, false)}', '#{SecureRandom.hex(10)}');")
|
||||||
puts " Finished Create Adminstrator employee Set Up Data"
|
Rails.logger.info " Finished Create Adminstrator employee Set Up Data"
|
||||||
|
|
||||||
#PrintSetting
|
#PrintSetting
|
||||||
order_item_printer = PrintSetting.create({name: "OrderItemPdf",unique_code: "OrderItemPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
order_item_printer = PrintSetting.create({name: "OrderItemPdf",unique_code: "OrderItemPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
||||||
@@ -198,11 +198,11 @@ namespace :shop do
|
|||||||
close_cashier_printer = PrintSetting.create({name: "Close Cashier",unique_code: "CloseCashierPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
close_cashier_printer = PrintSetting.create({name: "Close Cashier",unique_code: "CloseCashierPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
||||||
crm_order_printer = PrintSetting.create({name: "CRM Order",unique_code: "CrmOrderPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
crm_order_printer = PrintSetting.create({name: "CRM Order",unique_code: "CrmOrderPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
||||||
queue_no_printer = PrintSetting.create({name: "Queue No",unique_code: "QueueNoPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
queue_no_printer = PrintSetting.create({name: "Queue No",unique_code: "QueueNoPdf",printer_name: "Cashier",api_settings: 'socket://192.168.1.118',print_copies: 1,header_font_size: 12,item_font_size: 8,precision: "0",delimiter: 0,heading_space: 5,page_width: 210,page_height: 1450,shop_code: args.shop_code})
|
||||||
puts " Finished PrintSetting Set Up Data"
|
Rails.logger.info " Finished PrintSetting Set Up Data"
|
||||||
|
|
||||||
|
|
||||||
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "https://staging.membership.paymal.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",shop_code: args.shop_code})
|
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "https://staging.membership.paymal.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",shop_code: args.shop_code})
|
||||||
puts " Finished member_setting Set Up Data"
|
Rails.logger.info " Finished member_setting Set Up Data"
|
||||||
|
|
||||||
member_actions= MembershipAction.create([{membership_type:"get_account_balance",is_active:1,gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
member_actions= MembershipAction.create([{membership_type:"get_account_balance",is_active:1,gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"redeem",is_active:1,gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"redeem",is_active:1,gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
@@ -217,10 +217,10 @@ namespace :shop do
|
|||||||
{membership_type:"search_paypar_account_no",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"search_paypar_account_no",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"void",is_active:1,gateway_url:"/api/payments/payment_void",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"void",is_active:1,gateway_url:"/api/payments/payment_void",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"search_paypar_security_code",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_security_code",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code}])
|
{membership_type:"search_paypar_security_code",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_security_code",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code}])
|
||||||
puts " Finished member_actions Set Up Data"
|
Rails.logger.info " Finished member_actions Set Up Data"
|
||||||
|
|
||||||
payment_methods = PaymentMethodSetting.create({payment_method:"PAYMAL",gateway_url: "/api/create_payment",merchant_account_id:"pZBHXEFbGNj/G",shop_code: args.shop_code})
|
payment_methods = PaymentMethodSetting.create({payment_method:"PAYMAL",gateway_url: "/api/create_payment",merchant_account_id:"pZBHXEFbGNj/G",shop_code: args.shop_code})
|
||||||
puts " Finished payment_methods Set Up Data"
|
Rails.logger.info " Finished payment_methods Set Up Data"
|
||||||
puts " Finished System Default Set Up Data"
|
Rails.logger.info " Finished System Default Set Up Data"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user