Add views for Tax Rates table
This commit is contained in:
parent
700584a084
commit
524b92e21a
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2019 Lance Edgar
|
# Copyright © 2010-2020 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -37,4 +37,5 @@ def includeme(config):
|
||||||
config.include('tailbone_corepos.views.corepos.customers')
|
config.include('tailbone_corepos.views.corepos.customers')
|
||||||
config.include('tailbone_corepos.views.corepos.employees')
|
config.include('tailbone_corepos.views.corepos.employees')
|
||||||
config.include('tailbone_corepos.views.corepos.coupons')
|
config.include('tailbone_corepos.views.corepos.coupons')
|
||||||
|
config.include('tailbone_corepos.views.corepos.taxrates')
|
||||||
config.include('tailbone_corepos.views.corepos.transactions')
|
config.include('tailbone_corepos.views.corepos.transactions')
|
||||||
|
|
|
@ -40,6 +40,10 @@ class CoreOfficeMasterView(MasterView):
|
||||||
supports_multiple_engines = True
|
supports_multiple_engines = True
|
||||||
engine_type_key = 'corepos'
|
engine_type_key = 'corepos'
|
||||||
|
|
||||||
|
labels = {
|
||||||
|
'id': "ID",
|
||||||
|
}
|
||||||
|
|
||||||
def get_db_engines(self):
|
def get_db_engines(self):
|
||||||
engines = OrderedDict()
|
engines = OrderedDict()
|
||||||
if self.rattail_config.corepos_engine:
|
if self.rattail_config.corepos_engine:
|
||||||
|
|
61
tailbone_corepos/views/corepos/taxrates.py
Normal file
61
tailbone_corepos/views/corepos/taxrates.py
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
# -*- coding: utf-8; -*-
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Rattail -- Retail Software Framework
|
||||||
|
# Copyright © 2010-2020 Lance Edgar
|
||||||
|
#
|
||||||
|
# This file is part of Rattail.
|
||||||
|
#
|
||||||
|
# Rattail is free software: you can redistribute it and/or modify it under the
|
||||||
|
# terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
"""
|
||||||
|
CORE-POS tax rate views
|
||||||
|
"""
|
||||||
|
|
||||||
|
from corepos.db.office_op import model as corepos
|
||||||
|
|
||||||
|
from .master import CoreOfficeMasterView
|
||||||
|
|
||||||
|
|
||||||
|
class TaxRateView(CoreOfficeMasterView):
|
||||||
|
"""
|
||||||
|
Master view for tax rates
|
||||||
|
"""
|
||||||
|
model_class = corepos.TaxRate
|
||||||
|
model_title = "CORE-POS Tax Rate"
|
||||||
|
url_prefix = '/core-pos/tax-rates'
|
||||||
|
route_prefix = 'corepos.taxrates'
|
||||||
|
|
||||||
|
grid_columns = [
|
||||||
|
'id',
|
||||||
|
'rate',
|
||||||
|
'description',
|
||||||
|
]
|
||||||
|
|
||||||
|
form_fields = [
|
||||||
|
'id',
|
||||||
|
'rate',
|
||||||
|
'description',
|
||||||
|
]
|
||||||
|
|
||||||
|
def configure_grid(self, g):
|
||||||
|
super(TaxRateView, self).configure_grid(g)
|
||||||
|
|
||||||
|
g.set_link('id')
|
||||||
|
g.set_link('description')
|
||||||
|
|
||||||
|
|
||||||
|
def includeme(config):
|
||||||
|
TaxRateView.defaults(config)
|
Loading…
Reference in a new issue