diff --git a/calculator_in_pos/README.rst b/calculator_in_pos/README.rst new file mode 100644 index 000000000..f19443f4a --- /dev/null +++ b/calculator_in_pos/README.rst @@ -0,0 +1,53 @@ +.. image:: https://img.shields.io/badge/license-OPL--1-red.svg + :target: https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps + :alt: License: OPL-1 + +Calculator in POS Screen +======================== +A simple virtual calculator on the POS screen enables quick calculations without the need for a physical calculator. + +Configuration +============= +After Installation, go to Configuration-> Point of Sales -> Shop/Restaurant -> Enable 'Virtual Calculator'. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Odoo Proprietary License v1.0 (OPL-1) +(https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps) + +Credits +------- +* Developers : (V11): Mashood K U, + (V12): Kavya Raveendran, + (V13): Mashood, + (V14): Abhishek E T, + (V15): Abhishek E T, + (V16): Sumith Sivan, + (V17): 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/calculator_in_pos/__init__.py b/calculator_in_pos/__init__.py new file mode 100644 index 000000000..888879bbd --- /dev/null +++ b/calculator_in_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import models diff --git a/calculator_in_pos/__manifest__.py b/calculator_in_pos/__manifest__.py new file mode 100644 index 000000000..34bbd9f29 --- /dev/null +++ b/calculator_in_pos/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +{ + 'name': 'Calculator in POS Screen', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """A simple virtual calculator with option to enable/disable it + from POS configuration.""", + 'description': """This module provides a straightforward virtual calculator + in the POS, offering users the flexibility to enable or disable its + functionality through the POS configuration settings allowing users to + effortlessly perform calculations within the POS environment.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['point_of_sale'], + 'data': ['views/pos_config_views.xml'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'calculator_in_pos/static/src/app/calculator_button/calculator_button.js', + 'calculator_in_pos/static/src/app/calculator_button/calculator_button.xml', + 'calculator_in_pos/static/src/app/calculator_popup/calculator_popup.js', + 'calculator_in_pos/static/src/app/calculator_popup/calculator_popup.xml', + 'calculator_in_pos/static/src/css/calculator_in_pos.css', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'OPL-1', + 'price': 4.99, + 'currency': 'EUR', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/calculator_in_pos/doc/RELEASE_NOTES.md b/calculator_in_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f30625bb7 --- /dev/null +++ b/calculator_in_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.12.2023 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Calculator in POS Screen diff --git a/calculator_in_pos/models/__init__.py b/calculator_in_pos/models/__init__.py new file mode 100644 index 000000000..590232cfd --- /dev/null +++ b/calculator_in_pos/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import pos_calculator +from . import pos_config diff --git a/calculator_in_pos/models/pos_calculator.py b/calculator_in_pos/models/pos_calculator.py new file mode 100644 index 000000000..bf1985d4f --- /dev/null +++ b/calculator_in_pos/models/pos_calculator.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import models + + +class PosCalculator(models.TransientModel): + """ Calculator in POS Screen """ + _name = 'pos.calculator' + _description = 'POS Calculator' + + def calculations(self, data): + """ Perform calculations on the given mathematical expression """ + while data.endswith((".", "+", "-", "/", "%", "*"), len(data) - 1, + len(data)): + data = data[:-1] + if data.find("%") == -1: + return str(eval(data)) + else: + vals = data.split('%') + while len(vals) > 1: + new_val = eval(vals[len(vals) - 2]) * eval( + vals[len(vals) - 1]) / 100 + vals.pop() + vals.pop() + vals.append(str(new_val)) + return vals[0] diff --git a/calculator_in_pos/models/pos_config.py b/calculator_in_pos/models/pos_config.py new file mode 100644 index 000000000..d650f711e --- /dev/null +++ b/calculator_in_pos/models/pos_config.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0(OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import fields, models + + +class PosConfig(models.Model): + """ Inheriting 'pos.config' for adding field for enabling/disabling + calculator in POS.""" + _inherit = 'pos.config' + + active_calc = fields.Boolean( + string='Virtual Calculator', default=True, + help="Enable Calculator in POS Screen") diff --git a/calculator_in_pos/security/ir.model.access.csv b/calculator_in_pos/security/ir.model.access.csv new file mode 100755 index 000000000..89c3fe620 --- /dev/null +++ b/calculator_in_pos/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_calculator_user,access.pos.calculator.user,model_pos_calculator,base.group_user,1,1,1,1 diff --git a/calculator_in_pos/static/description/assets/icons/capture (1).png b/calculator_in_pos/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/capture (1).png differ diff --git a/calculator_in_pos/static/description/assets/icons/check.png b/calculator_in_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/check.png differ diff --git a/calculator_in_pos/static/description/assets/icons/chevron.png b/calculator_in_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/chevron.png differ diff --git a/calculator_in_pos/static/description/assets/icons/cogs.png b/calculator_in_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/cogs.png differ diff --git a/calculator_in_pos/static/description/assets/icons/consultation.png b/calculator_in_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/consultation.png differ diff --git a/calculator_in_pos/static/description/assets/icons/ecom-black.png b/calculator_in_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/ecom-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/education-black.png b/calculator_in_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/education-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/hotel-black.png b/calculator_in_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/hotel-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/img.png b/calculator_in_pos/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/img.png differ diff --git a/calculator_in_pos/static/description/assets/icons/license.png b/calculator_in_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/license.png differ diff --git a/calculator_in_pos/static/description/assets/icons/lifebuoy.png b/calculator_in_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/calculator_in_pos/static/description/assets/icons/manufacturing-black.png b/calculator_in_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/photo-capture.png b/calculator_in_pos/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/photo-capture.png differ diff --git a/calculator_in_pos/static/description/assets/icons/pos-black.png b/calculator_in_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/pos-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/puzzle.png b/calculator_in_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/puzzle.png differ diff --git a/calculator_in_pos/static/description/assets/icons/restaurant-black.png b/calculator_in_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/service-black.png b/calculator_in_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/service-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/trading-black.png b/calculator_in_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/trading-black.png differ diff --git a/calculator_in_pos/static/description/assets/icons/training.png b/calculator_in_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/training.png differ diff --git a/calculator_in_pos/static/description/assets/icons/update.png b/calculator_in_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/update.png differ diff --git a/calculator_in_pos/static/description/assets/icons/user.png b/calculator_in_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/user.png differ diff --git a/calculator_in_pos/static/description/assets/icons/wrench.png b/calculator_in_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/calculator_in_pos/static/description/assets/icons/wrench.png differ diff --git a/calculator_in_pos/static/description/assets/misc/Cybrosys R.png b/calculator_in_pos/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/calculator_in_pos/static/description/assets/misc/Cybrosys R.png differ diff --git a/calculator_in_pos/static/description/assets/misc/email.svg b/calculator_in_pos/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/phone.svg b/calculator_in_pos/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/calculator_in_pos/static/description/assets/misc/star (1) 2.svg b/calculator_in_pos/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/support (1) 1.svg b/calculator_in_pos/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/support-email.svg b/calculator_in_pos/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/tick-mark.svg b/calculator_in_pos/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/whatsapp 1.svg b/calculator_in_pos/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/misc/whatsapp.svg b/calculator_in_pos/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/calculator_in_pos/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/calculator_in_pos/static/description/assets/modules/base_accounting_kit.gif b/calculator_in_pos/static/description/assets/modules/base_accounting_kit.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/base_accounting_kit.gif differ diff --git a/calculator_in_pos/static/description/assets/modules/dashboard_pos.png b/calculator_in_pos/static/description/assets/modules/dashboard_pos.png new file mode 100644 index 000000000..e10947739 Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/dashboard_pos.png differ diff --git a/calculator_in_pos/static/description/assets/modules/inventory_barcode_scanning.png b/calculator_in_pos/static/description/assets/modules/inventory_barcode_scanning.png new file mode 100644 index 000000000..cb17cf612 Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/inventory_barcode_scanning.png differ diff --git a/calculator_in_pos/static/description/assets/modules/invoice_format_editor.png b/calculator_in_pos/static/description/assets/modules/invoice_format_editor.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/invoice_format_editor.png differ diff --git a/calculator_in_pos/static/description/assets/modules/product_barcode.png b/calculator_in_pos/static/description/assets/modules/product_barcode.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/product_barcode.png differ diff --git a/calculator_in_pos/static/description/assets/modules/whatsapp_redirect.png b/calculator_in_pos/static/description/assets/modules/whatsapp_redirect.png new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/calculator_in_pos/static/description/assets/modules/whatsapp_redirect.png differ diff --git a/calculator_in_pos/static/description/assets/screenshots/1.png b/calculator_in_pos/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..9aa762c81 Binary files /dev/null and b/calculator_in_pos/static/description/assets/screenshots/1.png differ diff --git a/calculator_in_pos/static/description/assets/screenshots/2.png b/calculator_in_pos/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..d77b796d1 Binary files /dev/null and b/calculator_in_pos/static/description/assets/screenshots/2.png differ diff --git a/calculator_in_pos/static/description/assets/screenshots/3.png b/calculator_in_pos/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..7164fa156 Binary files /dev/null and b/calculator_in_pos/static/description/assets/screenshots/3.png differ diff --git a/calculator_in_pos/static/description/assets/screenshots/hero.gif b/calculator_in_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1dacadc6d Binary files /dev/null and b/calculator_in_pos/static/description/assets/screenshots/hero.gif differ diff --git a/calculator_in_pos/static/description/banner.png b/calculator_in_pos/static/description/banner.png new file mode 100644 index 000000000..2feab7783 Binary files /dev/null and b/calculator_in_pos/static/description/banner.png differ diff --git a/calculator_in_pos/static/description/icon.png b/calculator_in_pos/static/description/icon.png new file mode 100644 index 000000000..bc6b00867 Binary files /dev/null and b/calculator_in_pos/static/description/icon.png differ diff --git a/calculator_in_pos/static/description/index.html b/calculator_in_pos/static/description/index.html new file mode 100644 index 000000000..8a24faeda --- /dev/null +++ b/calculator_in_pos/static/description/index.html @@ -0,0 +1,568 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Calculator in POS Screen

+

+ A Simple Virtual Calculator with the Option to Enable/Disable it from POS Configurations. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Simple Virtual Calculator.

+

Simple Virtual Calculator with a Well-Structured Keyboard Layout. +

+
+
+
+
+
+
+ +
+
+

'Calculator' Button in POS Screen.

+

Adds a 'Calculator' Button to the POS Screen for Quick and Seamless Mathematical Operations. +

+
+
+
+
+
+
+ +
+
+

Enable/Disable Calculator.

+

Easily Enable/Disable Calculator from POS Configuration. +

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

+ To Enable POS Calculator, go to Configuration -> Point of Sales -> Shop/Restaurant -> Virtual Calculator.

+
+
+
+
+
+
+ +
+
+

+ A 'Calculator' Button will be Displayed on the POS Screen.

+
+
+
+
+
+
+ +
+
+

+ Click the 'Calculator' Button to Open the Virtual Calculator.

+
+
+
+
+
+
+
    +
  • + Displays a Window with a Structured Keyboard Layout. +
  • +
  • + Simple and Beautiful GUI. +
  • +
  • + All Basic Calculation Methods are Available. +
  • +
  • + Easily Accessible from the POS Screen by Clicking a Button. +
  • +
  • + Easily Enable/Disable Calculator from POS Configuration Settings. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:15th November 2023 +
+

+ Initial Commit for Calculator in POS Screen.

+
+
+
+
+
+
+
+

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/calculator_in_pos/static/src/app/calculator_button/calculator_button.js b/calculator_in_pos/static/src/app/calculator_button/calculator_button.js new file mode 100644 index 000000000..86ce16a41 --- /dev/null +++ b/calculator_in_pos/static/src/app/calculator_button/calculator_button.js @@ -0,0 +1,34 @@ +/** @odoo-module **/ +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { CalculatorPopup } from "../calculator_popup/calculator_popup.js"; +import { useService } from "@web/core/utils/hooks"; +import { _t } from "@web/core/l10n/translation"; + +/* This class represents calculator button in product screen. */ +export class CalculatorButton extends Component{ + static template = "CalculatorButton"; + /* Initializes the component and sets up necessary dependencies. */ + setup() { + super.setup(); + this.pos = usePos(); + this.popup = useService("popup"); + } + /** + * Handles the click event of the CalculatorButton. + * Opens a popup for calculator. + */ + async click() { + await this.popup.add(CalculatorPopup, { + title: _t('Calculator'), + }); + } +} +/* Adding CalculatorButton to the ProductScreen controls */ +ProductScreen.addControlButton({ + component: CalculatorButton, + condition: function() { + return this.pos.config.active_calc; + }, +}); diff --git a/calculator_in_pos/static/src/app/calculator_button/calculator_button.xml b/calculator_in_pos/static/src/app/calculator_button/calculator_button.xml new file mode 100644 index 000000000..74499b3c5 --- /dev/null +++ b/calculator_in_pos/static/src/app/calculator_button/calculator_button.xml @@ -0,0 +1,10 @@ + + + + +
+ + Calculator +
+
+
diff --git a/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.js b/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.js new file mode 100644 index 000000000..c749625e4 --- /dev/null +++ b/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.js @@ -0,0 +1,126 @@ +/** @odoo-module **/ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +import { useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { Numpad } from "@point_of_sale/app/generic_components/numpad/numpad"; + +const INPUT_KEYS = ['x', '/', '%', '+', '-', '=', 'Delete', '⌫'] + +/* This class represents calculator popup in product screen. */ +export class CalculatorPopup extends AbstractAwaitablePopup { + static template = "CalculatorPopup"; + static components = { Numpad }; + static defaultProps = { + cancelText: _t("Close"), + title: _t("Calculator"), + getInputBufferReminder: () => false, + }; + /* Initializes the component and sets up necessary dependencies. */ + setup() { + super.setup(); + let startingBuffer = ""; + if (typeof this.props.startingValue === "number" && this.props.startingValue > 0) { + startingBuffer = this.props.startingValue + .toFixed(this.props.nbrDecimal) + .toString() + .replace(".", this.decimalSeparator); + } + this.state = useState({ + buffer: startingBuffer, + }); + this.numberBuffer = useService("number_buffer"); + this.numberBuffer.use({ + triggerAtEnter: () => this.confirm(), + triggerAtEscape: () => this.cancel(), + state: this.state, + }); + this.orm = useService("orm"); + } + /* Load buttons in Calculator popup. */ + getNumpadButtonsPOS() { + return [ + { value: "1" , class:"input-btn"}, + { value: "2" , class:"input-btn"}, + { value: "3" , class:"input-btn"}, + { value: "4" , class:"input-btn"}, + { value: "5" , class:"input-btn"}, + { value: "6" , class:"input-btn"}, + { value: "7" , class:"input-btn"}, + { value: "8" , class:"input-btn"}, + { value: "9" , class:"input-btn"}, + { value: "0" , class:"input-btn"}, + { value: "Delete", text:"AC", class:"operator-btn"}, + { text:"+" , class:"operator-btn"}, + { text: "-", class:"operator-btn"}, + { value: this.env.services.localization.decimalPoint, class:"operator-btn"}, + { value: "x", text: "x", class:"operator-btn"}, + { text: "⌫", class:"backspace-btn"}, + { value: "/", text:"/" , class:"operator-btn"}, + { value: "%", text: "%", class:"operator-btn"}, + { value: "=", text: "=", class:"equal-btn"}, + ]; + } + /* + * This method retrieves the current state of the input buffer. If the buffer + * is null, an empty string is returned. + */ + get inputBuffer() { + if (this.state.buffer === null) { + return ""; + } + else { + return this.state.buffer; + } + } + /* Determine if the current device is in a mobile view. */ + isMobile() { + return window.innerWidth <= 768; + } + /** + * Handles numpad button click event. + * + * It performs different actions based on the clicked button including + * clearing the buffer, backspacing, performing calculations, and appending + * characters to the buffer. + */ + onClickNumpad(ev) { + if (INPUT_KEYS.includes(ev.target.innerText)){ + console.log('input keys') + if (ev.target.innerText === 'Clear') { + this.state.buffer = ''; + } else if (ev.target.innerText === '⌫') { + this.state.buffer = this.state.buffer.slice(0,-1); + } else if (ev.target.innerText === '=') { + console.log('key', ev.target.innerText) + var data = this.state.buffer.replace(/x/g, "*"); + var self = this; + this.state.buffer = this.orm.call('pos.calculator', 'calculations', [false, data] + ).then(function (result) { + self.state.buffer = result; + }); + } else { + if (this.state.buffer === null || this.state.buffer === '') { + if (ev.target.innerText === '+' ||ev.target.innerText === '-') { + this.state.buffer = ev.target.innerText; + console.log('1') + } + } else if (/[0-9]/g.test(this.state.buffer.slice(-1)) === true) { + console.log('this.state.buffer', this.state.buffer) + console.log('this.state.inner', ev.target.innerText) + this.state.buffer = this.state.buffer + ev.target.innerText; + console.log('2') + } else { + if (/[0-9]/g.test(this.state.buffer.slice(-2)) === true){ + console.log('3-res', this.state.buffer.slice(0,-1)) + this.state.buffer = this.state.buffer.slice(0,-1) + ev.target.innerText; + console.log('3') + } else { + this.state.buffer = this.state.buffer.slice(0,-2) + ev.target.innerText; + console.log('4') + } + } + } + } + } +} diff --git a/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.xml b/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.xml new file mode 100644 index 000000000..ebd5ed214 --- /dev/null +++ b/calculator_in_pos/static/src/app/calculator_popup/calculator_popup.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/calculator_in_pos/static/src/css/calculator_in_pos.css b/calculator_in_pos/static/src/css/calculator_in_pos.css new file mode 100644 index 000000000..044412844 --- /dev/null +++ b/calculator_in_pos/static/src/css/calculator_in_pos.css @@ -0,0 +1,34 @@ +.calculator-popup { + border-radius: 10px !important; + padding-bottom: 10px !important; +} +.operator-btn { + font-size: 20px !important; + border-radius:8px !important; + font-weight: bold !important; + margin: 4px; +} +.equal-btn { + width: 110px !important; + background-color:#7f7f7f !important; + color: black !important; + border-color: #606060 !important; + border-radius: 8px !important; + font-weight: bold !important; + font-size: 20px !important; + margin: 4px; +} +.backspace-btn { + font-size: 20px !important; + border-radius: 8px !important; + margin: 4px; +} +.input-btn{ + border-radius: 25px !important; + margin: 4px; + height: 50px; + width: 50px; + vertical-align :top; + color: #444; + font-size: 1.2rem; +} diff --git a/calculator_in_pos/views/pos_config_views.xml b/calculator_in_pos/views/pos_config_views.xml new file mode 100644 index 000000000..bfdcfca1e --- /dev/null +++ b/calculator_in_pos/views/pos_config_views.xml @@ -0,0 +1,26 @@ + + + + + pos.config.view.form.inherit.calculator.in.pos + pos.config + + + +
+
+
+ +
+
+
+
+
+
+
+
+