From 25d1eaa81605c9e9c33b921bf9b417a1328f0fe6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 6 Aug 2024 10:39:33 -0500 Subject: [PATCH] feat: add view for CORE Custom Receipt Lines (`op.customReceipt`) --- tailbone_corepos/menus.py | 5 +++ tailbone_corepos/views/corepos/__init__.py | 3 +- tailbone_corepos/views/corepos/receipts.py | 50 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tailbone_corepos/views/corepos/receipts.py diff --git a/tailbone_corepos/menus.py b/tailbone_corepos/menus.py index afa4ebc..af1ee89 100644 --- a/tailbone_corepos/menus.py +++ b/tailbone_corepos/menus.py @@ -202,6 +202,11 @@ def make_corepos_menu(request): 'route': 'corepos.tenders', 'perm': 'corepos.tenders.list', }, + { + 'title': "Custom Receipt Lines", + 'route': 'corepos.custom_receipt_lines', + 'perm': 'corepos.custom_receipt_lines.list', + }, ], }, { diff --git a/tailbone_corepos/views/corepos/__init__.py b/tailbone_corepos/views/corepos/__init__.py index 60531e7..4ccef2c 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-2023 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -48,6 +48,7 @@ def defaults(config, **kwargs): config.include(mod('tailbone_corepos.views.corepos.customers')) config.include(mod('tailbone_corepos.views.corepos.employees')) config.include(mod('tailbone_corepos.views.corepos.coupons')) + config.include(mod('tailbone_corepos.views.corepos.receipts')) config.include(mod('tailbone_corepos.views.corepos.tenders')) config.include(mod('tailbone_corepos.views.corepos.stockpurchases')) config.include(mod('tailbone_corepos.views.corepos.taxrates')) diff --git a/tailbone_corepos/views/corepos/receipts.py b/tailbone_corepos/views/corepos/receipts.py new file mode 100644 index 0000000..04d97d9 --- /dev/null +++ b/tailbone_corepos/views/corepos/receipts.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2024 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 receipt views +""" + +from corepos.db.office_op.model import CustomReceiptLine + +from .master import CoreOfficeMasterView + + +class CustomReceiptLineView(CoreOfficeMasterView): + """ + Master view for custom receipt text + """ + model_class = CustomReceiptLine + model_title = "CORE-POS Custom Receipt Line" + route_prefix = 'corepos.custom_receipt_lines' + url_prefix = '/core-pos/custom-receipt-lines' + + +def defaults(config, **kwargs): + base = globals() + + CustomReceiptLineView = kwargs.get('CustomReceiptLineView', base['CustomReceiptLineView']) + CustomReceiptLineView.defaults(config) + + +def includeme(config): + defaults(config)