diff --git a/pos_automatic_cashdrawer_cashlogy/README.rst b/pos_automatic_cashdrawer_cashlogy/README.rst new file mode 100644 index 0000000000..5c556634b8 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/README.rst @@ -0,0 +1,125 @@ +================================= +POS Automatic Cashdrawer Cashlogy +================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e73ed38d380e8af85d3a877abc3182d0fe2bf1ca0972506b861e1255689596da + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/18.0/pos_automatic_cashdrawer_cashlogy + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_automatic_cashdrawer_cashlogy + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +- This module adds support for automatic cashdrawers in the Point of + Sale with other IP Address different with IoT Box. +- In user form, you can add ``Point of Sale - Allow Cashlogy Config`` + group to user to display ``Cashlogy Admin`` popup in PoS. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module is designed to be installed on the *main Odoo server*. On +the *POSbox*, you should install the module *hw_x* depending on the +protocol implemented in your device. Cashlogy +<`http://www.cashlogy.com\\> >`__ are +implemented in the *hw_cashlogy* module and also in pywebdriver +<`https://github.com/akretion/pywebdriver\\> >`__. + +Configuration +============= + +- Go to Point of Sale > Configuration > Settings, in + ``Connected Devices`` section, enable Automation Cashdrawer and fill + IP Address, TCP Port. + +|Config automatic cashdrawer| + +- Go to Point of Sale > Configuration > Payment Methods, with ``Cash`` + type, enable ``Automation Cashdrawer``. + +|Config pos payment methods| + +.. |Config automatic cashdrawer| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_automatic_cashdrawer.png +.. |Config pos payment methods| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_payment_method.png + +Usage +===== + +In the frontend of the POS, when you select a payment method CASH you +can see a popup show ``Customer Transaction`` to start adding cash into +the machine. When fully paid or have change, the amount of cash will be +updated. + +|Payment| + +.. |Payment| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_automatic_cashdrawer_cashlogy/static/description/automatic_cashdrawer_payment_method.png + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Aurélien DUMAINE +* Druidoo + +Contributors +------------ + +- Aurelien Dumaine +- Mathieu Vatel +- Iván Todorovich +- Druidoo <`https://www.druidoo.io\\> >`__ +- `Trobz `__ + + - Phan Hong Phuc + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_automatic_cashdrawer_cashlogy/__init__.py b/pos_automatic_cashdrawer_cashlogy/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_automatic_cashdrawer_cashlogy/__manifest__.py b/pos_automatic_cashdrawer_cashlogy/__manifest__.py new file mode 100644 index 0000000000..b681474441 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/__manifest__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2014 Aurélien DUMAINE +# Copyright (C) 2015 Akretion (www.akretion.com) +# Copyright (C) 2019-Today: Druidoo () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "POS Automatic Cashdrawer Cashlogy", + "version": "18.0.1.0.0", + "category": "Point Of Sale", + "summary": "Manage Automatic Cashdrawer device from POS front end", + "author": "Aurélien DUMAINE, Druidoo, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "website": "https://github.com/OCA/pos", + "data": [ + "security/res_groups.xml", + "views/pos_payment_method.xml", + "views/res_config_settings_views.xml", + ], + "assets": { + "point_of_sale._assets_pos": [ + "pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/**/*", + "pos_automatic_cashdrawer_cashlogy/static/src/report/*", + "pos_automatic_cashdrawer_cashlogy/static/src/dialogs/*", + "pos_automatic_cashdrawer_cashlogy/static/src/css/*", + ] + }, +} diff --git a/pos_automatic_cashdrawer_cashlogy/i18n/fr.po b/pos_automatic_cashdrawer_cashlogy/i18n/fr.po new file mode 100644 index 0000000000..9af4b28383 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/i18n/fr.po @@ -0,0 +1,392 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_automatic_cashdrawer_cashlogy +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-12-23 03:22+0000\n" +"PO-Revision-Date: 2025-12-23 03:22+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer +msgid "An automatic cashdrawer is available on the Proxy" +msgstr "Un tiroir-caisse automatique est disponible sur le proxy." + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "Automatic Cashdrawer" +msgstr "Monnayeur automatique" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_ip_address +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_ip_address +msgid "Automatic Cashdrawer IP address" +msgstr "Monnayeur automatique IP address" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_tcp_port +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_tcp_port +msgid "Automatic Cashdrawer TCP port" +msgstr "Monnayeur automatique TCP port" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Close Till / ADDED" +msgstr "Monnayeur automatique: Close Till / ADDED" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Close Till / DISPENSED" +msgstr "Monnayeur automatique: Close Till / DISPENSED" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Complete Emptying" +msgstr "Tiroir-caisse Automatique : Vidage Complet" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Empty Stacker" +msgstr "Monnayeur automatique: Empty Stacker" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_account_journal__iface_automatic_cashdrawer +msgid "Automatic cashdrawer" +msgstr "Monnayeur automatique" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Cashdrawer Admin" +msgstr "Administration Du Tiroir-caisse" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashdrawer Error: " +msgstr "Erreur Monnayeur automatique" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Cashdrawer Inventory" +msgstr "Inventaire Du Tiroir-Caisse" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashdrawer not connected" +msgstr "Tiroir-caisse non connecté" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/navbar/proxy_status.esm.js:0 +msgid "Cashlogy" +msgstr "Cashlogy" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/navbar/navbar.xml:0 +msgid "Cashlogy Admin" +msgstr "Administration Cashlogy" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashlogy: The dispensed amount was different than the requested" +msgstr "Cashlogy : Le montant distribué était différent de celui demandé." + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_account_journal__iface_automatic_cashdrawer +msgid "Check this if this journal is linked to an automatic cashdrawer" +msgstr "Vérifiez sur ce journal est lié à un monnayeur automatique" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Close" +msgstr "Fermer" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Close Till / Cash Float" +msgstr "Clôturer la caisse / Fonds de caisse" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Close Till Result" +msgstr "Résultat de la clôture de la caisse" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Close Till: Put In" +msgstr "Clôture de la caisse : Entrée de fonds" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Closing Balance Set" +msgstr "Solde de clôture défini" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Complete Emptying" +msgstr "Vidage Complet" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Empty Stacker" +msgstr "Vider le stacker" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/store/pos_store.esm.js:0 +msgid "Error" +msgstr "Erreur" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/store/pos_store.esm.js:0 +msgid "Error: " +msgstr "Erreur: " + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "" +"IMPORTANT: This operations is not registered on the cash statement. You have" +" to manually register it." +msgstr "" +"IMPORTANT: Cette opération n'est pas enregistrées sur le journal d'espèces, " +"vous devez les enregistrer manuellement." + +#. module: pos_automatic_cashdrawer_cashlogy +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "IP address" +msgstr "Adresse IP" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Inventory" +msgstr "Ligne d'inventaire" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_account_journal +msgid "Journal" +msgstr "Journal" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Make sure Cashdrawer connected with IOT Box" +msgstr "Assurez-vous que le tiroir-caisse est connecté à l’IoT Box" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Manual Cancel" +msgstr "Annulation Manuelle" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Money in/out: " +msgstr "Ajout / retrait d'espèces. " + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Open Backoffice" +msgstr "Ouvrir le back-office" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Opening Balance Set" +msgstr "Ouverture du réglage de balance." + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "" +"Please check that the field 'Inter-Banks Transfer Account' is set on the " +"company." +msgstr "" +"Veuillez vérifier que le champ 'Compte de transfert interbancaire' est bien défini sur la société." + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:res.groups,name:pos_automatic_cashdrawer_cashlogy.group_pos_automatic_cashlogy_config +msgid "PoS - Allow Cashlogy config" +msgstr "Point de vente - Autoriser configuration Cashlogy" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__group_pos_automatic_cashlogy_config +msgid "Point of Sale - Allow Cashlogy Config" +msgstr "Point de Vente - Autoriser Cashlogy Config" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuration du point de vente" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_pos_session +msgid "Point of Sale Session" +msgstr "Session du point de vente" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Print" +msgstr "Imprimer" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Print Inventory" +msgstr "Imprimer l’inventaire" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "REF:" +msgstr "REF:" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Recycler" +msgstr "Recycleur" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Send Cancel Command" +msgstr "Envoyer la commande d’annulation" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Stacker" +msgstr "Stacker" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Statement:" +msgstr "Relevé:" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Success" +msgstr "Succès" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "TCP port" +msgstr "Port TCP" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "TOTAL" +msgstr "TOTAL" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "TOTALS" +msgstr "TOTAUX" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "The cash register has already been opened for this session." +msgstr "La caisse a déjà été ouverte pour cette session." + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_tcp_port +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_tcp_port +msgid "" +"The port to connect to the Cashdrawer.\n" +"WARNING: set a port bigger than 1024 to allow a non-root user to listen on it." +msgstr "" +"Port à connecter au Monnayeur automatique.\n" +"WARNING: configurez un port plus grand que 1024 pour autoriser l'écoute par un utilisateur non root." + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "There's no cash payment method for this PoS Session" +msgstr "Il n’y a pas de mode de paiement en espèces pour cette session PoS" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__group_pos_automatic_cashlogy_config +msgid "" +"This field is there to pass the id of the \"PoS - Allow Cashlogy config\" " +"group to the POS." +msgstr "" +"Ce champ sert à transmettre l'identifiant du groupe \'PoS - Allow Cashlogy config\' au POS." + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Total" +msgstr "Total" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Total added: " +msgstr "Total ajouté: " + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Total dispensed: " +msgstr "Total Distribué: " + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "User:" +msgstr "Utilisateur:" diff --git a/pos_automatic_cashdrawer_cashlogy/i18n/pos_automatic_cashdrawer_cashlogy.pot b/pos_automatic_cashdrawer_cashlogy/i18n/pos_automatic_cashdrawer_cashlogy.pot new file mode 100644 index 0000000000..07e9d62326 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/i18n/pos_automatic_cashdrawer_cashlogy.pot @@ -0,0 +1,386 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_automatic_cashdrawer_cashlogy +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-12-23 03:21+0000\n" +"PO-Revision-Date: 2025-12-23 03:21+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer +msgid "An automatic cashdrawer is available on the Proxy" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "Automatic Cashdrawer" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_ip_address +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_ip_address +msgid "Automatic Cashdrawer IP address" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_tcp_port +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_tcp_port +msgid "Automatic Cashdrawer TCP port" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Close Till / ADDED" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Close Till / DISPENSED" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Complete Emptying" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Automatic Cashdrawer: Empty Stacker" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_account_journal__iface_automatic_cashdrawer +msgid "Automatic cashdrawer" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Cancel" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Cashdrawer Admin" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashdrawer Error: " +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Cashdrawer Inventory" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashdrawer not connected" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/navbar/proxy_status.esm.js:0 +msgid "Cashlogy" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/navbar/navbar.xml:0 +msgid "Cashlogy Admin" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Cashlogy: The dispensed amount was different than the requested" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_account_journal__iface_automatic_cashdrawer +msgid "Check this if this journal is linked to an automatic cashdrawer" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Close" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Close Till / Cash Float" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Close Till Result" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Close Till: Put In" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Closing Balance Set" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Complete Emptying" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Empty Stacker" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/store/pos_store.esm.js:0 +msgid "Error" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/store/pos_store.esm.js:0 +msgid "Error: " +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "" +"IMPORTANT: This operations is not registered on the cash statement. You have" +" to manually register it." +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "IP address" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Inventory" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Make sure Cashdrawer connected with IOT Box" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Manual Cancel" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Money in/out: " +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Open Backoffice" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Opening Balance Set" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "" +"Please check that the field 'Inter-Banks Transfer Account' is set on the " +"company." +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:res.groups,name:pos_automatic_cashdrawer_cashlogy.group_pos_automatic_cashlogy_config +msgid "PoS - Allow Cashlogy config" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,field_description:pos_automatic_cashdrawer_cashlogy.field_pos_config__group_pos_automatic_cashlogy_config +msgid "Point of Sale - Allow Cashlogy Config" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model,name:pos_automatic_cashdrawer_cashlogy.model_pos_session +msgid "Point of Sale Session" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Print" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Print Inventory" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "REF:" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Recycler" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml:0 +msgid "Send Cancel Command" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Stacker" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "Statement:" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Success" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model_terms:ir.ui.view,arch_db:pos_automatic_cashdrawer_cashlogy.res_config_settings_view_form +msgid "TCP port" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "TOTAL" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "TOTALS" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "The cash register has already been opened for this session." +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__iface_automatic_cashdrawer_tcp_port +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_res_config_settings__pos_iface_automatic_cashdrawer_tcp_port +msgid "" +"The port to connect to the Cashdrawer.\n" +"WARNING: set a port bigger than 1024 to allow a non-root user to listen on it." +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-python +#: code:addons/pos_automatic_cashdrawer_cashlogy/models/pos_session.py:0 +msgid "There's no cash payment method for this PoS Session" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#: model:ir.model.fields,help:pos_automatic_cashdrawer_cashlogy.field_pos_config__group_pos_automatic_cashlogy_config +msgid "" +"This field is there to pass the id of the \"PoS - Allow Cashlogy config\" " +"group to the POS." +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml:0 +msgid "Total" +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Total added: " +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js:0 +msgid "Total dispensed: " +msgstr "" + +#. module: pos_automatic_cashdrawer_cashlogy +#. odoo-javascript +#: code:addons/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml:0 +msgid "User:" +msgstr "" diff --git a/pos_automatic_cashdrawer_cashlogy/models/__init__.py b/pos_automatic_cashdrawer_cashlogy/models/__init__.py new file mode 100644 index 0000000000..a7b59f000f --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/models/__init__.py @@ -0,0 +1,4 @@ +from . import pos_config +from . import pos_session +from . import pos_payment_method +from . import res_config_settings diff --git a/pos_automatic_cashdrawer_cashlogy/models/pos_config.py b/pos_automatic_cashdrawer_cashlogy/models/pos_config.py new file mode 100644 index 0000000000..e25eb43162 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/models/pos_config.py @@ -0,0 +1,45 @@ +# Copyright (C) 2015 Mathieu VATEL +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2019 Druidoo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + iface_automatic_cashdrawer = fields.Boolean( + "Automatic Cashdrawer", + help="An automatic cashdrawer is available", + ) + + iface_automatic_cashdrawer_ip_address = fields.Char( + "Automatic Cashdrawer IP address", + ) + + iface_automatic_cashdrawer_tcp_port = fields.Char( + "Automatic Cashdrawer TCP port", + help=( + "The port to connect to the Cashdrawer.\n" + "WARNING: set a port bigger than 1024 to allow a non-root user to " + "listen on it." + ), + ) + + group_pos_automatic_cashlogy_config = fields.Many2one( + comodel_name="res.groups", + string="Point of Sale - Allow Cashlogy Config", + compute="_compute_group_pos_automatic_cashlogy_config", + help=( + "This field is there to pass the id of the " + '"PoS - Allow Cashlogy config" group to the POS.' + ), + ) + + def _compute_group_pos_automatic_cashlogy_config(self): + group = self.env.ref( + "pos_automatic_cashdrawer_cashlogy.group_pos_automatic_cashlogy_config" + ) + for record in self: + record.group_pos_automatic_cashlogy_config = group diff --git a/pos_automatic_cashdrawer_cashlogy/models/pos_payment_method.py b/pos_automatic_cashdrawer_cashlogy/models/pos_payment_method.py new file mode 100644 index 0000000000..c75f674cc9 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/models/pos_payment_method.py @@ -0,0 +1,19 @@ +# Copyright (C) 2015 Mathieu VATEL +# Copyright (C) 2016-Today: La Louve +# Copyright (C) 2019 Druidoo + +from odoo import api, fields, models + + +class PosPaymentMethod(models.Model): + _inherit = "pos.payment.method" + + iface_automatic_cashdrawer = fields.Boolean( + "Automatic cashdrawer", + ) + + @api.model + def _load_pos_data_fields(self, config_id): + result = super()._load_pos_data_fields(config_id) + result.append("iface_automatic_cashdrawer") + return result diff --git a/pos_automatic_cashdrawer_cashlogy/models/pos_session.py b/pos_automatic_cashdrawer_cashlogy/models/pos_session.py new file mode 100644 index 0000000000..d873956993 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/models/pos_session.py @@ -0,0 +1,92 @@ +# Copyright (C) 2019 Druidoo + +from odoo import api, models + + +class PosSession(models.Model): + _inherit = "pos.session" + + def js_check_cash_in_out_possible(self): + self.ensure_one() + if not self.cash_journal_id: + return { + "error": True, + "message": self.env._( + "There's no cash payment method for this PoS Session" + ), + } + if not self.cash_journal_id.company_id.transfer_account_id: + return { + "error": True, + "message": self.env._( + "Please check that the field 'Inter-Banks Transfer Account' is set " + "on the company." + ), + } + statement_complete = self.statement_line_ids.filtered("statement_complete") + if statement_complete: + return { + "error": True, + "message": self.env._( + "The cash register has already been opened for this session." + ), + } + return { + "error": False, + "message": "", + } + + @api.model + def _get_cash_in_out_fields(self): + return [ + "id", + "display_name", + "ref", + "create_date", + "date", + "statement_id", + ] + + def action_put_money_in(self, amount, reason, extras): + self.ensure_one() + self.try_cash_in_out( + "in", + amount, + reason, + extras, + ) + return ( + self.env["account.bank.statement.line"] + .sudo() + .search( + [ + ("pos_session_id", "=", self.id), + ("journal_id", "=", self.cash_journal_id.id), + ], + limit=1, + order="id desc", + ) + .read(self._get_cash_in_out_fields())[0] + ) + + def action_take_money_out(self, amount, reason, extras): + self.ensure_one() + self.try_cash_in_out( + "out", + amount, + reason, + extras, + ) + return ( + self.env["account.bank.statement.line"] + .sudo() + .search( + [ + ("pos_session_id", "=", self.id), + ("journal_id", "=", self.cash_journal_id.id), + ], + limit=1, + order="id desc", + ) + .read(self._get_cash_in_out_fields())[0] + ) diff --git a/pos_automatic_cashdrawer_cashlogy/models/res_config_settings.py b/pos_automatic_cashdrawer_cashlogy/models/res_config_settings.py new file mode 100644 index 0000000000..80b20fb3ee --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/models/res_config_settings.py @@ -0,0 +1,23 @@ +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + pos_iface_automatic_cashdrawer = fields.Boolean( + related="pos_config_id.iface_automatic_cashdrawer", + string="Automatic Cashdrawer", + readonly=False, + ) + + pos_iface_automatic_cashdrawer_ip_address = fields.Char( + related="pos_config_id.iface_automatic_cashdrawer_ip_address", + string="Automatic Cashdrawer IP address", + readonly=False, + ) + + pos_iface_automatic_cashdrawer_tcp_port = fields.Char( + related="pos_config_id.iface_automatic_cashdrawer_tcp_port", + string="Automatic Cashdrawer TCP port", + readonly=False, + ) diff --git a/pos_automatic_cashdrawer_cashlogy/pyproject.toml b/pos_automatic_cashdrawer_cashlogy/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_automatic_cashdrawer_cashlogy/readme/CONFIGURE.md b/pos_automatic_cashdrawer_cashlogy/readme/CONFIGURE.md new file mode 100644 index 0000000000..1dae1af3f8 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/readme/CONFIGURE.md @@ -0,0 +1,8 @@ +- Go to Point of Sale > Configuration > Settings, in `Connected Devices` section, +enable Automation Cashdrawer and fill IP Address, TCP Port. + +![Config automatic cashdrawer](../static/description/config_pos_automatic_cashdrawer.png) + +- Go to Point of Sale > Configuration > Payment Methods, with `Cash` type, enable `Automation Cashdrawer`. + +![Config pos payment methods](../static/description/config_pos_payment_method.png) diff --git a/pos_automatic_cashdrawer_cashlogy/readme/CONTRIBUTORS.md b/pos_automatic_cashdrawer_cashlogy/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..52ef9b9c58 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Aurelien Dumaine +- Mathieu Vatel +- Iván Todorovich +- Druidoo \ +- [Trobz](https://www.trobz.com/) + - Phan Hong Phuc \ diff --git a/pos_automatic_cashdrawer_cashlogy/readme/DESCRIPTION.md b/pos_automatic_cashdrawer_cashlogy/readme/DESCRIPTION.md new file mode 100644 index 0000000000..457c488a60 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +- This module adds support for automatic cashdrawers in the Point of Sale with other IP Address different with IoT Box. +- In user form, you can add `Point of Sale - Allow Cashlogy Config` group to user to display `Cashlogy Admin` popup in PoS. diff --git a/pos_automatic_cashdrawer_cashlogy/readme/INSTALL.md b/pos_automatic_cashdrawer_cashlogy/readme/INSTALL.md new file mode 100644 index 0000000000..d9d2d515ab --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/readme/INSTALL.md @@ -0,0 +1,5 @@ +This module is designed to be installed on the *main Odoo server*. On +the *POSbox*, you should install the module *hw_x* depending on the +protocol implemented in your device. Cashlogy +\ are implemented in the *hw_cashlogy* module +and also in pywebdriver \. diff --git a/pos_automatic_cashdrawer_cashlogy/readme/USAGE.md b/pos_automatic_cashdrawer_cashlogy/readme/USAGE.md new file mode 100644 index 0000000000..c573c1860f --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/readme/USAGE.md @@ -0,0 +1,3 @@ +In the frontend of the POS, when you select a payment method CASH you can see a popup show `Customer Transaction` to start adding cash into the machine. When fully paid or have change, the amount of cash will be updated. + +![Payment](../static/description/automatic_cashdrawer_payment_method.png) diff --git a/pos_automatic_cashdrawer_cashlogy/security/res_groups.xml b/pos_automatic_cashdrawer_cashlogy/security/res_groups.xml new file mode 100644 index 0000000000..23c69371cf --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/security/res_groups.xml @@ -0,0 +1,7 @@ + + + + PoS - Allow Cashlogy config + + + diff --git a/pos_automatic_cashdrawer_cashlogy/static/description/automatic_cashdrawer_payment.png b/pos_automatic_cashdrawer_cashlogy/static/description/automatic_cashdrawer_payment.png new file mode 100644 index 0000000000..98562323cb Binary files /dev/null and b/pos_automatic_cashdrawer_cashlogy/static/description/automatic_cashdrawer_payment.png differ diff --git a/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_automatic_cashdrawer.png b/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_automatic_cashdrawer.png new file mode 100644 index 0000000000..b5b8e582e6 Binary files /dev/null and b/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_automatic_cashdrawer.png differ diff --git a/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_payment_method.png b/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_payment_method.png new file mode 100644 index 0000000000..f5f2a7873e Binary files /dev/null and b/pos_automatic_cashdrawer_cashlogy/static/description/config_pos_payment_method.png differ diff --git a/pos_automatic_cashdrawer_cashlogy/static/description/icon.png b/pos_automatic_cashdrawer_cashlogy/static/description/icon.png new file mode 100644 index 0000000000..fd60220fbe Binary files /dev/null and b/pos_automatic_cashdrawer_cashlogy/static/description/icon.png differ diff --git a/pos_automatic_cashdrawer_cashlogy/static/description/index.html b/pos_automatic_cashdrawer_cashlogy/static/description/index.html new file mode 100644 index 0000000000..c9b3ae6875 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/description/index.html @@ -0,0 +1,470 @@ + + + + + +POS Automatic Cashdrawer Cashlogy + + + +
+

POS Automatic Cashdrawer Cashlogy

+ + +

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+
    +
  • This module adds support for automatic cashdrawers in the Point of +Sale with other IP Address different with IoT Box.
  • +
  • In user form, you can add Point of Sale - Allow Cashlogy Config +group to user to display Cashlogy Admin popup in PoS.
  • +
+

Table of contents

+ +
+

Installation

+

This module is designed to be installed on the main Odoo server. On +the POSbox, you should install the module hw_x depending on the +protocol implemented in your device. Cashlogy +<http://www.cashlogy.com\> are +implemented in the hw_cashlogy module and also in pywebdriver +<https://github.com/akretion/pywebdriver\>.

+
+
+

Configuration

+
    +
  • Go to Point of Sale > Configuration > Settings, in +Connected Devices section, enable Automation Cashdrawer and fill +IP Address, TCP Port.
  • +
+

Config automatic cashdrawer

+
    +
  • Go to Point of Sale > Configuration > Payment Methods, with Cash +type, enable Automation Cashdrawer.
  • +
+

Config pos payment methods

+
+
+

Usage

+

In the frontend of the POS, when you select a payment method CASH you +can see a popup show Customer Transaction to start adding cash into +the machine. When fully paid or have change, the amount of cash will be +updated.

+

Payment

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Aurélien DUMAINE
  • +
  • Druidoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/css/pos_automatic_cashdrawer_cashlogy.css b/pos_automatic_cashdrawer_cashlogy/static/src/css/pos_automatic_cashdrawer_cashlogy.css new file mode 100644 index 0000000000..bd5f451f8e --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/css/pos_automatic_cashdrawer_cashlogy.css @@ -0,0 +1,73 @@ +.automatic-cashdrawer-transaction-start button { + width: 150px; + height: 60px; + font-size: 18px; + cursor: pointer; + text-align: center; + box-sizing: border-box; + -moz-box-sizing: border-box; + left: 105%; + bottom: 10px; + position: absolute; +} + +.popup-cashdrawer-admin.actions .button { + float: none; + width: auto; + margin: 15px 0px; + height: 40px; + line-height: 40px; + font-size: 16px; + font-weight: normal; + display: flex; + align-items: center; +} + +.popup-cashdrawer-admin hr { + margin: 10px 15px; +} + +.popup-cashdrawer-admin.actions .button .fa { + left: 15px; + top: 8px; + margin-right: 8px; + font-size: 25px; + width: 35px; +} + +.popup-cashdrawer .total .value { + text-align: center; + padding: 24px 0px 18px; + font-size: 64px; + color: #43996e; + text-shadow: + 0px 2px white, + 0px 2px 2px rgba(0, 0, 0, 0.27); +} + +.popup-cashdrawer-inventory .inventory-table { + padding: 20px; +} + +.popup-cashdrawer-inventory .inventory-table table { + width: 100%; + font-weight: normal; + font-size: 15px; + text-align: right; +} + +.popup-cashdrawer-inventory .inventory-table table td { + line-height: 25px; + padding: 0 10px; +} + +.popup-cashdrawer-inventory .inventory-table table th { + line-height: 30px; + padding: 0 10px; + width: 25%; +} + +.popup-cashdrawer-inventory .inventory-table thead > tr, +.popup-cashdrawer-inventory .inventory-table tr:nth-child(even) { + background: rgb(247, 247, 247); +} diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js new file mode 100644 index 0000000000..acbadc93c7 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.esm.js @@ -0,0 +1,257 @@ +import {AutomaticCashdrawerInventoryDialog} from "@pos_automatic_cashdrawer_cashlogy/dialogs/cashdrawer_inventory.esm"; +import {Component} from "@odoo/owl"; +import {Dialog} from "@web/core/dialog/dialog"; +import {_t} from "@web/core/l10n/translation"; +import {renderToElement} from "@web/core/utils/render"; +import {usePos} from "@point_of_sale/app/store/pos_hook"; +import {useService} from "@web/core/utils/hooks"; + +export class AutomaticCashdrawerAdmin extends Component { + static template = "AutomaticCashdrawerAdmin"; + static components = {Dialog}; + static props = { + close: Function, + }; + setup() { + super.setup(...arguments); + this.dialog = useService("dialog"); + this.notification = useService("notification"); + this.pos = usePos(); + this.printer = useService("printer"); + this.ui = useService("ui"); + } + + /** + * HELPERS + **/ + + extras(amount, type) { + const formattedAmount = this.pos.formatCurrencyCashlogy(amount); + const translatedType = _t(type); + return { + formattedAmount, + translatedType, + }; + } + + /** + * ACTIONS + **/ + + cancel() { + this.props.close(); + } + + async action_print_inventory() { + this.dialog.closeAll(); + try { + this.ui.block(); + const totals = await this.pos.callAutomaticCashdrawerGetTotalAmount(); + const inventory = await this.pos.callAutomaticCashdrawerGetInventory(); + const sorted_values = Object.keys(inventory.total) + .map((k) => parseFloat(k)) + .sort((a, b) => b - a); + return this.dialog.add(AutomaticCashdrawerInventoryDialog, { + totals: totals, + inventory: inventory, + sorted_values: sorted_values, + }); + } catch (error) { + this.pos.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + } + + async action_display_backoffice() { + try { + await this.pos.callAutomaticCashlogyDisplayBackoffice(); + } catch (error) { + this.pos.showErrorCashlogy(error); + } finally { + this.notification.add(_t("Backoffice displayed successfully"), { + type: "success", + }); + } + } + + async action_cancel() { + this.ui.block(); + await this.pos.callAutomaticCashdrawerStopAcceptance().then(async (res) => { + const xmlReportElement = renderToElement( + "AutomaticCashdrawerActionXmlReport", + { + pos: this.pos, + report: { + name: _t("Manual Cancel"), + lines: [ + _t("Money in/out: ") + this.pos.formatCurrencyCashlogy(res), + _t( + "IMPORTANT: This operations is not registered on the cash statement. You have to manually register it." + ), + ], + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add(_t("Send Cancel Successfully"), {type: "success"}); + }); + this.ui.unblock(); + this.dialog.closeAll(); + } + + async action_close_till() { + this.ui.block(); + this.pos.checkCashInOutPossible(); + await this.pos.callAutomaticCashdrawerDisplayCloseTill().then(async (res) => { + if (res.added) { + await this.pos + .actionPutMoneyIn( + res.added, + _t("Automatic Cashdrawer: Close Till / ADDED"), + this.extras(res.added, "in") + ) + .then(async (st_line) => { + const xmlReportElement = renderToElement( + "AutomaticCashdrawerActionXmlReport", + { + pos: this.pos, + report: { + name: _t("Close Till Result"), + lines: [ + _t("Total added: ") + + this.pos.formatCurrencyCashlogy(res.added), + ], + st_line: st_line, + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add(_t("Close Till / ADDED Successfully"), { + type: "success", + }); + }); + } + if (res.dispensed) { + await this.pos + .actionTakeMoneyOut( + res.dispensed, + _t("Automatic Cashdrawer: Close Till / DISPENSED"), + this.extras(res.dispensed, "out") + ) + .then(async (st_line) => { + const xmlReportElement = renderToElement( + "AutomaticCashdrawerActionXmlReport", + { + pos: this.pos, + report: { + name: _t("Close Till Result"), + lines: [ + _t("Total dispensed: ") + + this.pos.formatCurrencyCashlogy( + res.dispensed + ), + ], + st_line: st_line, + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add( + _t("Close Till / DISPENSED Successfully"), + {type: "success"} + ); + }); + } + }); + this.ui.unblock(); + this.dialog.closeAll(); + } + + async action_empty_stacker() { + this.ui.block(); + this.pos.checkCashInOutPossible(); + await this.pos.callAutomaticCashdrawerEmptyStacker().then(async (res) => { + if (res) { + await this.pos + .actionTakeMoneyOut( + res, + _t("Automatic Cashdrawer: Empty Stacker"), + this.extras(res, "out") + ) + .then(async (st_line) => { + const xmlReportElement = renderToElement( + "AutomaticCashdrawerActionXmlReport", + { + pos: this.pos, + report: { + name: _t("Empty Stacker"), + lines: [ + _t("Total dispensed: ") + + this.pos.formatCurrencyCashlogy(res), + ], + st_line: st_line, + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add(_t("Empty Stacker Successfully"), { + type: "success", + }); + }); + } + }); + this.ui.unblock(); + this.dialog.closeAll(); + } + + async action_complete_emptying() { + this.ui.block(); + this.pos.checkCashInOutPossible(); + await this.pos + .callAutomaticCashdrawerDisplayCompleteEmptying() + .then(async (res) => { + if (res) { + await this.pos + .actionTakeMoneyOut( + res, + _t("Automatic Cashdrawer: Complete Emptying"), + this.extras(res, "out") + ) + .then(async (st_line) => { + const xmlReportElement = renderToElement( + "AutomaticCashdrawerActionXmlReport", + { + pos: this.pos, + report: { + name: _t("Complete Emptying"), + lines: [ + _t("Total dispensed: ") + + this.pos.formatCurrencyCashlogy(res), + ], + st_line: st_line, + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add( + _t("Complete Emptying Successfully"), + {type: "success"} + ); + }); + } + }); + this.ui.unblock(); + this.dialog.closeAll(); + } +} diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml new file mode 100644 index 0000000000..bee7d56e30 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_admin.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.esm.js new file mode 100644 index 0000000000..e2321e89c9 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.esm.js @@ -0,0 +1,136 @@ +/* global clearTimeout, setTimeout */ + +import {Component, onMounted, onWillUnmount, useState} from "@odoo/owl"; +import {AlertDialog} from "@web/core/confirmation_dialog/confirmation_dialog"; +import {Dialog} from "@web/core/dialog/dialog"; +import {_t} from "@web/core/l10n/translation"; +import {roundPrecision} from "@web/core/utils/numbers"; +import {usePos} from "@point_of_sale/app/store/pos_hook"; +import {useService} from "@web/core/utils/hooks"; + +export class AutomaticCashdrawerCashInDialog extends Component { + static template = "AutomaticCashdrawerCashInDialog"; + static components = {Dialog}; + static props = { + allow_cancel: Boolean, + auto_accept: Boolean, + to_collect: Number, + payment: Boolean, + confirmCashIn: Function, + cancelCashIn: Function, + close: Function, + body: {type: String, optional: true}, + }; + + setup() { + super.setup(); + this.pos = usePos(); + this.dialog = useService("dialog"); + this.notification = useService("notification"); + this.ui = useService("ui"); + this.inputBuffer = useState({value: 0.0}); + this.loading = useState({value: false}); + this.closed = false; + const {payment} = this.props; + onMounted(() => { + this.loading.value = true; + if (payment) { + this.pos.callAutomaticCashdrawerStartAcceptance().then(() => { + this.updateCounter(); + }); + } else { + this.pos.callAutomaticCashdrawerStartAddChange().then(() => { + this.updateCounter(); + }); + } + }); + onWillUnmount(() => { + if (this.timer) { + clearTimeout(this.timer); + } + this.closed = true; + }); + } + + async updateCounter() { + await this.pos.callAutomaticCashdrawerGetAmountAccepted().then((res) => { + if (this.closed) { + return; + } + this.inputBuffer.value = res; + // Auto accept dialog if amount is enough + const {to_collect, auto_accept} = this.props; + if (to_collect && auto_accept && this.inputBuffer.value >= to_collect) { + return this.onClickConfirm(); + } + this.timer = setTimeout(async () => { + this.updateCounter(); + }, 1000); + }); + } + + async onClickCancel() { + if (this.props.allow_cancel) { + try { + this.ui.block(); + await this.pos.callAutomaticCashdrawerStopAcceptance().then((value) => { + this.pos.callAutomaticCashdrawerDispense(value); + }); + } catch { + this.dialog.add(AlertDialog, { + title: _t("Error"), + body: _t("An error occurred during the cancel."), + }); + } finally { + this.ui.unblock(); + this.props.close(); + this.props.cancelCashIn(); + this.notification.add(_t("Transaction Cancelled"), {type: "success"}); + } + } else { + this.dialog.add(AlertDialog, { + title: _t("Failed"), + body: _t("Cancel not enable"), + }); + } + } + + async onClickConfirm() { + try { + this.loading.value = false; + this.ui.block(); + await this.pos + .callAutomaticCashdrawerStopAcceptance() + .then(async (response) => { + const {to_collect} = this.props; + if (to_collect && response >= to_collect) { + const rounding = this.pos.currency.rounding; + const change = roundPrecision(response - to_collect, rounding); + if (change > 0) { + // More was collected, we dispense + await this.pos + .callAutomaticCashdrawerDispense(change) + .then(() => { + this.props.confirmCashIn(response); + }); + } else { + // Exact amount was collected + this.props.confirmCashIn(response); + } + } else { + // Not enough was collected + this.props.confirmCashIn(response); + } + }); + } catch { + this.dialog.add(AlertDialog, { + title: _t("Error"), + body: _t("An error occurred during the confirm."), + }); + } finally { + this.ui.unblock(); + this.props.close(); + this.notification.add(_t("Transaction Success"), {type: "success"}); + } + } +} diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.xml b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.xml new file mode 100644 index 0000000000..bd00101dea --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_cash_in.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.esm.js new file mode 100644 index 0000000000..a79c85dc91 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.esm.js @@ -0,0 +1,54 @@ +import {Component} from "@odoo/owl"; +import {Dialog} from "@web/core/dialog/dialog"; +import {_t} from "@web/core/l10n/translation"; +import {renderToElement} from "@web/core/utils/render"; +import {usePos} from "@point_of_sale/app/store/pos_hook"; +import {useService} from "@web/core/utils/hooks"; + +export class AutomaticCashdrawerInventoryDialog extends Component { + static template = "AutomaticCashdrawerInventoryDialog"; + static components = {Dialog}; + static props = { + close: Function, + totals: Object, + inventory: Object, + sorted_values: Array, + }; + setup() { + super.setup(...arguments); + this.dialog = useService("dialog"); + this.notification = useService("notification"); + this.printer = useService("printer"); + this.ui = useService("ui"); + this.pos = usePos(); + } + + /** + * ACTIONS + **/ + + cancel() { + this.props.close(); + } + async print_inventory() { + this.ui.block(); + const {totals, inventory, sorted_values} = this.props; + const xmlReportElement = renderToElement( + "AutomaticCashdrawerInventoryXmlReport", + { + pos: this.pos, + report: { + totals: totals, + inventory: inventory, + sorted_values: sorted_values, + }, + } + ); + await this.pos.sendCashlogy("print_xml_receipt", { + receipt: xmlReportElement.outerHTML, + }); + this.notification.add(_t("Print Inventory Successfully"), {type: "success"}); + this.ui.unblock(); + this.props.close(); + } +} diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml new file mode 100644 index 0000000000..a955e07769 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/dialogs/cashdrawer_inventory.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/hardware_proxy/hardware_proxy_device.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/hardware_proxy/hardware_proxy_device.esm.js new file mode 100644 index 0000000000..9bd09882c0 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/hardware_proxy/hardware_proxy_device.esm.js @@ -0,0 +1,16 @@ +import {HardwareProxy} from "@point_of_sale/app/hardware_proxy/hardware_proxy_service"; +import {patch} from "@web/core/utils/patch"; + +patch(HardwareProxy.prototype, { + async keepalive() { + super.keepalive(); + if (this.pos.config.iface_automatic_cashdrawer) { + await this.pos.sendCashlogy("/cashlogy/connnect", { + config: { + host: this.pos.config.iface_automatic_cashdrawer_ip_address, + port: this.pos.config.iface_automatic_cashdrawer_tcp_port, + }, + }); + } + }, +}); diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.esm.js new file mode 100644 index 0000000000..164633b2be --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.esm.js @@ -0,0 +1,22 @@ +import {AutomaticCashdrawerAdmin} from "@pos_automatic_cashdrawer_cashlogy/dialogs/cashdrawer_admin.esm"; +import {Navbar} from "@point_of_sale/app/navbar/navbar"; +import {onWillStart} from "@odoo/owl"; +import {patch} from "@web/core/utils/patch"; +import {user} from "@web/core/user"; + +patch(Navbar.prototype, { + setup() { + super.setup(...arguments); + onWillStart(async () => { + this.allowCashlogy = await user.hasGroup( + "pos_automatic_cashdrawer_cashlogy.group_pos_automatic_cashlogy_config" + ); + }); + }, + get showCashlogyAdmin() { + return this.pos.config.iface_automatic_cashdrawer && this.allowCashlogy; + }, + openCashlogyAdmin() { + this.dialog.add(AutomaticCashdrawerAdmin, {}); + }, +}); diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.xml b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.xml new file mode 100644 index 0000000000..8e1d06abc8 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/navbar/navbar.xml @@ -0,0 +1,19 @@ + + + + + + + Cashlogy Admin + + + + + diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/payment_screen.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/payment_screen.esm.js new file mode 100644 index 0000000000..773cf8cc74 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/payment_screen.esm.js @@ -0,0 +1,30 @@ +import {AutomaticCashdrawerCashInDialog} from "@pos_automatic_cashdrawer_cashlogy/dialogs/cashdrawer_cash_in.esm"; +import {PaymentScreen} from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import {patch} from "@web/core/utils/patch"; + +patch(PaymentScreen.prototype, { + async addNewPaymentLine(paymentMethod) { + const result = super.addNewPaymentLine(paymentMethod); + const line = this.selectedPaymentLine; + if (line && line.get_iface_automatic_cashdrawer()) { + this.openCashdrawerCashInDialog(line); + } + return result; + }, + + openCashdrawerCashInDialog(line) { + const amount = line.get_amount(); + this.dialog.add(AutomaticCashdrawerCashInDialog, { + to_collect: amount, + allow_cancel: true, + auto_accept: true, + payment: true, + confirmCashIn: (amountIn) => { + line.set_amount(amountIn); + }, + cancelCashIn: () => { + this.deletePaymentLine(line.uuid); + }, + }); + }, +}); diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/pos_payment.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/pos_payment.esm.js new file mode 100644 index 0000000000..06e2800dbb --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/payment_screen/pos_payment.esm.js @@ -0,0 +1,8 @@ +import {PosPayment} from "@point_of_sale/app/models/pos_payment"; +import {patch} from "@web/core/utils/patch"; + +patch(PosPayment.prototype, { + get_iface_automatic_cashdrawer() { + return this.payment_method_id.iface_automatic_cashdrawer || false; + }, +}); diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/store/pos_store.esm.js b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/store/pos_store.esm.js new file mode 100644 index 0000000000..8aaad7e411 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/overrides/components/store/pos_store.esm.js @@ -0,0 +1,290 @@ +/* global console, fetch*/ + +import {AlertDialog} from "@web/core/confirmation_dialog/confirmation_dialog"; +import {PosStore} from "@point_of_sale/app/store/pos_store"; +import {_t} from "@web/core/l10n/translation"; +import {deduceUrl} from "@point_of_sale/utils"; +import {patch} from "@web/core/utils/patch"; + +patch(PosStore.prototype, { + async setup() { + await super.setup(...arguments); + }, + async checkCashInOutPossible() { + const result = await this.data.call( + "pos.session", + "js_check_cash_in_out_possible", + [this.session.id] + ); + if (result.error) { + this.dialog.add(AlertDialog, { + title: _t("Error"), + body: result.message, + }); + } + }, + async actionPutMoneyIn(amount, reason, extras) { + const res = await this.data.call("pos.session", "action_put_money_in", [ + [this.session.id], + amount, + reason, + extras, + ]); + return res; + }, + async actionTakeMoneyOut(amount, reason, extras) { + const res = await this.data.call("pos.session", "action_take_money_out", [ + [this.session.id], + amount, + reason, + extras, + ]); + return res; + }, + + /** + * CALL CASHLOGY METHODS + **/ + + async callAutomaticCashdrawerDisplayTransactionStart(amount, options = {}) { + try { + this.ui.block(); + const res = await this.sendCashlogy("cashlogy/display_transaction_start", { + amount: amount, + options: options, + }); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + }, + + async callAutomaticCashlogyDisplayBackoffice() { + try { + this.ui.block(); + const res = await this.sendCashlogy("cashlogy/display_backoffice", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + }, + + /* + Dispenses money + amount float + options.only_coins default False + + @returns 0.00 + */ + async callAutomaticCashdrawerDispense(amount, options = {}) { + try { + const res = await this.sendCashlogy("cashlogy/dispense", { + amount: amount, + options: options, + }); + if (res !== amount) { + const message = _t( + "Cashlogy: The dispensed amount was different than the requested" + ); + console.error(message); + this.notification.add(message, {type: "warning"}); + } else { + const res_formatted = this.formatCurrencyCashlogy(res); + this.notification.add( + _t(`Successfully made a dispend amount of ${res_formatted}`), + {type: "success"} + ); + } + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Start add change + Used to load money into the cashdrawer + It has to be stopped using stop_acceptance + The amount loaded so far can be queried with get_amount_accepted + */ + async callAutomaticCashdrawerStartAddChange() { + try { + const res = await this.sendCashlogy("cashlogy/start_add_change", {}); + const res_formatted = this.formatCurrencyCashlogy(res); + this.notification.add( + _t(`Successfully load money into the cashdrawer of ${res_formatted}`), + {type: "success"} + ); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Start acceptance + Similar to Start add change, but used for sales + It has to be stopped using stop_acceptance + The amount loaded so far can be queried with get_amount_accepted + */ + async callAutomaticCashdrawerStartAcceptance() { + try { + const res = await this.sendCashlogy("cashlogy/start_acceptance", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + /* + Returns the money accepted so far + @returns 0.00 + */ + async callAutomaticCashdrawerGetAmountAccepted() { + try { + const res = await this.sendCashlogy("cashlogy/get_amount_accepted", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Stops acceptance of money + @returns 0.00 + */ + async callAutomaticCashdrawerStopAcceptance() { + try { + const res = await this.sendCashlogy("cashlogy/stop_acceptance", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Gets the inventory of the machine + Returns {total: {} recycler: {} stacker: {}} + */ + async callAutomaticCashdrawerGetInventory() { + try { + const res = await this.sendCashlogy("cashlogy/get_inventory", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Gets the total amount on the machine + Returns {total: 0.00, recycler: 0.00, stacker: 0.00} + */ + async callAutomaticCashdrawerGetTotalAmount() { + try { + const res = await this.sendCashlogy("cashlogy/get_total_amount", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } + }, + + /* + Display Close Till + @returns {total_before: 0.00, added: 0.00, dispensed: 0.00, total: 0.00} + */ + async callAutomaticCashdrawerDisplayCloseTill() { + try { + this.ui.block(); + const res = await this.sendCashlogy("cashlogy/display_close_till", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + }, + + /* + Displays the backoffice empty stacker wizard. + @returns 0.00 - the amount removed from stacker + */ + async callAutomaticCashdrawerEmptyStacker() { + try { + this.ui.block(); + const res = await this.sendCashlogy("cashlogy/display_empty_stacker", {}); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + }, + + /* + Displays the backoffice complete emptying wizard. + @returns 0.00 - the dispensed amount + */ + async callAutomaticCashdrawerDisplayCompleteEmptying() { + try { + this.ui.block(); + const res = await this.sendCashlogy( + "cashlogy/display_complete_emptying", + {} + ); + return res; + } catch (error) { + this.showErrorCashlogy(error); + } finally { + this.ui.unblock(); + } + }, + + /** + * HELPERS + **/ + + _getCashlogyIP() { + const IPAdress = this.config.iface_automatic_cashdrawer_ip_address; + const TCPPort = this.config.iface_automatic_cashdrawer_tcp_port; + if (!TCPPort) return IPAdress; + return `${IPAdress}:${TCPPort}`; + }, + + async sendCashlogy(name, params) { + const proxyIP = this._getCashlogyIP(); + if (!proxyIP) { + this.showErrorCashlogy({message: _t("IP address not configured.")}); + return; + } + const response = await fetch(`${deduceUrl(proxyIP)}/hw_proxy/${name}`, { + method: "POST", + headers: { + Accept: "application/json", + "Content-Type": "application/json", + }, + body: JSON.stringify({ + params, + }), + }); + const data = await response.json(); + return data.result; + }, + + showErrorCashlogy(error) { + this.dialog.closeAll(); + const message = error + ? error?.message + : _t("Make sure Cashdrawer connected with IOT Box"); + this.dialog.add(AlertDialog, { + title: _t("Cashdrawer Error"), + body: message, + }); + }, + + formatCurrencyCashlogy(value) { + const number = Number(value) || 0; + return this.env.utils.formatCurrency(number); + }, +}); diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_action_xml_report.xml b/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_action_xml_report.xml new file mode 100644 index 0000000000..c15e4dc422 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_action_xml_report.xml @@ -0,0 +1,54 @@ + + + + +

Automatic Cashdrawer

+

+ +

+ + + + + +
+
+ +

+ +

+
+
+
+ +
+
+
--------------------------------
+
User:
+
+
+ +
+
+
+
+ + + + + +

+ +

+
+ +
+
+
--------------------------------
+
REF: ()
+
+
+
+
diff --git a/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml b/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml new file mode 100644 index 0000000000..76fce5b187 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/static/src/report/cashdrawer_inventory_report.xml @@ -0,0 +1,115 @@ + + + + + + +

Automatic Cashdrawer

+

Inventory

+ + + + +
+
+ +

+ +

+
+
+
+ +
+
+
--------------------------------
+
User:
+
+
+
+
+ + + + + TOTALS + + + -------------------------------- + +
+ + + + + + + + + x ( + + + + + + + + ) = + + + + + +
+ + + + + -------- + + + Recycler + + + + + + + + Stacker + + + + + + + + + + + -------- + + + +
        TOTAL
+
+ + + + + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
diff --git a/pos_automatic_cashdrawer_cashlogy/views/pos_payment_method.xml b/pos_automatic_cashdrawer_cashlogy/views/pos_payment_method.xml new file mode 100644 index 0000000000..a352af3bf6 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/views/pos_payment_method.xml @@ -0,0 +1,14 @@ + + + + pos.payment.method.view.form + pos.payment.method + + 20 + + + + + + + diff --git a/pos_automatic_cashdrawer_cashlogy/views/res_config_settings_views.xml b/pos_automatic_cashdrawer_cashlogy/views/res_config_settings_views.xml new file mode 100644 index 0000000000..2b4ffb6b43 --- /dev/null +++ b/pos_automatic_cashdrawer_cashlogy/views/res_config_settings_views.xml @@ -0,0 +1,35 @@ + + + + res.config.settings + + + + + +
+
+
+
+
+
+
+
+
+
+