diff --git a/service_charges_pos/README.rst b/service_charges_pos/README.rst new file mode 100755 index 000000000..bf6355e64 --- /dev/null +++ b/service_charges_pos/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Service Charges +======================= +This module allows to set service charges for orders in POS by globally and session wise. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: Aysha Shalin, 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 +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/service_charges_pos/__init__.py b/service_charges_pos/__init__.py new file mode 100644 index 000000000..c3924c90a --- /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: Aysha Shalin (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..e2f92f97a --- /dev/null +++ b/service_charges_pos/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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': 'POS Service Charges', + 'version': '15.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': 'Add service charges to the Orders from POS.', + 'description': """This module enables to set service charges for orders in + POS globally and session wise.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'point_of_sale'], + 'data': [ + 'views/res_config_settings_views.xml', + 'views/pos_config_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + 'service_charges_pos/static/src/js/service_charge_button.js', + ], + 'web.assets_qweb': [ + '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..46051d85e --- /dev/null +++ b/service_charges_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 20.07.2024 +#### Version 15.0.1.0.0 +##### ADD + +- Initial commit for POS Service Charges diff --git a/service_charges_pos/models/__init__.py b/service_charges_pos/models/__init__.py new file mode 100644 index 000000000..8085c002a --- /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: Aysha Shalin (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..5e50e357b --- /dev/null +++ b/service_charges_pos/models/pos_config.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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): + """ Inherits POS Configuration """ + _inherit = 'pos.config' + + is_session = fields.Boolean(string="Session", + compute='_compute_is_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") + + has_service_charge = fields.Boolean(string='Service charge', + compute="_compute_has_service_charge") + config_visibility = fields.Selection([ + ('global', 'Global'), + ('session', 'Session')], + string="Visibility", compute="_compute_config_visibility", + help='Setup the Service charge globally or per session') + config_selection = fields.Selection([ + ('amount', 'Amount'), + ('percentage', 'Percentage')], + string='Selection type', compute="_compute_config_selection", + help='Set the service charge as a amount or percentage') + config_charge = fields.Float(string='Charge', + compute="_compute_config_charge", + help='Set a default service charge globally') + config_product_id = fields.Many2one('product.product', + string='Service Product', + domain="[('available_in_pos', '=', " + "True)," + "('sale_ok', '=', True), " + "('type', '=', 'service')]", + compute="_compute_config_product", + help='Set a service product globally') + + def _compute_is_session(self): + """ To check the service charge is set for session wise or globally """ + check_session = self.env['ir.config_parameter'].sudo().get_param( + 'service_charges_pos.visibility') + if check_session == 'session': + self.is_session = True + else: + self.is_session = False + + @api.onchange('is_service_charges') + def onchange_is_service_charges(self): + """ When the service charge is enabled set the service product and + amount by default per session. """ + if self.is_service_charges: + if not self.service_product_id: + domain = [('available_in_pos', '=', True), + ('sale_ok', '=', True), ('type', '=', 'service')] + self.service_product_id = self.env['product.product'].search( + domain, limit=1) + self.service_charge = 10.0 + else: + self.service_product_id = False + self.service_charge = 0.0 + + def _compute_has_service_charge(self): + """ To check if service charge is enabled from settings """ + if self.env['ir.config_parameter'].sudo().get_param( + 'service_charges_pos.enable_service_charge'): + self.has_service_charge = True + else: + self.has_service_charge = False + + def _compute_config_visibility(self): + """ To obtain service charge type from res.config.settings """ + res = self.env['ir.config_parameter'].sudo() + if res.get_param( + 'service_charges_pos.enable_service_charge'): + settings_visibility = res.get_param( + 'service_charges_pos.visibility') + self.config_visibility = settings_visibility + else: + self.config_visibility = '' + + def _compute_config_charge(self): + """ To obtain service charge from res.config.settings """ + res = self.env['ir.config_parameter'].sudo() + if res.get_param( + 'service_charges_pos.enable_service_charge'): + charge = res.get_param( + 'service_charges_pos.global_charge') + self.config_charge = charge + else: + self.config_charge = 0 + + def _compute_config_selection(self): + """ To obtain service charge mode from res.config.settings """ + res = self.env['ir.config_parameter'].sudo() + if res.get_param( + 'service_charges_pos.enable_service_charge'): + selection = res.get_param( + 'service_charges_pos.global_selection') + self.config_selection = selection + else: + self.config_selection = '' + + def _compute_config_product(self): + """ To obtain service charge product from res.config.settings """ + res = self.env['ir.config_parameter'].sudo() + if res.get_param( + 'service_charges_pos.enable_service_charge'): + product_id = res.get_param( + 'service_charges_pos.global_product_id') + product = self.env['product.template'].browse(int(product_id)) + self.config_product_id = product.id + else: + self.config_product_id = '' diff --git a/service_charges_pos/models/pos_session.py b/service_charges_pos/models/pos_session.py new file mode 100644 index 000000000..97c94f861 --- /dev/null +++ b/service_charges_pos/models/pos_session.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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): + """ Inherits 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..013add4e1 --- /dev/null +++ b/service_charges_pos/models/res_config_settings.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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): + """ Inherits 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', + default=10, + 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 globally """ + if self.enable_service_charge: + if not self.global_product_id: + domain = [('available_in_pos', '=', True), + ('sale_ok', '=', True), ('type', '=', 'service')] + self.global_product_id = self.env[ + 'product.product'].search( + domain, limit=1) + 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/logo.png b/service_charges_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/service_charges_pos/static/description/assets/icons/logo.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/modules/point_of_sale_logo.png b/service_charges_pos/static/description/assets/modules/point_of_sale_logo.png new file mode 100644 index 000000000..b80003109 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/point_of_sale_logo.png differ diff --git a/service_charges_pos/static/description/assets/modules/pos_magnify_image.png b/service_charges_pos/static/description/assets/modules/pos_magnify_image.png new file mode 100644 index 000000000..551db150f Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/pos_magnify_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/pos_mrp_order.png b/service_charges_pos/static/description/assets/modules/pos_mrp_order.png new file mode 100644 index 000000000..234f364d2 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/pos_mrp_order.png differ diff --git a/service_charges_pos/static/description/assets/modules/pos_order_line_image.png b/service_charges_pos/static/description/assets/modules/pos_order_line_image.png new file mode 100644 index 000000000..899749138 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/pos_order_line_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/pos_product_creation.png b/service_charges_pos/static/description/assets/modules/pos_product_creation.png new file mode 100644 index 000000000..cf749372e Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/pos_product_creation.png differ diff --git a/service_charges_pos/static/description/assets/modules/product_exchange_pos_sys.png b/service_charges_pos/static/description/assets/modules/product_exchange_pos_sys.png new file mode 100644 index 000000000..944abdae3 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/product_exchange_pos_sys.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/1.png b/service_charges_pos/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..c6803cf98 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/1.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/2.png b/service_charges_pos/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..4e1937b20 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/2.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/3.png b/service_charges_pos/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..4b89c462f Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/3.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/4.png b/service_charges_pos/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..c0b1c553f Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/4.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/5.png b/service_charges_pos/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..715950ae6 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/5.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/6.png b/service_charges_pos/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..c6070f8ff Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/6.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/7.png b/service_charges_pos/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..528d445ac Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/7.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/8.png b/service_charges_pos/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..3e6b6830f Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/8.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..f279bd2e4 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/hero.gif 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..8dd186c10 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..113b8c030 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..2fd14df6d --- /dev/null +++ b/service_charges_pos/static/description/index.html @@ -0,0 +1,545 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+ +
+
+
+

+ POS Service Charges +

+

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

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module crafted by Cybrosys Technologies provides an option to set the Service charge in every order of POS. + The main feature of the module is possible to set the Service charge for every session or globally. +

+
+
+
+
+

+ Features +

+
+
+
+ +
+
+

+ 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 a order. +

+
+
+
+ +
+
+

+ Screenshots +

+
+
+

Configuration Settings for Service charge(Globally)

+

+ 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. +

+ +
+
+ +
+
+

Percentage

+

+ You can also add the percentage of total amount as service charge by enabling the field percentage in settings. +

+ +
+
+ +
+
+

+ 15% of the total amount is added as service charge on order. +

+ +
+
+

Configuration Settings for Service charge(Session)

+

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

+ +
+
+

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

+ +
+
+ + +
+
+

Suggested Products

+
+ +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo Customization +
+
+ +
+
+ +
+
+ Odoo Implementation +
+
+ +
+
+ +
+
+ Odoo Support +
+
+ +
+
+ +
+
+ Hire Odoo Developer +
+
+ +
+
+ +
+
+ Odoo Integration +
+
+ +
+
+ +
+
+ Odoo Migration +
+
+ +
+
+ +
+
+ Odoo + Consultancy +
+
+ +
+
+ +
+
+ Odoo Implementation +
+
+ +
+
+ +
+
+ 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 +

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

Need Help?

+
+
+
+ + +
+ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file 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..e4393c5da --- /dev/null +++ b/service_charges_pos/static/src/js/service_charge_button.js @@ -0,0 +1,108 @@ +odoo.define('service_charges_pos.ServiceChargeButton', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const {useListener} = require("@web/core/utils/hooks"); + + class ServiceChargeButton extends PosComponent { + setup() { + super.setup(); + useListener('click', this._onClick); + } + // Click event for button service charge + async _onClick() { + if (this.env.pos.config.has_service_charge){ + var global_selection = this.env.pos.config.config_selection + var global_charge = this.env.pos.config.config_charge + var visibility = this.env.pos.config.config_visibility + var global_product = this.env.pos.config.config_product_id[0] + + var order = this.env.pos.get_order(); + var lines = order.get_orderlines(); + if (visibility == 'global') { + var product = this.env.pos.db.get_product_by_id(global_product) + if (product === undefined) { + await this.showPopup('ErrorPopup', { + title: this.env._t("No service product found"), + body: this.env._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.remove_orderline(line)); + const { + confirmed, + payload + } = await this.showPopup('NumberPopup', { + title: this.env._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.env.pos.config.charge_type + var product = this.env.pos.db.get_product_by_id(this.env.pos.config.service_product_id[0]); + if (product === undefined) { + await this.showPopup('ErrorPopup', { + title: this.env._t("No service product found"), + body: this.env._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.remove_orderline(line)); + const { + confirmed, + payload + } = await this.showPopup('NumberPopup', { + title: this.env._t('Service Charge'), + startingValue: this.env.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 + }); + } + } + } + } + } + } + } + ServiceChargeButton.template = 'service_charges_pos.ServiceChargeButton'; + ProductScreen.addControlButton({ + component: ServiceChargeButton, + condition: function() { + return true + }, + }); + Registries.Component.add(ServiceChargeButton); + return ServiceChargeButton; +}); \ No newline at end of file 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..1f7688474 --- /dev/null +++ b/service_charges_pos/static/src/xml/ServiceChargeButton.xml @@ -0,0 +1,12 @@ + + + + + +
+ + Service Charge +
+
+
+
\ No newline at end of file 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..a5f7b33b4 --- /dev/null +++ b/service_charges_pos/views/pos_config_views.xml @@ -0,0 +1,48 @@ + + + + pos.config.view.form.inherit.service.charges.pos + pos.config + + + +
+
+ +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file 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..84e925422 --- /dev/null +++ b/service_charges_pos/views/res_config_settings_views.xml @@ -0,0 +1,54 @@ + + + + res.config.settings.view.form.inherit.service.charges.pos + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file