diff --git a/README.md b/README.md index b5d2c62b..506ab0b6 100755 --- a/README.md +++ b/README.md @@ -132,12 +132,34 @@ ADD COLUMN image_path VARCHAR(255); ALTER TABLE sales ADD COLUMN equal_persons INT(11) after rebate_status; + +ALTER TABLE sale_items +ADD COLUMN remark VARCHAR(255) after status; + +ALTER TABLE shops +ADD COLUMN shop_code VARCHAR(255) after name, +ADD COLUMN client_name VARCHAR(255) after shop_code, +ADD COLUMN client_code VARCHAR(255) after client_name; + +ALTER TABLE print_settings +ADD COLUMN brand_name VARCHAR(255) after api_settings, +ADD COLUMN type VARCHAR(255) after brand_name; + +ALTER TABLE tax_profiles +ADD COLUMN group_type VARCHAR(255) after name; + <---- Extra Fields Script -----> For CloseCashierCustomisePdf in lookups *** change CloseCashierPdf to CloseCashierCustomisePdf 1) settings/print_settings 2) settings/lookups => { type:print_settings, name: CloseCashierCustomisePdf, value:1 } +/* Tax Profile Group Types in lookups */ +1) settings/lookups => { type:tax_profiles, name: Cashier, value:cashier } +2) settings/lookups => { type:tax_profiles, name: Quick Service, value: quick_service } +3) settings/lookups => { type:tax_profiles, name: Doemal, value: doemal } +/* Tax Profile Group Types in lookups */ + * ToDo list 1. Migration diff --git a/app/controllers/settings/tax_profiles_controller.rb b/app/controllers/settings/tax_profiles_controller.rb index 77414c57..6e6e08f5 100755 --- a/app/controllers/settings/tax_profiles_controller.rb +++ b/app/controllers/settings/tax_profiles_controller.rb @@ -6,6 +6,8 @@ class Settings::TaxProfilesController < ApplicationController # GET /settings/tax_profiles.json def index @settings_tax_profiles = TaxProfile.all + tax_profiles = Lookup.collection_of("tax_profiles") + end # GET /settings/tax_profiles/1 @@ -73,6 +75,6 @@ class Settings::TaxProfilesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_tax_profile_params - params.require(:tax_profile).permit(:name, :rate, :inclusive, :order_by, :created_by) + params.require(:tax_profile).permit(:name, :group_type, :rate, :inclusive, :order_by, :created_by) end end diff --git a/app/models/tax_profile.rb b/app/models/tax_profile.rb index e478ecd5..a9e56fac 100755 --- a/app/models/tax_profile.rb +++ b/app/models/tax_profile.rb @@ -1,5 +1,5 @@ class TaxProfile < ApplicationRecord default_scope { order('order_by asc') } # validations - validates_presence_of :name, :rate + validates_presence_of :name, :rate, :group_type end diff --git a/app/views/settings/tax_profiles/_form.html.erb b/app/views/settings/tax_profiles/_form.html.erb index bd397920..1997e655 100755 --- a/app/views/settings/tax_profiles/_form.html.erb +++ b/app/views/settings/tax_profiles/_form.html.erb @@ -8,6 +8,7 @@ <%= f.error_notification %>
| <%= t("views.right_panel.detail.group_type") %> | <%= t("views.right_panel.detail.name") %> | <%= t("views.right_panel.detail.rate") %> | <%= t("views.right_panel.detail.inclusive") %> | @@ -29,6 +30,9 @@
|---|---|---|---|
| + <%= settings_tax_profile.group_type %> + | <%= settings_tax_profile.name %> | <%= settings_tax_profile.rate %> | <%= settings_tax_profile.inclusive %> | diff --git a/config/locales/en.yml b/config/locales/en.yml index c66d4cc3..dda9180c 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -450,6 +450,7 @@ en: additional_parameter: "Additional parameter" lookup: "Lookup" product_sale_report: "Product Sale" + group_type: "Group Type" code_txt: "code " charge_txt: "charge" diff --git a/config/locales/mm.yml b/config/locales/mm.yml index 8ede4a79..af901d6e 100755 --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -445,6 +445,7 @@ mm: survey: "ခြုံငုံလေ့လာခြင်း" lookup: "သတ်မှတ်ချက်များ" product_sale_report: "Product Sale" + group_type: "Group Type" code_txt: "ကုတ်ဒ် " charge_txt: "ကောက်ခံသည်" diff --git a/db/migrate/20170403183755_create_tax_profiles.rb b/db/migrate/20170403183755_create_tax_profiles.rb index 1f9dfceb..f5210bbb 100755 --- a/db/migrate/20170403183755_create_tax_profiles.rb +++ b/db/migrate/20170403183755_create_tax_profiles.rb @@ -2,6 +2,7 @@ class CreateTaxProfiles < ActiveRecord::Migration[5.1] def change create_table :tax_profiles do |t| t.string :name, :null => false + t.string :group_type, :null => false t.decimal :rate, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.boolean :inclusive, :null => false, :default => false t.integer :order_by, :null => false, :default => 1 diff --git a/db/seeds.rb b/db/seeds.rb index df707508..df5e815e 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -119,8 +119,8 @@ customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contac # room = Room.create({name:"Table 2", zone: zone2, status:"available", seater: 4 , order_by:1, created_by:"SYSTEM DEFAULT"}) #Tax Profile -tax_profiles = TaxProfile.create({id:1, name: "Commercial Tax", rate:5.0, order_by:2, created_by:"SYSTEM DEFAULT"}) -service_charges = TaxProfile.create({id:2, name: "Service Charges", rate:10.0, order_by:1, created_by:"SYSTEM DEFAULT"}) +tax_profiles = TaxProfile.create({id:1, name: "Commercial Tax", group_type: "cashier", rate:5.0, order_by:2, created_by:"SYSTEM DEFAULT"}) +service_charges = TaxProfile.create({id:2, name: "Service Charges", group_type: "cashier", rate:10.0, order_by:1, created_by:"SYSTEM DEFAULT"}) #Default menu menu = Menu.create({name: "Main Menu", is_active: true, created_by: "SYSTEM DEFAULT"})