diff --git a/service_charges_pos/README.rst b/service_charges_pos/README.rst new file mode 100755 index 000000000..bea3e7fe9 --- /dev/null +++ b/service_charges_pos/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Service Charges POS +======================= +This module allows you to set service charges for an order by globally and session wise. + +Configuration +============= + - www.odoo.com/documentation/17.0/setup/install.html + - Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developers: (V16) Ammu Raj @ Cybrosys, + (V17) Advaith BG @ Cybrosys +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +.. image:: https://cybrosys.com/images/logo.png + :target: https://www.cybrosys.com" + +Further information +=================== +HTML Description: ``__ diff --git a/service_charges_pos/__init__.py b/service_charges_pos/__init__.py new file mode 100644 index 000000000..eee9909d2 --- /dev/null +++ b/service_charges_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/service_charges_pos/__manifest__.py b/service_charges_pos/__manifest__.py new file mode 100644 index 000000000..cbe6cf400 --- /dev/null +++ b/service_charges_pos/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Service Charges POS', + 'version': '17.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': 'Allows you to set service charges.', + 'description': 'Allows you to set service charges for an order by globally' + ' and session wise.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + 'views/res_config_settings_views.xml', + 'views/pos_config_views.xml', + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'service_charges_pos/static/src/js/pos_load_data.js', + 'service_charges_pos/static/src/js/service_charge_button.js', + 'service_charges_pos/static/src/xml/ServiceChargeButton.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/service_charges_pos/doc/RELEASE_NOTES.md b/service_charges_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..6aaa54d62 --- /dev/null +++ b/service_charges_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 18.01.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Service Charges POS diff --git a/service_charges_pos/models/__init__.py b/service_charges_pos/models/__init__.py new file mode 100644 index 000000000..4a5f6dc48 --- /dev/null +++ b/service_charges_pos/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import pos_config +from . import pos_session +from . import res_config_settings diff --git a/service_charges_pos/models/pos_config.py b/service_charges_pos/models/pos_config.py new file mode 100644 index 000000000..1d01c0d25 --- /dev/null +++ b/service_charges_pos/models/pos_config.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models + + +class PosConfig(models.Model): + """Inherited POS Configuration""" + _inherit = 'pos.config' + + is_session = fields.Boolean(string="Session", + compute='_compute_check_session', + help="Check it is for sessions", ) + is_service_charges = fields.Boolean(string="Service Charges", + help="Enable to add service charge") + charge_type = fields.Selection( + [('amount', 'Amount'), + ('percentage', 'Percentage')], + string='Type', default='amount', + help="Can choose charge percentage or amount") + service_charge = fields.Float(string='Service Charge', + help="Charge need to apply") + service_product_id = fields.Many2one('product.product', + string='Service Product', + domain="[('available_in_pos', '=', " + "True)," + "('sale_ok', '=', True), " + "('type', '=', 'service')]", + help="Service Product") + + def _compute_check_session(self): + """To check the service charge is set up for session wise or + globally""" + for record in self: + check_session = self.env['ir.config_parameter'].sudo().get_param( + 'service_charges_pos.visibility') + if check_session == 'session': + record.is_session = True + else: + record.is_session = False + + @api.onchange('is_service_charges') + def onchange_is_service_charges(self): + """When the service charge is enabled set service product + and amount by default per session""" + if self.is_service_charges: + if not self.service_product_id: + self.service_product_id = self.env[ + 'product.product'].search([ + ('available_in_pos', '=', True), + ('sale_ok', '=', True), ('type', '=', 'service') + ], limit=1) + self.service_charge = 10.0 + else: + self.service_product_id = False + self.service_charge = 0.0 diff --git a/service_charges_pos/models/pos_session.py b/service_charges_pos/models/pos_session.py new file mode 100644 index 000000000..2a7e17d19 --- /dev/null +++ b/service_charges_pos/models/pos_session.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import models + + +class PosSession(models.Model): + """Inherited POS Session""" + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """Supering the function for loading res.config.settings to pos + session""" + result = super()._pos_ui_models_to_load() + result.append('res.config.settings') + return result + + def _loader_params_res_config_settings(self): + """Returning the field required""" + return { + 'search_params': { + 'fields': ['enable_service_charge', 'visibility', + 'global_selection', 'global_charge', + 'global_product_id'], + }, + } + + def _get_pos_ui_res_config_settings(self, params): + """Returns the model""" + return self.env['res.config.settings'].sudo().search_read( + **params['search_params'] + ) diff --git a/service_charges_pos/models/res_config_settings.py b/service_charges_pos/models/res_config_settings.py new file mode 100644 index 000000000..a00bc0040 --- /dev/null +++ b/service_charges_pos/models/res_config_settings.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ADVAITH B G (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + """Inherited Configuration Settings""" + _inherit = "res.config.settings" + + enable_service_charge = fields.Boolean(string="Service Charges", + config_parameter="service_charges_" + "pos.enable_service" + "_charge", + help="Enable to add service charge") + visibility = fields.Selection([ + ('global', 'Global'), + ('session', 'Session')], + default='global', string="Visibility", + config_parameter="service_charges_pos.visibility", + help='Setup the Service charge globally or per session') + global_selection = fields.Selection([ + ('amount', 'Amount'), + ('percentage', 'Percentage')], + string='Type', default='amount', + config_parameter="service_charges_pos.global_selection", + help='Set the service charge as a amount or percentage') + global_charge = fields.Float(string='Service Charge', + config_parameter="service_charges_pos." + "global_charge", + help='Set a default service charge globally') + global_product_id = fields.Many2one('product.product', + string='Service Product', + domain="[('available_in_pos', '=', " + "True)," + "('sale_ok', '=', True), " + "('type', '=', 'service')]", + config_parameter="service_charges_pos" + ".global_product_id", + help='Set a service product globally') + + @api.onchange('enable_service_charge') + def onchange_enable_service_charge(self): + """When the service charge is enabled set service product and amount + by default in globally""" + if self.enable_service_charge: + if not self.global_product_id: + self.global_product_id = self.env[ + 'product.product'].search([ + ('available_in_pos', '=', True), + ('sale_ok', '=', True), + ('type', '=', 'service') + ], limit=1) + self.global_charge = 10.0 + else: + self.global_product_id = False + self.global_charge = 0.0 diff --git a/service_charges_pos/static/description/assets/icons/check.png b/service_charges_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/check.png differ diff --git a/service_charges_pos/static/description/assets/icons/chevron.png b/service_charges_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/chevron.png differ diff --git a/service_charges_pos/static/description/assets/icons/cogs.png b/service_charges_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/cogs.png differ diff --git a/service_charges_pos/static/description/assets/icons/consultation.png b/service_charges_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/consultation.png differ diff --git a/service_charges_pos/static/description/assets/icons/ecom-black.png b/service_charges_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/ecom-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/education-black.png b/service_charges_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/education-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/hotel-black.png b/service_charges_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/hotel-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/license.png b/service_charges_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/license.png differ diff --git a/service_charges_pos/static/description/assets/icons/lifebuoy.png b/service_charges_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/service_charges_pos/static/description/assets/icons/manufacturing-black.png b/service_charges_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/pos-black.png b/service_charges_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/pos-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/puzzle.png b/service_charges_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/puzzle.png differ diff --git a/service_charges_pos/static/description/assets/icons/restaurant-black.png b/service_charges_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/service-black.png b/service_charges_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/service-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/trading-black.png b/service_charges_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/trading-black.png differ diff --git a/service_charges_pos/static/description/assets/icons/training.png b/service_charges_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/training.png differ diff --git a/service_charges_pos/static/description/assets/icons/update.png b/service_charges_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/update.png differ diff --git a/service_charges_pos/static/description/assets/icons/user.png b/service_charges_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/user.png differ diff --git a/service_charges_pos/static/description/assets/icons/wrench.png b/service_charges_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/wrench.png differ diff --git a/service_charges_pos/static/description/assets/misc/Cybrosys R.png b/service_charges_pos/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/Cybrosys R.png differ diff --git a/service_charges_pos/static/description/assets/misc/categories.png b/service_charges_pos/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/categories.png differ diff --git a/service_charges_pos/static/description/assets/misc/check-box.png b/service_charges_pos/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/check-box.png differ diff --git a/service_charges_pos/static/description/assets/misc/compass.png b/service_charges_pos/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/compass.png differ diff --git a/service_charges_pos/static/description/assets/misc/corporate.png b/service_charges_pos/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/corporate.png differ diff --git a/service_charges_pos/static/description/assets/misc/customer-support.png b/service_charges_pos/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/customer-support.png differ diff --git a/service_charges_pos/static/description/assets/misc/cybrosys-logo.png b/service_charges_pos/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/cybrosys-logo.png differ diff --git a/service_charges_pos/static/description/assets/misc/email.svg b/service_charges_pos/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/features.png b/service_charges_pos/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/features.png differ diff --git a/service_charges_pos/static/description/assets/misc/logo.png b/service_charges_pos/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/logo.png differ diff --git a/service_charges_pos/static/description/assets/misc/phone.svg b/service_charges_pos/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/service_charges_pos/static/description/assets/misc/pictures.png b/service_charges_pos/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/pictures.png differ diff --git a/service_charges_pos/static/description/assets/misc/pie-chart.png b/service_charges_pos/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/pie-chart.png differ diff --git a/service_charges_pos/static/description/assets/misc/right-arrow.png b/service_charges_pos/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/right-arrow.png differ diff --git a/service_charges_pos/static/description/assets/misc/star (1) 2.svg b/service_charges_pos/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/star.png b/service_charges_pos/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/star.png differ diff --git a/service_charges_pos/static/description/assets/misc/support (1) 1.svg b/service_charges_pos/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/support-email.svg b/service_charges_pos/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/support.png b/service_charges_pos/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/support.png differ diff --git a/service_charges_pos/static/description/assets/misc/tick-mark.svg b/service_charges_pos/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/whatsapp 1.svg b/service_charges_pos/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/misc/whatsapp.png b/service_charges_pos/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/service_charges_pos/static/description/assets/misc/whatsapp.png differ diff --git a/service_charges_pos/static/description/assets/misc/whatsapp.svg b/service_charges_pos/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/service_charges_pos/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service_charges_pos/static/description/assets/modules/1.png b/service_charges_pos/static/description/assets/modules/1.png new file mode 100644 index 000000000..ab375ff3a Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/1.png differ diff --git a/service_charges_pos/static/description/assets/modules/2.png b/service_charges_pos/static/description/assets/modules/2.png new file mode 100644 index 000000000..e257ddb23 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/2.png differ diff --git a/service_charges_pos/static/description/assets/modules/3.png b/service_charges_pos/static/description/assets/modules/3.png new file mode 100644 index 000000000..fd64cf8ca Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/3.png differ diff --git a/service_charges_pos/static/description/assets/modules/4.png b/service_charges_pos/static/description/assets/modules/4.png new file mode 100644 index 000000000..612be4b77 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/4.png differ diff --git a/service_charges_pos/static/description/assets/modules/5.png b/service_charges_pos/static/description/assets/modules/5.png new file mode 100644 index 000000000..eba886e6a Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/5.png differ diff --git a/service_charges_pos/static/description/assets/modules/6.png b/service_charges_pos/static/description/assets/modules/6.png new file mode 100644 index 000000000..c8e6c355a Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/6.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/hero.gif b/service_charges_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..c61df7c63 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/hero.gif differ diff --git a/service_charges_pos/static/description/assets/screenshots/service1.png b/service_charges_pos/static/description/assets/screenshots/service1.png new file mode 100644 index 000000000..d31b376e2 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service1.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service2.png b/service_charges_pos/static/description/assets/screenshots/service2.png new file mode 100644 index 000000000..49fae2814 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service2.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service3.png b/service_charges_pos/static/description/assets/screenshots/service3.png new file mode 100644 index 000000000..77b4632ca Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service3.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service4.png b/service_charges_pos/static/description/assets/screenshots/service4.png new file mode 100644 index 000000000..38417d177 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service4.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service5.png b/service_charges_pos/static/description/assets/screenshots/service5.png new file mode 100644 index 000000000..3f91bad02 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service5.png differ diff --git a/service_charges_pos/static/description/banner.png b/service_charges_pos/static/description/banner.png new file mode 100644 index 000000000..e1aa53f5c Binary files /dev/null and b/service_charges_pos/static/description/banner.png differ diff --git a/service_charges_pos/static/description/icon.png b/service_charges_pos/static/description/icon.png new file mode 100644 index 000000000..5bd84f6cd Binary files /dev/null and b/service_charges_pos/static/description/icon.png differ diff --git a/service_charges_pos/static/description/index.html b/service_charges_pos/static/description/index.html new file mode 100644 index 000000000..d433953aa --- /dev/null +++ b/service_charges_pos/static/description/index.html @@ -0,0 +1,712 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Service Charges POS

+

+ This module allows you to set service charges for an order by globally and session wise.

+ +
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

Global or session

+

When enable the service charge in configuration settings of POS you can choose either Global or session.

+
+
+
+
+
+
+ +
+
+

Default service charge

+

You can set a default service charge.

+
+
+
+
+
+
+
+
+ +
+
+

Percentage or amount

+

We can set the service charge as percentage or amount.

+
+
+
+
+
+
+ +
+
+

Dynamical service charge

+

Possible to set the service charge dynamically for an order.

+
+
+
+
+
+
+
+ +
+
+
+
+
+ + +
+
+

Configuration Settings for Service Charges (Global)

+

In the general settings of POS, you can see the option Service charge.Enable the option and under that you can see the option 'Global' and 'Session'. Service Product: You can choose a service product there.The Latest service product will be there by default(should be service and can be sold) Type: The service charge can be added on the order as amount or percentage of the total amount.

+
+
+
+
+
+
+ + +
+
+

Service Charge Button

+

You can see the Service Charge button.Clicking the button will lead to a NumberPopup with the default service charge that we set before.

+
+
+
+
+
+
+ + +
+
+

Configuration Settings for Service Charges (Session)

+

Enable the selection field 'session'.If enable it the service charge will appear on every session.

+
+
+
+
+
+
+ + +
+
+

Pos Session Configuration for Service Charges

+

In every session you can see the option.Then you can set service charge percentage or amount as like global.

+
+
+
+
+ +
+
+
    +
  • + + This module allows you to set service charges for an order by globally and session wise. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on: 12th January 2024 +
+

+ + Initial Commit for Service Charges POS

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+ +
+ + + + + + diff --git a/service_charges_pos/static/src/js/pos_load_data.js b/service_charges_pos/static/src/js/pos_load_data.js new file mode 100644 index 000000000..217f966be --- /dev/null +++ b/service_charges_pos/static/src/js/pos_load_data.js @@ -0,0 +1,10 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; +patch(PosStore.prototype, { + async _processData(loadedData) { + // To load data to pos session + await super._processData(...arguments); + this.res_config_settings = loadedData["res.config.settings"]; + } +}); diff --git a/service_charges_pos/static/src/js/service_charge_button.js b/service_charges_pos/static/src/js/service_charge_button.js new file mode 100644 index 000000000..e985bdfde --- /dev/null +++ b/service_charges_pos/static/src/js/service_charge_button.js @@ -0,0 +1,100 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup"; +import { _t } from "@web/core/l10n/translation"; + +export class ServiceChargeButton extends Component { + static template = "service_charges_pos.ServiceChargeButton"; + setup() { + this.pos = usePos(); + this.popup = useService("popup"); + } + async click() { + // To show number pop up and service charge applying functions based on conditions. + let res_config_settings = this.pos.res_config_settings[this.pos.res_config_settings.length -1] + var global_selection = res_config_settings.global_selection + var global_charge = res_config_settings.global_charge + var visibility = res_config_settings.visibility + var global_product = res_config_settings.global_product_id[0] + var order = this.pos.get_order(); + var lines = order.get_orderlines(); + if (visibility == 'global') { + var product = this.pos.db.get_product_by_id(global_product) + if (product === undefined) { + await this.popup.add(ErrorPopup, { + title: _t("No service product found"), + body: _t("The service product seems misconfigured. Make sure it is flagged as 'Can be Sold' and 'Available in Point of Sale'.") + }); + return + } + // Remove existing discounts + lines.filter(line => line.get_product() === product).forEach(line => order.removeOrderline(line)); + const { confirmed, payload } = await this.popup.add(NumberPopup, { + title: _t('Service Charge'), + startingValue: parseInt(global_charge), + isInputSelected: true + }) + if (confirmed) { + if (payload > 0) { + if (global_selection == 'amount') { + order.add_product(product, { + price: payload + }); + } else { + var total_amount = order.get_total_with_tax() + var per_amount = payload / 100 * total_amount + order.add_product(product, { + price: per_amount + }); + } + } + } + } else { + var type = this.pos.config.charge_type + var product = this.pos.db.get_product_by_id(this.pos.config.service_product_id[0]); + if (product === undefined) { + await this.popup.add(ErrorPopup, { + title: _t("No service product found"), + body: _t("The service product seems misconfigured. Make sure it is flagged as 'Can be Sold' and 'Available in Point of Sale'."), + }); + return; + } + lines.filter(line => line.get_product() === product).forEach(line => order.removeOrderline(line)); + const {confirmed, payload } = await this.popup.add(NumberPopup, { + title: _t('Service Charge'), + startingValue: this.pos.config.service_charge, + isInputSelected: true + }) + if (confirmed) { + if (payload > 0) { + if (type == 'amount') { + order.add_product(product, { + price: payload + }); + } else { + var total_amount = order.get_total_with_tax() + var per_amount = payload / 100 * total_amount + order.add_product(product, { + price: per_amount + }); + } + } + } + } + } +} +ProductScreen.addControlButton({ + component: ServiceChargeButton, + condition: function () { + let res_config_settings = this.pos.res_config_settings[this.pos.res_config_settings.length -1] + if (res_config_settings) { + return res_config_settings.enable_service_charge + } else { + return false + } + }, +}); diff --git a/service_charges_pos/static/src/xml/ServiceChargeButton.xml b/service_charges_pos/static/src/xml/ServiceChargeButton.xml new file mode 100644 index 000000000..96eb62a69 --- /dev/null +++ b/service_charges_pos/static/src/xml/ServiceChargeButton.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/service_charges_pos/views/pos_config_views.xml b/service_charges_pos/views/pos_config_views.xml new file mode 100644 index 000000000..ffde1fedf --- /dev/null +++ b/service_charges_pos/views/pos_config_views.xml @@ -0,0 +1,43 @@ + + + + + pos.config.view.form.inherit.service.charges.pos + pos.config + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/service_charges_pos/views/res_config_settings_views.xml b/service_charges_pos/views/res_config_settings_views.xml new file mode 100644 index 000000000..f76b9f546 --- /dev/null +++ b/service_charges_pos/views/res_config_settings_views.xml @@ -0,0 +1,52 @@ + + + + + res.config.settings.view.form.inherit.service.charges.pos + res.config.settings + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+