odoo-addon-l10n-es-verifactu-oca 18.0.1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/l10n_es_verifactu_oca/README.rst +195 -0
- odoo/addons/l10n_es_verifactu_oca/__init__.py +3 -0
- odoo/addons/l10n_es_verifactu_oca/__manifest__.py +50 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_config_parameter.xml +9 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_cron.xml +13 -0
- odoo/addons/l10n_es_verifactu_oca/data/l10n.es.aeat.map.tax.line.tax.csv +50 -0
- odoo/addons/l10n_es_verifactu_oca/data/mail_activity_data.xml +11 -0
- odoo/addons/l10n_es_verifactu_oca/data/neutralize.sql +2 -0
- odoo/addons/l10n_es_verifactu_oca/data/template/account.fiscal.position-es_common.csv +27 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu.map.csv +2 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu.map.line.csv +8 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_registration_key_data.xml +205 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_tax_agency_data.xml +19 -0
- odoo/addons/l10n_es_verifactu_oca/hooks.py +43 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/es.po +1682 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/l10n_es_verifactu_oca.pot +1640 -0
- odoo/addons/l10n_es_verifactu_oca/migrations/18.0.1.1.0/pre-migration.py +25 -0
- odoo/addons/l10n_es_verifactu_oca/models/__init__.py +15 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_chart_template.py +17 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_fiscal_position.py +34 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_journal.py +64 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_move.py +631 -0
- odoo/addons/l10n_es_verifactu_oca/models/aeat_tax_agency.py +30 -0
- odoo/addons/l10n_es_verifactu_oca/models/res_company.py +48 -0
- odoo/addons/l10n_es_verifactu_oca/models/res_partner.py +26 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_chaining.py +37 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_developer.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry.py +398 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response.py +116 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response_line.py +47 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_map.py +68 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_mixin.py +485 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_registration_key.py +26 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONFIGURE.md +27 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONTRIBUTORS.md +18 -0
- odoo/addons/l10n_es_verifactu_oca/readme/DESCRIPTION.md +1 -0
- odoo/addons/l10n_es_verifactu_oca/readme/INSTALL.md +6 -0
- odoo/addons/l10n_es_verifactu_oca/readme/ROADMAP.md +30 -0
- odoo/addons/l10n_es_verifactu_oca/readme/USAGE.md +3 -0
- odoo/addons/l10n_es_verifactu_oca/security/ir.model.access.csv +23 -0
- odoo/addons/l10n_es_verifactu_oca/security/verifactu_security.xml +6 -0
- odoo/addons/l10n_es_verifactu_oca/static/description/icon.png +0 -0
- odoo/addons/l10n_es_verifactu_oca/static/description/index.html +551 -0
- odoo/addons/l10n_es_verifactu_oca/tests/__init__.py +2 -0
- odoo/addons/l10n_es_verifactu_oca/tests/common.py +281 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_accepted_with_errors.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel_incorrect.json +37 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel_with_errors.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_correct.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_duplicated.json +43 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_incorrect.json +37 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_invoice_s_iva10b_s_iva21s_dict.json +59 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_invoice_s_iva21s_s_req52_dict.json +58 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_refund_s_iva10b_s_iva10b_s_iva21s_dict.json +66 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_10n_es_verifactu.py +506 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_verifactu_invoice.py +348 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_fiscal_position_view.xml +29 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_journal_view.xml +22 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_move_view.xml +237 -0
- odoo/addons/l10n_es_verifactu_oca/views/aeat_tax_agency_view.xml +31 -0
- odoo/addons/l10n_es_verifactu_oca/views/report_invoice.xml +53 -0
- odoo/addons/l10n_es_verifactu_oca/views/res_company_view.xml +50 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_chaining_view.xml +45 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_developer_view.xml +46 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_response_view.xml +134 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_view.xml +127 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_lines_view.xml +16 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_view.xml +54 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_registration_keys_view.xml +43 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/__init__.py +2 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/account_move_reversal.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/verifactu_cancel_invoice_wizard.py +24 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/verifactu_cancel_invoice_wizard_view.xml +35 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/METADATA +213 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/RECORD +78 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/WHEEL +5 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Copyright 2024 FactorLibre - Luis J. Salvatierra
|
|
2
|
+
# Copyright 2025 Tecnativa - Pedro M. Baeza
|
|
3
|
+
from odoo import Command, fields
|
|
4
|
+
|
|
5
|
+
from odoo.addons.l10n_es_aeat.tests.test_l10n_es_aeat_certificate import (
|
|
6
|
+
TestL10nEsAeatCertificateBase,
|
|
7
|
+
)
|
|
8
|
+
from odoo.addons.l10n_es_aeat.tests.test_l10n_es_aeat_mod_base import (
|
|
9
|
+
TestL10nEsAeatModBase,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestVerifactuCommon(TestL10nEsAeatModBase, TestL10nEsAeatCertificateBase):
|
|
14
|
+
"""Common base class for VeriFactu tests with shared setup and utilities."""
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def setUpClass(cls):
|
|
18
|
+
super().setUpClass()
|
|
19
|
+
cls.maxDiff = None
|
|
20
|
+
cls.fp_nacional = cls.env.ref(f"account.{cls.company.id}_fp_nacional")
|
|
21
|
+
cls.fp_registration_key_01 = cls.env.ref(
|
|
22
|
+
"l10n_es_verifactu_oca.verifactu_registration_keys_01"
|
|
23
|
+
)
|
|
24
|
+
cls.fp_nacional.verifactu_registration_key = cls.fp_registration_key_01
|
|
25
|
+
cls.fp_recargo = cls.env.ref(f"account.{cls.company.id}_fp_recargo")
|
|
26
|
+
cls.fp_recargo.verifactu_registration_key = cls.fp_registration_key_01
|
|
27
|
+
cls.partner = cls.env["res.partner"].create(
|
|
28
|
+
{
|
|
29
|
+
"name": "Test partner",
|
|
30
|
+
"vat": "89890001K",
|
|
31
|
+
"country_id": cls.env.ref("base.es").id,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
cls.product = cls.env["product.product"].create({"name": "Test product"})
|
|
35
|
+
cls.account_expense = cls.env.ref(
|
|
36
|
+
f"account.{cls.company.id}_account_common_600"
|
|
37
|
+
)
|
|
38
|
+
cls.verifactu_developer = cls.env["verifactu.developer"].create(
|
|
39
|
+
{
|
|
40
|
+
"name": "Odoo Developer",
|
|
41
|
+
"vat": "A12345674",
|
|
42
|
+
"sif_name": "odoo",
|
|
43
|
+
"version": "1.0",
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
cls.verifactu_chaining = cls.env["verifactu.chaining"].create(
|
|
47
|
+
{"name": "VERI*FACTU Chaining", "sif_id": "11", "installation_number": 1}
|
|
48
|
+
)
|
|
49
|
+
cls.company.write(
|
|
50
|
+
{
|
|
51
|
+
"verifactu_enabled": True,
|
|
52
|
+
"verifactu_test": True,
|
|
53
|
+
"vat": "G87846952",
|
|
54
|
+
"country_id": cls.env.ref("base.es").id,
|
|
55
|
+
"tax_agency_id": cls.env.ref("l10n_es_aeat.aeat_tax_agency_spain"),
|
|
56
|
+
"verifactu_developer_id": cls.verifactu_developer.id,
|
|
57
|
+
"verifactu_chaining_id": cls.verifactu_chaining.id,
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
cls.invoice = cls.env["account.move"].create(
|
|
61
|
+
{
|
|
62
|
+
"company_id": cls.company.id,
|
|
63
|
+
"partner_id": cls.partner.id,
|
|
64
|
+
"invoice_date": "2026-01-01",
|
|
65
|
+
"move_type": "out_invoice",
|
|
66
|
+
"invoice_line_ids": [
|
|
67
|
+
Command.create(
|
|
68
|
+
{
|
|
69
|
+
"product_id": cls.product.id,
|
|
70
|
+
"account_id": cls.account_expense.id,
|
|
71
|
+
"name": "Test line",
|
|
72
|
+
"price_unit": 100,
|
|
73
|
+
"quantity": 1,
|
|
74
|
+
},
|
|
75
|
+
)
|
|
76
|
+
],
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def _create_test_invoice(
|
|
81
|
+
self,
|
|
82
|
+
company=None,
|
|
83
|
+
date="2024-01-01",
|
|
84
|
+
amount=100,
|
|
85
|
+
partner=None,
|
|
86
|
+
move_type="out_invoice",
|
|
87
|
+
product=None,
|
|
88
|
+
account=None,
|
|
89
|
+
name=None,
|
|
90
|
+
):
|
|
91
|
+
"""
|
|
92
|
+
Helper method to create a test invoice with customizable parameters.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
company: Company for the invoice (defaults to self.company)
|
|
96
|
+
date: Invoice date (defaults to "2024-01-01")
|
|
97
|
+
amount: Invoice line amount (defaults to 100)
|
|
98
|
+
partner: Invoice partner (defaults to self.partner)
|
|
99
|
+
move_type: Invoice type (defaults to "out_invoice")
|
|
100
|
+
product: Product for invoice line (defaults to self.product)
|
|
101
|
+
account: Account for invoice line (defaults to self.account_expense)
|
|
102
|
+
name: Invoice line description (defaults to "Test line")
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
account.move: Created invoice record
|
|
106
|
+
"""
|
|
107
|
+
company = company or self.company
|
|
108
|
+
partner = partner or self.partner
|
|
109
|
+
product = product or self.product
|
|
110
|
+
if account is None:
|
|
111
|
+
if company == self.company:
|
|
112
|
+
account = self.account_expense
|
|
113
|
+
else:
|
|
114
|
+
account = self.env["account.account"].search(
|
|
115
|
+
[
|
|
116
|
+
("company_ids", "=", company.id),
|
|
117
|
+
("account_type", "=", "expense"),
|
|
118
|
+
],
|
|
119
|
+
limit=1,
|
|
120
|
+
)
|
|
121
|
+
if not account:
|
|
122
|
+
account = self.env["account.account"].search(
|
|
123
|
+
[("company_ids", "=", company.id)], limit=1
|
|
124
|
+
)
|
|
125
|
+
if name is None:
|
|
126
|
+
name = f"Test line - {amount}"
|
|
127
|
+
return self.env["account.move"].create(
|
|
128
|
+
{
|
|
129
|
+
"company_id": company.id,
|
|
130
|
+
"partner_id": partner.id,
|
|
131
|
+
"invoice_date": date,
|
|
132
|
+
"move_type": move_type,
|
|
133
|
+
"invoice_line_ids": [
|
|
134
|
+
Command.create(
|
|
135
|
+
{
|
|
136
|
+
"product_id": product.id,
|
|
137
|
+
"account_id": account.id,
|
|
138
|
+
"name": name,
|
|
139
|
+
"price_unit": amount,
|
|
140
|
+
"quantity": 1,
|
|
141
|
+
},
|
|
142
|
+
)
|
|
143
|
+
],
|
|
144
|
+
"aeat_state": "sent",
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
def _create_test_company(
|
|
149
|
+
self,
|
|
150
|
+
name="Test Company",
|
|
151
|
+
vat="B87654321",
|
|
152
|
+
verifactu_enabled=True,
|
|
153
|
+
):
|
|
154
|
+
"""
|
|
155
|
+
Helper method to create a test company configured for verifactu.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
name: Company name
|
|
159
|
+
vat: Company VAT number (must be in valid Spanish format without country
|
|
160
|
+
code)
|
|
161
|
+
verifactu_enabled: Enable verifactu for the company
|
|
162
|
+
verifactu_test: Set verifactu test mode
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
res.company: Created company record
|
|
166
|
+
"""
|
|
167
|
+
company = self.env["res.company"].create(
|
|
168
|
+
{"name": name, "vat": vat, "country_id": self.env.ref("base.es").id}
|
|
169
|
+
)
|
|
170
|
+
if not company.chart_template:
|
|
171
|
+
chart = self.env["account.chart.template"]
|
|
172
|
+
chart._load(template_code="es_pymes", company=company, install_demo=False)
|
|
173
|
+
company.write(
|
|
174
|
+
{
|
|
175
|
+
"verifactu_enabled": verifactu_enabled,
|
|
176
|
+
"verifactu_test": True,
|
|
177
|
+
"tax_agency_id": self.env.ref("l10n_es_aeat.aeat_tax_agency_spain").id,
|
|
178
|
+
"verifactu_developer_id": self.verifactu_developer.id,
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
return company
|
|
182
|
+
|
|
183
|
+
def _prepare_invoice_for_verifactu(self, invoice):
|
|
184
|
+
"""
|
|
185
|
+
Helper method to prepare an invoice for verifactu processing.
|
|
186
|
+
This includes posting the invoice and setting the registration date.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
invoice: Invoice to prepare
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
account.move: The prepared invoice
|
|
193
|
+
"""
|
|
194
|
+
invoice.action_post()
|
|
195
|
+
invoice.verifactu_registration_date = fields.Datetime.now()
|
|
196
|
+
return invoice
|
|
197
|
+
|
|
198
|
+
def _create_and_prepare_invoice(self, **kwargs):
|
|
199
|
+
"""
|
|
200
|
+
Helper method to create and prepare an invoice for verifactu in one step.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
**kwargs: Arguments passed to _create_test_invoice
|
|
204
|
+
|
|
205
|
+
Returns:
|
|
206
|
+
account.move: Created and prepared invoice
|
|
207
|
+
"""
|
|
208
|
+
invoice = self._create_test_invoice(**kwargs)
|
|
209
|
+
return self._prepare_invoice_for_verifactu(invoice)
|
|
210
|
+
|
|
211
|
+
def _verify_queue_creation(self, invoice):
|
|
212
|
+
"""
|
|
213
|
+
Helper method to verify that a queue record was created for an invoice.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
invoice: Invoice to verify queue creation for
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
verifactu.invoice.entry: The created queue record
|
|
220
|
+
"""
|
|
221
|
+
entry = invoice.last_verifactu_invoice_entry_id
|
|
222
|
+
self.assertTrue(
|
|
223
|
+
entry,
|
|
224
|
+
"Invoice should have a VERI*FACTU invoice entry after posting",
|
|
225
|
+
)
|
|
226
|
+
response_lines = entry.response_line_ids
|
|
227
|
+
self.assertEqual(len(response_lines), 1, "Should have exactly one queue record")
|
|
228
|
+
response_line = response_lines[-1]
|
|
229
|
+
self.assertEqual(
|
|
230
|
+
response_line.entry_id,
|
|
231
|
+
entry,
|
|
232
|
+
"Queue record should link to the VERI*FACTU invoice entry",
|
|
233
|
+
)
|
|
234
|
+
self.assertEqual(
|
|
235
|
+
response_line.company_id,
|
|
236
|
+
invoice.company_id,
|
|
237
|
+
"Queue record should belong to the same company",
|
|
238
|
+
)
|
|
239
|
+
return response_line
|
|
240
|
+
|
|
241
|
+
def _verify_response_integration(self, invoice, response_line):
|
|
242
|
+
"""
|
|
243
|
+
Helper method to verify response line integration with verifactu.invoice.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
invoice: Original invoice
|
|
247
|
+
response_line: Response line to verify
|
|
248
|
+
|
|
249
|
+
Returns:
|
|
250
|
+
bool: True if integration is correct
|
|
251
|
+
"""
|
|
252
|
+
self.assertTrue(
|
|
253
|
+
response_line.document_id,
|
|
254
|
+
"Response line should have verifactu invoice reference",
|
|
255
|
+
)
|
|
256
|
+
self.assertEqual(
|
|
257
|
+
response_line.entry_id,
|
|
258
|
+
invoice.last_verifactu_invoice_entry_id,
|
|
259
|
+
"Response line should link to the correct VERI*FACTU invoice entry",
|
|
260
|
+
)
|
|
261
|
+
self.assertEqual(
|
|
262
|
+
response_line.entry_id.document_id,
|
|
263
|
+
invoice,
|
|
264
|
+
"Response line should reference the original invoice through verifactu "
|
|
265
|
+
"entry",
|
|
266
|
+
)
|
|
267
|
+
return True
|
|
268
|
+
|
|
269
|
+
def _generate_invoice_entry(self, invoice):
|
|
270
|
+
"""
|
|
271
|
+
Helper method to generate VERI*FACTU invoice entry for an invoice.
|
|
272
|
+
This assumes the invoice is already prepared for verifactu.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
invoice: Prepared invoice
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
verifactu.invoice: Created invoice entry
|
|
279
|
+
"""
|
|
280
|
+
invoice._generate_verifactu_chaining()
|
|
281
|
+
return invoice.last_verifactu_invoice_entry_id
|
odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_accepted_with_errors.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Correcto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Alta",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "AceptadoConErrores"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Correcto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Anulacion",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "Correcto"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Incorrecto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Anulacion",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "Incorrecto",
|
|
33
|
+
"CodigoErrorRegistro": 1286,
|
|
34
|
+
"DescripcionErrorRegistro": "Si el impuesto es IVA(01), IGIC(03) o vacio, si ClaveRegimen es 02 solo se podrá informar OperacionExenta."
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel_with_errors.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "anulada",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Anulacion",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "AceptadoConErrores"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Correcto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Alta",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "Correcto"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Incorrecto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Alta",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "Incorrecto",
|
|
33
|
+
"CodigoErrorRegistro": "3000",
|
|
34
|
+
"DescripcionErrorRegistro": "Registro de facturación duplicado.",
|
|
35
|
+
"RegistroDuplicado": {
|
|
36
|
+
"IdPeticionRegistroDuplicado": "",
|
|
37
|
+
"EstadoRegistroDuplicado": "Correcta",
|
|
38
|
+
"CodigoErrorRegistro": "",
|
|
39
|
+
"DescripcionErrorRegistro": ""
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CSV": "A-Y23JP3582934",
|
|
3
|
+
"DatosPresentacion": {
|
|
4
|
+
"NIFPresentador": "G87846952",
|
|
5
|
+
"TimestampPresentacion": "2026-01-01T16:54:41+02:00"
|
|
6
|
+
},
|
|
7
|
+
"Cabecera": {
|
|
8
|
+
"ObligadoEmision": {
|
|
9
|
+
"NombreRazon": "Spanish test company",
|
|
10
|
+
"NIF": "G87846952"
|
|
11
|
+
},
|
|
12
|
+
"Representante": "",
|
|
13
|
+
"RemisionVoluntaria": "",
|
|
14
|
+
"RemisionRequerimiento": ""
|
|
15
|
+
},
|
|
16
|
+
"TiempoEsperaEnvio": "60",
|
|
17
|
+
"EstadoEnvio": "Incorrecto",
|
|
18
|
+
"RespuestaLinea": [
|
|
19
|
+
{
|
|
20
|
+
"IDFactura": {
|
|
21
|
+
"IDEmisorFactura": "89890001K",
|
|
22
|
+
"NumSerieFactura": "INV/2026/00001",
|
|
23
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
24
|
+
},
|
|
25
|
+
"Operacion": {
|
|
26
|
+
"TipoOperacion": "Alta",
|
|
27
|
+
"Subsanacion": "",
|
|
28
|
+
"RechazoPrevio": "",
|
|
29
|
+
"SinRegistroPrevio": ""
|
|
30
|
+
},
|
|
31
|
+
"RefExterna": "",
|
|
32
|
+
"EstadoRegistro": "Incorrecto",
|
|
33
|
+
"CodigoErrorRegistro": 1286,
|
|
34
|
+
"DescripcionErrorRegistro": "Si el impuesto es IVA(01), IGIC(03) o vacio, si ClaveRegimen es 02 solo se podrá informar OperacionExenta."
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_invoice_s_iva10b_s_iva21s_dict.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"RegistroAlta": {
|
|
3
|
+
"IDVersion": 1.0,
|
|
4
|
+
"IDFactura": {
|
|
5
|
+
"IDEmisorFactura": "G87846952",
|
|
6
|
+
"NumSerieFactura": "TEST001",
|
|
7
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
8
|
+
},
|
|
9
|
+
"NombreRazonEmisor": "Spanish test company",
|
|
10
|
+
"TipoFactura": "F1",
|
|
11
|
+
"DescripcionOperacion": "/",
|
|
12
|
+
"Destinatarios": {
|
|
13
|
+
"IDDestinatario": {
|
|
14
|
+
"NombreRazon": "Test partner",
|
|
15
|
+
"NIF": "89890001K"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"Desglose": {
|
|
19
|
+
"DetalleDesglose": [
|
|
20
|
+
{
|
|
21
|
+
"Impuesto": "01",
|
|
22
|
+
"ClaveRegimen": "01",
|
|
23
|
+
"CalificacionOperacion": "S1",
|
|
24
|
+
"TipoImpositivo": "10.0",
|
|
25
|
+
"BaseImponibleOimporteNoSujeto": 100.0,
|
|
26
|
+
"CuotaRepercutida": 10.0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"Impuesto": "01",
|
|
30
|
+
"ClaveRegimen": "01",
|
|
31
|
+
"CalificacionOperacion": "S1",
|
|
32
|
+
"TipoImpositivo": "21.0",
|
|
33
|
+
"BaseImponibleOimporteNoSujeto": 200.0,
|
|
34
|
+
"CuotaRepercutida": 42.0
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"CuotaTotal": 52.0,
|
|
39
|
+
"ImporteTotal": 352.0,
|
|
40
|
+
"Encadenamiento": {
|
|
41
|
+
"PrimerRegistro": "S"
|
|
42
|
+
},
|
|
43
|
+
"SistemaInformatico": {
|
|
44
|
+
"NombreRazon": "Odoo Developer",
|
|
45
|
+
"NIF": "A12345674",
|
|
46
|
+
"NombreSistemaInformatico": "odoo",
|
|
47
|
+
"IdSistemaInformatico": "11",
|
|
48
|
+
"Version": "1.0",
|
|
49
|
+
"NumeroInstalacion": 1,
|
|
50
|
+
"TipoUsoPosibleSoloVerifactu": "S",
|
|
51
|
+
"TipoUsoPosibleMultiOT": "S",
|
|
52
|
+
"IndicadorMultiplesOT": "N",
|
|
53
|
+
"IDOtro": {
|
|
54
|
+
"IDType": "",
|
|
55
|
+
"ID": ""
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"RegistroAlta": {
|
|
3
|
+
"IDVersion": 1.0,
|
|
4
|
+
"IDFactura": {
|
|
5
|
+
"IDEmisorFactura": "G87846952",
|
|
6
|
+
"NumSerieFactura": "TEST003",
|
|
7
|
+
"FechaExpedicionFactura": "01-01-2026"
|
|
8
|
+
},
|
|
9
|
+
"NombreRazonEmisor": "Spanish test company",
|
|
10
|
+
"TipoFactura": "F1",
|
|
11
|
+
"DescripcionOperacion": "/",
|
|
12
|
+
"Destinatarios": {
|
|
13
|
+
"IDDestinatario": {
|
|
14
|
+
"NombreRazon": "Test partner",
|
|
15
|
+
"NIF": "89890001K"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"Desglose": {
|
|
19
|
+
"DetalleDesglose": [
|
|
20
|
+
{
|
|
21
|
+
"Impuesto": "01",
|
|
22
|
+
"ClaveRegimen": "01",
|
|
23
|
+
"CalificacionOperacion": "S1",
|
|
24
|
+
"TipoImpositivo": "21.0",
|
|
25
|
+
"BaseImponibleOimporteNoSujeto": 200.0,
|
|
26
|
+
"CuotaRepercutida": 42.0,
|
|
27
|
+
"TipoRecargoEquivalencia": 5.2,
|
|
28
|
+
"CuotaRecargoEquivalencia": 10.4
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"CuotaTotal": 52.4,
|
|
33
|
+
"ImporteTotal": 252.4,
|
|
34
|
+
"Encadenamiento": {
|
|
35
|
+
"RegistroAnterior": {
|
|
36
|
+
"FechaExpedicionFactura": "01-01-2026",
|
|
37
|
+
"Huella": "97303DAE5BDF62521F9462A1F431A4F88F1B68C4A8E1A72B067000668FACB023",
|
|
38
|
+
"IDEmisorFactura": "G87846952",
|
|
39
|
+
"NumSerieFactura": "TEST002"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"SistemaInformatico": {
|
|
43
|
+
"NombreRazon": "Odoo Developer",
|
|
44
|
+
"NIF": "A12345674",
|
|
45
|
+
"NombreSistemaInformatico": "odoo",
|
|
46
|
+
"IdSistemaInformatico": "11",
|
|
47
|
+
"Version": "1.0",
|
|
48
|
+
"NumeroInstalacion": 1,
|
|
49
|
+
"TipoUsoPosibleSoloVerifactu": "S",
|
|
50
|
+
"TipoUsoPosibleMultiOT": "S",
|
|
51
|
+
"IndicadorMultiplesOT": "N",
|
|
52
|
+
"IDOtro": {
|
|
53
|
+
"IDType": "",
|
|
54
|
+
"ID": ""
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|