diff --git a/service_charges_pos/README.rst b/service_charges_pos/README.rst new file mode 100755 index 000000000..2ef191e15 --- /dev/null +++ b/service_charges_pos/README.rst @@ -0,0 +1,37 @@ +.. 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 you to set service charges for an order by globally and session wise. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Ammu @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 +========== +.. 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..44584e58c --- /dev/null +++ b/service_charges_pos/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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..700513ab6 --- /dev/null +++ b/service_charges_pos/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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': '16.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', + 'images': ['static/description/banner.png'], + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'point_of_sale'], + 'data': [ + 'views/res_config_settings.xml', + 'views/pos_config.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + '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', + ], + }, + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': 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..f8ed8a442 --- /dev/null +++ b/service_charges_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 07.01.2023 +#### Version 16.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..883e2ae67 --- /dev/null +++ b/service_charges_pos/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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 res_config_settings +from . import pos_config +from . import pos_session diff --git a/service_charges_pos/models/pos_config.py b/service_charges_pos/models/pos_config.py new file mode 100644 index 000000000..a63920a75 --- /dev/null +++ b/service_charges_pos/models/pos_config.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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 setup 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 enable set 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 \ No newline at end of file diff --git a/service_charges_pos/models/pos_session.py b/service_charges_pos/models/pos_session.py new file mode 100644 index 000000000..b52b2eb3f --- /dev/null +++ b/service_charges_pos/models/pos_session.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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'].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..6b16e9e77 --- /dev/null +++ b/service_charges_pos/models/res_config_settings.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ammu (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: + domain = [('available_in_pos', '=', True), + ('sale_ok', '=', True), ('type', '=', 'service')] + self.global_product_id = self.env[ + 'product.product'].search( + domain, 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/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/budget_image.png b/service_charges_pos/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/budget_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/credit_image.png b/service_charges_pos/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/credit_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/employee_image.png b/service_charges_pos/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/employee_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/export_image.png b/service_charges_pos/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/export_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/gantt_image.png b/service_charges_pos/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/gantt_image.png differ diff --git a/service_charges_pos/static/description/assets/modules/quotation_image.png b/service_charges_pos/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/service_charges_pos/static/description/assets/modules/quotation_image.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..b7d48c074 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/service10.png b/service_charges_pos/static/description/assets/screenshots/service10.png new file mode 100644 index 000000000..033f0b7ff Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service10.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..2e6fcdb7b 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..8df8582f5 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..59eddff98 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..e56ca6529 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service5.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service6.png b/service_charges_pos/static/description/assets/screenshots/service6.png new file mode 100644 index 000000000..3e595685a Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service6.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service7.png b/service_charges_pos/static/description/assets/screenshots/service7.png new file mode 100644 index 000000000..d7781b09c Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service7.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service8.png b/service_charges_pos/static/description/assets/screenshots/service8.png new file mode 100644 index 000000000..b69285bca Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service8.png differ diff --git a/service_charges_pos/static/description/assets/screenshots/service9.png b/service_charges_pos/static/description/assets/screenshots/service9.png new file mode 100644 index 000000000..122ae4974 Binary files /dev/null and b/service_charges_pos/static/description/assets/screenshots/service9.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..c247ba6ac 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..34ef5ab79 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..f0739609e --- /dev/null +++ b/service_charges_pos/static/description/index.html @@ -0,0 +1,556 @@ +
+
+
+
+ +
+
+
+ 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 add 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 leads to a NumberPopup with the default service charge that we set before. +

+ +
+
+ +
+
+

Dynamical service charge

+

+ Set the required amount of service charge. +

+ +
+
+ +
+
+

Percentage

+

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

+ +
+
+ + +
+
+

+ 10% 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/pos_load_data.js b/service_charges_pos/static/src/js/pos_load_data.js new file mode 100644 index 000000000..9db4617dd --- /dev/null +++ b/service_charges_pos/static/src/js/pos_load_data.js @@ -0,0 +1,15 @@ +odoo.define('service_charges_pos.pos', function(require) { + "use strict"; + + var { PosGlobalState } = require('point_of_sale.models'); + const Registries = require('point_of_sale.Registries'); +//model loading to this.res_config_settings + const NewPosGlobalState = (PosGlobalState) => class NewPosGlobalState extends PosGlobalState { + async _processData(loadedData) { + await super._processData(...arguments); + this.res_config_settings = loadedData['res.config.settings']; + } + } + Registries.Model.extend(PosGlobalState, NewPosGlobalState); + +}); \ 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..020e0a122 --- /dev/null +++ b/service_charges_pos/static/src/js/service_charge_button.js @@ -0,0 +1,112 @@ +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"); + var rpc = require('web.rpc'); + + class ServiceChargeButton extends PosComponent { + setup() { + super.setup(); + useListener('click', this._onClick); + } +// click button service charge + async _onClick() { + var self = this; + let res_config_settings = self.env.pos.res_config_settings[self.env.pos.res_config_settings.length -1] + var self = this; + 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.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..2847be049 --- /dev/null +++ b/service_charges_pos/static/src/xml/ServiceChargeButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Service Charge +
+
+ +
\ No newline at end of file diff --git a/service_charges_pos/views/pos_config.xml b/service_charges_pos/views/pos_config.xml new file mode 100644 index 000000000..d46b9d176 --- /dev/null +++ b/service_charges_pos/views/pos_config.xml @@ -0,0 +1,48 @@ + + + + pos.service.config.view.form + pos.config + + + +
+
+ +
+
+ +
+
+
+
+
+
+
+
diff --git a/service_charges_pos/views/res_config_settings.xml b/service_charges_pos/views/res_config_settings.xml new file mode 100644 index 000000000..041e0570c --- /dev/null +++ b/service_charges_pos/views/res_config_settings.xml @@ -0,0 +1,54 @@ + + + + res.config.settings.view.form.inherit + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file