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" msgid "Type"
msgstr "Typ" 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:" msgctxt "field:account_invoice_xrechnung.runrep.start,as_zip:"
msgid "ZIP-File" msgid "ZIP-File"
msgstr "ZIP-Datei" msgstr "ZIP-Datei"

View file

@ -22,6 +22,22 @@ msgctxt "field:account_invoice_xrechnung.runrep.start,edocument:"
msgid "Type" msgid "Type"
msgstr "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:" msgctxt "field:account_invoice_xrechnung.runrep.start,as_zip:"
msgid "ZIP-File" msgid "ZIP-File"
msgstr "ZIP-File" msgstr "ZIP-File"
@ -38,3 +54,7 @@ msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,export:"
msgid "Export" msgid "Export"
msgstr "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 = [ 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'), ('edocument.uncefact.invoice', 'CII CrossIndustryInvoice D16B'),
] ]
edoc_versions = { 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'} 'edocument.uncefact.invoice': '16B-CII'}
@ -44,7 +48,7 @@ class RunXRechnungReportStart(ModelView):
def default_edocument(cls): def default_edocument(cls):
""" default xrechnung """ default xrechnung
""" """
return 'edocument.xrechnung.invoice' return 'edocument.xrechnung.invoice-3.0'
# end RunXRechnungReportStart # end RunXRechnungReportStart
@ -67,11 +71,13 @@ class RunXRechnungReport(Wizard):
""" set defaults """ set defaults
""" """
context = Transaction().context 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)]) invoice = Invoice.browse([context.get('active_id', -1)])
result = { result = {
'edocument': 'edocument.xrechnung.invoice', 'edocument': WizRepStart.default_edocument(),
'invoice': context.get('active_id', -1), 'invoice': context.get('active_id', -1),
'state': invoice[0].state if invoice else ''} 'state': invoice[0].state if invoice else ''}
return result return result

View file

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