Monto Gravado |
@@ -212,8 +211,7 @@
Total
-
+
diff --git a/l10n_do_accounting/views/report_templates.xml b/l10n_do_accounting/views/report_templates.xml
index f552321f5..85d1b3c45 100644
--- a/l10n_do_accounting/views/report_templates.xml
+++ b/l10n_do_accounting/views/report_templates.xml
@@ -8,23 +8,22 @@
-
-
-
+
+
doc_model != "account.move" or (doc_model == "account.move" and o.country_code != "DO")
-
-
+
+
doc_model != "account.move" or (doc_model == "account.move" and o.country_code != "DO")
diff --git a/l10n_do_accounting/wizard/account_debit_note.py b/l10n_do_accounting/wizard/account_debit_note.py
index 62fed073a..c92b64e1d 100644
--- a/l10n_do_accounting/wizard/account_debit_note.py
+++ b/l10n_do_accounting/wizard/account_debit_note.py
@@ -19,7 +19,6 @@ def _get_l10n_do_default_debit_type(self):
@api.model
def _get_l10n_do_debit_action_selection(self):
-
return [
("draft_debit", _("Draft debit")),
("apply_debit", _("Apply debit")),
@@ -72,7 +71,6 @@ def _get_l10n_do_debit_action_selection(self):
@api.model
def default_get(self, fields):
-
res = super(AccountDebitNote, self).default_get(fields)
move_ids = (
@@ -160,7 +158,6 @@ def _onchange_move_id(self):
}
def _prepare_default_values(self, move):
-
res = super(AccountDebitNote, self)._prepare_default_values(move)
# Include additional info when l10n_do debit note
@@ -174,23 +171,46 @@ def _prepare_default_values(self, move):
l10n_do_expense_type=move.l10n_do_expense_type,
l10n_do_income_type=move.l10n_do_income_type,
invoice_origin=move.name,
- line_ids=[],
+ line_ids=[(5, 0, 0)],
l10n_do_fiscal_number=move.name,
)
)
+ origin_invoice_id = self.move_ids or self.env["account.move"].browse(
+ self.env.context.get("active_ids")
+ )
+ taxes = (
+ [
+ (
+ 6,
+ 0,
+ [origin_invoice_id._get_debit_line_tax(res["invoice_date"]).id],
+ )
+ ]
+ if self.l10n_do_debit_type
+ else [(5, 0)]
+ )
+ price_unit = (
+ self.l10n_do_amount
+ if self.l10n_do_debit_type == "fixed_amount"
+ else origin_invoice_id.amount_untaxed * (self.l10n_do_percentage / 100)
+ )
+ res["invoice_line_ids"] = [
+ (
+ 0,
+ 0,
+ {
+ "name": self.reason or _("Debit"),
+ "price_unit": price_unit,
+ "quantity": 1,
+ "tax_ids": taxes,
+ },
+ )
+ ]
+
return res
def create_debit(self):
-
- if self.l10n_latam_use_documents and self.l10n_latam_country_code:
- self = self.with_context(
- l10n_do_debit_type=self.l10n_do_debit_type,
- amount=self.l10n_do_amount,
- percentage=self.l10n_do_percentage,
- reason=self.reason,
- )
-
action = super(AccountDebitNote, self).create_debit()
if self.l10n_do_debit_action == "apply_debit":
# Post Debit Note
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
diff --git a/l10n_do_accounting/wizard/account_move_reversal.py b/l10n_do_accounting/wizard/account_move_reversal.py
index 8931065ad..c10a16327 100644
--- a/l10n_do_accounting/wizard/account_move_reversal.py
+++ b/l10n_do_accounting/wizard/account_move_reversal.py
@@ -6,7 +6,7 @@ class AccountMoveReversal(models.TransientModel):
_inherit = "account.move.reversal"
@api.model
- def _get_refund_type_selection(self):
+ def _get_l10n_do_refund_type_selection(self):
selection = [
("full_refund", _("Full Refund")),
("percentage", _("Percentage")),
@@ -16,12 +16,11 @@ def _get_refund_type_selection(self):
return selection
@api.model
- def _get_default_refund_type(self):
+ def _get_default_l10n_do_refund_type(self):
return "full_refund"
@api.model
def _get_refund_action_selection(self):
-
return [
("draft_refund", _("Partial Refund")),
("apply_refund", _("Full Refund")),
@@ -45,17 +44,17 @@ def _default_account(self):
related="company_id.country_code",
help="Technical field used to hide/show fields regarding the localization",
)
- refund_type = fields.Selection(
- selection=_get_refund_type_selection,
- default=_get_default_refund_type,
+ l10n_do_refund_type = fields.Selection(
+ selection=_get_l10n_do_refund_type_selection,
+ default=_get_default_l10n_do_refund_type,
)
- refund_action = fields.Selection(
+ l10n_do_refund_action = fields.Selection(
selection=_get_refund_action_selection,
default="draft_refund",
string="Refund Action",
)
- percentage = fields.Float()
- amount = fields.Float()
+ l10n_do_percentage = fields.Float("Percentage")
+ l10n_do_amount = fields.Float("Amount")
l10n_do_ecf_modification_code = fields.Selection(
selection=lambda self: self.env[
"account.move"
@@ -114,27 +113,56 @@ def default_get(self, fields):
return res
- @api.onchange("refund_type")
- def onchange_refund_type(self):
- if self.refund_type != "full_refund":
+ @api.onchange("l10n_do_refund_type")
+ def onchange_l10n_do_refund_type(self):
+ if self.l10n_do_refund_type != "full_refund":
self.refund_method = "refund"
- @api.onchange("refund_action")
+ @api.onchange("l10n_do_refund_action")
def onchange_refund_action(self):
- if self.refund_action == "apply_refund":
+ if self.l10n_do_refund_action == "apply_refund":
self.refund_method = "cancel"
else:
self.refund_method = "refund"
- def reverse_moves(self):
-
- return super(
- AccountMoveReversal,
- self.with_context(
- refund_type=self.refund_type,
- percentage=self.percentage,
- amount=self.amount,
- reason=self.reason,
- l10n_do_ecf_modification_code=self.l10n_do_ecf_modification_code,
- ),
- ).reverse_moves()
+ def _prepare_default_reversal(self, move):
+ result = super(AccountMoveReversal, self)._prepare_default_reversal(move)
+
+ if self.country_code == "DO" and move.l10n_latam_use_documents:
+ result.update(
+ {
+ "l10n_do_ecf_modification_code": self.l10n_do_ecf_modification_code,
+ "l10n_latam_document_number": self.l10n_latam_document_number,
+ "l10n_do_origin_ncf": move.l10n_latam_document_number,
+ "l10n_do_expense_type": move.l10n_do_expense_type,
+ "l10n_do_income_type": move.l10n_do_income_type,
+ "invoice_origin": move.name,
+ }
+ )
+
+ if self.l10n_do_refund_type != "full_refund":
+ result.update(
+ {
+ "l10n_latam_document_type_id": self.l10n_latam_document_type_id.id,
+ "line_ids": [(5, 0, 0)],
+ }
+ )
+
+ price_unit = (
+ self.l10n_do_amount
+ if self.l10n_do_refund_type == "fixed_amount"
+ else move.amount_untaxed * (self.l10n_do_percentage / 100)
+ )
+ result["invoice_line_ids"] = [
+ (
+ 0,
+ 0,
+ {
+ "name": self.reason or _("Credit"),
+ "price_unit": price_unit,
+ "quantity": 1,
+ },
+ )
+ ]
+
+ return result
diff --git a/l10n_do_accounting/wizard/account_move_reversal_views.xml b/l10n_do_accounting/wizard/account_move_reversal_views.xml
index 47f7da1e9..a34196ca1 100644
--- a/l10n_do_accounting/wizard/account_move_reversal_views.xml
+++ b/l10n_do_accounting/wizard/account_move_reversal_views.xml
@@ -25,23 +25,23 @@
}"/>
-
- {'invisible': [('refund_type', '!=', 'full_refund')]}
+ {'invisible': [('l10n_do_refund_type', '!=', 'full_refund')]}
-
+
-
-
+
+
- {'invisible': [('refund_type', '!=', 'full_refund')]}
+ {'invisible': [('l10n_do_refund_type', '!=', 'full_refund')]}
-
-
+
+
You will be able to edit and validate this
credit note directly or keep it draft.
-
+
Use this option if you want to fully apply a credit note.
The credit note will be created, validated and reconciled
with the invoice. You will not be able to modify the credit note.
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"]
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 05d6111ad..000000000
Binary files a/l10n_do_pos/static/description/icon.png and /dev/null differ
diff --git a/l10n_do_pos/static/src/css/pos.css b/l10n_do_pos/static/src/css/pos.css
deleted file mode 100644
index ed292bbb1..000000000
--- a/l10n_do_pos/static/src/css/pos.css
+++ /dev/null
@@ -1,304 +0,0 @@
-.pos .invoiceslist-screen .button.search {
- left: 50%;
- margin-left: 100px;
- margin-top: 20px;
- line-height: 18px;
- font-size: 14px;
-}
-
-.popup > 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 5e5ec685b..000000000
Binary files a/l10n_do_pos/static/src/img/icon-cross.png and /dev/null differ
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 10e23486e..000000000
Binary files a/l10n_do_pos/static/src/img/icon-features.png and /dev/null differ
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 303f9e248..000000000
Binary files a/l10n_do_pos/static/src/img/icon-help.png and /dev/null differ
diff --git a/l10n_do_pos/static/src/img/icon-support.png b/l10n_do_pos/static/src/img/icon-support.png
deleted file mode 100644
index 5f9759099..000000000
Binary files a/l10n_do_pos/static/src/img/icon-support.png and /dev/null differ
diff --git a/l10n_do_pos/static/src/img/icon.png b/l10n_do_pos/static/src/img/icon.png
deleted file mode 100644
index ebd80f4ce..000000000
Binary files a/l10n_do_pos/static/src/img/icon.png and /dev/null differ
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
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
- -
- |
-
-
-
-
-
-
-
-
- Detalles de la Orden
-
-
- Nombre:
-
-
-
-
-
-
- Cliente:
-
-
-
-
-
-
-
- Cliente:
- -
-
-
-
-
-
-
-
-
- NC/Devolución
-
-
-
-
- Refunded
-
-
-
-
-
-
- Fecha:
-
-
-
-
-
- NC/Devolución:
-
-
-
-
-
-
-
-
-
- Producto |
- Cantidad |
- Devoluciones |
- Precio Unitario |
- Impuesto |
- Descuento(%) |
- Precio |
-
-
-
-
-
-
-
- (Unavailable In POS)
-
- |
-
-
- |
-
-
- -
-
-
-
-
- |
-
-
- |
-
-
-
-
-
- -
-
- |
-
-
- -
-
-
- %
-
- |
-
-
- |
-
-
-
-
-
-
-
-
- Métodos de pago:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Customer:
-
-
-
-
-
- Tax ID:
-
-
-
-
-
-
- Edit
-
-
-
-
-
-
-
- Product |
- Quantity |
- Taxes |
- Amount |
-
-
-
-
-
-
-
-
-
- |
- |
- |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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:
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/l10n_do_pos/views/pos_config_views.xml b/l10n_do_pos/views/pos_config_views.xml
deleted file mode 100644
index 9a4109168..000000000
--- a/l10n_do_pos/views/pos_config_views.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
- l10n.do.pos.config.view.form
- pos.config
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List Orders
-
-
-
-
-
- Select to load orders
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Select days before for Credit Notes
-
-
-
-
-
-
-
-
-
-
diff --git a/l10n_do_pos/views/pos_order_views.xml b/l10n_do_pos/views/pos_order_views.xml
deleted file mode 100644
index b6b09f4f7..000000000
--- a/l10n_do_pos/views/pos_order_views.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
- l10n.do.pos.view.pos.pos.form
- pos.order
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {'invisible':[('state','not in', ('invoiced',
- 'l10n_do_is_return_order'))]}
-
-
-
-
-
- l10n.do.pos.view.pos.order.tree
- pos.order
-
-
-
-
-
-
-
-
|