tax profiles
This commit is contained in:
22
README.md
22
README.md
@@ -132,12 +132,34 @@ ADD COLUMN image_path VARCHAR(255);
|
|||||||
|
|
||||||
ALTER TABLE sales
|
ALTER TABLE sales
|
||||||
ADD COLUMN equal_persons INT(11) after rebate_status;
|
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 ----->
|
<---- Extra Fields Script ----->
|
||||||
For CloseCashierCustomisePdf in lookups
|
For CloseCashierCustomisePdf in lookups
|
||||||
*** change CloseCashierPdf to CloseCashierCustomisePdf
|
*** change CloseCashierPdf to CloseCashierCustomisePdf
|
||||||
1) settings/print_settings
|
1) settings/print_settings
|
||||||
2) settings/lookups => { type:print_settings, name: CloseCashierCustomisePdf, value:1 }
|
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
|
* ToDo list
|
||||||
|
|
||||||
1. Migration
|
1. Migration
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ class Settings::TaxProfilesController < ApplicationController
|
|||||||
# GET /settings/tax_profiles.json
|
# GET /settings/tax_profiles.json
|
||||||
def index
|
def index
|
||||||
@settings_tax_profiles = TaxProfile.all
|
@settings_tax_profiles = TaxProfile.all
|
||||||
|
tax_profiles = Lookup.collection_of("tax_profiles")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /settings/tax_profiles/1
|
# 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.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def settings_tax_profile_params
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class TaxProfile < ApplicationRecord
|
class TaxProfile < ApplicationRecord
|
||||||
default_scope { order('order_by asc') }
|
default_scope { order('order_by asc') }
|
||||||
# validations
|
# validations
|
||||||
validates_presence_of :name, :rate
|
validates_presence_of :name, :rate, :group_type
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<%= f.error_notification %>
|
<%= f.error_notification %>
|
||||||
|
|
||||||
<div class="form-inputs p-l-15">
|
<div class="form-inputs p-l-15">
|
||||||
|
<%= f.input :group_type, :collection => Lookup.collection_of("tax_profiles"),:input_html=>{:class=>"col-md-10"},:required=>true %>
|
||||||
<%= f.input :name %>
|
<%= f.input :name %>
|
||||||
<%= f.input :rate %>
|
<%= f.input :rate %>
|
||||||
<%= f.input :inclusive %>
|
<%= f.input :inclusive %>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th><%= t("views.right_panel.detail.group_type") %></th>
|
||||||
<th><%= t("views.right_panel.detail.name") %></th>
|
<th><%= t("views.right_panel.detail.name") %></th>
|
||||||
<th><%= t("views.right_panel.detail.rate") %></th>
|
<th><%= t("views.right_panel.detail.rate") %></th>
|
||||||
<th><%= t("views.right_panel.detail.inclusive") %></th>
|
<th><%= t("views.right_panel.detail.inclusive") %></th>
|
||||||
@@ -29,6 +30,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% @settings_tax_profiles.each do |settings_tax_profile| %>
|
<% @settings_tax_profiles.each do |settings_tax_profile| %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= settings_tax_profile.group_type %>
|
||||||
|
</td>
|
||||||
<td><%= settings_tax_profile.name %></td>
|
<td><%= settings_tax_profile.name %></td>
|
||||||
<td><%= settings_tax_profile.rate %></td>
|
<td><%= settings_tax_profile.rate %></td>
|
||||||
<td><%= settings_tax_profile.inclusive %></td>
|
<td><%= settings_tax_profile.inclusive %></td>
|
||||||
|
|||||||
@@ -450,6 +450,7 @@ en:
|
|||||||
additional_parameter: "Additional parameter"
|
additional_parameter: "Additional parameter"
|
||||||
lookup: "Lookup"
|
lookup: "Lookup"
|
||||||
product_sale_report: "Product Sale"
|
product_sale_report: "Product Sale"
|
||||||
|
group_type: "Group Type"
|
||||||
|
|
||||||
code_txt: "code "
|
code_txt: "code "
|
||||||
charge_txt: "charge"
|
charge_txt: "charge"
|
||||||
|
|||||||
@@ -445,6 +445,7 @@ mm:
|
|||||||
survey: "ခြုံငုံလေ့လာခြင်း"
|
survey: "ခြုံငုံလေ့လာခြင်း"
|
||||||
lookup: "သတ်မှတ်ချက်များ"
|
lookup: "သတ်မှတ်ချက်များ"
|
||||||
product_sale_report: "Product Sale"
|
product_sale_report: "Product Sale"
|
||||||
|
group_type: "Group Type"
|
||||||
|
|
||||||
code_txt: "ကုတ်ဒ် "
|
code_txt: "ကုတ်ဒ် "
|
||||||
charge_txt: "ကောက်ခံသည်"
|
charge_txt: "ကောက်ခံသည်"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class CreateTaxProfiles < ActiveRecord::Migration[5.1]
|
|||||||
def change
|
def change
|
||||||
create_table :tax_profiles do |t|
|
create_table :tax_profiles do |t|
|
||||||
t.string :name, :null => false
|
t.string :name, :null => false
|
||||||
|
t.string :group_type, :null => false
|
||||||
t.decimal :rate, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
t.decimal :rate, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||||
t.boolean :inclusive, :null => false, :default => false
|
t.boolean :inclusive, :null => false, :default => false
|
||||||
t.integer :order_by, :null => false, :default => 1
|
t.integer :order_by, :null => false, :default => 1
|
||||||
|
|||||||
@@ -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"})
|
# room = Room.create({name:"Table 2", zone: zone2, status:"available", seater: 4 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||||
|
|
||||||
#Tax Profile
|
#Tax Profile
|
||||||
tax_profiles = TaxProfile.create({id:1, name: "Commercial Tax", rate:5.0, order_by:2, 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", rate:10.0, order_by:1, 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
|
#Default menu
|
||||||
menu = Menu.create({name: "Main Menu", is_active: true, created_by: "SYSTEM DEFAULT"})
|
menu = Menu.create({name: "Main Menu", is_active: true, created_by: "SYSTEM DEFAULT"})
|
||||||
|
|||||||
Reference in New Issue
Block a user