From c2f957f072da1e5150a8ba7f1f548ae18af6e217 Mon Sep 17 00:00:00 2001 From: Alfredo Zamora Date: Thu, 14 Apr 2022 10:50:24 +0200 Subject: [PATCH] [MIG] fiscal_epos_print: Migration to 14.0 --- fiscal_epos_print/README.rst | 13 +- fiscal_epos_print/__manifest__.py | 21 +- fiscal_epos_print/i18n/fiscal_epos_print.pot | 784 ---------------- fiscal_epos_print/i18n/it.po | 845 ------------------ fiscal_epos_print/models/__init__.py | 2 +- fiscal_epos_print/models/pos_order.py | 11 +- fiscal_epos_print/models/pos_payment.py | 39 + fiscal_epos_print/readme/CONTRIBUTORS.rst | 1 - .../static/description/index.html | 1 - .../static/lib/fiscalprint/fiscalprint.js | 17 +- .../src/js/ChromeWidgets/EpsonEPOSButton.js | 31 + .../js/ChromeWidgets/EpsonFP81IIComponent.js | 205 +++++ .../js/ChromeWidgets/SetLotteryCodeButton.js | 62 ++ .../js/ChromeWidgets/SetRefundInfoButton.js | 139 +++ .../static/src/js/Popups/RefundInfoPopup.js | 99 ++ .../js/Screens/PaymentScreen/PaymentScreen.js | 86 ++ .../js/Screens/ReceiptScreen/ReceiptScreen.js | 52 ++ fiscal_epos_print/static/src/js/chrome.js | 213 ----- .../static/src/js/epson_epos_print.js | 153 +++- fiscal_epos_print/static/src/js/models.js | 36 +- fiscal_epos_print/static/src/js/popups.js | 2 +- .../static/src/js/pos_order_mgmt.js | 1 + fiscal_epos_print/static/src/js/screens.js | 267 ------ fiscal_epos_print/static/src/xml/Chrome.xml | 16 + .../src/xml/ChromeWidgets/EpsonEPOSButton.xml | 14 + .../ChromeWidgets/EpsonFP81IIComponent.xml | 113 +++ .../ChromeWidgets/SetLotteryCodeButton.xml | 11 + .../xml/ChromeWidgets/SetRefundInfoButton.xml | 11 + .../static/src/xml/Popups/RefundInfoPopup.xml | 77 ++ fiscal_epos_print/static/src/xml/lottery.xml | 7 +- fiscal_epos_print/static/src/xml/pos.xml | 110 +-- fiscal_epos_print/views/account.xml | 13 +- fiscal_epos_print/views/assets.xml | 39 +- 33 files changed, 1216 insertions(+), 2275 deletions(-) delete mode 100644 fiscal_epos_print/i18n/fiscal_epos_print.pot delete mode 100644 fiscal_epos_print/i18n/it.po create mode 100644 fiscal_epos_print/models/pos_payment.py create mode 100644 fiscal_epos_print/static/src/js/ChromeWidgets/EpsonEPOSButton.js create mode 100644 fiscal_epos_print/static/src/js/ChromeWidgets/EpsonFP81IIComponent.js create mode 100644 fiscal_epos_print/static/src/js/ChromeWidgets/SetLotteryCodeButton.js create mode 100644 fiscal_epos_print/static/src/js/ChromeWidgets/SetRefundInfoButton.js create mode 100644 fiscal_epos_print/static/src/js/Popups/RefundInfoPopup.js create mode 100644 fiscal_epos_print/static/src/js/Screens/PaymentScreen/PaymentScreen.js create mode 100644 fiscal_epos_print/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js delete mode 100644 fiscal_epos_print/static/src/js/chrome.js delete mode 100644 fiscal_epos_print/static/src/js/screens.js create mode 100644 fiscal_epos_print/static/src/xml/Chrome.xml create mode 100644 fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonEPOSButton.xml create mode 100644 fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonFP81IIComponent.xml create mode 100644 fiscal_epos_print/static/src/xml/ChromeWidgets/SetLotteryCodeButton.xml create mode 100644 fiscal_epos_print/static/src/xml/ChromeWidgets/SetRefundInfoButton.xml create mode 100644 fiscal_epos_print/static/src/xml/Popups/RefundInfoPopup.xml diff --git a/fiscal_epos_print/README.rst b/fiscal_epos_print/README.rst index ad8be26a688c..69edc8204a3e 100644 --- a/fiscal_epos_print/README.rst +++ b/fiscal_epos_print/README.rst @@ -98,6 +98,7 @@ Authors * Leonardo Donelli * TAKOBI * Level Prime Srl +* AIR www.air.co.it Contributors ~~~~~~~~~~~~ @@ -110,7 +111,17 @@ Contributors * Alessio Gerace * Roberto Fichera -* Giovanni Serra + +* Dario Del Zozzo + +* `AIR `_: + + * Kevin Poli + + * Simone Cuffaro + + * Leonardo Guerra + Maintainers ~~~~~~~~~~~ diff --git a/fiscal_epos_print/__manifest__.py b/fiscal_epos_print/__manifest__.py index 460de656d003..a47868133cee 100644 --- a/fiscal_epos_print/__manifest__.py +++ b/fiscal_epos_print/__manifest__.py @@ -6,7 +6,7 @@ { "name": "ITA - Driver per stampanti fiscali compatibili ePOS-Print XML", - "version": "12.0.1.3.6", + "version": "14.0.1.0.0", "category": "Point Of Sale", "summary": "ePOS-Print XML Fiscal Printer Driver - Stampanti Epson compatibili: " "FP81II, FP90III", @@ -17,15 +17,28 @@ "license": "AGPL-3", "website": "https://github.com/OCA/l10n-italy", "maintainers": ["eLBati"], - "depends": ["point_of_sale", "pos_order_mgmt"], + "depends": [ + "point_of_sale", + # TODO is this necessary? + # 'pos_order_mgmt' + ], "data": [ "views/account.xml", "views/point_of_sale.xml", "views/assets.xml", ], "qweb": [ - "static/src/xml/pos.xml", - "static/src/xml/lottery.xml", + # Popups + "static/src/xml/Popups/RefundInfoPopup.xml", + # Others + "static/src/xml/Chrome.xml", + "static/src/xml/ChromeWidgets/EpsonEPOSButton.xml", + "static/src/xml/ChromeWidgets/EpsonFP81IIComponent.xml", + "static/src/xml/ChromeWidgets/SetLotteryCodeButton.xml", + "static/src/xml/ChromeWidgets/SetRefundInfoButton.xml", + # TODO To be converted with new components system + # 'static/src/xml/pos.xml', + # 'static/src/xml/lottery.xml', ], "installable": True, "auto_install": False, diff --git a/fiscal_epos_print/i18n/fiscal_epos_print.pot b/fiscal_epos_print/i18n/fiscal_epos_print.pot deleted file mode 100644 index 7a2c22f30758..000000000000 --- a/fiscal_epos_print/i18n/fiscal_epos_print.pot +++ /dev/null @@ -1,784 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * fiscal_epos_print -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \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: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:41 -#, python-format -msgid ": order already has a fiscal number, " -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Fiscal Printer Serial" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Printer address" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:150 -#, python-format -msgid "An error happened while sending data to the printer. Error code: " -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:25 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:70 -#, python-format -msgid "Apply" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:28 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:73 -#, python-format -msgid "Cancel" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Cash" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Cheque" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:49 -#, python-format -msgid "Closing Seq." -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:130 -#, python-format -msgid "Closure Report Z (Fiscal)" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_report -msgid "Closure reference" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:128 -#, python-format -msgid "Confirm Printer Daily Financial Report (Report X)?" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:110 -#, python-format -msgid "Confirm Printer Fiscal Closure (Report Z)?" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:97 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:106 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:124 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:142 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:151 -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:46 -#: code:addons/fiscal_epos_print/static/src/js/screens.js:39 -#: code:addons/fiscal_epos_print/static/src/js/screens.js:72 -#, python-format -msgid "Connecting to the fiscal printer" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:149 -#, python-format -msgid "Connection to the printer failed" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Credit or Credit Card" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_printer_debug_info -msgid "Debug info" -msgstr "" - -#. module: fiscal_epos_print -#: code:addons/fiscal_epos_print/models/account.py:20 -#, python-format -msgid "Department ID number range [1 - 99]" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_tax__fpdeptax -msgid "Department on fiscal printer 1~99" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:377 -#, python-format -msgid "Discount" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Discount on payment" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_doc_num -msgid "Document Number" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_index -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_journal__fiscalprinter_payment_index -msgid "Electronic Payment / Ticket Index" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:6 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:87 -#, python-format -msgid "Epson ePOS" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:6 -#, python-format -msgid "Epson ePOS Operation" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/models.js:130 -#, python-format -msgid "Error" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:150 -#, python-format -msgid "Error Message: " -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:88 -#, python-format -msgid "Error on last ESC/POS command with Fiscal/Non fiscal closed" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:94 -#, python-format -msgid "Error on last ESC/POS command with Non fiscal open" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Files waiting to be sent: " -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:140 -#, python-format -msgid "Financial Report X" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:67 -#, python-format -msgid "Finished" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__fiscal_cashdrawer -msgid "Fiscal Printer Open CashDrawer" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__fiscal_printer_serial -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_printer_serial -msgid "Fiscal Printer Serial" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:128 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:138 -#, python-format -msgid "Fiscal closure" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_z_rep_number -msgid "Fiscal closure number" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:100 -#, python-format -msgid "Fiscal document open" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:75 -#, python-format -msgid "Fiscal open" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Fiscal printer" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_amount -msgid "Fiscal receipt amount" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_date -msgid "Fiscal receipt date" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_number -msgid "Fiscal receipt number" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:64 -#, python-format -msgid "From other measurement device" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:162 -#, python-format -msgid "IRA files" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:118 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:120 -#, python-format -msgid "IRA status" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:15 -#, python-format -msgid "Invoice recorded" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_account_journal -msgid "Journal" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Lottery" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:212 -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:6 -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__lottery_code -#, python-format -msgid "Lottery Code" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:51 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:56 -#, python-format -msgid "Max 4 numbers" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:91 -#, python-format -msgid "Negative receipt" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:198 -#, python-format -msgid "Network error" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "No Paid" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/models.js:131 -#, python-format -msgid "No taxes found" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:82 -#, python-format -msgid "Non fiscal open" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:44 -#, python-format -msgid "Offline (end of paper or open cover)" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Old files: " -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:95 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:97 -#, python-format -msgid "Open CashDrawer" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:90 -#, python-format -msgid "Operations" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:40 -#, python-format -msgid "Order already printed" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:41 -#, python-format -msgid "Paper running low" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:287 -#, python-format -msgid "Payment" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:85 -#, python-format -msgid "Payment in progress" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_type -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_journal__fiscalprinter_payment_type -msgid "Payment type" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:129 -#, python-format -msgid "Please confirm to execute the Printer Daily Financial Report" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:111 -#, python-format -msgid "Please confirm to execute the Printer Fiscal Closure" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:156 -#, python-format -msgid "Please confirm to reprint the last receipt" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_pos_config -msgid "Point of Sale Configuration" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_pos_order -msgid "Point of Sale Orders" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:61 -#, python-format -msgid "Previous" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__printer_ip -msgid "Printer IP Address" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:199 -#, python-format -msgid "Printer can not be reached" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:18 -#, python-format -msgid "Printing error" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:83 -#, python-format -msgid "Product prices on receipts must be set to 'Tax-Included Price' in POS configuration" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:64 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:66 -#, python-format -msgid "RT Serial" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "RT data" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Receipt" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:59 -#, python-format -msgid "Receipt Date" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:54 -#, python-format -msgid "Receipt Num." -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:12 -#, python-format -msgid "Receipt sent to the printer" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:385 -#, python-format -msgid "Refund >>> " -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_cash_fiscal_serial -msgid "Refund Cash Serial" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:35 -#, python-format -msgid "Refund Data" -msgstr "" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Refund Info" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:124 -#, python-format -msgid "Refund Information Details" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:94 -#, python-format -msgid "Refund Information Not Present" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_date -msgid "Refund date reference" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Rejected files: " -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:113 -#, python-format -msgid "Reports" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:105 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:107 -#, python-format -msgid "Reprint Last Receipt" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:155 -#, python-format -msgid "Reprint Last Receipt?" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:105 -#, python-format -msgid "Reprint last receipt" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:21 -#, python-format -msgid "Retry" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:55 -#, python-format -msgid "Running low" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:138 -#, python-format -msgid "Send fiscal X report to the fiscal printer" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:128 -#, python-format -msgid "Send fiscal closure command to the fiscal printer" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_index -#: model:ir.model.fields,help:fiscal_epos_print.field_account_journal__fiscalprinter_payment_index -msgid "Set the index of the given payment type to specify the detail." -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__show_receipt_when_printing -msgid "Show receipt on screen when printing" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:32 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:77 -#, python-format -msgid "Some fields are empty." -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:118 -#, python-format -msgid "Status of files to be sent to IRA" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:57 -#, python-format -msgid "SubTotal" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_account_tax -msgid "Tax" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_pos_config__printer_ip -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "The hostname or IP address of the fiscal printer" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_type -#: model:ir.model.fields,help:fiscal_epos_print.field_account_journal__fiscalprinter_payment_type -msgid "The payment type to send to the Fiscal Printer." -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:95 -#, python-format -msgid "The refund information aren't present. Please insert them before printing the receipt" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Ticket" -msgstr "" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Ticket with number" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:106 -#, python-format -msgid "Title closed" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:103 -#, python-format -msgid "Title open" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:58 -#, python-format -msgid "To format" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__use_https -msgid "Use https" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:97 -#, python-format -msgid "Waiting for receipt closing in JAVAPOS mode" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:47 -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:70 -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:109 -#, python-format -msgid "Wrong answer" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:82 -#, python-format -msgid "Wrong tax configuration" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:21 -#, python-format -msgid "XXXXXXXX" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:61 -#, python-format -msgid "YYYY-MM-DD" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:29 -#, python-format -msgid "display:none" -msgstr "" - diff --git a/fiscal_epos_print/i18n/it.po b/fiscal_epos_print/i18n/it.po deleted file mode 100644 index 838ce2eb518f..000000000000 --- a/fiscal_epos_print/i18n/it.po +++ /dev/null @@ -1,845 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * fiscal_epos_print -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-15 09:38+0000\n" -"PO-Revision-Date: 2020-05-28 19:19+0000\n" -"Last-Translator: Sergio Zanchetta \n" -"Language-Team: \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.10\n" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:41 -#, python-format -msgid ": order already has a fiscal number, " -msgstr ": l'ordine ha già un numero fiscale, " - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Fiscal Printer Serial" -msgstr "Seriale stampante fiscale" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Printer address" -msgstr "Indirizzo stampante" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:150 -#, python-format -msgid "An error happened while sending data to the printer. Error code: " -msgstr "" -"Si è verificato un errore inviando i dati alla stampante. Codice errore: " - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:25 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:70 -#, python-format -msgid "Apply" -msgstr "Applica" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:28 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:73 -#, python-format -msgid "Cancel" -msgstr "Annulla" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Cash" -msgstr "Contanti" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Cheque" -msgstr "Assegni" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:49 -#, python-format -msgid "Closing Seq." -msgstr "Seq. chiusura" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:130 -#, python-format -msgid "Closure Report Z (Fiscal)" -msgstr "Report Z di chiusura (fiscale)" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_report -msgid "Closure reference" -msgstr "Riferimento chiusura" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:128 -#, python-format -msgid "Confirm Printer Daily Financial Report (Report X)?" -msgstr "Confermare stampa finanziaria giornaliera (rendiconto X)?" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:110 -#, python-format -msgid "Confirm Printer Fiscal Closure (Report Z)?" -msgstr "Confermare stampa chiusura fiscale (rendiconto Z)?" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:97 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:106 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:124 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:142 -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:151 -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:46 -#: code:addons/fiscal_epos_print/static/src/js/screens.js:39 -#: code:addons/fiscal_epos_print/static/src/js/screens.js:72 -#, python-format -msgid "Connecting to the fiscal printer" -msgstr "Connessione alla stampante fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:149 -#, python-format -msgid "Connection to the printer failed" -msgstr "Connessione alla stampante fallita" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Credit or Credit Card" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_printer_debug_info -msgid "Debug info" -msgstr "" - -#. module: fiscal_epos_print -#: code:addons/fiscal_epos_print/models/account.py:20 -#, python-format -msgid "Department ID number range [1 - 99]" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_tax__fpdeptax -msgid "Department on fiscal printer 1~99" -msgstr "Reparto sulla stampante fiscale 1~99" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:377 -#, python-format -msgid "Discount" -msgstr "Sconto" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Discount on payment" -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_doc_num -msgid "Document Number" -msgstr "Numero documento" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_index -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_journal__fiscalprinter_payment_index -msgid "Electronic Payment / Ticket Index" -msgstr "Index pagamento elettronico / ticket" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:6 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:87 -#, python-format -msgid "Epson ePOS" -msgstr "Epson ePOS" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:6 -#, python-format -msgid "Epson ePOS Operation" -msgstr "Operazione Epson ePOS" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/models.js:130 -#, python-format -msgid "Error" -msgstr "Errore" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:150 -#, python-format -msgid "Error Message: " -msgstr "Messaggio errore: " - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:88 -#, python-format -msgid "Error on last ESC/POS command with Fiscal/Non fiscal closed" -msgstr "Errore ultimo comando ESC/POS con Fiscale/Non fiscale chiuso" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:94 -#, python-format -msgid "Error on last ESC/POS command with Non fiscal open" -msgstr "Errore ultimo comando ESC/POS con Non fiscale aperto" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Files waiting to be sent: " -msgstr "File in attesa di essere inviati: " - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:140 -#, python-format -msgid "Financial Report X" -msgstr "Rendiconto finanziario X" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:67 -#, python-format -msgid "Finished" -msgstr "Esaurito" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__fiscal_cashdrawer -msgid "Fiscal Printer Open CashDrawer" -msgstr "Aprire cassetto contanti stampante fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__fiscal_printer_serial -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_printer_serial -msgid "Fiscal Printer Serial" -msgstr "Seriale stampante fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:128 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:138 -#, python-format -msgid "Fiscal closure" -msgstr "Chiusura fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_z_rep_number -msgid "Fiscal closure number" -msgstr "Numero chiusura fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:100 -#, python-format -msgid "Fiscal document open" -msgstr "Documento fiscale aperto" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:75 -#, python-format -msgid "Fiscal open" -msgstr "Fiscale aperto" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "Fiscal printer" -msgstr "Stampante fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_amount -msgid "Fiscal receipt amount" -msgstr "Importo scontrino fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_date -msgid "Fiscal receipt date" -msgstr "Data scontrino fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__fiscal_receipt_number -msgid "Fiscal receipt number" -msgstr "Numero scontrino fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:64 -#, python-format -msgid "From other measurement device" -msgstr "Di altro misuratore" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:162 -#, python-format -msgid "IRA files" -msgstr "File ADE" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:118 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:120 -#, python-format -msgid "IRA status" -msgstr "Stato ADE" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:15 -#, python-format -msgid "Invoice recorded" -msgstr "Fattura registrata" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_account_journal -msgid "Journal" -msgstr "Registro" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Lottery" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:212 -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:6 -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__lottery_code -#, python-format -msgid "Lottery Code" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:51 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:56 -#, python-format -msgid "Max 4 numbers" -msgstr "Massimo 4 numeri" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:91 -#, python-format -msgid "Negative receipt" -msgstr "Scontrino in negativo" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:198 -#, python-format -msgid "Network error" -msgstr "Errore di rete" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "No Paid" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/models.js:131 -#, python-format -msgid "No taxes found" -msgstr "Nessuna imposta trovata" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:82 -#, python-format -msgid "Non fiscal open" -msgstr "Non fiscale aperto" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:44 -#, python-format -msgid "Offline (end of paper or open cover)" -msgstr "Offline (fine carta o coperchio aperto)" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Old files: " -msgstr "Vecchi file: " - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:95 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:97 -#, python-format -msgid "Open CashDrawer" -msgstr "Aprire cassetto" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:90 -#, python-format -msgid "Operations" -msgstr "Operazioni" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/pos_order_mgmt.js:40 -#, python-format -msgid "Order already printed" -msgstr "Ordine già stampato" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:41 -#, python-format -msgid "Paper running low" -msgstr "Carta in esaurimento" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:287 -#, python-format -msgid "Payment" -msgstr "Pagamento" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:85 -#, python-format -msgid "Payment in progress" -msgstr "Pagamento in corso" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_type -#: model:ir.model.fields,field_description:fiscal_epos_print.field_account_journal__fiscalprinter_payment_type -msgid "Payment type" -msgstr "Tipo di pagamento" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:129 -#, python-format -msgid "Please confirm to execute the Printer Daily Financial Report" -msgstr "" -"Confermare per eseguire la stampa del rendiconto finanziario giornaliero" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:111 -#, python-format -msgid "Please confirm to execute the Printer Fiscal Closure" -msgstr "Confermare per eseguire le stampa della chiusura fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:156 -#, python-format -msgid "Please confirm to reprint the last receipt" -msgstr "Confermare la ristampa dell'ultimo scontrino" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_pos_config -msgid "Point of Sale Configuration" -msgstr "Configurazione punto vendita" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_pos_order -msgid "Point of Sale Orders" -msgstr "Ordini punto vendita" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:61 -#, python-format -msgid "Previous" -msgstr "Precedente" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__printer_ip -msgid "Printer IP Address" -msgstr "Indirizzo IP stampante" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:199 -#, python-format -msgid "Printer can not be reached" -msgstr "La stampante non può essere raggiunta" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:18 -#, python-format -msgid "Printing error" -msgstr "Errore di stampa" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:83 -#, python-format -msgid "" -"Product prices on receipts must be set to 'Tax-Included Price' in POS " -"configuration" -msgstr "" -"Nella configurazione POS, i prezzi dei prodotti sugli scontrini devono " -"essere impostati \"Prezzo IVA inclusa\"" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:64 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:66 -#, python-format -msgid "RT Serial" -msgstr "Seriale RT" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "RT data" -msgstr "Dati RT" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Receipt" -msgstr "Scontrino" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:59 -#, python-format -msgid "Receipt Date" -msgstr "Data scontrino" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:54 -#, python-format -msgid "Receipt Num." -msgstr "Num. scontrino" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:12 -#, python-format -msgid "Receipt sent to the printer" -msgstr "Scontrino inviato alla stampante" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:385 -#, python-format -msgid "Refund >>> " -msgstr "Reso >>> " - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_cash_fiscal_serial -msgid "Refund Cash Serial" -msgstr "Matricola RT" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:35 -#, python-format -msgid "Refund Data" -msgstr "Dati reso" - -#. module: fiscal_epos_print -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_pos_form_refund_info -msgid "Refund Info" -msgstr "Informazioni reso" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:124 -#, python-format -msgid "Refund Information Details" -msgstr "Dettagli informazioni reso" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:94 -#, python-format -msgid "Refund Information Not Present" -msgstr "Informazioni reso non presenti" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_order__refund_date -msgid "Refund date reference" -msgstr "Data riferimento reso" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:160 -#, python-format -msgid "Rejected files: " -msgstr "File rifiutati: " - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:113 -#, python-format -msgid "Reports" -msgstr "Rendiconti" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:105 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:107 -#, python-format -msgid "Reprint Last Receipt" -msgstr "Ristampa ultimo scontrino" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/chrome.js:155 -#, python-format -msgid "Reprint Last Receipt?" -msgstr "Ristampare ultimo scontrino?" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:105 -#, python-format -msgid "Reprint last receipt" -msgstr "Ristampa ultimo scontrino" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:21 -#, python-format -msgid "Retry" -msgstr "Riprova" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:55 -#, python-format -msgid "Running low" -msgstr "In esaurimento" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:138 -#, python-format -msgid "Send fiscal X report to the fiscal printer" -msgstr "Inviare rendiconto finanziario X alla stampante fiscale" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:128 -#, python-format -msgid "Send fiscal closure command to the fiscal printer" -msgstr "Inviare comando di chiusura fiscale alla stampante fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_index -#: model:ir.model.fields,help:fiscal_epos_print.field_account_journal__fiscalprinter_payment_index -msgid "Set the index of the given payment type to specify the detail." -msgstr "" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__show_receipt_when_printing -msgid "Show receipt on screen when printing" -msgstr "Mostrare a schermo lo scontrino in fase di stampa" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:32 -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:77 -#, python-format -msgid "Some fields are empty." -msgstr "Alcuni campi sono vuoti." - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:118 -#, python-format -msgid "Status of files to be sent to IRA" -msgstr "Stato dei file da inviare all'ADE" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:57 -#, python-format -msgid "SubTotal" -msgstr "Subtotale" - -#. module: fiscal_epos_print -#: model:ir.model,name:fiscal_epos_print.model_account_tax -msgid "Tax" -msgstr "Imposta" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_pos_config__printer_ip -#: model_terms:ir.ui.view,arch_db:fiscal_epos_print.view_pos_config_printer_form -msgid "The hostname or IP address of the fiscal printer" -msgstr "L'hostname o indirizzo IP della stampante fiscale" - -#. module: fiscal_epos_print -#: model:ir.model.fields,help:fiscal_epos_print.field_account_bank_statement_import_journal_creation__fiscalprinter_payment_type -#: model:ir.model.fields,help:fiscal_epos_print.field_account_journal__fiscalprinter_payment_type -msgid "The payment type to send to the Fiscal Printer." -msgstr "Il tipo di pagamento da inviare alla stampante fiscale." - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:95 -#, python-format -msgid "" -"The refund information aren't present. Please insert them before printing " -"the receipt" -msgstr "" -"Le informazioni del reso non sono presenti, inserirle prima di stampare lo " -"scontrino" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Ticket" -msgstr "Ticket" - -#. module: fiscal_epos_print -#: selection:account.journal,fiscalprinter_payment_type:0 -msgid "Ticket with number" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:106 -#, python-format -msgid "Title closed" -msgstr "Titolo chiuso" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:103 -#, python-format -msgid "Title open" -msgstr "Titolo aperto" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:58 -#, python-format -msgid "To format" -msgstr "Da formattare" - -#. module: fiscal_epos_print -#: model:ir.model.fields,field_description:fiscal_epos_print.field_pos_config__use_https -msgid "Use https" -msgstr "Usa HTTPS" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:97 -#, python-format -msgid "Waiting for receipt closing in JAVAPOS mode" -msgstr "Attesa chiusura scontrino modalità JAVAPOS" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:47 -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:70 -#: code:addons/fiscal_epos_print/static/src/js/epson_epos_print.js:109 -#, python-format -msgid "Wrong answer" -msgstr "Risposta errata" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/js/screens.js:82 -#, python-format -msgid "Wrong tax configuration" -msgstr "Errata configurazione imposte" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/lottery.xml:21 -#, python-format -msgid "XXXXXXXX" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:61 -#, python-format -msgid "YYYY-MM-DD" -msgstr "" - -#. module: fiscal_epos_print -#. openerp-web -#: code:addons/fiscal_epos_print/static/src/xml/pos.xml:29 -#, python-format -msgid "display:none" -msgstr "display:none" - -#~ msgid "Not collected / Electronic payment" -#~ msgstr "Non riscosso / Pagamento elettronico" - -#~ msgid "" -#~ "Set the index of the given payment type to specify the detail. Such index " -#~ "of the payment type must programmed on the fiscal printer" -#~ msgstr "" -#~ "Impostare l'index del relativo tipo di pagamento, per specificare il " -#~ "dettaglio. Tale index deve essere impostato sulla stampante fiscale." - -#~ msgid "DDMMYYYY" -#~ msgstr "GGMMAAAA" - -#~ msgid "" -#~ "\n" -#~ "Old files: " -#~ msgstr "" -#~ "\n" -#~ "File vecchi: " - -#~ msgid "" -#~ "\n" -#~ "Rejected files: " -#~ msgstr "" -#~ "\n" -#~ "File rifiutati: " - -#~ msgid "ADE status" -#~ msgstr "Stato ADE" - -#~ msgid "Error missing paper." -#~ msgstr "Errore Manca La carta." - -#~ msgid "Network error. Printer can not be reached" -#~ msgstr "Errore di rete. La stampante non può essere raggiunta" - -#~ msgid "Product %s must have 1 tax" -#~ msgstr "Il prodotto %s deve avere un'imposta" - -#~ msgid "Product Template" -#~ msgstr "Modello prodotto" - -#~ msgid "Status of files to be sent to ADE" -#~ msgstr "Stato dei file da inviare all'ADE" - -#~ msgid "Tax %s must be included in price" -#~ msgstr "L'imposta %s deve essere inclusa nel prezzo" diff --git a/fiscal_epos_print/models/__init__.py b/fiscal_epos_print/models/__init__.py index ff3a2d6bd6e6..d170c45fd1ee 100644 --- a/fiscal_epos_print/models/__init__.py +++ b/fiscal_epos_print/models/__init__.py @@ -1,4 +1,4 @@ -from . import account_journal +from . import pos_payment from . import point_of_sale from . import account from . import pos_order diff --git a/fiscal_epos_print/models/pos_order.py b/fiscal_epos_print/models/pos_order.py index 7a6e5f4b1e19..179f4ad6cddb 100644 --- a/fiscal_epos_print/models/pos_order.py +++ b/fiscal_epos_print/models/pos_order.py @@ -5,15 +5,15 @@ class PosOrder(models.Model): _inherit = "pos.order" refund_date = fields.Date(string="Refund date reference") - refund_report = fields.Integer(string="Closure reference", digits=(4, 0)) - refund_doc_num = fields.Integer(string="Document Number", digits=(4, 0)) + refund_report = fields.Integer(string="Closure reference") + refund_doc_num = fields.Integer(string="Document Number") refund_cash_fiscal_serial = fields.Char(string="Refund Cash Serial") fiscal_receipt_number = fields.Integer( - string="Fiscal receipt number", digits=(4, 0) + string="Fiscal receipt number", ) fiscal_receipt_amount = fields.Float("Fiscal receipt amount") - fiscal_receipt_date = fields.Date("Fiscal receipt date", digits=(4, 0)) + fiscal_receipt_date = fields.Date("Fiscal receipt date") fiscal_z_rep_number = fields.Integer("Fiscal closure number") fiscal_printer_serial = fields.Char(string="Fiscal Printer Serial") fiscal_printer_debug_info = fields.Text("Debug info", readonly=True) @@ -43,7 +43,6 @@ def _order_fields(self, ui_order): # This is on pos_order_mgmt to send back the fields of already existing # pos.order - @api.multi def _prepare_done_order_for_pos(self): res = super(PosOrder, self)._prepare_done_order_for_pos() res["lottery_code"] = self.lottery_code @@ -95,7 +94,7 @@ def update_fiscal_receipt_values(self, pos_order): return True @api.model - def create_from_ui(self, orders): + def create_from_ui(self, orders, draft=False): res = super(PosOrder, self).create_from_ui(orders) for order in orders: if order["data"].get("fiscal_receipt_number"): diff --git a/fiscal_epos_print/models/pos_payment.py b/fiscal_epos_print/models/pos_payment.py new file mode 100644 index 000000000000..2ed2d0f1b856 --- /dev/null +++ b/fiscal_epos_print/models/pos_payment.py @@ -0,0 +1,39 @@ +from odoo import fields, models + + +class PosPayment(models.Model): + _inherit = "pos.payment" + + def _export_for_ui(self, payment): + res = super(PosPayment, self)._export_for_ui(payment) + res[ + "fiscalprinter_payment_type" + ] = payment.payment_method_id.fiscalprinter_payment_type + res[ + "fiscalprinter_payment_index" + ] = payment.payment_method_id.fiscalprinter_payment_index + return res + + +class PosPaymentMethod(models.Model): + _inherit = "pos.payment.method" + + fiscalprinter_payment_type = fields.Selection( + [ + ("0", "Cash"), + ("1", "Cheque"), + ("2", "Credit or Credit Card"), + ("3", "Ticket"), + ("4", "Ticket with number"), + ("5", "No Paid"), + ("6", "Discount on payment"), + ], + "Payment type", + help="The payment type to send to the Fiscal Printer.", + default="0", + ) + + fiscalprinter_payment_index = fields.Integer( + string="Electronic Payment / Ticket Index", + help="Set the index of the given payment type to specify the detail.", + ) diff --git a/fiscal_epos_print/readme/CONTRIBUTORS.rst b/fiscal_epos_print/readme/CONTRIBUTORS.rst index 1046f11f334d..d22cd5a750f3 100644 --- a/fiscal_epos_print/readme/CONTRIBUTORS.rst +++ b/fiscal_epos_print/readme/CONTRIBUTORS.rst @@ -6,4 +6,3 @@ * Alessio Gerace * Roberto Fichera -* Giovanni Serra diff --git a/fiscal_epos_print/static/description/index.html b/fiscal_epos_print/static/description/index.html index 58253b85ddb8..1ada855329e6 100644 --- a/fiscal_epos_print/static/description/index.html +++ b/fiscal_epos_print/static/description/index.html @@ -461,7 +461,6 @@

Contributors

  • Alessio Gerace
  • Roberto Fichera
  • -
  • Giovanni Serra <giovanni@gslab.it>
  • diff --git a/fiscal_epos_print/static/lib/fiscalprint/fiscalprint.js b/fiscal_epos_print/static/lib/fiscalprint/fiscalprint.js index 2a97bd3aba05..bf7fbebc39c2 100644 --- a/fiscal_epos_print/static/lib/fiscalprint/fiscalprint.js +++ b/fiscal_epos_print/static/lib/fiscalprint/fiscalprint.js @@ -1495,13 +1495,16 @@ Description: append constructors to window object */ - window.epson = { - ePOSBuilder: ePOSBuilder, - ePOSPrint: ePOSPrint, - fiscalPrint: fiscalPrint, - CanvasPrint: CanvasPrint, - encodeBase64Binary: encodeBase64Binary - }; + // Core module 'pos_epson_printer' appends constructors to the same window object so + // this implementation avoid to override the epson object. + if (!window.epson) { + window.epson = {} + } + window.epson.ePOSBuilder = window.epson.ePOSBuilder || ePOSBuilder + window.epson.ePOSPrint = window.epson.ePOSPrint || ePOSPrint + window.epson.CanvasPrint = window.epson.CanvasPrint || CanvasPrint + window.epson.fiscalPrint = fiscalPrint + window.epson.encodeBase64Binary = encodeBase64Binary })(window); diff --git a/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonEPOSButton.js b/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonEPOSButton.js new file mode 100644 index 000000000000..d6e91fab9f8e --- /dev/null +++ b/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonEPOSButton.js @@ -0,0 +1,31 @@ +odoo.define("fiscal_epos_print.EpsonEPOSButton", function (require) { + "use strict"; + + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); + + class EpsonEPOSButton extends PosComponent { + /** + * Method that manage EpsonFP81IIComponent visibility through onClick + * Handler + */ + onClick() { + var epsonFP81IIComponent = $(".status-buttons .epson-fp81ii-widget"); + if (epsonFP81IIComponent.hasClass("oe_hidden")) { + epsonFP81IIComponent.css({opacity: 0}); + epsonFP81IIComponent.removeClass("oe_hidden"); + epsonFP81IIComponent.animate({opacity: 1}, 250, "swing"); + } else { + epsonFP81IIComponent.animate({opacity: 0}, 250, "swing", function () { + epsonFP81IIComponent.addClass("oe_hidden"); + }); + } + } + } + + EpsonEPOSButton.template = "EpsonEPOSButton"; + + Registries.Component.add(EpsonEPOSButton); + + return EpsonEPOSButton; +}); diff --git a/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonFP81IIComponent.js b/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonFP81IIComponent.js new file mode 100644 index 000000000000..4091b22be029 --- /dev/null +++ b/fiscal_epos_print/static/src/js/ChromeWidgets/EpsonFP81IIComponent.js @@ -0,0 +1,205 @@ +odoo.define("fiscal_epos_print.EpsonFP81IIComponent", function (require) { + "use strict"; + + var core = require("web.core"); + var epson_epos_print = require("fiscal_epos_print.epson_epos_print"); + var _t = core._t; + var eposDriver = epson_epos_print.eposDriver; + + const {Gui} = require("point_of_sale.Gui"); + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); + + class EpsonFP81IIComponent extends PosComponent { + constructor(parent, options) { + super(parent, options); + var self = this; + + // For dragging the debug widget around + this.dragging = false; + this.dragpos = { + x: 0, + y: 0, + }; + + function eventpos(event) { + if (event.touches && event.touches[0]) { + return { + x: event.touches[0].screenX, + y: event.touches[0].screenY, + }; + } + return { + x: event.screenX, + y: event.screenY, + }; + } + + this.dragend_handler = function (event) { + self.dragging = false; + }; + this.dragstart_handler = function (event) { + self.dragging = true; + self.dragpos = eventpos(event); + }; + this.dragmove_handler = function (event) { + if (self.dragging) { + var top = this.offsetTop; + var left = this.offsetLeft; + var pos = eventpos(event); + var dx = pos.x - self.dragpos.x; + var dy = pos.y - self.dragpos.y; + + self.dragpos = pos; + + this.style.right = "auto"; + this.style.bottom = "auto"; + this.style.left = left + dx + "px"; + this.style.top = top + dy + "px"; + } + event.preventDefault(); + event.stopPropagation(); + }; + } + + mounted() { + // Jquery reference of the component + this.$el = $(this.el); + // Drag listeners + this.el.addEventListener("mouseleave", this.dragend_handler); + this.el.addEventListener("mouseup", this.dragend_handler); + this.el.addEventListener("touchend", this.dragend_handler); + this.el.addEventListener("touchcancel", this.dragend_handler); + this.el.addEventListener("mousedown", this.dragstart_handler); + this.el.addEventListener("touchstart", this.dragstart_handler); + this.el.addEventListener("mousemove", this.dragmove_handler); + this.el.addEventListener("touchmove", this.dragmove_handler); + } + + show() { + this.$el.css({opacity: 0}); + this.$el.removeClass("oe_hidden"); + this.$el.animate({opacity: 1}, 250, "swing"); + } + + hide() { + var self = this; + this.$el.animate({opacity: 0}, 250, "swing", function () { + self.$el.addClass("oe_hidden"); + }); + } + + getPrinterOptions() { + var protocol = this.env.pos.config.use_https ? "https://" : "http://"; + var printer_url = + protocol + this.env.pos.config.printer_ip + "/cgi-bin/fpmate.cgi"; + return {url: printer_url}; + } + + onToggleComponent() { + this.hide(); + } + + async openCashDrawer() { + this.hide(); + // TODO find the same Component method that show loading_* + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = this.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + fp90.printOpenCashDrawer(); + const {confirmed} = await Gui.showPopup("ConfirmPopup", { + title: _t("CashDrawer Opened"), + body: _t("Close"), + }); + if (confirmed) { + fp90.resetPrinter(); + } else { + // TODO not exist + // this.chrome.loading_hide(); + } + } + + async reprintLastReceipt() { + this.hide(); + // Var self = this; + // this._super(); + + // TODO find the same Component method that show loading_* + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = this.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + // ConfirmPopup + const {confirmed} = await Gui.showPopup("ConfirmPopup", { + title: _t("Reprint Last Receipt?"), + body: _t("Please confirm to reprint the last receipt"), + }); + if (confirmed) { + fp90.printFiscalReprintLast(); + } else { + // TODO not exist + // this.chrome.loading_hide(); + } + } + + showAdeStatus() { + this.hide(); + // TODO find the same Component method that show loading_* + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = this.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + fp90.getStatusOfFilesForADE(); + } + + async fiscalClosing() { + this.hide(); + // TODO find the same Component method that show loading_* + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = this.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + // ConfirmPopup + const {confirmed} = await this.showPopup("ConfirmPopup", { + title: _t("Confirm Printer Fiscal Closure (Report Z)?"), + body: _t("Please confirm to execute the Printer Fiscal Closure"), + }); + if (confirmed) { + // Fp90.printFiscalReport(); + fp90.printFiscalXZReport(); + } else { + // TODO not exist + // this.chrome.loading_hide(); + } + } + + async fiscalXreport() { + this.hide(); + // TODO find the same Component method that show loading_* + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = this.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + // ConfirmPopup + const {confirmed} = await this.showPopup("ConfirmPopup", { + title: _t("Confirm Printer Daily Financial Report (Report X)?"), + body: _t( + "Please confirm to execute the Printer Daily Financial Report" + ), + }); + if (confirmed) { + fp90.printFiscalXReport(); + } else { + // TODO not exist + // this.chrome.loading_hide(); + } + } + } + + EpsonFP81IIComponent.template = "EpsonFP81IIComponent"; + + Registries.Component.add(EpsonFP81IIComponent); + + return EpsonFP81IIComponent; +}); diff --git a/fiscal_epos_print/static/src/js/ChromeWidgets/SetLotteryCodeButton.js b/fiscal_epos_print/static/src/js/ChromeWidgets/SetLotteryCodeButton.js new file mode 100644 index 000000000000..dedb1b01c4d1 --- /dev/null +++ b/fiscal_epos_print/static/src/js/ChromeWidgets/SetLotteryCodeButton.js @@ -0,0 +1,62 @@ +odoo.define("fiscal_epos_print.SetLotteryCodeButton", function (require) { + "use strict"; + + const PosComponent = require("point_of_sale.PosComponent"); + const ProductScreen = require("point_of_sale.ProductScreen"); + const {useListener} = require("web.custom_hooks"); + const Registries = require("point_of_sale.Registries"); + const {Gui} = require("point_of_sale.Gui"); + + class SetLotteryCodeButton extends PosComponent { + constructor() { + super(...arguments); + useListener("click", this.onClick); + // This is from older widget system 12.0 + var self = this; + // This.pos.bind('change:selectedOrder',function(){ + // //self.renderElement(); + // },this); + } + mounted() { + var color = this.lottery_get_button_color(); + this.$el.css("background", color); + } + // WillUnmount() { + // this.env.pos.get('orders').off('add remove change', null, this); + // this.env.pos.off('change:selectedOrder', null, this); + // } + async onClick() { + var self = this; + var current_order = self.pos.get_order(); + Gui.showPopup("lotterycode", { + title: _t("Lottery Code"), + lottery_code: current_order.lottery_code, + update_lottery_info_button: function () { + // Self.renderElement(); + }, + }); + } + + lottery_get_button_color() { + var order = this.pos.get_order(); + var color = "#e2e2e2"; + if (order.lottery_code) { + color = "lightgreen"; + } + return color; + } + } + + SetLotteryCodeButton.template = "SetLotteryCodeButton"; + + ProductScreen.addControlButton({ + component: SetLotteryCodeButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(SetLotteryCodeButton); + + return SetLotteryCodeButton; +}); diff --git a/fiscal_epos_print/static/src/js/ChromeWidgets/SetRefundInfoButton.js b/fiscal_epos_print/static/src/js/ChromeWidgets/SetRefundInfoButton.js new file mode 100644 index 000000000000..ad0498a89783 --- /dev/null +++ b/fiscal_epos_print/static/src/js/ChromeWidgets/SetRefundInfoButton.js @@ -0,0 +1,139 @@ +odoo.define("fiscal_epos_print.SetRefundInfoButton", function (require) { + "use strict"; + + var core = require("web.core"); + var _t = core._t; + const PosComponent = require("point_of_sale.PosComponent"); + const ProductScreen = require("point_of_sale.ProductScreen"); + const {useListener} = require("web.custom_hooks"); + const Registries = require("point_of_sale.Registries"); + const {Gui} = require("point_of_sale.Gui"); + const {posbus} = require("point_of_sale.utils"); + const PaymentScreen = require("point_of_sale.PaymentScreen"); + + class SetRefundInfoButton extends PosComponent { + constructor() { + super(...arguments); + // UseListener('click', this.onClick); + // This is from older widget system 12.0 + // this.pos.bind('change:selectedOrder',function(){ + // this.orderline_change(); + // this.bind_order_events(); + // },this); + } + + mounted() { + this.bind_order_events(); + this.orderline_change(); + } + + is_available() { + const order = this.env.pos.get_order(); + return order; + } + + render() { + var color = this.refund_get_button_color(); + $(this.el).css("background", color); + } + + // WillUnmount() { + // this.env.pos.get('orders').off('add remove change', null, this); + // this.env.pos.off('change:selectedOrder', null, this); + // } + async onClickRefund() { + var self = this; + var current_order = this.env.pos.get_order(); + this.showPopup("RefundInfoPopup", { + title: _t("Refund Information Details"), + refund_date: current_order.refund_date, + refund_report: current_order.refund_report, + refund_doc_num: current_order.refund_doc_num, + refund_cash_fiscal_serial: current_order.refund_cash_fiscal_serial, + update_refund_info_button: function () { + self.render(); + }, + }); + } + + bind_order_events() { + var self = this; + var order = this.env.pos.get_order(); + + if (!order) { + return; + } + + if (this.old_order) { + this.old_order.unbind(null, null, this); + } + + this.env.pos.bind("change:selectedOrder", this.orderline_change, this); + + var lines = order.orderlines; + lines.unbind("add", this.orderline_change, this); + lines.bind("add", this.orderline_change, this); + lines.unbind("remove", this.orderline_change, this); + lines.bind("remove", this.orderline_change, this); + lines.unbind("change", this.orderline_change, this); + lines.bind("change", this.orderline_change, this); + + this.old_order = order; + } + + refund_get_button_color() { + var order = this.env.pos.get_order(); + var color = "#e2e2e2"; + if (order) { + var lines = order.orderlines; + var has_refund = + lines.find(function (line) { + return line.quantity < 0.0; + }) != undefined; + if (has_refund == true) { + if ( + order.refund_date && + order.refund_date != "" && + order.refund_doc_num && + order.refund_doc_num != "" && + order.refund_cash_fiscal_serial && + order.refund_cash_fiscal_serial != "" && + order.refund_report && + order.refund_report != "" + ) { + color = "lightgreen"; + } else { + color = "red"; + } + } + } + return color; + } + + orderline_change() { + var order = this.env.pos.get_order(); + if (order) { + var lines = order.orderlines; + order.has_refund = + lines.find(function (line) { + return line.quantity < 0.0; + }) != undefined; + } + this.render(); + } + } + + SetRefundInfoButton.template = "SetRefundInfoButton"; + + ProductScreen.addControlButton({ + component: SetRefundInfoButton, + condition: function () { + // Return true; + return this.env.pos; + }, + }); + + Registries.Component.add(SetRefundInfoButton); + + return SetRefundInfoButton; +}); diff --git a/fiscal_epos_print/static/src/js/Popups/RefundInfoPopup.js b/fiscal_epos_print/static/src/js/Popups/RefundInfoPopup.js new file mode 100644 index 000000000000..f50531be21ff --- /dev/null +++ b/fiscal_epos_print/static/src/js/Popups/RefundInfoPopup.js @@ -0,0 +1,99 @@ +odoo.define("fiscal_epos_print.RefundInfoPopup", function (require) { + "use strict"; + + const {useState, useRef} = owl.hooks; + const AbstractAwaitablePopup = require("point_of_sale.AbstractAwaitablePopup"); + const Registries = require("point_of_sale.Registries"); + + class RefundInfoPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + + this.state = useState({inputValue: this.props.startingValue}); + this.inputRefundReport = useRef("inputRefundReport"); + this.inputRefundDate = useRef("inputRefundDate"); + this.inputRefundDocNum = useRef("inputRefundDocNum"); + this.inputRefundCashFiscalSerial = useRef("inputRefundCashFiscalSerial"); + this.inputDatePicker = null; + // TODO to be removed; + // this.refund_report = null; + // this.refund_date = null; + // this.refund_doc_num = null; + // this.refund_cash_fiscal_serial = null; + // this.datepicker = null; + } + + mounted() { + this.inputRefundReport.el.focus(); + this.initializeDatePicker(); + } + + // TODO this first migration is from method show() and it's seems to be incorrect + // mounted(options){ + // options = options || {}; + // super.mounted(...arguments); + // this.update_refund_info_button = options.update_refund_info_button; + // // this.renderElement(); + // this.datepicker = null; + // // this.$('refund_report').focus(); + // this.initializeDatePicker(); + // } + + clickConfirmRefund() { + this.$el = $(this.el); + var self = this; + function allValid() { + return self.$el + .find("input") + .toArray() + .every(function (element) { + return element.value && element.value != ""; + }); + } + + if (allValid()) { + this.$el.find("#error-message-dialog").hide(); + + var order = this.env.pos.get_order(); + order.refund_report = this.$el.find("#refund_report").val(); + order.refund_date = this.$el.find("#refund_date").val(); + order.refund_doc_num = this.$el.find("#refund_doc_num").val(); + order.refund_cash_fiscal_serial = this.$el + .find("#refund_cash_fiscal_serial") + .val(); + this.trigger("close-popup"); + if ( + this.props.update_refund_info_button && + this.props.update_refund_info_button instanceof Function + ) { + this.props.update_refund_info_button(); + } + } else { + this.$el.find("#error-message-dialog").show(); + } + } + + initializeDatePicker() { + var self = this; + this.$el = $(this.el); + var element = this.$el.find("#refund_date").get(0); + if (element && !this.datepicker) { + this.datepicker = new Pikaday({ + field: element, + }); + } + } + } + + RefundInfoPopup.template = "RefundInfoPopup"; + + RefundInfoPopup.defaultProps = { + confirmText: "Ok", + cancelText: "Cancel", + body: "", + }; + + Registries.Component.add(RefundInfoPopup); + + return RefundInfoPopup; +}); diff --git a/fiscal_epos_print/static/src/js/Screens/PaymentScreen/PaymentScreen.js b/fiscal_epos_print/static/src/js/Screens/PaymentScreen/PaymentScreen.js new file mode 100644 index 000000000000..f58f0977d708 --- /dev/null +++ b/fiscal_epos_print/static/src/js/Screens/PaymentScreen/PaymentScreen.js @@ -0,0 +1,86 @@ +odoo.define("fiscal_epos_print.PaymentScreen", function (require) { + "use strict"; + + var core = require("web.core"); + var epson_epos_print = require("fiscal_epos_print.epson_epos_print"); + var _t = core._t; + var eposDriver = epson_epos_print.eposDriver; + const Registries = require("point_of_sale.Registries"); + const PaymentScreen = require("point_of_sale.PaymentScreen"); + + const MyPaymentScreen = (PaymentScreen) => + class extends PaymentScreen { + show() { + _super.apply(this, arguments); + if (this.pos.config.printer_ip) { + var currentOrder = this.env.pos.get_order(); + var printer_options = currentOrder.getPrinterOptions(); + var fp90 = new eposDriver(printer_options, this); + var amount = this.format_currency( + currentOrder.get_total_with_tax() + ); + fp90.printDisplayText(_t("SubTotal") + " " + amount); + } + } + + sendToFP90Printer(receipt, printer_options) { + var fp90 = new eposDriver(printer_options, this); + fp90.printFiscalReceipt(receipt); + } + + _finalizeValidation() { + // We need to get currentOrder before calling the _super() + // otherwise we will likely get a empty order when we want to skip + // the receipt preview + var currentOrder = this.env.pos.get("selectedOrder"); + super._finalizeValidation(...arguments); + if (this.env.pos.config.printer_ip && !currentOrder.is_to_invoice()) { + // TODO self.chrome does not exists + // this.chrome.loading_show(); + // this.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = currentOrder.getPrinterOptions(); + printer_options.order = currentOrder; + var receipt = currentOrder.export_for_printing(); + this.sendToFP90Printer(receipt, printer_options); + } + } + + _isOrderValid(isForceValidate) { + if (this.env.pos.config.iface_tax_included == "subtotal") { + this.showPopup("ErrorPopup", { + title: _t("Wrong tax configuration"), + body: _t( + "Product prices on receipts must be set to 'Tax-Included Price' in POS configuration" + ), + }); + return false; + } + var self = this; + var receipt = this.env.pos.get_order(); + if ( + receipt.has_refund && + (receipt.refund_date == null || + receipt.refund_date === "" || + receipt.refund_doc_num == null || + receipt.refund_doc_num == "" || + receipt.refund_cash_fiscal_serial == null || + receipt.refund_cash_fiscal_serial == "" || + receipt.refund_report == null || + receipt.refund_report == "") + ) { + this.showPopup("ErrorPopup", { + title: _t("Refund Information Not Present"), + body: _t( + "The refund information aren't present. Please insert them before printing the receipt" + ), + }); + return false; + } + return super._isOrderValid(isForceValidate); + } + }; + + Registries.Component.extend(PaymentScreen, MyPaymentScreen); + + return PaymentScreen; +}); diff --git a/fiscal_epos_print/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js b/fiscal_epos_print/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js new file mode 100644 index 000000000000..82e76d3b6360 --- /dev/null +++ b/fiscal_epos_print/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js @@ -0,0 +1,52 @@ +odoo.define("fiscal_epos_print.ReceiptScreen", function (require) { + "use strict"; + + var core = require("web.core"); + var epson_epos_print = require("fiscal_epos_print.epson_epos_print"); + var _t = core._t; + var eposDriver = epson_epos_print.eposDriver; + const Registries = require("point_of_sale.Registries"); + const ReceiptScreen = require("point_of_sale.ReceiptScreen"); + + const MyReceiptScreen = (ReceiptScreen) => + class extends ReceiptScreen { + lock_screen(locked) { + this._super.apply(this, arguments); + if (locked) { + this.$(".receipt-sent").hide(); + this.$(".printing-error").show(); + this.$(".printing-retry").show(); + } else { + this.$(".receipt-sent").show(); + this.$(".printing-error").hide(); + this.$(".printing-retry").hide(); + } + } + + sendToFP90Printer(receipt, printer_options) { + var fp90 = new eposDriver(printer_options, this); + fp90.printFiscalReceipt(receipt); + } + + render_receipt() { + var self = this; + this._super(); + this.$(".printing-retry").click(function () { + if (self._locked) { + var currentOrder = self.pos.get_order(); + // TODO self.chrome does not exists + // self.chrome.loading_show(); + // self.chrome.loading_message(_t('Connecting to the fiscal printer')); + var printer_options = currentOrder.getPrinterOptions(); + printer_options.order = currentOrder; + var receipt = currentOrder.export_for_printing(); + self.sendToFP90Printer(receipt, printer_options); + } + }); + } + }; + + Registries.Component.extend(ReceiptScreen, MyReceiptScreen); + + return ReceiptScreen; +}); diff --git a/fiscal_epos_print/static/src/js/chrome.js b/fiscal_epos_print/static/src/js/chrome.js deleted file mode 100644 index e3b35e824b67..000000000000 --- a/fiscal_epos_print/static/src/js/chrome.js +++ /dev/null @@ -1,213 +0,0 @@ -odoo.define("fiscal_epos_print.chrome", function (require) { - "use strict"; - - var core = require("web.core"); - var PosBaseWidget = require("point_of_sale.BaseWidget"); - var chrome = require("point_of_sale.chrome"); - var epson_epos_print = require("fiscal_epos_print.epson_epos_print"); - var _t = core._t; - var eposDriver = epson_epos_print.eposDriver; - - /* --------- Epson ePOS FP81II main Widget --------- */ - - var EpsonFP81IIWidget = PosBaseWidget.extend({ - template: "EpsonFP81IIWidget", - - init: function (parent, options) { - this._super(parent, options); - var self = this; - - // For dragging the debug widget around - this.dragging = false; - this.dragpos = {x: 0, y: 0}; - - function eventpos(event) { - if (event.touches && event.touches[0]) { - return {x: event.touches[0].screenX, y: event.touches[0].screenY}; - } - return {x: event.screenX, y: event.screenY}; - } - - this.dragend_handler = function (event) { - self.dragging = false; - }; - this.dragstart_handler = function (event) { - self.dragging = true; - self.dragpos = eventpos(event); - }; - this.dragmove_handler = function (event) { - if (self.dragging) { - var top = this.offsetTop; - var left = this.offsetLeft; - var pos = eventpos(event); - var dx = pos.x - self.dragpos.x; - var dy = pos.y - self.dragpos.y; - - self.dragpos = pos; - - this.style.right = "auto"; - this.style.bottom = "auto"; - this.style.left = left + dx + "px"; - this.style.top = top + dy + "px"; - } - event.preventDefault(); - event.stopPropagation(); - }; - }, - - show: function () { - this.$el.css({opacity: 0}); - this.$el.removeClass("oe_hidden"); - this.$el.animate({opacity: 1}, 250, "swing"); - }, - - hide: function () { - var self = this; - this.$el.animate({opacity: 0}, 250, "swing", function () { - self.$el.addClass("oe_hidden"); - }); - }, - - getPrinterOptions: function () { - var protocol = this.pos.config.use_https ? "https://" : "http://"; - var printer_url = - protocol + this.pos.config.printer_ip + "/cgi-bin/fpmate.cgi"; - return {url: printer_url}; - }, - - start: function () { - var self = this; - - this.el.addEventListener("mouseleave", this.dragend_handler); - this.el.addEventListener("mouseup", this.dragend_handler); - this.el.addEventListener("touchend", this.dragend_handler); - this.el.addEventListener("touchcancel", this.dragend_handler); - this.el.addEventListener("mousedown", this.dragstart_handler); - this.el.addEventListener("touchstart", this.dragstart_handler); - this.el.addEventListener("mousemove", this.dragmove_handler); - this.el.addEventListener("touchmove", this.dragmove_handler); - - this.$(".toggle").click(function () { - self.hide(); - }); - - this.$(".button.show_ade_status").click(function () { - self.hide(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = self.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, self); - fp90.getStatusOfFilesForADE(); - }); - - this.$(".button.fiscal_closing").click(function () { - self.hide(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = self.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, self); - self.gui.show_popup("confirm", { - title: _t("Confirm Printer Fiscal Closure (Report Z)?"), - body: _t("Please confirm to execute the Printer Fiscal Closure"), - confirm: function () { - fp90.printFiscalReport(); - }, - cancel: function () { - self.chrome.loading_hide(); - }, - }); - }); - - this.$(".button.fiscal_xreport").click(function () { - self.hide(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = self.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, self); - self.gui.show_popup("confirm", { - title: _t("Confirm Printer Daily Financial Report (Report X)?"), - body: _t( - "Please confirm to execute the Printer Daily Financial Report" - ), - confirm: function () { - fp90.printFiscalXReport(); - }, - cancel: function () { - self.chrome.loading_hide(); - }, - }); - }); - - this.$(".button.open_cashdrawer").click(function () { - self.hide(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = self.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, self); - fp90.printOpenCashDrawer(); - }); - - this.$(".button.reprint_last_receipt").click(function () { - self.hide(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = self.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, self); - self.gui.show_popup("confirm", { - title: _t("Reprint Last Receipt?"), - body: _t("Please confirm to reprint the last receipt"), - confirm: function () { - fp90.printFiscalReprintLast(); - }, - cancel: function () { - self.chrome.loading_hide(); - }, - }); - }); - }, - }); - - var EpsonEPOSWidget = PosBaseWidget.extend({ - template: "EpsonEPOSWidget", - - button_click: function () { - var widget = $(".pos-content .epson-fp81ii-widget"); - if (widget.hasClass("oe_hidden")) { - widget.css({opacity: 0}); - widget.removeClass("oe_hidden"); - widget.animate({opacity: 1}, 250, "swing"); - } else { - widget.animate({opacity: 0}, 250, "swing", function () { - widget.addClass("oe_hidden"); - }); - } - }, - - renderElement: function () { - var self = this; - this._super(); - this.$el.click(function () { - self.button_click(); - }); - }, - }); - - var widgets = chrome.Chrome.prototype.widgets; - - widgets.push({ - name: "epson-epos-widget", - widget: EpsonEPOSWidget, - append: ".pos-rightheader", - }); - - widgets.push({ - name: "epsonfp81ii", - widget: EpsonFP81IIWidget, - append: ".pos-content", - }); - - return { - EpsonEPOSWidget: EpsonEPOSWidget, - EpsonFP81IIWidget: EpsonFP81IIWidget, - }; -}); diff --git a/fiscal_epos_print/static/src/js/epson_epos_print.js b/fiscal_epos_print/static/src/js/epson_epos_print.js index 348cb3255fb9..4423ee1e7f78 100644 --- a/fiscal_epos_print/static/src/js/epson_epos_print.js +++ b/fiscal_epos_print/static/src/js/epson_epos_print.js @@ -3,11 +3,13 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { var core = require("web.core"); var utils = require("web.utils"); - var PosDB = require("point_of_sale.DB"); - var rpc = require("web.rpc"); + // Var PosDB = require('point_of_sale.DB'); + // var rpc = require('web.rpc'); var _t = core._t; var round_pr = utils.round_precision; + const {Gui} = require("point_of_sale.Gui"); + function addPadding(str, padding = 4) { var pad = new Array(padding).fill(0).join("") + str; return pad.substr(pad.length - padding, padding); @@ -127,7 +129,8 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { this.sender = sender; this.order = options.order || null; this.fiscalPrinter.onreceive = function (res, tag_list_names, add_info) { - sender.chrome.loading_hide(); + // TODO not exist + // sender.chrome.loading_hide(); var tagStatus = tag_list_names ? tag_list_names.filter(getStatusField) : []; @@ -147,14 +150,18 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { JSON.stringify(tag_list_names) + "\n" + JSON.stringify(add_info); - sender.pos.push_order(order); + // TODO is push_orders or push_single_order + // sender.env.pos.push_orders(order); + // sender.env.pos.push_single_order(order); } if (tagStatus.length > 0) { var info = add_info[tagStatus[0]]; var msgPrinter = decodeFpStatus(info); } - sender.chrome.screens.receipt.lock_screen(true); - sender.pos.gui.show_popup("error", { + // TODO + // sender.chrome.screens['receipt'].lock_screen(true); + // TODO is this correct? + Gui.showPopup("ErrorPopup", { title: _t("Connection to the printer failed"), body: _t( @@ -194,7 +201,8 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { "; " + _t("Rejected files: ") + rejected; - sender.pos.gui.show_popup("alert", { + // TODO is this correct? + Gui.showPopup("ErrorPopup", { title: _t("IRA files"), body: msg, }); @@ -208,7 +216,8 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { add_info.fiscalReceiptDate && add_info.zRepNumber ) { - sender.chrome.screens.receipt.lock_screen(false); + // TODO + // sender.chrome.screens['receipt'].lock_screen(false); var order = self.order; order._printed = true; if (!order.fiscal_receipt_number) { @@ -229,24 +238,30 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { ); order.fiscal_z_rep_number = add_info.zRepNumber; order.fiscal_printer_serial = - sender.pos.config.fiscal_printer_serial; - sender.pos.db.add_order(order.export_as_JSON()); + sender.env.pos.config.fiscal_printer_serial; + sender.env.pos.db.add_order(order.export_as_JSON()); // Try to save the order - sender.pos.push_order(); + // TODO is push_orders or push_single_order + // sender.env.pos.push_orders(); + // sender.env.pos.push_single_order(); } - if (sender.pos.config.fiscal_cashdrawer) { + if (sender.env.pos.config.fiscal_cashdrawer) { self.printOpenCashDrawer(); + self.resetPrinter(); } - if (!sender.pos.config.show_receipt_when_printing) { - sender.chrome.screens.receipt.click_next(); + if (!sender.env.pos.config.show_receipt_when_printing) { + // TODO + // sender.chrome.screens['receipt'].click_next(); } return; } }; this.fiscalPrinter.onerror = function () { - sender.chrome.loading_hide(); - sender.chrome.screens.receipt.lock_screen(true); - sender.pos.gui.show_popup("error", { + // TODO not exist + // sender.chrome.loading_hide(); + // sender.chrome.screens['receipt'].lock_screen(true); + // TODO is this correct? + Gui.showPopup("ErrorPopup", { title: _t("Network error"), body: _t("Printer can not be reached"), }); @@ -467,6 +482,24 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { this.fiscalPrinter.send(this.url, xml); }, + /* + Print the order.id into fiscal receipt for the refund + */ + printOrderId: function (receipt) { + var message = receipt.name; + // + var tag = + "\n"; + return tag; + }, + /* Prints a receipt */ @@ -475,12 +508,13 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { var has_refund = _.every(receipt.orderlines, function (line) { return line.quantity < 0; }); - var xml = ""; + var xml = ""; // Header must be printed before beginning a fiscal receipt xml += this.printFiscalReceiptHeader(receipt); - if (!has_refund) { - xml += ""; - } + // TODO now it's seems to be mandatory for refund too + // if (!has_refund) { + // xml += ''; + // } if (has_refund) { xml += this.printFiscalRefundDetails({ refund_date: receipt.refund_date, @@ -504,7 +538,7 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { description: _t("Discount") + " " + l.discount + "%", amount: round_pr( l.quantity * l.full_price - l.price_display, - self.sender.pos.currency.rounding + self.sender.env.pos.currency.rounding ), }); } @@ -515,6 +549,14 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { unitPrice: l.price, department: l.tax_department.code, }); + + // TODO This line of code is added by us, check if it's right + xml += self.printRecItem({ + description: _t("Refund cash"), + quantity: l.quantity * -1.0, + unitPrice: l.price, + department: l.tax_department.code, + }); } } else { xml += self.printRecItemAdjustment({ @@ -537,33 +579,59 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { receipt.lottery_code.padEnd(16, " ") + '0000" />'; } - if (has_refund) { - xml += self.printRecTotalRefund({}); - } else { - _.each(receipt.paymentlines, function (l, i, list) { - xml += self.printRecTotal({ - payment: l.amount, - paymentType: l.type, - paymentIndex: l.type_index, - description: l.journal, - }); + // TODO is always the same Total for refund and payments? + _.each(receipt.paymentlines, function (l, i, list) { + // Amount always positive because it's used for refund too + xml += self.printRecTotal({ + payment: Math.abs(l.amount), + paymentType: l.type, + paymentIndex: l.type_index, + description: l.journal, }); - } + }); + // If (has_refund) { + // xml += self.printRecTotalRefund({}); + // } + // else { + // _.each(receipt.paymentlines, function(l, i, list) { + // xml += self.printRecTotal({ + // payment: l.amount, + // paymentType: l.type, + // paymentIndex: l.type_index, + // description: l.journal, + // }); + // }); + // } + xml += this.printOrderId(receipt); xml += ""; this.fiscalPrinter.send(this.url, xml); console.log(xml); }, + /* + DON'T USE, this fiscal closure is forbid by Epson by default + */ printFiscalReport: function () { var xml = ""; - xml += ''; + xml += ''; xml += ""; - this.fiscalPrinter.send(this.url, xml); + var res = this.fiscalPrinter.send(this.url, xml); + }, + + /* + It prints report and fiscal closure both + */ + printFiscalXZReport: function () { + var xml = ""; + xml += ''; + xml += ''; + xml += ""; + var res = this.fiscalPrinter.send(this.url, xml); }, printFiscalXReport: function () { var xml = ""; - xml += ''; + xml += ''; xml += ""; this.fiscalPrinter.send(this.url, xml); }, @@ -575,8 +643,13 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { this.fiscalPrinter.send(this.url, xml); }, + /* + It need to be logged in to print the duplicate, the pw in data is 0212345 plus 93 spaces, total 100 chars + */ printFiscalReprintLast: function () { var xml = ""; + xml += + ''; xml += ''; xml += ""; this.fiscalPrinter.send(this.url, xml); @@ -588,6 +661,14 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) { xml += ""; this.fiscalPrinter.send(this.url, xml); }, + + resetPrinter: function () { + var xml = ""; + xml += ''; + xml += ''; + xml += ""; + this.fiscalPrinter.send(this.url, xml); + }, }); return { diff --git a/fiscal_epos_print/static/src/js/models.js b/fiscal_epos_print/static/src/js/models.js index 75603d101232..d57466b0950a 100644 --- a/fiscal_epos_print/static/src/js/models.js +++ b/fiscal_epos_print/static/src/js/models.js @@ -8,7 +8,9 @@ odoo.define("fiscal_epos_print.models", function (require) { var round_pr = utils.round_precision; var OrderSuper = models.Order; - models.load_fields("account.journal", [ + const {Gui} = require("point_of_sale.Gui"); + + models.load_fields("pos.payment.method", [ "fiscalprinter_payment_type", "fiscalprinter_payment_index", ]); @@ -114,6 +116,12 @@ odoo.define("fiscal_epos_print.models", function (require) { export_for_printing: function () { var res = _orderline_super.export_for_printing.call(this, arguments); res.tax_department = this.get_tax_details_r(); + if (!res.tax_department) { + Gui.showPopup("ErrorPopup", { + title: _t("Network error"), + body: _t("Manca iva su prodotto"), + }); + } if (res.tax_department.included_in_price == true) { res.full_price = this.price; } else { @@ -122,8 +130,8 @@ odoo.define("fiscal_epos_print.models", function (require) { return res; }, get_tax_details_r: function () { - var details = this.get_all_prices(); - for (var i in details.taxDetails) { + var detail = this.get_all_prices().taxDetails; + for (var i in detail) { return { code: this.pos.taxes_by_id[i].fpdeptax, taxname: this.pos.taxes_by_id[i].name, @@ -131,7 +139,8 @@ odoo.define("fiscal_epos_print.models", function (require) { tax_amount: this.pos.taxes_by_id[i].amount, }; } - this.pos.gui.show_popup("error", { + // TODO is this correct? + Gui.showPopup("ErrorPopup", { title: _t("Error"), body: _t("No taxes found"), }); @@ -143,6 +152,8 @@ odoo.define("fiscal_epos_print.models", function (require) { } return _orderline_super.set_quantity.call(this, quantity, keep_price); }, + + // TODO CONTROLLARE SE SERVE compute_all: function ( taxes, price_unit, @@ -165,30 +176,31 @@ odoo.define("fiscal_epos_print.models", function (require) { var base = total_excluded; var list_taxes = res.taxes; // Amount_type 'group' not handled (used only for purchases, in Italy) - _(taxes).each(function (tax) { + // _(taxes).each(function(tax) { + _(taxes).each(function (tax, index) { if (!no_map_tax) { tax = self._map_tax_fiscal_position(tax); } if (!tax) { return; } - var tax_amount = self._compute_all(tax, base, quantity); + var tax_amount = self._compute_all(tax[0], base, quantity); tax_amount = round_pr(tax_amount, currency_rounding); if (!tax_amount) { // Intervene here: also add taxes with 0 amount - if (tax.price_include) { + if (tax[0].price_include) { total_excluded -= tax_amount; base -= tax_amount; } else { total_included += tax_amount; } - if (tax.include_base_amount) { + if (tax[0].include_base_amount) { base += tax_amount; } var data = { - id: tax.id, + id: tax[0].id, amount: tax_amount, - name: tax.name, + name: tax[0].name, }; list_taxes.push(data); } @@ -208,8 +220,8 @@ odoo.define("fiscal_epos_print.models", function (require) { models.Paymentline = models.Paymentline.extend({ export_for_printing: function () { var res = original.apply(this, arguments); - res.type = this.cashregister.journal.fiscalprinter_payment_type; - res.type_index = this.cashregister.journal.fiscalprinter_payment_index; + res.type = this.payment_method.fiscalprinter_payment_type; + res.type_index = this.payment_method.fiscalprinter_payment_index; return res; }, }); diff --git a/fiscal_epos_print/static/src/js/popups.js b/fiscal_epos_print/static/src/js/popups.js index 2eca533a1ce6..7aff082bbd41 100644 --- a/fiscal_epos_print/static/src/js/popups.js +++ b/fiscal_epos_print/static/src/js/popups.js @@ -3,7 +3,7 @@ odoo.define("fiscal_epos_print.popups", function (require) { var core = require("web.core"); var popups = require("point_of_sale.popups"); - var gui = require("point_of_sale.gui"); + var gui = require("point_of_sale.Gui"); var _t = core._t; function addPadding(str, padding = 4) { diff --git a/fiscal_epos_print/static/src/js/pos_order_mgmt.js b/fiscal_epos_print/static/src/js/pos_order_mgmt.js index bfbc2acd2ce4..2646e53f82b3 100644 --- a/fiscal_epos_print/static/src/js/pos_order_mgmt.js +++ b/fiscal_epos_print/static/src/js/pos_order_mgmt.js @@ -1,3 +1,4 @@ +// TODO is this necessary? odoo.define("fiscal_epos_print.pos_order_mgmt", function (require) { "use strict"; diff --git a/fiscal_epos_print/static/src/js/screens.js b/fiscal_epos_print/static/src/js/screens.js deleted file mode 100644 index 4b1ed384e94e..000000000000 --- a/fiscal_epos_print/static/src/js/screens.js +++ /dev/null @@ -1,267 +0,0 @@ -odoo.define("fiscal_epos_print.screens", function (require) { - "use strict"; - - var core = require("web.core"); - var screens = require("point_of_sale.screens"); - var epson_epos_print = require("fiscal_epos_print.epson_epos_print"); - var _t = core._t; - var PaymentScreenWidget = screens.PaymentScreenWidget; - var ReceiptScreenWidget = screens.ReceiptScreenWidget; - var eposDriver = epson_epos_print.eposDriver; - - ReceiptScreenWidget.include({ - lock_screen: function (locked) { - this._super.apply(this, arguments); - if (locked) { - this.$(".receipt-sent").hide(); - this.$(".printing-error").show(); - this.$(".printing-retry").show(); - } else { - this.$(".receipt-sent").show(); - this.$(".printing-error").hide(); - this.$(".printing-retry").hide(); - } - }, - - sendToFP90Printer: function (receipt, printer_options) { - var fp90 = new eposDriver(printer_options, this); - fp90.printFiscalReceipt(receipt); - }, - - render_receipt: function () { - var self = this; - this._super(); - this.$(".printing-retry").click(function () { - if (self._locked) { - var currentOrder = self.pos.get_order(); - self.chrome.loading_show(); - self.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = currentOrder.getPrinterOptions(); - printer_options.order = currentOrder; - var receipt = currentOrder.export_for_printing(); - self.sendToFP90Printer(receipt, printer_options); - } - }); - }, - }); - - PaymentScreenWidget.include({ - show: function () { - this._super.apply(this, arguments); - if (this.pos.config.printer_ip) { - var currentOrder = this.pos.get_order(); - var printer_options = currentOrder.getPrinterOptions(); - var fp90 = new eposDriver(printer_options, this); - var amount = this.format_currency(currentOrder.get_total_with_tax()); - fp90.printDisplayText(_t("SubTotal") + " " + amount); - } - }, - sendToFP90Printer: function (receipt, printer_options) { - var fp90 = new eposDriver(printer_options, this); - fp90.printFiscalReceipt(receipt); - }, - finalize_validation: function () { - // We need to get currentOrder before calling the _super() - // otherwise we will likely get a empty order when we want to skip - // the receipt preview - var currentOrder = this.pos.get("selectedOrder"); - this._super.apply(this, arguments); - if (this.pos.config.printer_ip && !currentOrder.is_to_invoice()) { - this.chrome.loading_show(); - this.chrome.loading_message(_t("Connecting to the fiscal printer")); - var printer_options = currentOrder.getPrinterOptions(); - printer_options.order = currentOrder; - var receipt = currentOrder.export_for_printing(); - this.sendToFP90Printer(receipt, printer_options); - } - }, - order_is_valid: function (force_validation) { - if (this.pos.config.iface_tax_included == "subtotal") { - this.gui.show_popup("error", { - title: _t("Wrong tax configuration"), - body: _t( - "Product prices on receipts must be set to 'Tax-Included Price' in POS configuration" - ), - }); - return false; - } - var self = this; - var receipt = this.pos.get_order(); - if ( - receipt.has_refund && - (receipt.refund_date == null || - receipt.refund_date === "" || - receipt.refund_doc_num == null || - receipt.refund_doc_num == "" || - receipt.refund_cash_fiscal_serial == null || - receipt.refund_cash_fiscal_serial == "" || - receipt.refund_report == null || - receipt.refund_report == "") - ) { - this.gui.show_popup("error", { - title: _t("Refund Information Not Present"), - body: _t( - "The refund information aren't present. Please insert them before printing the receipt" - ), - }); - return false; - } - return this._super(force_validation); - }, - }); - - var set_refund_info_button = screens.ActionButtonWidget.extend({ - template: "SetRefundInfoButton", - init: function (parent, options) { - var self = this; - this._super(parent, options); - this.pos.bind( - "change:selectedOrder", - function () { - this.orderline_change(); - this.bind_order_events(); - }, - this - ); - this.bind_order_events(); - this.orderline_change(); - }, - renderElement: function () { - this._super(); - var color = this.refund_get_button_color(); - this.$el.css("background", color); - }, - button_click: function () { - var self = this; - var current_order = self.pos.get_order(); - self.gui.show_popup("refundinfo", { - title: _t("Refund Information Details"), - refund_date: current_order.refund_date, - refund_report: current_order.refund_report, - refund_doc_num: current_order.refund_doc_num, - refund_cash_fiscal_serial: current_order.refund_cash_fiscal_serial, - update_refund_info_button: function () { - self.renderElement(); - }, - }); - }, - bind_order_events: function () { - var self = this; - var order = this.pos.get_order(); - - if (!order) { - return; - } - - if (this.old_order) { - this.old_order.unbind(null, null, this); - } - - this.pos.bind("change:selectedOrder", this.orderline_change, this); - - var lines = order.orderlines; - lines.unbind("add", this.orderline_change, this); - lines.bind("add", this.orderline_change, this); - lines.unbind("remove", this.orderline_change, this); - lines.bind("remove", this.orderline_change, this); - lines.unbind("change", this.orderline_change, this); - lines.bind("change", this.orderline_change, this); - - this.old_order = order; - }, - refund_get_button_color: function () { - var order = this.pos.get_order(); - var color = "#e2e2e2"; - if (order) { - var lines = order.orderlines; - var has_refund = - lines.find(function (line) { - return line.quantity < 0.0; - }) != undefined; - if (has_refund == true) { - if ( - order.refund_date && - order.refund_date != "" && - order.refund_doc_num && - order.refund_doc_num != "" && - order.refund_cash_fiscal_serial && - order.refund_cash_fiscal_serial != "" && - order.refund_report && - order.refund_report != "" - ) { - color = "lightgreen"; - } else { - color = "red"; - } - } - } - return color; - }, - orderline_change: function () { - var order = this.pos.get_order(); - if (order) { - var lines = order.orderlines; - order.has_refund = - lines.find(function (line) { - return line.quantity < 0.0; - }) != undefined; - } - this.renderElement(); - }, - }); - - screens.define_action_button({ - name: "set_refund_info", - widget: set_refund_info_button, - }); - - // TODO Evaluate how to set lottery code without popup, automatically on barcode scanned - var set_lottery_code_button = screens.ActionButtonWidget.extend({ - template: "SetLotteryCodeButton", - init: function (parent, options) { - this._super(parent, options); - var self = this; - this.pos.bind( - "change:selectedOrder", - function () { - self.renderElement(); - }, - this - ); - }, - renderElement: function () { - this._super(); - var color = this.lottery_get_button_color(); - this.$el.css("background", color); - }, - button_click: function () { - var self = this; - var current_order = self.pos.get_order(); - self.gui.show_popup("lotterycode", { - title: _t("Lottery Code"), - lottery_code: current_order.lottery_code, - update_lottery_info_button: function () { - self.renderElement(); - }, - }); - }, - lottery_get_button_color: function () { - var order = this.pos.get_order(); - var color = "#e2e2e2"; - if (order && order.lottery_code) { - color = "lightgreen"; - } - return color; - }, - }); - - screens.define_action_button({ - name: "set_lottery_code", - widget: set_lottery_code_button, - }); - - return { - RefundInfoButtonActionWidget: set_refund_info_button, - LotteryCodeButtonActionWidget: set_lottery_code_button, - }; -}); diff --git a/fiscal_epos_print/static/src/xml/Chrome.xml b/fiscal_epos_print/static/src/xml/Chrome.xml new file mode 100644 index 000000000000..1a27399f1fd5 --- /dev/null +++ b/fiscal_epos_print/static/src/xml/Chrome.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonEPOSButton.xml b/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonEPOSButton.xml new file mode 100644 index 000000000000..7b7c5db2b60d --- /dev/null +++ b/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonEPOSButton.xml @@ -0,0 +1,14 @@ + + + + +
    + Epson ePOS +
    +
    + +
    diff --git a/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonFP81IIComponent.xml b/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonFP81IIComponent.xml new file mode 100644 index 000000000000..062c54008b28 --- /dev/null +++ b/fiscal_epos_print/static/src/xml/ChromeWidgets/EpsonFP81IIComponent.xml @@ -0,0 +1,113 @@ + + + + +
    +

    Epson ePOS

    + +
    + +
    + +
    +

    Operations

    +
      +
    • +
      + + Open CashDrawer + + + Open CashDrawer + +
      +
    • +
    • +
      + + Reprint Last Receipt + + + Reprint Last Receipt + +
      +
    • +
    +

    Reports

    +
      +
    • +
      + + IRA status + + + IRA status + +
      +
    • +
    • +
      + + Fiscal closure + + + Closure Report Z (Fiscal) + +
      +
    • +
    • +
      + + Fiscal closure + + + Financial Report X + +
      +
    • +
    +
    +
    +
    + +
    diff --git a/fiscal_epos_print/static/src/xml/ChromeWidgets/SetLotteryCodeButton.xml b/fiscal_epos_print/static/src/xml/ChromeWidgets/SetLotteryCodeButton.xml new file mode 100644 index 000000000000..caa1f91e20cc --- /dev/null +++ b/fiscal_epos_print/static/src/xml/ChromeWidgets/SetLotteryCodeButton.xml @@ -0,0 +1,11 @@ + + + + +
    + + Lottery Code +
    +
    + +
    diff --git a/fiscal_epos_print/static/src/xml/ChromeWidgets/SetRefundInfoButton.xml b/fiscal_epos_print/static/src/xml/ChromeWidgets/SetRefundInfoButton.xml new file mode 100644 index 000000000000..fded09a0246c --- /dev/null +++ b/fiscal_epos_print/static/src/xml/ChromeWidgets/SetRefundInfoButton.xml @@ -0,0 +1,11 @@ + + + + +
    + + Refund Data +
    +
    + +
    diff --git a/fiscal_epos_print/static/src/xml/Popups/RefundInfoPopup.xml b/fiscal_epos_print/static/src/xml/Popups/RefundInfoPopup.xml new file mode 100644 index 000000000000..430605b49c72 --- /dev/null +++ b/fiscal_epos_print/static/src/xml/Popups/RefundInfoPopup.xml @@ -0,0 +1,77 @@ + + + + + + + + + + diff --git a/fiscal_epos_print/static/src/xml/lottery.xml b/fiscal_epos_print/static/src/xml/lottery.xml index 193d8b3a5581..bf68fbb6ea1e 100644 --- a/fiscal_epos_print/static/src/xml/lottery.xml +++ b/fiscal_epos_print/static/src/xml/lottery.xml @@ -1,12 +1,13 @@ - + +