diff --git a/tailbone_corepos/views/corepos/__init__.py b/tailbone_corepos/views/corepos/__init__.py index 1f3eca2..dd894b4 100644 --- a/tailbone_corepos/views/corepos/__init__.py +++ b/tailbone_corepos/views/corepos/__init__.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2020 Lance Edgar # # 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.employees') config.include('tailbone_corepos.views.corepos.coupons') + config.include('tailbone_corepos.views.corepos.taxrates') config.include('tailbone_corepos.views.corepos.transactions') diff --git a/tailbone_corepos/views/corepos/master.py b/tailbone_corepos/views/corepos/master.py index 295af88..7d30c98 100644 --- a/tailbone_corepos/views/corepos/master.py +++ b/tailbone_corepos/views/corepos/master.py @@ -40,6 +40,10 @@ class CoreOfficeMasterView(MasterView): supports_multiple_engines = True engine_type_key = 'corepos' + labels = { + 'id': "ID", + } + def get_db_engines(self): engines = OrderedDict() if self.rattail_config.corepos_engine: diff --git a/tailbone_corepos/views/corepos/taxrates.py b/tailbone_corepos/views/corepos/taxrates.py new file mode 100644 index 0000000..345f00c --- /dev/null +++ b/tailbone_corepos/views/corepos/taxrates.py @@ -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 . +# +################################################################################ +""" +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)