From 72dc9e40362a877414ec147ccae9d4cdbe4554f5 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Thu, 13 Oct 2022 14:36:11 -0400 Subject: [PATCH 01/46] [WIP] l10n_do_accounting: v16 migration --- l10n_do_accounting/__manifest__.py | 4 ++-- l10n_do_accounting/views/account_move_views.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index be43b2e27..4a0cc935c 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "16.0.0.0.0", + "version": "16.0.0.0.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded @@ -33,7 +33,7 @@ "demo": [ "demo/res_partner_demo.xml", ], - "installable": False, + "installable": True, "auto_install": False, "application": False, } diff --git a/l10n_do_accounting/views/account_move_views.xml b/l10n_do_accounting/views/account_move_views.xml index ac0fbbe1d..7d7ff63d5 100644 --- a/l10n_do_accounting/views/account_move_views.xml +++ b/l10n_do_accounting/views/account_move_views.xml @@ -88,7 +88,7 @@ - + From 60fdc3bf735a5d9f2b131b4ffa5498aa30bd0507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Thu, 27 Oct 2022 13:35:49 -0400 Subject: [PATCH 02/46] [FIX] l10n_do_accounting: analytic accounts removed when invoice canceled (#1012) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/wizard/account_move_cancel.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 8fd61515a..382cff780 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.6.6", + "version": "15.0.0.7.0", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/wizard/account_move_cancel.py b/l10n_do_accounting/wizard/account_move_cancel.py index 6aad3baa7..34c681f15 100644 --- a/l10n_do_accounting/wizard/account_move_cancel.py +++ b/l10n_do_accounting/wizard/account_move_cancel.py @@ -42,6 +42,7 @@ def move_cancel(self): # we call button_cancel() so dependency chain is # not broken in other modules extending that function + invoice.mapped("line_ids.analytic_line_ids").unlink() invoice.with_context(skip_cancel_wizard=True).button_cancel() invoice.l10n_do_cancellation_type = self.l10n_do_cancellation_type From 3dca496668d7807bd478e7f29eee5e36c3167b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Thu, 29 Dec 2022 21:14:05 -0400 Subject: [PATCH 03/46] [FIX] l10n_do_accounting: wrong document type behavior (#854) (#1019) --- l10n_do_accounting/models/account_journal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/l10n_do_accounting/models/account_journal.py b/l10n_do_accounting/models/account_journal.py index 4e6146d24..805bc7ae9 100644 --- a/l10n_do_accounting/models/account_journal.py +++ b/l10n_do_accounting/models/account_journal.py @@ -142,7 +142,9 @@ def _get_journal_codes(self): self.ensure_one() if self.type == "purchase": return [] - return ["E"] if self.company_id.l10n_do_ecf_issuer else ["B"] + elif self.type == "sale" and self.company_id.l10n_do_ecf_issuer: + return ["E"] + return ["B"] def _l10n_do_create_document_types(self): self.ensure_one() From a24d7c7b7d4686aca71a0da09c5d7d1701e6aca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Tue, 3 Jan 2023 18:32:16 -0400 Subject: [PATCH 04/46] [FIX] l10n_do_accounting: wrong amount on qr stamp (#1020) (#1022) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 382cff780..73eb0164e 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.7.0", + "version": "15.0.0.7.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 62afad09a..c8b0a44d2 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -293,6 +293,7 @@ def _compute_l10n_do_electronic_stamp(self): l10n_do_total = ( l10n_do_amounts["itbis_taxable_amount"] + l10n_do_amounts["itbis_amount"] + + l10n_do_amounts["itbis_exempt_amount"] ) qr_string += "MontoTotal=%s&" % ("%f" % l10n_do_total).rstrip("0").rstrip( From 42ef0ad973655d5b078ecacade786af5900345c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Mon, 16 Jan 2023 20:22:48 -0400 Subject: [PATCH 05/46] [14.0][REF] l10n_do_accounting: test company address (#1023) * [REF] l10n_do_accounting: test company address * [REF] l10n_do_accounting: missing 'testing' context --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/tests/common.py | 1 + l10n_do_accounting/tests/test_account_move.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 73eb0164e..051d1669a 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.7.1", + "version": "15.0.0.7.2", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/tests/common.py b/l10n_do_accounting/tests/common.py index 20e1e088b..7d8319d76 100644 --- a/l10n_do_accounting/tests/common.py +++ b/l10n_do_accounting/tests/common.py @@ -13,6 +13,7 @@ def setUpClass(cls, chart_template_ref="l10n_do.do_chart_template"): "INDEXA SRL", chart_template=cls.env.ref(chart_template_ref), vat="131793916", + street="dummy address", country_id=cls.env.ref("base.do").id, )["company"] cls.fiscal_partner = cls.env["res.partner"].create( diff --git a/l10n_do_accounting/tests/test_account_move.py b/l10n_do_accounting/tests/test_account_move.py index a7753ace6..85c1511e0 100644 --- a/l10n_do_accounting/tests/test_account_move.py +++ b/l10n_do_accounting/tests/test_account_move.py @@ -582,7 +582,7 @@ def test_005_company_in_contingency(self): "document_number": "E310000000001", } ) - sale_invoice_1_id._post() + sale_invoice_1_id.with_context(testing=True)._post() self.do_company.l10n_do_ecf_issuer = False From d418fe64ba9d4de9a2f18c2f8b2554175c02b09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Thu, 19 Jan 2023 13:41:37 -0400 Subject: [PATCH 06/46] [REF] l10n_do_accounting: send 'testing' key through context to prevent ecf sending (#1024) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/tests/test_account_move.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 051d1669a..7dbcce0fb 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.7.2", + "version": "15.0.0.7.3", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/tests/test_account_move.py b/l10n_do_accounting/tests/test_account_move.py index 85c1511e0..5c49dd938 100644 --- a/l10n_do_accounting/tests/test_account_move.py +++ b/l10n_do_accounting/tests/test_account_move.py @@ -619,7 +619,7 @@ def test_006_invoice_electronic_stamp(self): } ) self.assertEqual(sale_invoice_1_id.l10n_do_electronic_stamp, stamp) - sale_invoice_1_id._post() + sale_invoice_1_id.with_context(testing=True)._post() def test_007_unique_sequence_number(self): """ From d5e10c4d028fd68e931e563f087033d5b6ed5349 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Thu, 19 Jan 2023 17:49:27 -0400 Subject: [PATCH 07/46] [REF] l10n_do_accounting: change the way to get ECF env for QR stamp --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 7 +++++-- l10n_do_accounting/tests/test_account_move.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 7dbcce0fb..493c51a99 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.7.3", + "version": "15.0.0.8.0", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index c8b0a44d2..d870596f0 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -254,7 +254,6 @@ def _compute_company_in_contingency(self): ) @api.depends("l10n_do_ecf_security_code", "l10n_do_ecf_sign_date", "invoice_date") - @api.depends_context("l10n_do_ecf_service_env") def _compute_l10n_do_electronic_stamp(self): l10n_do_ecf_invoice = self.filtered( @@ -265,7 +264,11 @@ def _compute_l10n_do_electronic_stamp(self): for invoice in l10n_do_ecf_invoice: - ecf_service_env = self.env.context.get("l10n_do_ecf_service_env", "CerteCF") + if hasattr(invoice.company_id, "l10n_do_ecf_service_env"): + ecf_service_env = invoice.company_id.l10n_do_ecf_service_env + else: + ecf_service_env = "TesteCF" + doc_code_prefix = invoice.l10n_latam_document_type_id.doc_code_prefix is_rfc = ( # Es un Resumen Factura Consumo doc_code_prefix == "E32" and invoice.amount_total_signed < 250000 diff --git a/l10n_do_accounting/tests/test_account_move.py b/l10n_do_accounting/tests/test_account_move.py index 5c49dd938..b61a09b41 100644 --- a/l10n_do_accounting/tests/test_account_move.py +++ b/l10n_do_accounting/tests/test_account_move.py @@ -598,7 +598,7 @@ def test_006_invoice_electronic_stamp(self): Check invoice electronic stamp feature works properly """ stamp = ( - "https%3A%2F%2Fecf.dgii.gov.do%2FCerteCF%2FConsultaTimbre%3FRncEmisor" + "https%3A%2F%2Fecf.dgii.gov.do%2FTesteCF%2FConsultaTimbre%3FRncEmisor" "%3D131793916%26RncComprador%3D131566332%26ENCF%3DE310000000001%26Fec" "haEmision%3D16-10-2021%26MontoTotal%3D118%26FechaFirma%3D16-10-2021%" "252000%3A00%3A00%26CodigoSeguridad%3Du83ac1" From 3071730a960ca5a3ae5dd60c3963ce036a5b0cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Wed, 25 Jan 2023 14:49:03 -0400 Subject: [PATCH 08/46] [IMP] l10n_do_accounting: eval context key to use resequence feature (#1027) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/wizard/account_resequence.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 493c51a99..facad9c5d 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.8.0", + "version": "15.0.0.8.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/wizard/account_resequence.py b/l10n_do_accounting/wizard/account_resequence.py index ceb7f8bd7..5be8d0c09 100644 --- a/l10n_do_accounting/wizard/account_resequence.py +++ b/l10n_do_accounting/wizard/account_resequence.py @@ -12,6 +12,7 @@ def default_get(self, fields_list): "active_model" in ctx and ctx["active_model"] == "account.move" and "active_ids" in ctx + and "skip_validation" not in ctx ): l10n_do_move_ids = ( self.env["account.move"] From d66c7c83585e34ca533bf05b9790bac173877258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Sat, 4 Feb 2023 10:07:33 -0400 Subject: [PATCH 09/46] [IMP] l10n_do_accounting: improve l10n_do amounts calc (#1030) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 20 ++++++++++++++------ l10n_do_accounting/views/report_invoice.xml | 3 +-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index facad9c5d..4c8bcaf74 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.8.1", + "version": "15.0.0.9.0", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index d870596f0..94893b12b 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -227,6 +227,17 @@ def _get_l10n_do_amounts(self, company_currency=False): for line in itbis_taxed_product_lines if any(True for tax in line.tax_ids if tax.amount == 0) ), + "invoice_total": self.amount_untaxed + + sum( + ( + line.debit or line.credit + if self.currency_id == self.company_id.currency_id + else abs(line.amount_currency) + ) + for line in self.line_ids.filtered( + lambda l: l.tax_line_id and l.tax_line_id.amount > 0 + ) + ), } @api.depends( @@ -292,12 +303,9 @@ def _compute_l10n_do_electronic_stamp(self): invoice.invoice_date or fields.Date.today() ).strftime("%d-%m-%Y") - l10n_do_amounts = invoice._get_l10n_do_amounts(company_currency=True) - l10n_do_total = ( - l10n_do_amounts["itbis_taxable_amount"] - + l10n_do_amounts["itbis_amount"] - + l10n_do_amounts["itbis_exempt_amount"] - ) + l10n_do_total = invoice._get_l10n_do_amounts(company_currency=True)[ + "invoice_total" + ] qr_string += "MontoTotal=%s&" % ("%f" % l10n_do_total).rstrip("0").rstrip( "." diff --git a/l10n_do_accounting/views/report_invoice.xml b/l10n_do_accounting/views/report_invoice.xml index e7c9fe281..e9e6714b7 100644 --- a/l10n_do_accounting/views/report_invoice.xml +++ b/l10n_do_accounting/views/report_invoice.xml @@ -212,8 +212,7 @@ Total - + From 27692281b200e7a78c21b8b14f8eaeb14f788713 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Mon, 6 Feb 2023 10:51:37 -0400 Subject: [PATCH 10/46] [FIX] l10n_do_accounting: get amount total in company currency --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 4c8bcaf74..2c55cb08a 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.9.0", + "version": "15.0.0.9.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 94893b12b..b41a5e612 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -227,7 +227,7 @@ def _get_l10n_do_amounts(self, company_currency=False): for line in itbis_taxed_product_lines if any(True for tax in line.tax_ids if tax.amount == 0) ), - "invoice_total": self.amount_untaxed + "invoice_total": abs(self.amount_untaxed_signed) + sum( ( line.debit or line.credit From 316392c94025750ed3247f0b1e6609bbf64f2ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Wed, 8 Feb 2023 13:55:34 -0400 Subject: [PATCH 11/46] [FIX] l10n_do_accounting: split company and invoice total amounts (#1033) --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 2c55cb08a..5f7a4a6b0 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.9.1", + "version": "15.0.0.9.2", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index b41a5e612..23960c1e9 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -227,7 +227,18 @@ def _get_l10n_do_amounts(self, company_currency=False): for line in itbis_taxed_product_lines if any(True for tax in line.tax_ids if tax.amount == 0) ), - "invoice_total": abs(self.amount_untaxed_signed) + "company_invoice_total": abs(self.amount_untaxed_signed) + + sum( + ( + line.debit or line.credit + if self.currency_id == self.company_id.currency_id + else abs(line.amount_currency) + ) + for line in self.line_ids.filtered( + lambda l: l.tax_line_id and l.tax_line_id.amount > 0 + ) + ), + "invoice_total": abs(self.amount_untaxed) + sum( ( line.debit or line.credit @@ -304,7 +315,7 @@ def _compute_l10n_do_electronic_stamp(self): ).strftime("%d-%m-%Y") l10n_do_total = invoice._get_l10n_do_amounts(company_currency=True)[ - "invoice_total" + "company_invoice_total" ] qr_string += "MontoTotal=%s&" % ("%f" % l10n_do_total).rstrip("0").rstrip( From f2363f51dd9bfbfc170f31feaacd26d5c26069f7 Mon Sep 17 00:00:00 2001 From: Daniel Alexander Pereyra Beltran <95594662+DanielAPereyraB@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:03:02 -0400 Subject: [PATCH 12/46] [14.0][IMP] l10n_do_accounting: improvement in name_search (#1035) * [IMP]l10n_do_accounting: improvement in name_search * black solution * black solution --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 5f7a4a6b0..8995a6b7e 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.9.2", + "version": "15.0.0.9.3", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 23960c1e9..ff9f4649b 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -3,6 +3,7 @@ from werkzeug import urls from odoo import models, fields, api, _ +from odoo.osv import expression from odoo.exceptions import ValidationError, UserError, AccessError @@ -150,6 +151,22 @@ def init(self): ) ) + @api.model + def _name_search( + self, name="", args=None, operator="ilike", limit=100, name_get_uid=None + ): + args = args or [] + domain = [] + if name: + domain = [ + "|", + ("name", operator, name), + ("l10n_do_fiscal_number", operator, name), + ] + return self._search( + expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid + ) + @api.depends( "journal_id.l10n_latam_use_documents", "l10n_latam_manual_document_number", From d211f55a4750aca95ba6133ad030ab888999c395 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Mon, 6 Mar 2023 12:20:27 -0400 Subject: [PATCH 13/46] [REF] workflows: update actions --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5fb2e839b..3b7f60a3c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ on: pull_request: branches: - '[0-9]+.0' - types: [ labeled ] + types: [ opened, synchronize, reopened, labeled ] env: REQUIRED_MODULES: # list of addional addons to install separated by comma From 647fc13d7304b7f685c466b3179b595ad066e4c2 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Mon, 6 Mar 2023 12:45:22 -0400 Subject: [PATCH 14/46] [REF] l10n_do_accounting: using new _rec_names_search class attribute --- l10n_do_accounting/models/account_move.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index ff9f4649b..31b19ff86 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -3,12 +3,12 @@ from werkzeug import urls from odoo import models, fields, api, _ -from odoo.osv import expression from odoo.exceptions import ValidationError, UserError, AccessError class AccountMove(models.Model): _inherit = "account.move" + _rec_names_search = ["l10n_do_fiscal_number"] _l10n_do_sequence_field = "l10n_do_fiscal_number" _l10n_do_sequence_fixed_regex = r"^(?P.*?)(?P\d{0,8})$" @@ -151,22 +151,6 @@ def init(self): ) ) - @api.model - def _name_search( - self, name="", args=None, operator="ilike", limit=100, name_get_uid=None - ): - args = args or [] - domain = [] - if name: - domain = [ - "|", - ("name", operator, name), - ("l10n_do_fiscal_number", operator, name), - ] - return self._search( - expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid - ) - @api.depends( "journal_id.l10n_latam_use_documents", "l10n_latam_manual_document_number", From 107f6fbb3c785a165bdb98e754029b744f7159f7 Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Mon, 6 Mar 2023 12:52:09 -0400 Subject: [PATCH 15/46] [REF] l10n_do_accounting: use v16 flush and index --- l10n_do_accounting/models/account_move.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 31b19ff86..2f9694c1a 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -108,7 +108,7 @@ def _get_l10n_do_income_type(self): ) l10n_do_fiscal_number = fields.Char( "Fiscal Number", - index=True, + index="trigram", tracking=True, copy=False, help="Stored field equivalent of l10n_latam_document number", @@ -349,7 +349,7 @@ def _check_unique_sequence_number(self): and inv.state == "posted" ) if l10n_do_invoices: - self.flush( + self.flush_model( ["name", "journal_id", "move_type", "state", "l10n_do_fiscal_number"] ) self._cr.execute( @@ -789,7 +789,7 @@ def _get_last_sequence(self, relaxed=False, with_prefix=None, lock=True): field=self._l10n_do_sequence_field, ) - self.flush( + self.flush_model( [ self._l10n_do_sequence_field, "l10n_do_sequence_number", From 940525630b1385818cc8b347102ce53a3a24f7db Mon Sep 17 00:00:00 2001 From: Jose Lopez Date: Tue, 7 Mar 2023 09:57:45 -0400 Subject: [PATCH 16/46] [REM] l10n_do_pos: remove deprecated module --- l10n_do_pos/README.rst | 0 l10n_do_pos/__init__.py | 1 - l10n_do_pos/__manifest__.py | 27 - l10n_do_pos/i18n/es_DO.po | 992 ---------------- l10n_do_pos/models/__init__.py | 4 - l10n_do_pos/models/ir_sequence.py | 11 - l10n_do_pos/models/pos_config.py | 71 -- l10n_do_pos/models/pos_order.py | 364 ------ l10n_do_pos/models/pos_session.py | 9 - l10n_do_pos/security/ir.model.access.csv | 2 - l10n_do_pos/static/description/icon.png | Bin 15070 -> 0 bytes l10n_do_pos/static/src/css/pos.css | 304 ----- l10n_do_pos/static/src/img/icon-cross.png | Bin 436 -> 0 bytes l10n_do_pos/static/src/img/icon-features.png | Bin 341 -> 0 bytes l10n_do_pos/static/src/img/icon-help.png | Bin 469 -> 0 bytes l10n_do_pos/static/src/img/icon-support.png | Bin 315 -> 0 bytes l10n_do_pos/static/src/img/icon.png | Bin 3981 -> 0 bytes l10n_do_pos/static/src/js/models.js | 598 ---------- l10n_do_pos/static/src/js/screens.js | 1077 ------------------ l10n_do_pos/static/src/xml/pos.xml | 575 ---------- l10n_do_pos/static/src/xml/posticket.xml | 241 ---- l10n_do_pos/views/assets.xml | 10 - l10n_do_pos/views/pos_config_views.xml | 76 -- l10n_do_pos/views/pos_order_views.xml | 60 - 24 files changed, 4422 deletions(-) delete mode 100644 l10n_do_pos/README.rst delete mode 100644 l10n_do_pos/__init__.py delete mode 100644 l10n_do_pos/__manifest__.py delete mode 100644 l10n_do_pos/i18n/es_DO.po delete mode 100644 l10n_do_pos/models/__init__.py delete mode 100644 l10n_do_pos/models/ir_sequence.py delete mode 100644 l10n_do_pos/models/pos_config.py delete mode 100644 l10n_do_pos/models/pos_order.py delete mode 100644 l10n_do_pos/models/pos_session.py delete mode 100644 l10n_do_pos/security/ir.model.access.csv delete mode 100644 l10n_do_pos/static/description/icon.png delete mode 100644 l10n_do_pos/static/src/css/pos.css delete mode 100644 l10n_do_pos/static/src/img/icon-cross.png delete mode 100644 l10n_do_pos/static/src/img/icon-features.png delete mode 100644 l10n_do_pos/static/src/img/icon-help.png delete mode 100644 l10n_do_pos/static/src/img/icon-support.png delete mode 100644 l10n_do_pos/static/src/img/icon.png delete mode 100644 l10n_do_pos/static/src/js/models.js delete mode 100644 l10n_do_pos/static/src/js/screens.js delete mode 100644 l10n_do_pos/static/src/xml/pos.xml delete mode 100644 l10n_do_pos/static/src/xml/posticket.xml delete mode 100644 l10n_do_pos/views/assets.xml delete mode 100644 l10n_do_pos/views/pos_config_views.xml delete mode 100644 l10n_do_pos/views/pos_order_views.xml diff --git a/l10n_do_pos/README.rst b/l10n_do_pos/README.rst deleted file mode 100644 index e69de29bb..000000000 diff --git a/l10n_do_pos/__init__.py b/l10n_do_pos/__init__.py deleted file mode 100644 index 0650744f6..000000000 --- a/l10n_do_pos/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import models diff --git a/l10n_do_pos/__manifest__.py b/l10n_do_pos/__manifest__.py deleted file mode 100644 index 98c39927d..000000000 --- a/l10n_do_pos/__manifest__.py +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Fiscal POS (Rep. Dominicana)", - "summary": """Incorpora funcionalidades de facturación con NCF al POS.""", - "author": "Xmarts, " "Indexa, " "Iterativo SRL", - "license": "LGPL-3", - "website": "https://github.com/odoo-dominicana", - "category": "Localization", - "version": "13.0.0.1.1", - "depends": [ - "point_of_sale", - "l10n_do_accounting", - ], - "data": [ - "security/ir.model.access.csv", - "views/assets.xml", - "views/pos_config_views.xml", - "views/pos_order_views.xml", - ], - "qweb": [ - "static/src/xml/pos.xml", - "static/src/xml/posticket.xml", - ], - 'demo': [ - - ], - 'installable': False, -} diff --git a/l10n_do_pos/i18n/es_DO.po b/l10n_do_pos/i18n/es_DO.po deleted file mode 100644 index c0bb602fe..000000000 --- a/l10n_do_pos/i18n/es_DO.po +++ /dev/null @@ -1,992 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_do_pos -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-05 23:22+0000\n" -"PO-Revision-Date: 2021-04-05 19:38-0400\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"Language: es_DO\n" -"X-Generator: Poedit 2.4.2\n" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "$/Und." -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "% discount" -msgstr "% descuento" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "(Unavailable In POS)" -msgstr "(No disponible en PdV)" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "All Invoices" -msgstr "Todas las facturas" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__amount -#, python-format -msgid "Amount" -msgstr "Importe" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Are you sure you want to create this refund order?" -msgstr "¿Está seguro que desea crear esta devolución?" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Back" -msgstr "Atrás" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Cajero/a.:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Cambio:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Cancel" -msgstr "Cancelar" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Cant." -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Cant. devuelta." -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Cantidad" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Cliente" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Cliente..:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Cliente:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Completar Devolución" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Confirm" -msgstr "Confirmar" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_latam_country_code -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_latam_country_code -msgid "Country Code" -msgstr "Código País" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__create_uid -msgid "Created by" -msgstr "Creado por" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__create_date -msgid "Created on" -msgstr "Creado en" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_payment_credit_note_ids -msgid "Credit Note payments" -msgstr "Notas de Crédito" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_view_pos_pos_form -msgid "Credit Notes" -msgstr "Notas de Crédito" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__account_move_id -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_order__state__is_l10n_do_return_order -msgid "Credit note" -msgstr "Nota de Crédito" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__currency_id -msgid "Currency" -msgstr "Moneda" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Customer" -msgstr "Cliente" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Código..:" -msgstr "" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_pos_config_view_form -msgid "Default customer" -msgstr "Cliente predeterminado" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_do_default_partner_id -msgid "Default partner" -msgstr "Contacto predeterminado" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Descuento(%)" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Descuento:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Detalles de la Orden" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Devoluciones" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Devolver" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Devolver Productos" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__display_name -msgid "Display Name" -msgstr "Nombre mostrado" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_latam_document_type_id -msgid "Document Type" -msgstr "Tipo Comprobante" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Document type" -msgstr "Tipo Comprobante" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Edit" -msgstr "Editar" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "El balance de la Nota de Credito es 0." -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Error: Could not Save Changes" -msgstr "Error: no se pueden guardar los cambios" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Estado" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Factura de" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Fecha Orden" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Fecha....:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Fecha:" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_latam_document_number -msgid "Fiscal Number" -msgstr "NCF" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_latam_sequence_id -msgid "Fiscal Sequence" -msgstr "Secuencia Fiscal" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/models.js:0 -#, python-format -msgid "Fiscal document type not found" -msgstr "Tipo de comprobante no encontrado" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_view_pos_pos_form -msgid "Fiscal info" -msgstr "Información fiscal" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "" -"For invoice fiscal type it is necessary for the customer have RNC or Céd." -msgstr "Para Factura Fiscal es necesario RNC/Cédula en el cliente." - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "" -"For invoice fiscal type its necessary customer, please select customer" -msgstr "" -"Para Factura Fiscal es necesario un cliente. Por favor seleccione uno" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "For this sale it is necessary for the customer have ID" -msgstr "" -"Para este tipo de venta es necesario que el cliente tenga un RNC/Cédula" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_order__l10n_do_return_status__fully_returned -msgid "Fully returned" -msgstr "Completamente devuelto" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__id -msgid "ID" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "ITBIS" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,help:l10n_do_pos.field_pos_config__l10n_latam_use_documents -msgid "" -"If active: will be using for legal invoicing (invoices, debit/credit " -"notes). If not set means that will be used to register accounting entries " -"not related to invoicing legal documents. For Example: Receipts, Tax " -"Payments, Register journal entries" -msgstr "" -"Si está activo: será usado para facturas fiscales, notas de débito y " -"crédito. De lo contrario puede ser usado para registros contables no " -"relacionados con facturas fiscales. Por ejemplo, recibos, pago de " -"impuestos, asientos" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Impuesto" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_latam_use_documents -msgid "L10N Latam Use Documents" -msgstr "Es fiscal" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "La Nota de Crédito Pertenece a Otro Cliente" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "La nota de credito no existe." -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_do_number_of_days -msgid "Last Days (invoices)" -msgstr "Últimos ’n’ días (facturas)" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_do_credit_notes_number_of_days -msgid "Last Days (refunds)" -msgstr "Últimos ’n’ días (reembolsos)" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note____last_update -msgid "Last Modified on" -msgstr "Última modificación en" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__write_uid -msgid "Last Updated by" -msgstr "Última actualización por" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__write_date -msgid "Last Updated on" -msgstr "Última actualización en" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_pos_config_view_form -msgid "List Orders" -msgstr "Listar ordenes" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_config__l10n_do_order_loading_options__current_session -msgid "Load current session orders" -msgstr "Cargar ordenes de la sesión actual" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_config__l10n_do_order_loading_options__n_days -msgid "Load last 'n' days orders" -msgstr "Cargar las ordenes de los últimos ’n’ días" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_do_order_loading_options -msgid "Loading options" -msgstr "Opciones de carga" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_origin_ncf -msgid "Modified NCF" -msgstr "NCF modificado" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_return_order_id -msgid "Modifies" -msgstr "Afecta a" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Monto" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Métodos de pago:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "N/A" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "NC/Devolución" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "NC/Devolución:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "NCF" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "NCF Modificado:" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_ncf_expiration_date -msgid "NCF expiration date" -msgstr "Fecha Expiración NCF" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "NCF:" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__name -msgid "Name" -msgstr "Nombre" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "No customer" -msgstr "No cliente" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "" -"No quedan productos retornables en esta orden. Tal vez los productos son No " -"Retornables o no estan disponibles en el Punto de Venta!!" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "No se puede devolver esta Orden!!!" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Nombre:" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_order__l10n_do_return_status__non_returnable -msgid "Non Returnable" -msgstr "No reembolsable" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Not fiscal sequence" -msgstr "No secuencia fiscal" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_order__l10n_do_return_status__- -msgid "Not returned" -msgstr "No reembolsado" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Número de Pedido" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_line__l10n_do_original_line_id -msgid "Original line" -msgstr "Línea original" - -#. module: l10n_do_pos -#: model:ir.model,name:l10n_do_pos.model_pos_order_payment_credit_note -msgid "POS Credit Notes" -msgstr "Notas de Crédito PdV" - -#. module: l10n_do_pos -#: model:ir.model.fields.selection,name:l10n_do_pos.selection__pos_order__l10n_do_return_status__partially_returned -msgid "Partially Returned" -msgstr "Parcialmente reembolsada" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Payment" -msgstr "Pagos" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Please check if RNC or Cédula is correct" -msgstr "Por favor marque si el RNC/Cédula es correcto" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Please configure correct fiscal sequence in invoice journal" -msgstr "" -"Por favor configure correctamente las secuencias fiscales en el diario de " -"facturas" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "" -"Please select a customer or set one as default in the point of sale settings" -msgstr "" -"Por favor seleccione un cliente o coloque uno predeterminado en la " -"configuración del Punto de Ventas" - -#. module: l10n_do_pos -#: model:ir.model,name:l10n_do_pos.model_pos_config -msgid "Point of Sale Configuration" -msgstr "Configuración del TPV" - -#. module: l10n_do_pos -#: model:ir.model,name:l10n_do_pos.model_pos_order_line -msgid "Point of Sale Order Lines" -msgstr "Líneas de Orden de Punto de Venta" - -#. module: l10n_do_pos -#: model:ir.model,name:l10n_do_pos.model_pos_order -msgid "Point of Sale Orders" -msgstr "Pedidos del TPV" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Precio" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Precio Unitario" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Product" -msgstr "Producto" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Producto" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Producto (" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Quantity" -msgstr "Cantidad" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "RNC/Céd..:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "RNC:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Refund Order" -msgstr "Orden reembolso" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Refunded" -msgstr "Reembolsado" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Required document (RNC/Céd.)" -msgstr "Documento requerido (RNC/Céd.)" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_line__l10n_do_line_qty_returned -msgid "Return line" -msgstr "Línea reembolso" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_is_return_order -msgid "Return order" -msgstr "Orden reembolso" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__l10n_do_return_status -msgid "Return status" -msgstr "Estado reembolso" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Sale greater than RD$ 250,000.00" -msgstr "Venta mayor a RD$250,000.00" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Sale in" -msgstr "Venta en" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Search" -msgstr "Búsqueda" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Search Invoices" -msgstr "Buscar facturas" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_pos_config_view_form -msgid "Select days before for Credit Notes" -msgstr "Seleccione los días anterior a Nota de Crédito" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Select document type" -msgstr "Seleccione Tipo de Comprobante" - -#. module: l10n_do_pos -#: model_terms:ir.ui.view,arch_db:l10n_do_pos.l10n_do_pos_pos_config_view_form -msgid "Select to load orders" -msgstr "Seleccione para cargar ordenes" - -#. module: l10n_do_pos -#: model:ir.model,name:l10n_do_pos.model_ir_sequence -msgid "Sequence" -msgstr "Secuencia" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order__state -msgid "Status" -msgstr "Estado" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "SubTotal:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Tax ID" -msgstr "RNC/Cédula" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Taxes" -msgstr "Impuestos" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Taxpayer Type" -msgstr "Tipo Contribuyente" - -#. module: l10n_do_pos -#: model:ir.model.fields,help:l10n_do_pos.field_pos_config__l10n_latam_country_code -#: model:ir.model.fields,help:l10n_do_pos.field_pos_order__l10n_latam_country_code -msgid "Technical field used to hide/show fields regarding the localization" -msgstr "Campo técnico para mostrar/ocultar campos dependiendo la localización" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Telefono.:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/models.js:0 -#, python-format -msgid "This fiscal document type not exist." -msgstr "Este documento no existe." - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "This not RNC or Cédula" -msgstr "No es un RNC/Cédula" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "This order has no pending balance." -msgstr "La orden no tiene balance pendiente." - -#. module: l10n_do_pos -#: code:addons/l10n_do_pos/models/pos_order.py:0 -#, python-format -msgid "This point of sale does not have a default customer." -msgstr "Punto de Ventas no tiene cliente predeterminado." - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/pos.xml:0 -#, python-format -msgid "Total" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Total:" -msgstr "" - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_config__l10n_latam_use_documents -msgid "Use Documents?" -msgstr "Es fiscal?" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Valor" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Vendedor/a.:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "Válida hasta:" -msgstr "" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Warning !!!" -msgstr "Advertencia!!!" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Warning!!!" -msgstr "Advertencia!!" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/xml/posticket.xml:0 -#, python-format -msgid "With a" -msgstr "Con un" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "You cannot make sales in 0, please add a product with value" -msgstr "" -"No puede vender por monto cero (0). Por favor seleccione producto con valor" - -#. module: l10n_do_pos -#: code:addons/l10n_do_pos/models/pos_config.py:0 -#, python-format -msgid "You have to set a number of days." -msgstr "Debe seleccionar un número de días" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "" -"You need to select a customer with RNC/Céd for this fiscal type, place " -"writes RNC/Céd" -msgstr "" -"Debe seleccionar un cliente con RNC/Cédula para este Tipo de Comprobante. " -"Coloque un RNC/Céd en el cliente" - -#. module: l10n_do_pos -#. openerp-web -#: code:addons/l10n_do_pos/static/src/js/screens.js:0 -#, python-format -msgid "Your Internet connection is probably down." -msgstr "Su conexión de Internet está probablemente caída." - -#. module: l10n_do_pos -#: model:ir.model.fields,field_description:l10n_do_pos.field_pos_order_payment_credit_note__pos_order_id -msgid "order" -msgstr "Orden" - -#. module: l10n_do_pos -#: code:addons/l10n_do_pos/models/pos_config.py:0 -#, python-format -msgid "" -"You cannot set a Fiscal Journal as Sales Journal. Please, select a non-fiscal journal." -msgstr "No puede establecer un Diario Fiscal como diario de ventas. Por favor, seleccione un diario no fiscal." \ No newline at end of file diff --git a/l10n_do_pos/models/__init__.py b/l10n_do_pos/models/__init__.py deleted file mode 100644 index 4d9fad81f..000000000 --- a/l10n_do_pos/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from . import pos_config -from . import pos_order -from . import ir_sequence -from . import pos_session diff --git a/l10n_do_pos/models/ir_sequence.py b/l10n_do_pos/models/ir_sequence.py deleted file mode 100644 index d3bf908d0..000000000 --- a/l10n_do_pos/models/ir_sequence.py +++ /dev/null @@ -1,11 +0,0 @@ -from odoo import models - - -class IrSequence(models.Model): - _inherit = "ir.sequence" - - def get_l10n_do_fiscal_info(self): - return { - "ncf": self.next_by_id(), - "expiration_date": self.expiration_date, - } diff --git a/l10n_do_pos/models/pos_config.py b/l10n_do_pos/models/pos_config.py deleted file mode 100644 index 19b410a3e..000000000 --- a/l10n_do_pos/models/pos_config.py +++ /dev/null @@ -1,71 +0,0 @@ -from odoo import models, fields, api, _ -from odoo.exceptions import UserError, ValidationError - - -class PosConfig(models.Model): - _inherit = "pos.config" - - l10n_do_default_partner_id = fields.Many2one( - "res.partner", - string="Default partner", - ) - l10n_do_order_loading_options = fields.Selection( - [ - ("current_session", "Load current session orders"), - ("n_days", "Load last 'n' days orders"), - ], - default="current_session", - string="Loading options", - ) - l10n_do_number_of_days = fields.Integer( - string="Last Days (invoices)", - default=10, - ) - l10n_latam_use_documents = fields.Boolean( - related="invoice_journal_id.l10n_latam_use_documents", - ) - l10n_do_credit_notes_number_of_days = fields.Integer( - string="Last Days (refunds)", - default=10, - ) - l10n_latam_country_code = fields.Char( - related="company_id.country_id.code", - help="Technical field used to hide/show fields regarding the localization", - ) - - # TODO: search criteria - # order_search_criteria = fields.Many2many( - # comodel_name='pos.search_criteria', - # string=u"Criterios de Búsqueda", - # ) - - @api.constrains("l10n_do_number_of_days") - def l10n_do_number_of_days_validation(self): - if self.l10n_do_order_loading_options == "n_days" and ( - not self.l10n_do_number_of_days or self.l10n_do_number_of_days < 0 - ): - raise UserError(_("You have to set a number of days.")) - - def get_l10n_do_fiscal_type_data(self): - return { - "tax_payer_type_list": [ - self.env["res.partner"]._get_l10n_do_dgii_payer_types_selection()[i] - for i in [1, 0, 2, 3, 4, 5] - ], - "ncf_types_data": self.env["account.journal"]._get_l10n_do_ncf_types_data(), - } - - @api.constrains("company_id", "journal_id") - def _check_company_journal(self): - if ( - self.journal_id - and self.journal_id.company_id.l10n_do_country_code == "DO" - and self.journal_id.l10n_latam_use_documents - ): - raise ValidationError( - _( - "You cannot set a Fiscal Journal as Sales Journal. " - "Please, select a non-fiscal journal." - ) - ) - super(PosConfig, self)._check_company_journal() diff --git a/l10n_do_pos/models/pos_order.py b/l10n_do_pos/models/pos_order.py deleted file mode 100644 index f2454b2b5..000000000 --- a/l10n_do_pos/models/pos_order.py +++ /dev/null @@ -1,364 +0,0 @@ -import logging -from datetime import timedelta - -from odoo import models, fields, api, _ -from odoo.exceptions import UserError - -_logger = logging.getLogger(__name__) - - -class PosOrder(models.Model): - _inherit = "pos.order" - - l10n_latam_document_number = fields.Char( - string="Fiscal Number", - ) - l10n_latam_document_type_id = fields.Many2one( - comodel_name="l10n_latam.document.type", - string="Document Type", - ) - l10n_latam_sequence_id = fields.Many2one( - comodel_name="ir.sequence", - string="Fiscal Sequence", - copy=False, - ) - l10n_do_ncf_expiration_date = fields.Date( - string="NCF expiration date", - ) - l10n_latam_use_documents = fields.Boolean() - state = fields.Selection( - selection_add=[ - ("is_l10n_do_return_order", "Credit note"), - ], - ) - l10n_do_origin_ncf = fields.Char( - string="Modified NCF", - ) - l10n_do_is_return_order = fields.Boolean( - string="Return order", - copy=False, - ) - l10n_do_return_order_id = fields.Many2one( - "pos.order", - string="Modifies", - readonly=True, - copy=False, - ) - l10n_do_return_status = fields.Selection( - selection=[ - ("-", "Not returned"), - ("fully_returned", "Fully returned"), - ("partially_returned", "Partially Returned"), - ("non_returnable", "Non Returnable"), - ], - default="-", - copy=False, - string="Return status", - ) - l10n_do_payment_credit_note_ids = fields.One2many( - "pos.order.payment.credit.note", - "pos_order_id", - string="Credit Note payments", - ) - l10n_latam_country_code = fields.Char( - related="company_id.country_id.code", - help="Technical field used to hide/show fields regarding the localization", - ) - - @api.model - def _order_fields(self, ui_order): - """ - Prepare the dict of values to create the new pos order. - """ - res = super(PosOrder, self)._order_fields(ui_order) - if ui_order.get("l10n_latam_sequence_id", False) and ui_order["to_invoice"]: - res.update( - { - "l10n_latam_sequence_id": ui_order["l10n_latam_sequence_id"], - "l10n_latam_document_number": ui_order[ - "l10n_latam_document_number" - ], - "l10n_latam_document_type_id": ui_order[ - "l10n_latam_document_type_id" - ], - "l10n_latam_use_documents": True, - "l10n_do_origin_ncf": ui_order["l10n_do_origin_ncf"], - "l10n_do_return_status": ui_order["l10n_do_return_status"], - "l10n_do_is_return_order": ui_order["l10n_do_is_return_order"], - "l10n_do_return_order_id": ui_order["l10n_do_return_order_id"], - "l10n_do_ncf_expiration_date": ui_order[ - "l10n_do_ncf_expiration_date" - ], - } - ) - - for line in ui_order["lines"]: - line_dic = line[2] - original_line = self.env["pos.order.line"].browse( - line_dic.get("l10n_do_original_line_id", False) - ) - original_line.l10n_do_line_qty_returned += abs(line_dic.get("qty", 0)) - - return res - - @api.model - def _payment_fields(self, order, ui_paymentline): - res = super(PosOrder, self)._payment_fields(order, ui_paymentline) - if res["payment_method_id"] == 10001: - res.update( - { - "name": ui_paymentline.get("note"), - } - ) - return res - - def add_payment(self, data): - self.ensure_one() - if data["payment_method_id"] == 10001: - # TODO: CHECK WTF l10n_latam_document_number cant filter - # TODO: AGREGAR SOLO EL MONTO DEL PAGO EN LA FACTURA, ACTUALMENTE SE AGREGA COMO "PAGO" LA NOTA DE CREDITO - # EL PROBLEMA ES QUE SI LA NOTA DE CREDITO NO ES IGUAL AL PAGO HACE UNA DEVOLUCION POR LO TANTO EL "PAGO" - # CON NOTA DE CREDITO QUEDA POR ENSIMA DE LA ORDEN (ESTO ES SOLO UN PROBLEMA VISUAL QUE PUEDE CONFUDNIR AL - # USUARIO) - account_move_credit_note = ( - self.env["pos.order"] - .search([("l10n_latam_document_number", "=", data["name"])]) - .account_move - ) - self.env["pos.order.payment.credit.note"].create( - { - "amount": data["amount"], - "account_move_id": account_move_credit_note.id, - "pos_order_id": data["pos_order_id"], - "name": data["name"], - } - ) - self.amount_paid = sum(self.payment_ids.mapped("amount")) + sum( - self.l10n_do_payment_credit_note_ids.mapped("amount") - ) - - elif not self.l10n_do_is_return_order: - super(PosOrder, self).add_payment(data) - self.amount_paid = sum(self.payment_ids.mapped("amount")) + sum( - self.l10n_do_payment_credit_note_ids.mapped("amount") - ) - - def _process_payment_lines(self, pos_order, order, pos_session, draft): - super(PosOrder, self)._process_payment_lines( - pos_order, order, pos_session, draft - ) - - order.amount_paid = sum(order.payment_ids.mapped("amount")) + sum( - order.l10n_do_payment_credit_note_ids.mapped("amount") - ) - - if sum(order.payment_ids.mapped("amount")) < 0: - order.payment_ids.unlink() - - def _prepare_invoice_vals(self): - invoice_vals = super(PosOrder, self)._prepare_invoice_vals() - documents = self.config_id.invoice_journal_id.l10n_latam_use_documents - if documents and self.to_invoice: - invoice_vals["l10n_latam_sequence_id"] = self.l10n_latam_sequence_id.id - invoice_vals["l10n_latam_document_number"] = self.l10n_latam_document_number - invoice_vals[ - "l10n_latam_document_type_id" - ] = self.l10n_latam_document_type_id.id - if invoice_vals["type"] == "out_refund": - del invoice_vals["l10n_latam_sequence_id"] - invoice_vals["l10n_latam_document_number"] = False - del invoice_vals["l10n_latam_document_type_id"] - invoice_vals["ncf_expiration_date"] = self.l10n_do_ncf_expiration_date - - invoice_vals["l10n_do_origin_ncf"] = self.l10n_latam_document_number - - # a POS sale invoice NCF is always an internal sequence - invoice_vals["is_l10n_do_internal_sequence"] = True - - if self.l10n_do_is_return_order: - invoice_vals["type"] = "out_refund" - - return invoice_vals - - @api.model - def _process_order(self, order, draft, existing_order): - if order["data"].get("to_invoice_backend", False): - order["data"]["to_invoice"] = True - order["to_invoice"] = True - if not order["data"]["partner_id"]: - pos_config = ( - self.env["pos.session"] - .search([("id", "=", order["data"]["pos_session_id"])]) - .config_id - ) - if not pos_config.l10n_do_default_partner_id: - raise UserError( - _("This point of sale does not have a default customer.") - ) - order["data"]["partner_id"] = pos_config.l10n_do_default_partner_id.id - - return super(PosOrder, self)._process_order(order, draft, existing_order) - - @api.model - def order_search_from_ui(self, day_limit=0, config_id=0, session_id=0): - invoice_domain = [("type", "=", "out_invoice")] - pos_order_domain = [] - - if day_limit: - today = fields.Date.from_string(fields.Date.context_today(self)) - limit = today - timedelta(days=day_limit) - invoice_domain.append(("invoice_date", ">=", limit)) - - if config_id: - pos_order_domain.append(("config_id", "=", config_id)) - - if session_id: - pos_order_domain.append(("session_id", "=", session_id)) - - invoice_ids = self.env["account.move"].search(invoice_domain) - pos_order_domain.append(("account_move", "in", invoice_ids.ids)) - - order_ids = self.search(pos_order_domain) - order_list = [] - order_lines_list = [] - for order in order_ids: - order_json = { - "id": order.id, - "name": order.name, - "date_order": order.date_order, - "partner_id": [order.partner_id.id, order.partner_id.name], - "pos_reference": order.pos_reference, - "account_move": [ - order.account_move.id, - order.account_move.l10n_latam_document_number, - ], - "amount_total": order.amount_total, - "l10n_latam_document_number": order.account_move.l10n_latam_document_number, - "lines": [line.id for line in order.lines], - "payment_ids": [payment_id.id for payment_id in order.payment_ids], - "l10n_do_is_return_order": order.l10n_do_is_return_order, - } - if not order.l10n_do_is_return_order: - order_json["l10n_do_return_status"] = order.l10n_do_return_status - else: - order.l10n_do_return_order_id.l10n_do_return_status = ( - order.l10n_do_return_status - ) - order_json["l10n_do_return_order_id"] = order.l10n_do_return_order_id.id - order_json[ - "l10n_do_return_status" - ] = order.l10n_do_return_order_id.l10n_do_return_status - - for line in order.lines: - order_lines_json = { - "order_id": [order.id, order.name], - "id": line.id, - "discount": line.discount, - "price_subtotal": line.price_subtotal, - "price_subtotal_incl": line.price_subtotal_incl, - "qty": line.qty, - "price_unit": line.price_unit, - "product_id": [line.product_id.id, line.product_id.name], - "l10n_do_line_qty_returned": line.l10n_do_line_qty_returned, - } - order_lines_list.append(order_lines_json) - order_list.append(order_json) - return {"orders": order_list, "orderlines": order_lines_list} - - def _is_pos_order_paid(self): - if self.filtered( - lambda order: order.l10n_latam_use_documents - and order.l10n_do_is_return_order - ): - return True - return super(PosOrder, self)._is_pos_order_paid() - - def action_pos_order_invoice(self): - res = super(PosOrder, self).action_pos_order_invoice() - for order in self: - if order.l10n_do_is_return_order: - order.sudo().write({"state": "is_l10n_do_return_order"}) - - # Reconcile Credit Notes - invoice_rec_line = order.account_move.line_ids.filtered( - lambda l: l.debit > 0 - ) - for credit_note in order.l10n_do_payment_credit_note_ids: - credit_note_rec_line = credit_note.account_move_id.line_ids.filtered( - lambda l: l.account_id.id == invoice_rec_line.account_id.id - ) - to_reconcile = invoice_rec_line | credit_note_rec_line - to_reconcile.sudo().auto_reconcile_lines() - return res - - @api.model - def credit_note_info_from_ui(self, ncf): - # TODO: CHECK WTF l10n_latam_document_number cant filter - out_refund_invoice = ( - self.env["pos.order"] - .search( - [ - ("l10n_latam_document_number", "=", ncf), - ("l10n_do_is_return_order", "=", True), - ] - ) - .account_move - ) - return { - "id": out_refund_invoice.id, - "residual": out_refund_invoice.amount_residual, - "partner_id": out_refund_invoice.partner_id.id, - } - - def _get_amount_receivable(self): - if self.state == "is_l10n_do_return_order": - return 0 - return super(PosOrder, self)._get_amount_receivable() - - -class PosOrderLine(models.Model): - _inherit = "pos.order.line" - - l10n_do_line_qty_returned = fields.Integer( # TODO: not Float values? - string="Return line", - default=0, - ) - l10n_do_original_line_id = fields.Many2one( - comodel_name="pos.order.line", - string="Original line", - ) - - @api.model - def _order_line_fields(self, line, session_id=None): - fields_return = super(PosOrderLine, self)._order_line_fields(line, session_id) - fields_return[2].update( - { - "l10n_do_line_qty_returned": line[2].get( - "l10n_do_line_qty_returned", "" - ), - "l10n_do_original_line_id": line[2].get("l10n_do_original_line_id", ""), - } - ) - return fields_return - - -class PosOrderPaymentCreditNote(models.Model): - _name = "pos.order.payment.credit.note" - _rec_name = "name" - _description = "POS Credit Notes" - - name = fields.Char() - amount = fields.Monetary() - account_move_id = fields.Many2one( - comodel_name="account.move", - string="Credit note", - required=False, - ) - currency_id = fields.Many2one( - related="account_move_id.currency_id", - ) - pos_order_id = fields.Many2one( - comodel_name="pos.order", - string="order", - required=False, - ) diff --git a/l10n_do_pos/models/pos_session.py b/l10n_do_pos/models/pos_session.py deleted file mode 100644 index 95ddac502..000000000 --- a/l10n_do_pos/models/pos_session.py +++ /dev/null @@ -1,9 +0,0 @@ -from odoo import fields, models, api - - -class PosSession(models.Model): - _inherit = "pos.session" - - def action_pos_session_close(self): - self.config_id._check_company_journal() - return super(PosSession, self).action_pos_session_close() diff --git a/l10n_do_pos/security/ir.model.access.csv b/l10n_do_pos/security/ir.model.access.csv deleted file mode 100644 index 47686c3d8..000000000 --- a/l10n_do_pos/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_pos_order_payment_credit_note,l10n_do_pos.pos_order_payment_credit_note,model_pos_order_payment_credit_note,point_of_sale.group_pos_user,1,1,1,1 diff --git a/l10n_do_pos/static/description/icon.png b/l10n_do_pos/static/description/icon.png deleted file mode 100644 index 05d6111ad82d6a132c38b7f0652c49360b60b4b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15070 zcmY+r1yr1|vj+;LNTEmz6lbv(XK`mKQe2C>LvdN$Dee@91r|yR6kDXYI}|InxVt+n zw!HrDz3<-lzVCcrCX-)gGRes~lS~q=rXq`rO^%I%f`ThAC;j}Ey7&%w#TNe9BFp`j6V zv$PieEG_dt)&J$h=)SnSy9fh;US3`tUOXJmZZ<$JAt50kCpVCroBbbx9qi-eZsyJI z1g8IQA^)!&X)CaWo2`qxt+Nx&f8?5(JA1f`(b4@!(f>aG-A;E~>;Kc_1pXhh{uv1T zPYIBVgA@3_vj0^T{SQ}I)y>xGpXUF_2XTr17xMqd`yV}`!2c-!|1{>mE&VU2 zqQL*{HV`(M@j507ir}ogw1lQN>T#}7`A-{<)m8A$+$Pr?h66)fJZ{%V`abz-^14s{ zsWD|GpHZSq40+#5SCle+n>4&G5@;I=_~}LhiMs!;Nq1HBnUzjLzE?{lRR)`v$+Lg} zgge*ElQ&-Z{H)heH~VnpH6FLAzCAHgYje8m1J{3kzW2RpxfQY*7m`(^P!)f=dH@== zUmeo=Zv07Obru4F0*}*%bxsTuB;DShW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=dRthQyC4(mr{^M3-2BYhF%uKB}#>zIP_H z120-F=+Z%|Hw($dvstq&#l7X0K%Vr{O>MS88I&C6**X_8G(sQpWYq}K*vx6YBM&qZ zA#uR-{Fy)pq7MjiOrWyUTX{P1>JV3Xf(?vI p.body { - white-space: pre-wrap; - text-align: left; -} - -/* c) The receipt screen */ - -.dotted_ticket_title { - border: 1px dashed black; - border-left: none; - border-right: none; - padding: .5em 0; - margin: .9em 0 0 0; -} - -.dotted_ticket_table_header { - border-bottom: 1px dashed black; - height: 2em; -} - -.popup > p.body { - white-space: pre-wrap; - text-align: left; -} - -.return_popup_table { - table-layout: fixed; - text-align: left; - width: 100%; -} - -.container_div { - height: 240px; - overflow-y: scroll; - margin-top: -3%; -} - -.return_popup_tr { - height: 53px; - background-color: rgb(222, 224, 224); -} - -.table_data_cells { - padding-left: 2%; -} - -.return_popup_style { - height: 375px !important; - width: 535px !important; - font-family: inherit; -} - -.button.confirm { - right: 0px; - margin-right: 16px; -} - -.button.cancel { - left: 0px; - margin-left: 16px; -} - -.info-content { - margin: 30px 0px 8px; - display: flow-root; -} - -.label-text { - font-size: 16px; - padding: 5px 8px 3px 8px; -} - -.highlight-2 { - background: rgb(184, 152, 204); - color: white; - font-size: 18px; -} - -.col-right { - text-align: right; -} - -.font-bold { - font-weight: bold; -} - -.button-custom { - line-height: 48px; - padding: 10px 13px; - font-size: 20px; - background: rgb(230, 230, 230); - margin: 12px; - border-radius: 3px; - border: solid 1px rgb(209, 209, 209); - cursor: pointer; - transition: all 150ms linear; -} - -.button-custom:hover { - background: #efefef; -} - -.button-custom:active { - background: black; - border-color: black; - color: white; -} - -.button-custom.highlight { - background: rgb(110, 200, 155); - color: white; - border: solid 1px rgb(110, 200, 155); -} - -.button-custom.highlight:hover { - background: rgb(120, 210, 165); -} - -.button-custom.highlight-2 { - background: rgb(184, 152, 204); - color: white; - border: solid 1px rgb(184, 152, 204); -} - -.sale_fiscal_type_label { - color: red; -} - -.pos .popup select.credit_notes { - text-align: left; - display: inline-block; - overflow: hidden; - background: white; - min-height: 44px; - font-family: "Lato"; - font-size: 20px; - color: #444; - padding: 10px; - border-radius: 3px; - border: none; - box-shadow: 0px 0px 0px 1px rgb(220,220,220) inset; - box-sizing: border-box; - width: 80%; -} - -.pos .disable { - background: #00000036!important; - pointer-events: none; -} -.active_state:after { - content: ""; - width: 100px; - height: 100px; - position: absolute; - top: 35%; - left: 50%; - z-index: 9999; - background-size: cover; -} - -.active_state { - position: fixed; - width: 100%; - height: 100%; - z-index: 9998; - cursor: not-allowed; - background: rgba(25, 22, 22, 0.8); -} - -.loader_spin { - border: 16px solid transparent; - border-radius: 50%; - border-top: 16px solid rgba(81, 155, 110, 0.97); - position: absolute; - width: 100%; - top: 35%; - left: 0%; - text-align: center; - -webkit-animation: spin 2s linear infinite; /* Safari */ - animation: spin 2s linear infinite; -} - -/* Safari */ -@-webkit-keyframes spin { - 0% { - -webkit-transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - } -} - -@keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} - -.lds-spinner { - color: #ffffff; - display: inline-block; - position: absolute; - top: 35%; - left: 50%; - width: 64px; - height: 64px; -} - -.lds-spinner div { - transform-origin: 32px 32px; - animation: lds-spinner 1.2s linear infinite; -} - -.lds-spinner div:after { - content: " "; - display: block; - position: absolute; - top: 3px; - left: 29px; - width: 5px; - height: 14px; - border-radius: 20%; - background: #fff; -} - -.lds-spinner div:nth-child(1) { - transform: rotate(0deg); - animation-delay: -1.1s; -} - -.lds-spinner div:nth-child(2) { - transform: rotate(30deg); - animation-delay: -1s; -} - -.lds-spinner div:nth-child(3) { - transform: rotate(60deg); - animation-delay: -0.9s; -} - -.lds-spinner div:nth-child(4) { - transform: rotate(90deg); - animation-delay: -0.8s; -} - -.lds-spinner div:nth-child(5) { - transform: rotate(120deg); - animation-delay: -0.7s; -} - -.lds-spinner div:nth-child(6) { - transform: rotate(150deg); - animation-delay: -0.6s; -} - -.lds-spinner div:nth-child(7) { - transform: rotate(180deg); - animation-delay: -0.5s; -} - -.lds-spinner div:nth-child(8) { - transform: rotate(210deg); - animation-delay: -0.4s; -} - -.lds-spinner div:nth-child(9) { - transform: rotate(240deg); - animation-delay: -0.3s; -} - -.lds-spinner div:nth-child(10) { - transform: rotate(270deg); - animation-delay: -0.2s; -} - -.lds-spinner div:nth-child(11) { - transform: rotate(300deg); - animation-delay: -0.1s; -} - -.lds-spinner div:nth-child(12) { - transform: rotate(330deg); - animation-delay: 0s; -} - -@keyframes lds-spinner { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} diff --git a/l10n_do_pos/static/src/img/icon-cross.png b/l10n_do_pos/static/src/img/icon-cross.png deleted file mode 100644 index 5e5ec685b3de2a953b1e4b57cf369c714d17d2c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 436 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TG$pJngu0Z-falpaB0jSW$#pU3^ zgXhkjJ9_l!%$YMMOqh_9lT%bw6c7-wYuB!K@7@&_7A7SnB_}7>*VhLH1*N2<{Cuy* z5447_B*-tA;T7xTV-4W~K0nq@`{kQ^?)^ES%qLG5#}JM4t&?x}H5>4_JZ90@65G!_ z#pz}0|Nq+M-Y!BJs^_^U^{4Po-q^WmtM-b_6$M*Ot7W~MM5eauuI0%1{ZRFj)Gx6G zTFu{BO2Yegl^rh*X=OU}cx;qccp3i+}zQaNL!F2mC46BYBA3eMK@0V}!iyp6k z74Yx363h9|Dv3ImjeoF51~2Bl%o!*4>fzxfuDLQ*&q{S(rw8(93kbv8{ z3b#s@nQVt7&uef?v1*?d%|6w?G@_;}H7fb1=R&($p3=UBTKpbB($rHDy8+7%&mdKI;Vst05L1o9{>OV diff --git a/l10n_do_pos/static/src/img/icon-features.png b/l10n_do_pos/static/src/img/icon-features.png deleted file mode 100644 index 10e23486e564328acd7a66407937947179bfac57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%3?x6Bmj(i;*Tw!n`h%V>%SLJ)l5$p#}JM4dnb5`H7f|X zI0~?Y6r2e8ZlA$)%PeL7AJHrA@4kEenZ5Dzxk}5L=iciB0zO~rC^_6Jt!-EtvZJ%t zwfTv@_VTpw3)fePcdz5&NSSB(%1@Ce;lvE1TXIfJGftj(oa33GENnM@o?NQV%q5$W z7}ve%TjcR$mG9i<<7Hvt+oeQi#9ndn-O0B|b>`M5w&rJf4EZMi5X^u6R7mqjf~W@2 Okqn-$elF{r5}E-0s)mCA diff --git a/l10n_do_pos/static/src/img/icon-help.png b/l10n_do_pos/static/src/img/icon-help.png deleted file mode 100644 index 303f9e2487d7533b8b4efa31c13c6d88854227e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 469 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%3?x6Bmj(i<%mAMdS0L@@JBtoz8uwf`pk+!W zL4Lsu&VPO~pW)@au`l53$LINiM<>>##fO_{-`lj@(^7J7tHSYu?EbSr)jvI5978nD zFP#`UsYOA+rQ4O&^>*!jwfFTW7^g@q|GoM1>xbPM+Ku~8XD7Vwwo~e!#Qb2_#Q#T) zoXm3~W(#%Mx-zJ>o=$4j)&Nhvtdx{(IU~mxe{zjffeg`FE(t* zZ0}W(I=}X*`1(BKbWYv~oB0{JjtAFWx)Y}NBX&hkOmX1+Pc{||YnK(wtvK(MxGjHP zneQ#m_G*EDa+`nKhfO{C*wR!S8oS{E0JX>@0%?i?pQrbm{~-b;{_*BRlTQ+V~EE2t>-=Y4jBlz zT-+oqb3j;4x%7W?lBUjtm`K;3Szn*62~-l=^9FHWvehLm%wE}IxfYoUxDYNWDhi^RmX@Y3(XzB;lk8c~(z0H*Jfro| zW@c(yDj@Ef;fjh2xJBj$u7Co6e&>JAckkS}Gk4B6bLPxB_hx`U(m;2sE&u>9@b>Zy zQc24HmNrPWFADBT0RXj40mp+8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1snvp0C{sad3XwUk&lh$1=t0L?)} zV5jmvpK0xQiL8lc{#281)Ze76f-N>nHcO{mXzs8I^~*K;N(7ukCUum=2#K&1)oI0# zg?CaNikUuSeG_tWx&G3J8JcreQEfhsza4l*@yKB>W9u`U=Wim<)1JwJ8AZnC&}rHI z(Sd|M!>2Ot^2{cIb{-)}af;8c!pYuaa5Ry$A1(vgzf)XGSbas5Y0)xKE#;szeaRZq zDq@ZYy$-zs^`_aFtL7@VvB65bBWCLx;%_$HllF?-x3G87&zw@2jv_?7K=J4?VCUr- zYLk$;dPOgO^$$Ws3Q+rmw719?c5?lySdH**W)ovyv(;J>U}V6ZrU5EL-Gn~UiZV)r zj-We17L8yExF_9~VclUhHsFv%%p-|(>rhcm?WIbI{>L1Pwp<&xJd_S}5)55|y(YPa zixA{VbRKFil)(I`Sg16=GmRG96QZf87BKV|UI8M_Ww@pr%y#C|02S8DBU$=$4smf* ag;|=WN3qSLZ9S?F6u=wd@A=U^iu!+l=?0eo diff --git a/l10n_do_pos/static/src/js/models.js b/l10n_do_pos/static/src/js/models.js deleted file mode 100644 index b20805bba..000000000 --- a/l10n_do_pos/static/src/js/models.js +++ /dev/null @@ -1,598 +0,0 @@ -// © 2015-2018 Eneldo Serrata -// © 2017-2018 Gustavo Valverde -// © 2018 Francisco Peñaló -// © 2018 Kevin Jiménez -// © 2019-2020 Raul Ovalle - -// This file is part of NCF Manager. - -// NCF Manager is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// NCF Manager is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with NCF Manager. If not, see . - -odoo.define('l10n_do_pos.models', function (require) { - "use strict"; - - var models = require('point_of_sale.models'); - var core = require('web.core'); - var _t = core._t; - var _super_order = models.Order.prototype; - var _super_posmodel = models.PosModel.prototype; - var rpc = require('web.rpc'); - - models.load_fields('res.partner', ['l10n_do_dgii_tax_payer_type']); - models.load_fields('pos.config', ['l10n_do_default_partner_id']); - - models.load_fields('account.journal', [ - 'l10n_latam_use_documents', - 'l10n_do_sequence_ids', - 'l10n_do_payment_form', - ]); - - models.load_models({ - model: 'account.journal', - fields: ['name', 'l10n_latam_use_documents', 'l10n_do_sequence_ids'], - domain: function (self) { - return [['id', '=', self.config.invoice_journal_id[0]]]; - }, - loaded: function (self, journals) { - self.invoice_journal = false; - if (journals[0]) { - self.invoice_journal = journals[0]; - } - }, - }); - - //TODO: CHECK THIS - models.load_models([{ - model: 'pos.order', - fields: ['id', 'name', 'date_order', 'partner_id', 'lines', 'pos_reference', 'account_move', 'amount_total', - 'l10n_latam_document_number', 'payment_ids', 'l10n_do_return_order_id', 'l10n_do_is_return_order', 'l10n_do_return_status'], - domain: function (self) { - var domain_list = []; - - if (self.config.l10n_do_order_loading_options === 'n_days') { - var today = new Date(); - var validation_date = new Date(today); - validation_date.setDate(today.getDate() - self.config.l10n_do_number_of_days); - - domain_list = [ - ['account_move.invoice_date', '>', validation_date.toISOString()], - ['state', 'not in', ['draft', 'cancel']], - ['config_id', '=', self.config.id], - ]; - } else { - domain_list = [ - ['session_id', '=', self.pos_session.id], - ['state', 'not in', ['draft', 'cancel']], - ]; - } - domain_list.push(['l10n_do_is_return_order', '=', false]); - return domain_list; - }, - loaded: function (self, orders) { - self.db.pos_all_orders = orders || []; - self.db.order_by_id = {}; - orders.forEach(function (order) { - order.number = order.ncf; - order.account_move = [order.account_move[0], order.ncf]; - console.log('order', order); - self.db.order_by_id[order.id] = order; - }); - }, - }, { - model: 'account.move', - fields: ['l10n_latam_document_number'], - domain: function (self) { - var invoice_ids = self.db.pos_all_orders.map(function (order) { - return order.account_move[0]; - }); - - return [['id', 'in', invoice_ids]]; - }, - loaded: function (self, invoices) { - var invoice_by_id = {}; - - invoices.forEach(function (invoice) { - invoice_by_id[invoice.id] = invoice; - }); - self.db.pos_all_orders.forEach(function (order, ix) { - var invoice_id = invoice_by_id[order.account_move[0]]; - var l10n_latam_document_number = invoice_id && invoice_id.l10n_latam_document_number; - self.db.pos_all_orders[ix].l10n_latam_document_number = l10n_latam_document_number; - self.db.order_by_id[order.id].l10n_latam_document_number = l10n_latam_document_number; - }); - }, - }, { - model: 'account.move', - fields: ['l10n_latam_document_number', 'partner_id'], - // TODO: CHECK WTF IS residual - domain: function (self) { - var today = new Date(); - var validation_date = new Date(today); - validation_date.setDate(today.getDate() - self.config.l10n_do_credit_notes_number_of_days); - //TODO: try analize correct date - return [ - ['type', '=', 'out_refund'], ['state', '!=', 'paid'], - ['invoice_date', '>', validation_date.toISOString()], - ]; - }, - loaded: function (self, invoices) { - var credit_note_by_id = {}; - var credit_notes_by_partner_id = {}; - var partner_id = false; - - _.each(invoices, function (invoice) { - partner_id = invoice.partner_id[0]; - invoice.partner_id = self.db.get_partner_by_id(partner_id); - credit_note_by_id[invoice.id] = invoice; - credit_notes_by_partner_id[partner_id] = credit_notes_by_partner_id[partner_id] || []; - credit_notes_by_partner_id[partner_id].push(invoice); - }); - - self.db.credit_note_by_id = credit_note_by_id; - self.db.credit_notes_by_partner_id = credit_notes_by_partner_id; - }, - }, { - model: 'pos.order.line', - fields: ['product_id', 'order_id', 'qty', 'discount', 'price_unit', 'price_subtotal_incl', - 'price_subtotal', 'l10n_do_line_qty_returned'], - domain: function (self) { - var orders = self.db.pos_all_orders; - var order_lines = []; - - for (var i in orders) { - order_lines = order_lines.concat(orders[i].lines); - } - - return [ - ['id', 'in', order_lines], - ]; - }, - loaded: function (self, order_lines) { - self.db.pos_all_order_lines = order_lines || []; - self.db.line_by_id = {}; - order_lines.forEach(function (line) { - self.db.line_by_id[line.id] = line; - }); - }, - }], { - 'after': 'product.product', - }); - - models.load_models([{ - label: "Custom Account Journal", - loaded: function (self, tmp) { - var payment_method_credit_note = $.extend({}, self.payment_methods[0]); - for (var n in self.payment_methods) { - if (self.payment_methods[n].is_cash_count) { - payment_method_credit_note = $.extend({}, self.payment_methods[n]); - break; - } - } - payment_method_credit_note = $.extend(payment_method_credit_note, { - id: 10001, - css_class: 'altlight', - show_popup: true, - popup_name: 'textinput', - popup_options: {}, - name: 'Nota de Credito', - }); - - // Creamos una forma de pago especial para la Nota de Credito - self.payment_methods.push(payment_method_credit_note); - self.payment_methods_by_id[payment_method_credit_note.id] = payment_method_credit_note; - }, - }], { - 'after': 'pos.payment.method', - }); - - models.load_models({ - model: 'ir.sequence', - fields: [ - 'l10n_latam_document_type_id', - ], - domain: function (self) { - return [ - ['id', 'in', self.invoice_journal.l10n_do_sequence_ids], - ]; - }, - loaded: function (self, latam_sequences) { - self.l10n_latam_sequences = latam_sequences; - console.log('Sequences loaded:', latam_sequences); - }, - }); - - models.load_models({ - model: 'l10n_latam.document.type', - fields: [ - 'name', - 'code', - 'l10n_do_ncf_type', - 'is_vat_required', - 'internal_type', - 'doc_code_prefix', - 'country_id', - ], - domain: function () { - return [ - ['internal_type', 'in', ['invoice', 'credit_note']], - ['active', '=', true], - ['code', '=', 'B'], - ]; - }, - loaded: function (self, latam_document_types) { - latam_document_types.forEach(function (latam_document_type, index, array) { - if (latam_document_type.internal_type === 'credit_note') { - self.l10n_latam_document_type_credit_note = latam_document_type; - } - }); - self.l10n_latam_document_types = latam_document_types.filter( - item => item.id !== self.l10n_latam_document_type_credit_note.id); - console.log('Document types loaded:', latam_document_types); - }, - }); - - models.Order = models.Order.extend({ - initialize: function () { - _super_order.initialize.apply(this, arguments); - var self = this; - this.l10n_latam_sequence_id = false; - this.l10n_latam_document_type_id = false; - this.l10n_latam_document_type = - self.pos.get_latam_document_type_by_prefix(); - this.to_invoice_backend = false; - - this.l10n_do_return_status = '-'; - this.l10n_do_origin_ncf = ''; - this.l10n_do_is_return_order = false; - this.l10n_do_return_order_id = false; - this.set_to_invoice(true); - this.save_to_db(); - }, - - set_latam_document_type: function (l10n_latam_document_type) { - this.l10n_latam_document_type = l10n_latam_document_type; - this.l10n_latam_document_type_id = l10n_latam_document_type.id; - this.save_to_db(); - this.latam_document_type_changed(); - }, - - get_latam_document_type: function () { - return this.l10n_latam_document_type; - }, - - latam_document_type_changed: function () { - var current_order = this.pos.get_order(); - if (current_order){ - var latam_document_type_name = - current_order.l10n_latam_document_type.name || false; - this.pos.gui.screen_instances.payment - .$('.js_latam_document_type_name').text( - latam_document_type_name); - this.pos.gui.screen_instances.products - .$('.js_latam_document_type_name').text( - latam_document_type_name); - } - }, - // TODO: check this is meaby its important - // init_from_JSON: function (json) { - // var self = this; - // _super_order.init_from_JSON.call(this, json); - // this.l10n_do_return_status = json.l10n_do_return_status; - // this.l10n_do_is_return_order = json.l10n_do_is_return_order; - // this.l10n_do_return_order_id = json.l10n_do_return_order_id; - // this.amount_total = json.amount_total; - // this.to_invoice = json.to_invoice; - // this.ncf = json.ncf; - // this.ncf_control = json.ncf_control; - // if (this.orderlines && $.isArray(this.orderlines.models)) { - // this.orderlines.models.forEach(function (line) { - // var productDefCode = line.product.default_code; - // self.orderlineList.push( - // { - // line_id: line.id, - // product_id: line.product.id, - // product_name: (productDefCode && '[' + productDefCode + '] ' || '') + line.product.display_name, - // quantity: line.quantity, - // price: line.price, - // }); - // }); - // } - // }, - init_from_JSON: function(json) { - _super_order.init_from_JSON.call(this, json); - this.l10n_latam_document_number = json.l10n_latam_document_number; - this.l10n_do_ncf_expiration_date = json.l10n_do_ncf_expiration_date - this.l10n_latam_sequence_id = json.l10n_latam_sequence_id; - this.l10n_latam_document_type_id = json.l10n_latam_document_type_id; - this.to_invoice_backend = json.to_invoice_backend; - this.l10n_do_return_status = json.l10n_do_return_status; - this.l10n_do_origin_ncf = json.l10n_do_origin_ncf; - this.l10n_do_is_return_order = json.l10n_do_is_return_order; - this.l10n_do_return_order_id = json.l10n_do_return_order_id; - this.set_latam_document_type( - this.pos.get_latam_document_type_by_id( - json.l10n_latam_document_type_id)); - }, - export_as_JSON: function () { - - var self = this; - var loaded = _super_order.export_as_JSON.call(this); - var current_order = self.pos.get_order(); - - if (current_order) { - loaded.l10n_latam_document_number = - current_order.l10n_latam_document_number; - loaded.l10n_do_ncf_expiration_date = current_order.l10n_do_ncf_expiration_date; - loaded.l10n_latam_sequence_id = - current_order.l10n_latam_sequence_id; - loaded.l10n_latam_document_type_id = - current_order.l10n_latam_document_type_id; - loaded.to_invoice_backend = current_order.to_invoice_backend; - - loaded.l10n_do_return_status = current_order.l10n_do_return_status; - loaded.l10n_do_origin_ncf = current_order.l10n_do_origin_ncf; - loaded.l10n_do_is_return_order = current_order.l10n_do_is_return_order; - loaded.l10n_do_return_order_id = current_order.l10n_do_return_order_id; - } - - return loaded; - }, - set_to_invoice: function (to_invoice) { - _super_order.set_to_invoice.call(this, to_invoice); - this.to_invoice_backend = to_invoice; - }, - - set_client: function(client) { - var self = this; - _super_order.set_client.apply(this, arguments); - if (client){ - self.set_latam_document_type( - self.pos.get_latam_document_type_by_l10n_do_ncf_type( - self.pos.ncf_types_data.issued[client.l10n_do_dgii_tax_payer_type][0]) - ); - }else{ - self.set_latam_document_type( - self.pos.get_latam_document_type_by_l10n_do_ncf_type() - ); - } - }, - - }); - - var super_paymentline = models.Paymentline.prototype; - models.Paymentline = models.Paymentline.extend({ - initialize: function (attr, options) { - this.credit_note_id = null; - this.note = ''; - super_paymentline.initialize.call(this, attr, options); - }, - init_from_JSON: function (json) { - super_paymentline.init_from_JSON.call(this, json); - this.credit_note_id = json.credit_note_id; - this.note = json.note; - }, - export_as_JSON: function () { - var json = super_paymentline.export_as_JSON.call(this); - - $.extend(json, { - credit_note_id: this.credit_note_id, - note: this.note, - payment_reference: this.payment_method.payment_reference, - }); - return json; - }, - }); - - //TODO: CHECK AVOVE THIS PART - - var _super_orderline = models.Orderline.prototype; - models.Orderline = models.Orderline.extend({ - initialize: function (attr, options) { - this.l10n_do_line_qty_returned = 0; - this.l10n_do_original_line_id = null; - _super_orderline.initialize.call(this, attr, options); - }, - init_from_JSON: function (json) { - _super_orderline.init_from_JSON.call(this, json); - this.l10n_do_line_qty_returned = json.l10n_do_line_qty_returned; - this.l10n_do_original_line_id = json.l10n_do_original_line_id; - }, - export_as_JSON: function () { - var json = _super_orderline.export_as_JSON.call(this); - - $.extend(json, { - l10n_do_line_qty_returned: this.l10n_do_line_qty_returned, - l10n_do_original_line_id: this.l10n_do_original_line_id, - }); - return json; - }, - }); - - - models.PosModel = models.PosModel.extend({ - initialize: function (session, attributes) { - this.invoices = []; - this.sale_fiscal_type_selection = []; // This list define sale_fiscal_type on pos - this.sale_fiscal_type_default_id = 'final'; // This define the default id of sale_fiscal_type - this.sale_fiscal_type = []; // This list define sale_fiscal_type on pos - this.sale_fiscal_type_by_id = {}; // This object define sale_fiscal_type on pos - this.sale_fiscal_type_vat = []; // This list define relation between sale_fiscal_type and vat on pos - this.tax_payer_type_list = []; - this.ncf_types_data = {}; - - _super_posmodel.initialize.call(this, session, attributes); - }, - get_latam_document_type_by_id: function (id) { - var self = this; - var res_latam_document_type = false; - // TODO: try make at best performance - self.l10n_latam_document_types.forEach( - function (latam_document_type) { - if (latam_document_type.id === id) { - res_latam_document_type = latam_document_type; - } - }); - if (!res_latam_document_type) { - res_latam_document_type = - this.get_latam_document_type_by_prefix(); - } - return res_latam_document_type; - }, - - get_l10n_latam_sequence_by_document_type_id: - function (document_type_id) { - var result = false; - var self = this; - self.l10n_latam_sequences.forEach( - function (latam_sequence) { - if (latam_sequence.l10n_latam_document_type_id[0] === - document_type_id) { - result = latam_sequence; - } - }); - return result; - }, - - get_latam_document_type_by_l10n_do_ncf_type: function (l10n_do_ncf_type) { - var self = this; - var res_latam_document_type = false; - // TODO: try make at best performance - if (!l10n_do_ncf_type) { - l10n_do_ncf_type = 'consumer'; - } - self.l10n_latam_document_types.forEach( - function (latam_document_type) { - if (latam_document_type.l10n_do_ncf_type === l10n_do_ncf_type) { - res_latam_document_type = latam_document_type; - } - }); - if (res_latam_document_type) { - return res_latam_document_type; - } - self.gui.show_popup('error', { - 'title': _t('Fiscal document type not found'), - 'body': _t('This fiscal document type not exist.'), - }); - return false; - }, - - get_latam_document_type_by_prefix: function (prefix) { - var self = this; - var res_latam_document_type = false; - // TODO: try make at best performance - var real_prefix = prefix; - if (!real_prefix) { - real_prefix = 'B02'; - } - self.l10n_latam_document_types.forEach( - function (latam_document_type) { - if (latam_document_type.doc_code_prefix === real_prefix) { - res_latam_document_type = latam_document_type; - } - }); - if (res_latam_document_type) { - return res_latam_document_type; - } - self.gui.show_popup('error', { - 'title': _t('Fiscal document type not found'), - 'body': _t('This fiscal document type not exist.'), - }); - return false; - }, - - loading_screen_on: function () { - $('.freeze_screen_spinner').addClass("active_state"); - }, - - loading_screen_off: function () { - $('.freeze_screen_spinner').removeClass("active_state"); - }, - - - // TODO: check this part for credit order - set_order: function (order) { - _super_posmodel.set_order.call(this, order); - - if (order && order.l10n_do_is_return_order === true) { - this.gui.show_screen('payment'); - } - }, - - get_orders_from_server: function () { - var self = this; - var kwargs = {}; - var loading_type = posmodel.config.l10n_do_order_loading_options; - if (loading_type === 'n_days') { - kwargs.day_limit = this.config.l10n_do_number_of_days || 0; - kwargs.config_id = this.config.id; - } else if (loading_type === "current_session") { - kwargs.session_id = posmodel.pos_session.id; - } - rpc.query({ - model: 'pos.order', - method: 'order_search_from_ui', - args: [], - kwargs: kwargs, - }, {}) - .then(function (result) { - var orders = result && result.orders || []; - var orderlines = result && result.orderlines || []; - - orders.forEach(function (order) { - var obj = self.db.order_by_id[order.id]; - - if (!obj) { - self.db.pos_all_orders.unshift(order); - } - self.db.order_by_id[order.id] = order; - }); - self.db.pos_all_order_lines.concat(orderlines); - orderlines.forEach(function (line) { - self.db.line_by_id[line.id] = line; - }); - - self.gui.screen_instances.invoiceslist.render_list( - self.db.pos_all_orders); - - }); - }, - - get_tax_payer_name: function (tax_payer_type_id) { - var tax_payer_name = 'N/A'; - this.tax_payer_type_list.forEach(function (tax_payer_type) { - if(tax_payer_type[0] === tax_payer_type_id) - tax_payer_name = tax_payer_type[1]; - }); - return tax_payer_name - }, - - load_server_data: function () { - var self = this; - var loaded = _super_posmodel.load_server_data.call(this); - return loaded.then(function() { - return rpc.query({ - model: "pos.config", - method: "get_l10n_do_fiscal_type_data", - args: [false], - }).then(function(result) { - self.tax_payer_type_list = result.tax_payer_type_list; - self.ncf_types_data = result.ncf_types_data; - }); - }); - }, - - }); - - return models; -}); diff --git a/l10n_do_pos/static/src/js/screens.js b/l10n_do_pos/static/src/js/screens.js deleted file mode 100644 index 59353aa27..000000000 --- a/l10n_do_pos/static/src/js/screens.js +++ /dev/null @@ -1,1077 +0,0 @@ -// © 2015-2018 Eneldo Serrata -// © 2017-2018 Gustavo Valverde -// © 2018 Jorge Hernández -// © 2018 Francisco Peñaló -// © 2018 Kevin Jiménez -// © 2019-2020 Raul Ovalle - -// This file is part of NCF Manager. - -// NCF Manager is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// NCF Manager is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with NCF Manager. If not, see . - - -odoo.define('l10n_do_pos.screens', function (require) { - "use strict"; - - var screens = require('point_of_sale.screens'); - var gui = require('point_of_sale.gui'); - var popups = require('point_of_sale.popups'); - var core = require('web.core'); - var rpc = require('web.rpc'); - var QWeb = core.qweb; - var _t = core._t; - - var QueryInvoicesButton = screens.ActionButtonWidget.extend({ - template: 'QueryInvoicesButton', - button_click: function () { - this.pos.get_orders_from_server(); - this.gui.show_screen('invoiceslist'); - }, - }); - - screens.define_action_button({ - 'name': 'invoices_query', - 'widget': QueryInvoicesButton, - 'condition': function () { - return true; - }, - }); - - screens.PaymentScreenWidget.include({ - init: function (parent, options) { - var self = this, - popup_options = { - popup_name: "textinput", - title: 'Digite el número de NCF de la Nota de Crédito', - disable_keyboard_handler: true, - input_name: 'ncf', - text_input_value: '', - confirm: function (input_value) { - // var selection_val = $('.pos .popup select.credit_notes').val(); - // if (selection_val) { - // var credit_note = self.pos.db.credit_note_by_id[selection_val] - // input_value = credit_note.reference; - // } - var msg_error = ""; - rpc.query({ - model: 'pos.order', - method: 'credit_note_info_from_ui', - args: [input_value], - }, {}) - .then(function (result) { - var residual = parseFloat(result.residual) || 0; - var client = self.pos.get_client(); - if (!client){ - client = { - id: self.pos.config.l10n_do_default_partner_id[0] - } - } - - if (result.id === false) { - msg_error = _t("La nota de credito no existe."); - } else if (!client || (client && client.id !== result.partner_id)){ - msg_error = _t("La Nota de Crédito Pertenece a Otro Cliente"); - } else if (residual < 1) { - msg_error = _t("El balance de la Nota de Credito es 0."); - } else { - var order = self.pos.get_order(); - var payment_method = self.pos.payment_methods_by_id[10001]; - var paymentline = order.paymentlines.find(function (pl) { - return pl.note === input_value; - }); - - if (paymentline) { - msg_error = "Esta Nota de Credito ya esta aplicada a la Orden"; - } else { - order.add_paymentline(payment_method); - order.selected_paymentline.credit_note_id = result.id; - order.selected_paymentline.note = input_value; - order.selected_paymentline.set_amount(residual); // Add paymentline for residual - self.reset_input(); - self.order_changes(); - self.render_paymentlines(); - return false; - } - } - popup_options.text_input_value = input_value; - self.gui.show_popup('error', { - title: _t("Search") + " Nota de Credito", - body: msg_error, - disable_keyboard_handler: true, - cancel: function () { - self.gui.show_popup('textinput', popup_options); - }, - }); - }); - }, - }, - credit_card_options = { - popup_name: 'textinput', - title: 'Digite el número de Referencia', - disable_keyboard_handler: true, - input_name: 'credit_card', - text_input_value: '', - confirm: function (input) { - var payment_method = this.options.payment_method; - payment_method.payment_reference = input; - self.pos.get_order().add_paymentline(payment_method); - self.reset_input(); - self.render_paymentlines(); - }, - }; - - this._super(parent, options); - this.orderValidationDate = null; - - for (var n in this.pos.payment_methods) { - var current_payment_method = this.pos.payment_methods[n]; - - if (current_payment_method.id == 10001) { - // Set the popup options for the payment method Credit Note - current_payment_method.popup_options = popup_options; - } - // TODO: CREDIT CARD OPTIONS - // else if (current_payment_method.journal.payment_form === "card" && !current_payment_method.credit) { - // // Set the popup options for the payment method Credit/Debit Card - // current_payment_method.popup_options = credit_card_options; - // } - - } - }, - show: function () { - var self = this; - var order = this.pos.get_order(); - var paymentContents = this.$('.left-content, .right-content, .back, .next'); - var refundContents = this.$('.refund-confirm-content, .cancel, .confirm'); - - this._super(); - if (order && order.l10n_do_is_return_order) { - var refundConfirm = this.$('.refund-confirm-content'); - - paymentContents.addClass('oe_hidden'); - refundContents.removeClass('oe_hidden'); - this.$('.top-content h1').html(_t('Refund Order')); - refundConfirm.empty(); - refundConfirm.append(QWeb.render('OrderRefundConfirm', {widget: this, order: order})); - if (order.paymentlines.length === 0) { - var payment_method = this.pos.payment_methods[0]; - - for (var n in this.pos.payment_methods) { - if (this.pos.payment_methods[n].is_cash_count) { - payment_method = this.pos.payment_methods[n]; - break; - } - } - order.add_paymentline(payment_method); - order.selected_paymentline.set_amount(order.get_total_with_tax()); // Add paymentline for total+tax - } - this.order_changes(); - this.$('.button.confirm').click(function () { - self.gui.show_popup('confirm', { - title: _t('Create') + ' ' + _t('Refund Order'), - body: _t('Are you sure you want to create this refund order?'), - confirm: function () { - self.validate_order(); - }, - }); - return false; - }).addClass('highlight'); - this.$('.button.cancel').click(function () { - $('.order-selector .deleteorder-button').click(); - return false; - }); - this.$('.button-custom.edit').click(function () { - var original_order = self.pos.db.order_by_id[order.l10n_do_return_order_id]; - var original_orderlines = []; - var return_product = {}; - - order.orderlineList.forEach(function (obj) { - return_product[obj.product_id] = obj.quantity; - }); - self.gui.show_popup('refund_order_popup', { - disable_keyboard_handler: true, - order: original_order, - orderlines: original_orderlines, - is_partial_return: true, - mode: 'edit', - confirm: function () { - var paymentlines = order.get_paymentlines(); - - for (var n = paymentlines.length - 1; n >= 0; n--) { - order.paymentlines.remove(paymentlines[n]); - } - }, - }); - return false; - }); - } else { - paymentContents.removeClass('oe_hidden'); - refundContents.addClass('oe_hidden'); - } - this.$('.button.js_invoice').remove(); - // Improving the keyboard handling method - this.gui.__disable_keyboard_handler(); - this.gui.__enable_keyboard_handler(); - }, - click_paymentmethods: function (id) { - // Validamos que la orden tenga saldo pendiente antes de agregar una nueva linea de pago - if (this.pos.get_order().get_due() <= 0) { - this.gui.show_popup('alert', { - title: _t("Payment"), - body: _t("This order has no pending balance."), - disable_keyboard_handler: true, - }); - } else { - for (var i = 0; i < this.pos.payment_methods.length; i++) { - var payment_method = this.pos.payment_methods[i]; - - // Evaluamos si es una forma de pago especial que abre un popup - if (payment_method.id === id && payment_method.popup_options) { - var popup_options = _.extend(_.clone(payment_method.popup_options), {payment_method: payment_method}); - this.gui.show_popup(popup_options.popup_name || 'alert', popup_options); - return false; - } - } - this._super(id); - } - }, - payment_input: function (input) { - var order = this.pos.get_order(); - - // Evitamos que se pueda cambiar el monto de la Nota de Credito - if (order.selected_paymentline && order.selected_paymentline.payment_method.id === 10001) { - return false; - } - this._super(input); - }, - - // TODO: check above this part ^^^^^^^^^^ - - keyboard_off: function () { - // That one comes from BarcodeEvents - $('body').keypress(this.keyboard_handler); - // That one comes from the pos, but we prefer to cover - // all the basis - $('body').keydown(this.keyboard_keydown_handler); - }, - keyboard_on: function () { - $('body').off('keypress', this.keyboard_handler); - $('body').off('keydown', this.keyboard_keydown_handler); - }, - - renderElement: function () { - this._super(); - var self = this; - this.$('.js_set_latam_document_type').click(function () { - self.click_set_latam_document_type(); - }); - }, - - open_vat_popup: function () { - var self = this; - var current_order = self.pos.get_order(); - - self.keyboard_on(); - self.gui.show_popup('textinput', { - 'title': _t('You need to select a customer with RNC/Céd for' + - ' this fiscal type, place writes RNC/Céd'), - 'vat': '', - confirm: function (vat) { - self.keyboard_off(); - if (!(vat.length === 9 || vat.length === 11) || - Number.isNaN(Number(vat))) { - - self.gui.show_popup('error', { - 'title': _t('This not RNC or Cédula'), - 'body': _t('Please check if RNC or Cédula is' + - ' correct'), - cancel: function () { - self.open_vat_popup(); - }, - }); - - } else { - // TODO: in future try optimize search partners - // link get_partner_by_id - self.keyboard_off(); - var partner = self.pos.partners.find( - function (partner_obj) { - return partner_obj.vat === vat; - } - ); - if (partner) { - current_order.set_client(partner); - } else { - // TODO: in future create automatic partner - self.gui.show_screen('clientlist'); - } - } - - }, - cancel: function () { - self.keyboard_off(); - if (!current_order.get_client()) { - current_order.set_latam_document_type( - this.pos.get_latam_document_type_by_prefix() - ); - } - }, - }); - }, - - click_set_latam_document_type: function () { - var self = this; - var current_order = self.pos.get_order(); - var client = self.pos.get_client(); - var ncf_types_data = self.pos.ncf_types_data.issued['non_payer']; - if (client && client.l10n_do_dgii_tax_payer_type) - ncf_types_data = self.pos.ncf_types_data.issued[client.l10n_do_dgii_tax_payer_type]; - - var latam_document_type_list = - _.map(self.pos.l10n_latam_document_types, - function (latam_document_type) { - if (latam_document_type.internal_type === 'invoice' && - ncf_types_data.includes(latam_document_type.l10n_do_ncf_type)) { - return { - label: latam_document_type.name, - item: latam_document_type, - }; - } - return false; - }); - - self.gui.show_popup('selection', { - title: _t('Select document type'), - list: latam_document_type_list, - confirm: function (latam_document_type) { - current_order.set_latam_document_type(latam_document_type); - if (latam_document_type.is_vat_required && !client) { - self.open_vat_popup(); - } - if (latam_document_type.is_vat_required && client) { - if (!client.vat) { - self.open_vat_popup(); - } - } - }, - is_selected: function (latam_document_type) { - var order = self.pos.get_order(); - return latam_document_type === - order.l10n_latam_document_type; - }, - }); - }, - - order_is_valid: function (force_validation) { - - var self = this; - var current_order = this.pos.get_order(); - var client = current_order.get_client(); - var total = current_order.get_total_with_tax(); - if (current_order.to_invoice_backend) { - current_order.to_invoice = false; - current_order.save_to_db(); - } - - if (total === 0) { - this.gui.show_popup('error', { - 'title': _t('Sale in'), - 'body': _t('You cannot make sales in 0, please add a ' + - 'product with value'), - }); - return false; - } - - if (self.pos.invoice_journal.l10n_latam_use_documents && - current_order.to_invoice_backend) { - - var latam_sequence = - self.pos.get_l10n_latam_sequence_by_document_type_id( - current_order.l10n_latam_document_type.id - ); - - if (!latam_sequence) { - this.gui.show_popup('error', { - 'title': _t('Not fiscal sequence'), - 'body': _t('Please configure correct fiscal sequence in invoice journal'), - }); - current_order.to_invoice = true; - current_order.save_to_db(); - return false; - } - - if (!self.pos.config.l10n_do_default_partner_id && !client) { - this.gui.show_popup('error', { - 'title': _t('No customer'), - 'body': _t('Please select a customer or set one as default in the point of sale settings'), - }); - current_order.to_invoice = true; - current_order.save_to_db(); - return false; - } - - if (current_order.l10n_latam_document_type.is_vat_required && - !client) { - - this.gui.show_popup('error', { - 'title': _t('Required document (RNC/Céd.)'), - 'body': _t('For invoice fiscal type ' + - current_order.fiscal_type.name + - ' its necessary customer, please select customer'), - }); - current_order.to_invoice = true; - current_order.save_to_db(); - return false; - - } - - if (current_order.l10n_latam_document_type.is_vat_required && - !client.vat) { - - this.gui.show_popup('error', { - 'title': _t('Required document (RNC/Céd.)'), - 'body': _t('For invoice fiscal type ' + - current_order.l10n_latam_document_type.name + - ' it is necessary for the customer have ' + - 'RNC or Céd.'), - }); - current_order.to_invoice = true; - current_order.save_to_db(); - return false; - } - - if (total >= 250000.00 && (!client || !client.vat)) { - this.gui.show_popup('error', { - 'title': _t('Sale greater than RD$ 250,000.00'), - 'body': _t('For this sale it is necessary for the ' + - 'customer have ID'), - }); - current_order.to_invoice = true; - current_order.save_to_db(); - return false; - } - - } - - - if (this._super(force_validation)) { - return true; - } - - if (current_order.to_invoice_backend) { - current_order.to_invoice = true; - current_order.save_to_db(); - } - - return false; - - }, - - finalize_validation: function () { - var self = this; - var current_order = this.pos.get_order(); - var _super = this._super.bind(this); - if (current_order.to_invoice_backend && - self.pos.invoice_journal.l10n_latam_use_documents && - !current_order.l10n_latam_document_number) { - var latam_sequence = - self.pos.get_l10n_latam_sequence_by_document_type_id( - current_order.l10n_latam_document_type.id - ); - self.pos.loading_screen_on(); - rpc.query({ - model: 'ir.sequence', - method: 'get_l10n_do_fiscal_info', - args: [latam_sequence.id], - }).then(function (res) { - self.pos.loading_screen_off(); - current_order.l10n_latam_document_number = res.ncf; - current_order.l10n_do_ncf_expiration_date = res.expiration_date; - current_order.l10n_latam_sequence_id = latam_sequence.id; - current_order.l10n_latam_document_type_id = - current_order.l10n_latam_document_type.id; - current_order.save_to_db(); - console.log(res); - _super(); - }, function (err) { - self.pos.loading_screen_off(); - current_order.to_invoice = true; - current_order.save_to_db(); - console.log('err', err); - err.event.preventDefault(); - var error_body = - _t('Your Internet connection is probably down.'); - if (err.message.data) { - var except = err.message.data; - error_body = except.message || except.arguments || error_body; - } - self.gui.show_popup('error', { - 'title': _t('Error: Could not Save Changes'), - 'body': error_body, - }); - }); - } else { - this._super(); - } - }, - }); - - /* --------------------------------------*\ - THE INVOICES LIST - ====================================== - Displays the list of invoices and allows the cashier - to reoder and rewrite the invoices. - */ - var InvoicesListScreenWidget = screens.ScreenWidget.extend({ - template: 'InvoicesListScreenWidget', - init: function (parent, options) { - this._super(parent, options); - }, - show: function () { - var self = this; - - this._super(); - this.renderElement(); - this.$('.order-details-contents').empty(); - this.$('.order-list').parent().scrollTop(0); - this.$('.back').click(function () { - self.gui.back(); - }); - - if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) { - this.chrome.widget.keyboard.connect(this.$('.invoices_search')); - } - - this.$('.invoices_search').on('keyup', function () { - self.perform_search(this.value); - }); - - this.$('.searchbox .search-clear').click(function () { - self.clear_search(); - }); - this.$('.order-list-contents').on('click', '.order-line', function (e) { - self.line_select(e, $(this), parseInt($(this).data('id'))); - }); - this.render_list(this.pos.db.pos_all_orders); - }, - perform_search: function (query) { - var self = this, - search_criteria = self.pos.config.order_search_criteria, - allOrders = this.pos.db.pos_all_orders, - filteredOrders = []; - - if ($.trim(query) === "") { - this.render_list(allOrders); - } else { - _.each(allOrders, function (order) { - _.each(search_criteria, function (criteria) { - if (order[criteria]) { - // The property partner_id in order object is an Array, the value to compare is in index 1 - if (_.isArray(order[criteria])) { - if (order[criteria][1].toLowerCase().indexOf(query.toLowerCase()) > -1) { - filteredOrders.push(order); - return true; - } - } else if (order[criteria].toLowerCase().indexOf(query.toLowerCase()) > -1) { - filteredOrders.push(order); - return true; - } - } - }); - }); - - this.render_list(_.uniq(filteredOrders)); - } - }, - clear_search: function () { - this.$('.invoices_search')[0].value = ''; - this.$('.invoices_search').focus(); - this.render_list(this.pos.db.pos_all_orders); - }, - render_list: function (orders) { - var self = this; - var contents = this.$('.order-list-contents'); - - contents.empty(); - - if (!orders) { - return; - } - - this.display_order_details('hide'); - orders.forEach(function (order) { - contents.append(QWeb.render('InvoicesLine', {widget: self, order: order})); - }); - }, - close: function () { - this._super(); - this.$('.order-list-contents').off('click', '.order-line'); - if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) { - this.chrome.widget.keyboard.hide(); - } - }, - line_select: function (event, $line, id) { - var self = this; - var order = self.pos.db.order_by_id[id]; - - this.$('.order-list .lowlight').removeClass('lowlight'); - if ($line.hasClass('highlight')) { - $line.removeClass('highlight'); - $line.addClass('lowlight'); - this.display_order_details('hide'); - } else { - var y; - - this.$('.order-list .highlight').removeClass('highlight'); - $line.addClass('highlight'); - this.selected_tr_element = $line; - y = event.pageY - $line.parent().offset().top; - this.display_order_details('show', order, y); - } - }, - display_order_details: function (visibility, order, clickpos) { - var self = this; - var contents = this.$('.order-details-contents'); - var parent = this.$('.order-list').parent(); - var scroll = parent.scrollTop(); - var height = contents.height(); - var new_height = 0; - var orderlines = []; - var payment_ids = []; - - if (visibility === 'show') { - var sumQty = 0; - order.lines.forEach(function (line_id) { - var line = self.pos.db.line_by_id[line_id]; - orderlines.push(line); - sumQty += line.qty - line.l10n_do_line_qty_returned; - }); - - if (sumQty === 0) { - order.refunded = true; - order.l10n_do_return_status = 'fully_returned'; - } - contents.empty(); - contents.append($(QWeb.render('OrderDetails', - { - widget: this, - order: order, - orderlines: orderlines, - payment_ids: payment_ids, - }))); - new_height = contents.height(); - if (!this.details_visible) { - if (clickpos < scroll + new_height + 20) { - parent.scrollTop(clickpos - 20); - } else { - parent.scrollTop(parent.scrollTop() + new_height); - } - } else { - parent.scrollTop(parent.scrollTop() - height + new_height); - } - this.$("#close_order_details").on("click", function () { - self.display_order_details('hide'); - }); - self.$("#refund").on("click", function () { - var message = ''; - var non_returnable_products = false; - var original_orderlines = []; - var allow_return = true; - var orders = self.pos.get_order_list(); - - // Mostramos la pantalla con la orden si ya esta en proceso de creacion - for (var n in orders) { - var _order = orders[n]; - - if (_order.l10n_do_is_return_order && _order.l10n_do_return_order_id === order.id) { - self.pos.set_order(_order); - return false; - } - } - if (order.l10n_do_return_status === 'fully_returned') { - message = 'No quedan items para devolver en esta orden!!'; - allow_return = false; - } - if (allow_return) { - order.lines.forEach(function (line_id) { - var line = self.pos.db.line_by_id[line_id]; - var product = self.pos.db.get_product_by_id(line.product_id[0]); - - if (product == null) { - non_returnable_products = true; - message = 'Algun(os) producto(s) de esta orden no esta(n) disponible(s) en el Punto de Venta, desea devolver los productos restantes?'; - } else if (line.qty - line.l10n_do_line_qty_returned > 0) { - original_orderlines.push(line); - } - }); - if (original_orderlines.length === 0) { - self.gui.show_popup('alert', { - 'title': _t('No se puede devolver esta Orden!!!'), - 'body': _t("No quedan productos retornables en esta orden. Tal vez los productos son No Retornables o no estan disponibles en el Punto de Venta!!"), - }); - } else if (non_returnable_products) { - self.gui.show_popup('confirm', { - 'title': _t('Warning !!!'), - 'body': _t(message), - confirm: function () { - self.gui.show_popup('refund_order_popup', { - 'orderlines': original_orderlines, - 'order': order, - 'is_partial_return': true, - }); - }, - }); - } else { - self.gui.show_popup('refund_order_popup', { - 'orderlines': original_orderlines, - 'order': order, - 'is_partial_return': false, - }); - } - } else { - self.gui.show_popup('alert', { - 'title': _t('Warning!!!'), - 'body': _t(message), - }); - } - }); - } else if (visibility === 'hide') { - if (this.selected_tr_element) { - this.selected_tr_element.removeClass('highlight'); - this.selected_tr_element.addClass('lowlight'); - } - contents.empty(); - if (height > scroll) { - contents.css({height: height + 'px'}); - contents.animate({height: 0}, 400, - function () { - contents.css({height: ''}); - }); - } else { - parent.scrollTop(parent.scrollTop() - height); - } - } - - this.details_visible = visibility === 'show'; - }, - }); - - gui.define_screen({name: 'invoiceslist', widget: InvoicesListScreenWidget}); - - var OrderRefundPopup = popups.extend({ - template: 'OrderRefundPopup', - events: { - 'click .button.cancel': 'click_cancel', - 'click #complete_return': 'click_complete_return', - 'click #return_order': 'click_return_order', - }, - click_complete_return: function () { - $.each($('.return_qty'), function (index, value) { - var line_quantity_remaining = parseFloat($(value).find('input').attr('line-qty-remaining')); - $(value).find('input').val(line_quantity_remaining); - }); - }, - click_return_order: function () { - var self = this; - var all = $('.return_qty'); - var return_lines = {}; - var return_entries_ok = true, is_input_focused = false; - - $.each(all, function (index, value) { - var input_element = $(value).find('input'); - var line_quantity_remaining = parseFloat(input_element.attr('line-qty-remaining')); - var line_id = parseFloat(input_element.attr('line-id')); - var qty_input = parseFloat(input_element.val()); - - if (!$.isNumeric(qty_input) || qty_input > line_quantity_remaining || qty_input < 0) { - return_entries_ok = false; - input_element.css("background-color", "#ff8888;"); - setTimeout(function () { - input_element.css("background-color", ""); - }, 100); - setTimeout(function () { - input_element.css("background-color", "#ff8888;"); - }, 200); - setTimeout(function () { - input_element.css("background-color", ""); - }, 300); - setTimeout(function () { - input_element.css("background-color", "#ff8888;"); - }, 400); - setTimeout(function () { - input_element.css("background-color", ""); - }, 500); - if (!is_input_focused) { - input_element.select(); - is_input_focused = true; - } - } - - if (qty_input === 0 && line_quantity_remaining !== 0 && !self.options.is_partial_return) { - self.options.is_partial_return = true; - } else if (qty_input > 0) { - return_lines[line_id] = { - qty: qty_input, - qty_remaining: line_quantity_remaining, - }; - if (line_quantity_remaining !== qty_input && !self.options.is_partial_return) { - self.options.is_partial_return = true; - } - } - }); - if (Object.keys(return_lines).length === 0) { - self.$("input").css("background-color", "#ff8888;"); - setTimeout(function () { - self.$("input").css("background-color", ""); - }, 100); - setTimeout(function () { - self.$("input").css("background-color", "#ff8888;"); - }, 200); - setTimeout(function () { - self.$("input").css("background-color", ""); - }, 300); - setTimeout(function () { - self.$("input").css("background-color", "#ff8888;"); - }, 400); - setTimeout(function () { - self.$("input").css("background-color", ""); - }, 500); - if (self.$("input").length > 0) { - self.$("input:eq(0)").select(); - } - } else if (return_entries_ok) { - self.create_return_order(return_lines); - } - }, - create_return_order: function (return_lines) { - var self = this; - var order = self.options.order; - var refund_order = {}; - - if (Object.keys(return_lines).length === 0) { - return; - } - - if (self.options.mode === 'edit') { - var _order = self.pos.get_order(); - var orderlines = _order.get_orderlines(); - for (var n = orderlines.length - 1; n >= 0; n--) { - _order.orderlines.remove(orderlines[n]); - } - refund_order = _order; - } else { - self.gui.show_screen('products'); - self.pos.add_new_order(); // Crea un nuevo objeto orden del lado del cliente - refund_order = self.pos.get_order(); - refund_order.l10n_do_is_return_order = true; - refund_order.l10n_do_return_order_id = order.id; - refund_order.l10n_do_origin_ncf = order.l10n_latam_document_number; - refund_order.set_client(self.pos.db.get_partner_by_id(order.partner_id[0])); - refund_order.set_latam_document_type( - self.pos.l10n_latam_document_type_credit_note) - } - refund_order.orderlineList = []; - refund_order.amount_total = 0; - if (self.options.is_partial_return) { - refund_order.l10n_do_return_status = 'partially_returned'; - } else { - refund_order.l10n_do_return_status = 'fully_returned'; - } - Object.keys(return_lines).forEach(function (line_id) { - var return_line = return_lines[line_id]; - var line = self.pos.db.line_by_id[line_id]; - var product = self.pos.db.get_product_by_id(line.product_id[0]); - var qty = -1*parseFloat(return_line.qty); - - refund_order.add_product(product, { - quantity: qty, - price: line.price_unit, - discount: line.discount, - }); - refund_order.selected_orderline.l10n_do_original_line_id = line.id; - var apply_discounts = function (price, discount) { - return price - (price * Math.max(Math.min(discount, 100), 0))/100; - }; - var unit_price_with_discounts = apply_discounts(line.price_unit, line.discount); - var unit_price_with_taxes = line.qty ? parseFloat(line.price_subtotal_incl) / line.qty : 0; - refund_order.amount_total += unit_price_with_taxes * qty; - refund_order.orderlineList.push({ - line_id: line_id, - product_id: line.product_id[0], - product_name: line.product_id[1], - quantity: qty, - price: line.price_subtotal_incl, - price_unit: unit_price_with_discounts, - taxes: qty ? ( unit_price_with_taxes - unit_price_with_discounts ) : 0 - }); - }); - this.click_confirm(); - self.gui.show_screen('payment', null, true); - }, - show: function (options) { - var firstInput; - - options = options || {}; - this._super(options); - this.orderlines = options.orderlines || []; - this.renderElement(); - firstInput = $('.return_qty input:eq(0)'); - if (firstInput.length) { - firstInput.select(); - } - }, - }); - - gui.define_popup({ - name: 'refund_order_popup', - widget: OrderRefundPopup, - }); - - popups.include({ - /** - * Show the popup - * @param {(string, Object)} options - The title or optional configuration for the popup. - * @param {boolean} options.disable_keyboard_handler - Disable the keyboard capture for the payment screen - * when the popup is opened. - * @param {string} options.input_name - Indicate the name of text input and is used for show the - * description of it for the textinput and textarea popups - * @param {string} options.text_input_value - Indicate the initial value of text input for the textinput - * and textarea popups - */ - show: function (options) { - this._super(options); - }, - renderElement: function () { - this._super(); - // Ponemos un valor por defecto al input del popup TextInput o TextArea - if (["TextInputPopupWidget", "TextAreaPopupWidget"].indexOf(this.template) > -1) { - var self = this; - var input = this.$('input,textarea'); - - if (input.length > 0) { - // Ponemos un valor al input - input.val(this.options.text_input_value || ''); - // Ejecutamos el clic al boton confirm al presionar Enter - input.on('keypress', function (event) { - if (event.which === 13) { - self.click_confirm(this.value); - event.stopPropagation(); - event.preventDefault(); - } - }); - } - } - }, - close: function () { - this._super(); - if (this.options && this.options.hasOwnProperty('text_input_value')) { - this.options.text_input_value = ''; - } - }, - }); - - // TODO CHECK THIS - // screens.ActionpadWidget.include({ - // renderElement: function () { - // var self = this, - // $payButton, - // payButtonClickSuper; - // - // this._super.apply(this, arguments); - // $payButton = this.$('.pay'); - // // TODO CHECK THIS - // // payButtonClickSuper = $payButton.getEvent('click', 0); - // $payButton.off('click'); - // $payButton.on("click", function () { - // var invoicing = self.pos.config.module_account; - // var order = self.pos.get_order(); - // var client = self.pos.get_client(); - // var popupErrorOptions = ''; - // - // if (order.get_total_with_tax() <= 0) { - // popupErrorOptions = { - // 'title': 'Cantidad de articulos a pagar', - // 'body': 'La orden esta vacia o el total pagar es RD$0.00', - // }; - // } else if (client && !client.vat) { - // if (["fiscal", "gov", "special"].indexOf(client.sale_fiscal_type) > -1) { - // popupErrorOptions = { - // 'title': 'Para el tipo de comprobante', - // 'body': 'No puede crear una factura con crédito fiscal si el cliente ' + - // 'no tiene RNC o Cédula.\n\nPuede pedir ayuda para que el cliente sea ' + - // 'registrado correctamente si este desea comprobante fiscal.', - // }; - // } else if (invoicing && order.get_total_without_tax() >= 250000) { - // popupErrorOptions = { - // 'title': 'Factura sin Cedula de Cliente', - // 'body': 'El cliente debe tener una cedula si el total de la factura ' + - // 'es igual o mayor a RD$250,000.00 o mas', - // }; - // } - // } - // if (popupErrorOptions) { - // self.gui.show_popup('error', popupErrorOptions); - // } else if (payButtonClickSuper) { - // payButtonClickSuper.apply(this, arguments); - // } - // }); - // }, - // }); - - gui.Gui.include({ - - /** - * Allows the keyboard capture for the current screen - */ - __enable_keyboard_handler: function () { - var current_screen = this.current_screen; - - if (!current_screen || !current_screen.keyboard_handler) { - return; - } - - $('body').on('keypress', current_screen.keyboard_handler); - $('body').on('keydown', current_screen.keyboard_keydown_handler); - }, - - /** - * Remove the keyboard capture for the current screen - */ - __disable_keyboard_handler: function () { - var current_screen = this.current_screen; - - if (!current_screen || !current_screen.keyboard_handler) { - return; - } - - $('body').off('keypress', current_screen.keyboard_handler); - $('body').off('keydown', current_screen.keyboard_keydown_handler); - window.document.body.removeEventListener('keypress', current_screen.keyboard_handler); - window.document.body.removeEventListener('keydown', current_screen.keyboard_keydown_handler); - }, - show_popup: function (name, options) { - if (options && options.disable_keyboard_handler === true) { - this.__disable_keyboard_handler(); - } - return this._super(name, options); - }, - close_popup: function () { - if (this.current_popup && this.current_popup.options && - this.current_popup.options.disable_keyboard_handler === true) { - this.__enable_keyboard_handler(); - } - this._super(); - }, - }); -}); diff --git a/l10n_do_pos/static/src/xml/pos.xml b/l10n_do_pos/static/src/xml/pos.xml deleted file mode 100644 index 674254e8b..000000000 --- a/l10n_do_pos/static/src/xml/pos.xml +++ /dev/null @@ -1,575 +0,0 @@ - - - - - - -
- - - - - - - - Select document type - - - -
-
-
-
- - - - - - - - - -
-
-
-
-
- - - - All Invoices - - - - -
-
-
- - - Back - - - - - -
-
-
- -
-
-
- - - - - - - - - - - - - -
Fecha OrdenNúmero de PedidoNCFClienteMontoEstado
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-

Detalles de la Orden

-
-
- Nombre: - - - -
- -
- Cliente: - - - -
-
- -
- Cliente: - - -
-
-
-
-
- - -
- NC/Devolución -
-
- -
- Refunded -
-
-
-
- -
- Fecha: - - - -
-
- NC/Devolución: - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - -
ProductoCantidadDevolucionesPrecio UnitarioImpuestoDescuento(%)Precio
- - - - (Unavailable In POS) - - - - - - - - - - - - - - - - - - - - - - - - - - - - % - - - -
-
-
-
-
- - Métodos de pago: - -
    - -
  • - - () -
  • -
    -
-
-
-
-
- Total - - - -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- Customer: - - - -
-
- Tax ID: - -
-
-
- - - Edit - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductQuantityTaxesAmount
- - - - - - - -
- -
-
-
-
- - - -
-
-
- - - - Cancel - - - - Confirm - - - - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - -
- Taxpayer Type - -
-
-
- - - -
- Taxpayer Type - - - - - - - N/A - -
-
-
-
diff --git a/l10n_do_pos/static/src/xml/posticket.xml b/l10n_do_pos/static/src/xml/posticket.xml deleted file mode 100644 index fd1756246..000000000 --- a/l10n_do_pos/static/src/xml/posticket.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - -
-
- - -
-
- - -
-
- - , - - - - - -
- RNC: - -
-
-
- -
- -
- Factura de - - -
- NCF: - - - -
- NCF Modificado: - - -
- -
- Válida hasta: - - -
-
-
-
-
-
- Fecha....: - -
- - - Cliente..: - -
- - RNC/Céd..: - -
-
- - Código..: - -
-
-
- - - - - Telefono.: - -
-
-
- Cajero/a.: - -
- - - - -
- Vendedor/a.: - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Cant. - - Producto - - $/Und. - - ITBIS - - Valor - - -
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
- -
-
- -
With a% discount -
-
-
- - - - - - - - E - -
- -
-
-
-
-
-
- SubTotal: -
-
- -
- : -
-
-
- - - Descuento: - -
-
-
-
-
- - Total: - -
-
-
-
-
- -
- : - - - -
-
-
-
-
-
- -
- Cambio: - -
-
-
-
-
- - - - diff --git a/l10n_do_pos/views/assets.xml b/l10n_do_pos/views/assets.xml deleted file mode 100644 index 2b220d5d8..000000000 --- a/l10n_do_pos/views/assets.xml +++ /dev/null @@ -1,10 +0,0 @@ - - -