add Factur-X-EN16931
This commit is contained in:
parent
4e03a1022e
commit
037ff9636a
4 changed files with 455 additions and 8 deletions
13
document.py
13
document.py
|
@ -30,7 +30,7 @@ xml_types = [
|
|||
(['xsd', 'Factur-X_1.07.2_BASICWL', 'Factur-X_1.07.2_BASICWL.xsd'],
|
||||
'Factur-X basicwl', 'facturx_basicwl'),
|
||||
(['xsd', 'Factur-X_1.07.2_EN16931', 'Factur-X_1.07.2_EN16931.xsd'],
|
||||
'Factur-X EN16931', ''),
|
||||
'Factur-X EN16931', 'facturx_en16931'),
|
||||
(['xsd', 'Factur-X_1.07.2_EXTENDED', 'Factur-X_1.07.2_EXTENDED.xsd'],
|
||||
'Factur-X extended', 'facturx_extended'),
|
||||
(['xsd', 'CII D22B XSD', 'CrossIndustryInvoice_100pD22B.xsd'],
|
||||
|
@ -63,25 +63,20 @@ class Incoming(metaclass=PoolMeta):
|
|||
with_children (bool, optional): convert sub-documents.
|
||||
Defaults to False.
|
||||
"""
|
||||
print('\n## process:', documents)
|
||||
for document in documents:
|
||||
document._facturx_detect_content()
|
||||
print('-- process-2:')
|
||||
super().process(documents, with_children)
|
||||
print('-- process-3:')
|
||||
|
||||
def _process_supplier_invoice(self):
|
||||
""" try to detect content of 'data', read values
|
||||
"""
|
||||
invoice = super()._process_supplier_invoice()
|
||||
print('\n## _process_supplier_invoice:', self)
|
||||
|
||||
if self.mime_type == 'application/xml':
|
||||
# detect xml-content
|
||||
xml_info = self._facturx_detect_content()
|
||||
if xml_info:
|
||||
(xsd_type, funcname, xmltree) = xml_info
|
||||
print('-- _process_supplier_invoice-xml_info:', xml_info)
|
||||
xml_read_func = getattr(self, '_readxml_%s' % funcname, None)
|
||||
if not xml_read_func:
|
||||
raise UserError(gettext(
|
||||
|
@ -95,7 +90,6 @@ class Incoming(metaclass=PoolMeta):
|
|||
invoice.save()
|
||||
self._readxml_check_invoice(invoice)
|
||||
# raise ValueError('stop')
|
||||
print('-- _process_supplier_invoice-FIN:', invoice)
|
||||
return invoice
|
||||
|
||||
def _readxml_check_invoice(self, invoice):
|
||||
|
@ -436,6 +430,11 @@ class Incoming(metaclass=PoolMeta):
|
|||
'document_incoming_invoice_xml.msg_convert_error',
|
||||
msg='factur-x basic-wl not supported'))
|
||||
|
||||
def _readxml_facturx_en16931(self, xmltree):
|
||||
""" read facturx - EN16931
|
||||
"""
|
||||
self._readxml_facturx_extended(xmltree)
|
||||
|
||||
def _readxml_facturx_extended(self, xmltree):
|
||||
""" read factur-x extended
|
||||
"""
|
||||
|
|
|
@ -13,7 +13,8 @@ from trytond.exceptions import UserError
|
|||
from trytond.modules.company.tests import create_company, set_company
|
||||
from trytond.modules.account.tests import create_chart, get_fiscalyear
|
||||
from .parsed_data import (
|
||||
parsed_data_facturx_extended, parsed_data_facturx_basic)
|
||||
parsed_data_facturx_extended, parsed_data_facturx_basic,
|
||||
parsed_data_facturx_en16931)
|
||||
|
||||
|
||||
def set_invoice_sequences(fiscalyear):
|
||||
|
@ -412,4 +413,121 @@ class DocumentTestCase(object):
|
|||
self.assertEqual(attachment.data, document.data)
|
||||
self.assertEqual(attachment.name, 'facturx-basic.xml')
|
||||
|
||||
@with_transaction()
|
||||
def test_xmldoc_check_xml_read_facturx_en16931(self):
|
||||
""" add incoming-dcument 'facturx-en16931' in memory,
|
||||
read xml into 'parsed_data'
|
||||
"""
|
||||
pool = Pool()
|
||||
IncDocument = pool.get('document.incoming')
|
||||
|
||||
with open(os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
'facturx-en16931.xml'), 'rb') as fhdl:
|
||||
xml_txt = fhdl.read()
|
||||
|
||||
incoming = IncDocument(data=xml_txt)
|
||||
(xsdtype, funcname, xml_data) = incoming._facturx_detect_content()
|
||||
self.assertEqual(xsdtype, 'Factur-X EN16931')
|
||||
self.assertEqual(funcname, 'facturx_en16931')
|
||||
|
||||
incoming._readxml_facturx_en16931(xml_data)
|
||||
self.assertEqual(
|
||||
self.prep_sorted_dict(incoming.parsed_data),
|
||||
parsed_data_facturx_en16931)
|
||||
|
||||
@with_transaction()
|
||||
def test_xmldoc_import_facturx_en16931(self):
|
||||
""" create incoming-document, load factur-x-en16931 xml, detect type
|
||||
"""
|
||||
pool = Pool()
|
||||
IncDocument = pool.get('document.incoming')
|
||||
Configuration = pool.get('document.incoming.configuration')
|
||||
Party = pool.get('party.party')
|
||||
IrAttachment = pool.get('ir.attachment')
|
||||
Invoice = pool.get('account.invoice')
|
||||
|
||||
company = create_company('m-ds')
|
||||
with set_company(company):
|
||||
|
||||
create_chart(company=company, tax=True)
|
||||
self.prep_fiscalyear(company)
|
||||
|
||||
product_categories = self.prep_prodcat_category(company)
|
||||
config = Configuration(
|
||||
product_category=product_categories)
|
||||
config.save()
|
||||
|
||||
self.assertEqual(config.create_supplier, True)
|
||||
self.assertEqual(config.accept_other_company, False)
|
||||
self.assertEqual(config.number_target, 'reference')
|
||||
self.assertEqual(len(config.product_category), 3)
|
||||
self.assertEqual(config.product_category[0].name, 'Accounting')
|
||||
self.assertEqual(config.product_category[1].name, 'Accounting 19%')
|
||||
self.assertEqual(config.product_category[2].name, 'Accounting 7%')
|
||||
|
||||
to_create = []
|
||||
with open(os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
'facturx-en16931.xml'), 'rb') as fhdl:
|
||||
to_create.append({
|
||||
'data': fhdl.read(),
|
||||
'name': 'facturx-en16931.xml',
|
||||
'type': 'supplier_invoice'})
|
||||
|
||||
document, = IncDocument.create(to_create)
|
||||
self.assertEqual(document.mime_type, 'application/xml')
|
||||
self.assertEqual(document.company.id, company.id)
|
||||
self.assertTrue(document.data.startswith(
|
||||
b'<?xml version="1.0" encoding="UTF-8"?>\n' +
|
||||
b'<rsm:CrossIndustryInvoice'))
|
||||
|
||||
# no supplier-party in db
|
||||
self.assertEqual(
|
||||
Party.search_count([('name', '=', 'Name of the Supplier')]),
|
||||
0)
|
||||
# no invoices
|
||||
self.assertEqual(Invoice.search_count([]), 0)
|
||||
|
||||
config.create_supplier = True
|
||||
config.accept_other_company = True
|
||||
config.number_target = 'reference'
|
||||
config.save()
|
||||
|
||||
# 'process' will queue the job to workers
|
||||
IncDocument.process([document])
|
||||
# run the usual call: process workers
|
||||
self.prep_incomingdoc_run_worker()
|
||||
|
||||
# check imported invoice
|
||||
invoice, = Invoice.search([])
|
||||
self.assertEqual(invoice.type, 'in')
|
||||
self.assertEqual(invoice.reference, 'RE2024.01234')
|
||||
self.assertEqual(invoice.number, None)
|
||||
self.assertEqual(invoice.invoice_date, date(2024, 6, 17))
|
||||
self.assertEqual(invoice.currency.name, 'usd')
|
||||
self.assertEqual(invoice.company.rec_name, 'm-ds')
|
||||
self.assertEqual(invoice.description, 'Description of invoice')
|
||||
self.assertEqual(
|
||||
invoice.comment,
|
||||
'Some notes to the customer.\n' +
|
||||
'Subject=42, Goes to field comment.')
|
||||
self.assertEqual(invoice.party.rec_name, 'Name of the Supplier')
|
||||
self.assertEqual(invoice.account.rec_name, 'Main Payable')
|
||||
|
||||
self.assertEqual(document.result.__name__, 'account.invoice')
|
||||
self.assertEqual(document.result.reference, 'RE2024.01234')
|
||||
|
||||
parsed_ori = copy.deepcopy(parsed_data_facturx_en16931)
|
||||
parsed_ori['seller_party']['party'] = invoice.party.id
|
||||
self.assertEqual(
|
||||
self.prep_sorted_dict(document.parsed_data),
|
||||
self.prep_sorted_dict(parsed_ori))
|
||||
|
||||
attachment, = IrAttachment.search([
|
||||
('resource.party', '=', invoice.party, 'account.invoice'),
|
||||
('type', '=', 'data')])
|
||||
self.assertEqual(attachment.data, document.data)
|
||||
self.assertEqual(attachment.name, 'facturx-en16931.xml')
|
||||
|
||||
# end DocumentTestCase
|
||||
|
|
216
tests/facturx-en16931.xml
Normal file
216
tests/facturx-en16931.xml
Normal file
|
@ -0,0 +1,216 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rsm:CrossIndustryInvoice
|
||||
xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<rsm:ExchangedDocumentContext>
|
||||
<ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
<ram:ID>urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:en16931</ram:ID>
|
||||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument>
|
||||
<ram:ID>RE2024.01234</ram:ID>
|
||||
<ram:TypeCode>380</ram:TypeCode>
|
||||
<ram:IssueDateTime>
|
||||
<udt:DateTimeString format="102">20240617</udt:DateTimeString>
|
||||
</ram:IssueDateTime>
|
||||
<ram:IncludedNote>
|
||||
<ram:Content>Description of invoice</ram:Content>
|
||||
</ram:IncludedNote>
|
||||
<ram:IncludedNote>
|
||||
<ram:Content>Some notes to the customer.</ram:Content>
|
||||
</ram:IncludedNote>
|
||||
<ram:IncludedNote>
|
||||
<ram:Content>Goes to field comment.</ram:Content>
|
||||
<ram:SubjectCode>42</ram:SubjectCode>
|
||||
</ram:IncludedNote>
|
||||
</rsm:ExchangedDocument>
|
||||
<rsm:SupplyChainTradeTransaction>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>1</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Name of Product 1</ram:Name>
|
||||
<ram:Description>Description of Product 1</ram:Description>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">1350.00</ram:ChargeAmount>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="KGM">1.0</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
<ram:LineTotalAmount currencyID="EUR">1350.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>2</ram:LineID>
|
||||
<ram:IncludedNote>
|
||||
<ram:Content>Description of Line 2</ram:Content>
|
||||
</ram:IncludedNote>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:GlobalID>3</ram:GlobalID>
|
||||
<ram:SellerAssignedID>4</ram:SellerAssignedID>
|
||||
<ram:BuyerAssignedID>5</ram:BuyerAssignedID>
|
||||
<ram:Name>Name of Product 2</ram:Name>
|
||||
<ram:Description>Description of Product 2</ram:Description>
|
||||
<ram:ApplicableProductCharacteristic>
|
||||
<ram:Description>Kilogram</ram:Description>
|
||||
<ram:Value>kg</ram:Value>
|
||||
</ram:ApplicableProductCharacteristic>
|
||||
<ram:DesignatedProductClassification>
|
||||
<ram:ClassCode>3c</ram:ClassCode>
|
||||
</ram:DesignatedProductClassification>
|
||||
<ram:OriginTradeCountry>
|
||||
<ram:ID>DE</ram:ID>
|
||||
</ram:OriginTradeCountry>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">950.00</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="C62">1.0</ram:BasisQuantity>
|
||||
</ram:GrossPriceProductTradePrice>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">800.00</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="C62">1.0</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="KGM">1.5</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
<ram:LineTotalAmount currencyID="EUR">1200.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>3</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Name of Product 3</ram:Name>
|
||||
<ram:Description>Description of Product 3</ram:Description>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">150.00</ram:ChargeAmount>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="MTR">2.0</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
<ram:LineTotalAmount currencyID="EUR">300.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:SellerTradeParty>
|
||||
<ram:Name>Name of the Supplier</ram:Name>
|
||||
<ram:SpecifiedLegalOrganization>
|
||||
</ram:SpecifiedLegalOrganization>
|
||||
<ram:PostalTradeAddress>
|
||||
<ram:PostcodeCode>12345</ram:PostcodeCode>
|
||||
<ram:LineOne>Street of Supplier No 1</ram:LineOne>
|
||||
<ram:CityName>Berlin</ram:CityName>
|
||||
<ram:CountryID>DE</ram:CountryID>
|
||||
<ram:CountrySubDivisionName>Berlin</ram:CountrySubDivisionName>
|
||||
</ram:PostalTradeAddress>
|
||||
</ram:SellerTradeParty>
|
||||
<ram:BuyerTradeParty>
|
||||
<ram:Name>Our Company</ram:Name>
|
||||
<ram:SpecifiedLegalOrganization>
|
||||
</ram:SpecifiedLegalOrganization>
|
||||
<ram:PostalTradeAddress>
|
||||
<ram:PostcodeCode>23456</ram:PostcodeCode>
|
||||
<ram:LineOne>Address Line 1</ram:LineOne>
|
||||
<ram:LineTwo>Address Line 2</ram:LineTwo>
|
||||
<ram:CityName>Potsdam</ram:CityName>
|
||||
<ram:CountryID>DE</ram:CountryID>
|
||||
<ram:CountrySubDivisionName>Brandenburg</ram:CountrySubDivisionName>
|
||||
</ram:PostalTradeAddress>
|
||||
</ram:BuyerTradeParty>
|
||||
<ram:BuyerOrderReferencedDocument>
|
||||
<ram:IssuerAssignedID/>
|
||||
</ram:BuyerOrderReferencedDocument>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
</ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:PaymentReference>RE2024.01234</ram:PaymentReference>
|
||||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:TypeCode>30</ram:TypeCode>
|
||||
<ram:Information>Wire transfer</ram:Information>
|
||||
<ram:ApplicableTradeSettlementFinancialCard>
|
||||
<ram:ID>DE02300209000106531065</ram:ID>
|
||||
<ram:CardholderName>Card Holder</ram:CardholderName>
|
||||
</ram:ApplicableTradeSettlementFinancialCard>
|
||||
<ram:PayerPartyDebtorFinancialAccount>
|
||||
<ram:IBANID>DE02300209000106531065</ram:IBANID>
|
||||
</ram:PayerPartyDebtorFinancialAccount>
|
||||
<ram:PayeePartyCreditorFinancialAccount>
|
||||
<ram:IBANID>DE02300209000106531065</ram:IBANID>
|
||||
<ram:AccountName>mbs</ram:AccountName>
|
||||
</ram:PayeePartyCreditorFinancialAccount>
|
||||
<ram:PayeeSpecifiedCreditorFinancialInstitution>
|
||||
<ram:BICID>WELADED1PMB</ram:BICID>
|
||||
</ram:PayeeSpecifiedCreditorFinancialInstitution>
|
||||
</ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:CalculatedAmount currencyID="EUR">484.5</ram:CalculatedAmount>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:BasisAmount>2550.0</ram:BasisAmount>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:CalculatedAmount currencyID="EUR">21.0</ram:CalculatedAmount>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:BasisAmount>300.0</ram:BasisAmount>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradePaymentTerms>
|
||||
<ram:Description>Payment description</ram:Description>
|
||||
<ram:DueDateDateTime>
|
||||
<udt:DateTimeString format="102">20240701</udt:DateTimeString>
|
||||
</ram:DueDateDateTime>
|
||||
<ram:DirectDebitMandateID>mandat id</ram:DirectDebitMandateID>
|
||||
</ram:SpecifiedTradePaymentTerms>
|
||||
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
<ram:LineTotalAmount currencyID="EUR">1350.00</ram:LineTotalAmount>
|
||||
<ram:TaxBasisTotalAmount currencyID="EUR">2850.00</ram:TaxBasisTotalAmount>
|
||||
<ram:TaxTotalAmount currencyID="EUR">505.5</ram:TaxTotalAmount>
|
||||
<ram:GrandTotalAmount currencyID="EUR">3355.50</ram:GrandTotalAmount>
|
||||
<ram:DuePayableAmount currencyID="EUR">3355.50</ram:DuePayableAmount>
|
||||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
</ram:ApplicableHeaderTradeSettlement>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:CrossIndustryInvoice>
|
|
@ -7,6 +7,120 @@
|
|||
from decimal import Decimal
|
||||
from datetime import date
|
||||
|
||||
parsed_data_facturx_en16931 = {
|
||||
'buyer_party': {
|
||||
'city': 'Potsdam',
|
||||
'name': 'Our Company',
|
||||
'postal_code': '23456',
|
||||
'street': 'Address Line 1\nAddress Line 2'},
|
||||
'invoice_date': date(2024, 6, 17),
|
||||
'invoice_number': 'RE2024.01234',
|
||||
'lines_data': [{
|
||||
'line_no': '1',
|
||||
'name': 'Name of Product 1',
|
||||
'description': 'Description of Product 1',
|
||||
'unit_net_price': {'amount': Decimal('1350.00')},
|
||||
'quantity': {
|
||||
'billed': Decimal('1.0'), 'unit_code': 'KGM'},
|
||||
'taxes': [{
|
||||
'type': 'VAT',
|
||||
'category_code': 'S',
|
||||
'percent': Decimal('19.00')}],
|
||||
'total': {'amount': Decimal('1350.00')},
|
||||
}, {
|
||||
'line_no': '2',
|
||||
'line_note': 'Description of Line 2',
|
||||
'glob_id': '3',
|
||||
'seller_id': '4',
|
||||
'buyer_id': '5',
|
||||
'name': 'Name of Product 2',
|
||||
'description': 'Description of Product 2',
|
||||
'trade_country': 'DE',
|
||||
'attributes': [{
|
||||
'description': 'Kilogram',
|
||||
'uom': 'kg'}],
|
||||
'classification': [{'code': '3c'}],
|
||||
'unit_net_price': {
|
||||
'amount': Decimal('800.00'),
|
||||
'basequantity': Decimal('1.0')},
|
||||
'unit_gross_price': {
|
||||
'amount': Decimal('950.00'),
|
||||
'basequantity': Decimal('1.0')},
|
||||
'quantity': {
|
||||
'billed': Decimal('1.5'),
|
||||
'unit_code': 'KGM'},
|
||||
'taxes': [{
|
||||
'type': 'VAT',
|
||||
'category_code': 'S',
|
||||
'percent': Decimal('19.00')}],
|
||||
'total': {
|
||||
'amount': Decimal('1200.00')},
|
||||
}, {
|
||||
'line_no': '3',
|
||||
'name': 'Name of Product 3',
|
||||
'description': 'Description of Product 3',
|
||||
'unit_net_price': {'amount': Decimal('150.00')},
|
||||
'quantity': {
|
||||
'billed': Decimal('2.0'),
|
||||
'unit_code': 'MTR'},
|
||||
'taxes': [{
|
||||
'type': 'VAT',
|
||||
'category_code': 'S',
|
||||
'percent': Decimal('7.00')}],
|
||||
'total': {'amount': Decimal('300.00')}}],
|
||||
'note_list': [{
|
||||
'Content': 'Description of invoice',
|
||||
'ContentCode': None,
|
||||
'SubjectCode': None,
|
||||
}, {
|
||||
'Content': 'Some notes to the customer.',
|
||||
'ContentCode': None,
|
||||
'SubjectCode': None,
|
||||
}, {
|
||||
'Content': 'Goes to field comment.',
|
||||
'ContentCode': None,
|
||||
'SubjectCode': '42'}],
|
||||
'payment': {
|
||||
'bank': [{
|
||||
'info': 'Wire transfer',
|
||||
'type': '30',
|
||||
'debitor_iban': 'DE02300209000106531065',
|
||||
'creditor_iban': 'DE02300209000106531065',
|
||||
'creditor_name': 'mbs',
|
||||
'card_id': 'DE02300209000106531065',
|
||||
'card_holder_name': 'Card Holder',
|
||||
'institution': 'WELADED1PMB'}],
|
||||
'currency': 'EUR',
|
||||
'reference': 'RE2024.01234',
|
||||
'taxes': [{
|
||||
'amount': Decimal('484.5'),
|
||||
'type': 'VAT',
|
||||
'base': Decimal('2550.0'),
|
||||
'category_code': 'S',
|
||||
'percent': Decimal('19.00'),
|
||||
}, {
|
||||
'amount': Decimal('21.0'),
|
||||
'type': 'VAT',
|
||||
'base': Decimal('300.0'),
|
||||
'category_code': 'S',
|
||||
'percent': Decimal('7.00')}],
|
||||
'terms': [{
|
||||
'description': 'Payment description',
|
||||
'duedate': date(2024, 7, 1),
|
||||
'mandat_id': 'mandat id'}]},
|
||||
'seller_party': {
|
||||
'city': 'Berlin',
|
||||
'name': 'Name of the Supplier',
|
||||
'postal_code': '12345',
|
||||
'street': 'Street of Supplier No 1'},
|
||||
'total': {
|
||||
'amount': Decimal('1350.00'),
|
||||
'duepayable': Decimal('3355.50'),
|
||||
'grand': Decimal('3355.50'),
|
||||
'taxbase': Decimal('2850.00'),
|
||||
'taxtotal': Decimal('505.5')}}
|
||||
|
||||
|
||||
parsed_data_facturx_basic = {
|
||||
'buyer_party': {
|
||||
'city': 'Potsdam',
|
||||
|
|
Loading…
Reference in a new issue