This commit is contained in:
Nweni
2017-08-30 14:21:05 +06:30
81 changed files with 4943 additions and 1327 deletions

View File

@@ -6,6 +6,7 @@ class CreateOrderItems < ActiveRecord::Migration[5.1]
t.string :order_item_status, :null => false, :default => "new"
t.string :item_order_by #person who order this
t.string :item_code, :null => false
t.string :item_instance_code
t.string :item_name, :null => false
t.string :alt_name, :null => false
t.integer :account_id, :limit => 8, :null => false, :default => 1

View File

@@ -1,12 +0,0 @@
class CreateCommissioners < ActiveRecord::Migration[5.1]
def change
create_table :commissioners do |t|
t.string :name, :null => false
t.string :emp_id
t.string :created_by
t.string :commission_type
t.boolean :is_active
t.timestamps
end
end
end

View File

@@ -1,11 +0,0 @@
class CreateCommissions < ActiveRecord::Migration[5.1]
def change
create_table :commissions do |t|
t.integer :product_id, null: false
t.integer :amount
t.string :commission_type
t.boolean :is_active
t.timestamps
end
end
end

View File

@@ -1,16 +0,0 @@
class CreateProductCommissions < ActiveRecord::Migration[5.1]
# rake db:migrate:down VERSION=20170823034141
def change
create_table :product_commissions do |t|
t.string :product_id
t.integer :commission_id
t.integer :commissioner_id
t.decimal :qty, :precision => 10, :scale => 2, :default => 0.00
t.string :sale_id
t.string :sale_item_id
t.decimal :price, :precision => 10, :scale => 2, :default => 0.00
t.decimal :amount, :precision => 10, :scale => 2, :default => 0.00
t.timestamps
end
end
end

View File

@@ -0,0 +1,17 @@
class CreateProductCommissions < ActiveRecord::Migration[5.1]
# rake db:migrate:down VERSION=20170825034141
def change
create_table :product_commissions do |t|
t.string :product_type
t.string :product_code
t.string :commission_id
t.integer :commissioner_id
t.decimal :qty, precision: 10, scale: 2, default: 0.00
t.string :sale_id
t.string :sale_item_id
t.decimal :price, precision: 10, scale: 2, default: 0.00
t.decimal :amount, precision: 10, scale: 2, default: 0.00
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreateCommissioners < ActiveRecord::Migration[5.1]
# rake db:migrate:down VERSION=20170825090115
def change
create_table :commissioners do |t|
t.string :name
t.string :emp_id
t.string :created_by
t.string :commission_id
t.datetime :joined_date
t.datetime :resigned_date
t.boolean :is_active, default: true
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreateCommissions < ActiveRecord::Migration[5.1]
# rake db:migrate:down VERSION=20170825093252
def change
create_table :commissions, id: false do |t|
t.string :commission_id, limit: 16, primary_key: true # custom primary key
t.string :product_type
t.string :product_code
t.string :commission_type
t.integer :amount
t.boolean :is_active, default: true
t.timestamps
end
end
end

View File

@@ -218,25 +218,26 @@ zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAU
table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"})
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
{membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"},
member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"search_paypar_account_no",gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"}
])
payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://membership.paypar.ws"})
payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://membership.paypar.ws"})
payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://membership.paypar.ws"})
payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://membership.paypar.ws"})
payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://membership.paypar.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"})
payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
#Default Order Queue stations
order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004']), print_copy:true, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"})