export of xrechnung 2.2 + 2.3 + 3.0

This commit is contained in:
Frederik Jaeckel 2024-12-05 11:28:44 +01:00
parent 2dac79debe
commit eda7216907
4 changed files with 48 additions and 6 deletions

View file

@ -30,6 +30,22 @@ msgctxt "field:account_invoice_xrechnung.runrep.start,edocument:"
msgid "Type"
msgstr "Typ"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 2.2"
msgstr "XRechnung UBL Invoice 2.2"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 2.3"
msgstr "XRechnung UBL Invoice 2.3"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 3.0"
msgstr "XRechnung UBL Invoice 3.0"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "CII CrossIndustryInvoice D16B"
msgstr "CII CrossIndustryInvoice D16B"
msgctxt "field:account_invoice_xrechnung.runrep.start,as_zip:"
msgid "ZIP-File"
msgstr "ZIP-Datei"

View file

@ -22,6 +22,22 @@ msgctxt "field:account_invoice_xrechnung.runrep.start,edocument:"
msgid "Type"
msgstr "Type"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 2.2"
msgstr "XRechnung UBL Invoice 2.2"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 2.3"
msgstr "XRechnung UBL Invoice 2.3"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "XRechnung UBL Invoice 3.0"
msgstr "XRechnung UBL Invoice 3.0"
msgctxt "selection:account_invoice_xrechnung.runrep.start,edocument:"
msgid "CII CrossIndustryInvoice D16B"
msgstr "CII CrossIndustryInvoice D16B"
msgctxt "field:account_invoice_xrechnung.runrep.start,as_zip:"
msgid "ZIP-File"
msgstr "ZIP-File"
@ -38,3 +54,7 @@ msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,export:"
msgid "Export"
msgstr "Export"
msgctxt "model:account_invoice_xrechnung.export,name:"
msgid "eDocument Export"
msgstr "eDocument Export"

View file

@ -12,12 +12,16 @@ from trytond.transaction import Transaction
sel_edocument = [
('edocument.xrechnung.invoice', 'XRechnung UBL Invoice 2.1.1'),
('edocument.xrechnung.invoice-2.2', 'XRechnung UBL Invoice 2.2'),
('edocument.xrechnung.invoice-2.3', 'XRechnung UBL Invoice 2.3'),
('edocument.xrechnung.invoice-3.0', 'XRechnung UBL Invoice 3.0'),
('edocument.uncefact.invoice', 'CII CrossIndustryInvoice D16B'),
]
edoc_versions = {
'edocument.xrechnung.invoice': 'XRechnung-2.2',
'edocument.xrechnung.invoice-2.2': 'XRechnung-2.2',
'edocument.xrechnung.invoice-2.3': 'XRechnung-2.3',
'edocument.xrechnung.invoice-3.0': 'XRechnung-3.0',
'edocument.uncefact.invoice': '16B-CII'}
@ -44,7 +48,7 @@ class RunXRechnungReportStart(ModelView):
def default_edocument(cls):
""" default xrechnung
"""
return 'edocument.xrechnung.invoice'
return 'edocument.xrechnung.invoice-3.0'
# end RunXRechnungReportStart
@ -67,11 +71,13 @@ class RunXRechnungReport(Wizard):
""" set defaults
"""
context = Transaction().context
Invoice = Pool().get('account.invoice')
pool = Pool()
Invoice = pool.get('account.invoice')
WizRepStart = pool.get('account_invoice_xrechnung.runrep.start')
invoice = Invoice.browse([context.get('active_id', -1)])
result = {
'edocument': 'edocument.xrechnung.invoice',
'edocument': WizRepStart.default_edocument(),
'invoice': context.get('active_id', -1),
'state': invoice[0].state if invoice else ''}
return result

View file

@ -31,7 +31,7 @@ class XReport(Report):
pool = Pool()
IrDate = pool.get('ir.date')
Invoice = pool.get('account.invoice')
EDocument = pool.get(data['edocument'])
EDocument = pool.get(data['edocument'].split('-')[0])
invoice, = Invoice.browse([data['invoice']])
template = EDocument(invoice)