add bank account number to xml-export
This commit is contained in:
parent
813f5a4bcf
commit
9f2be4e593
2 changed files with 51 additions and 16 deletions
|
@ -12,7 +12,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<udt:DateTimeString format="102">${value.strftime('%Y%m%d')}</udt:DateTimeString>
|
||||
</py:def>
|
||||
<py:def function="TradeParty(party, address=None, tax_identifier=None)">
|
||||
<ram:Name>${party.name}</ram:Name>
|
||||
<ram:Name>${this.quote_text(party.name)}</ram:Name>
|
||||
<ram:SpecifiedLegalOrganization>
|
||||
<py:for each="id, attrs in this.party_legal_ids(party, address)">
|
||||
<ram:ID py:attrs="attrs">${id}</ram:ID>
|
||||
|
@ -26,13 +26,13 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<py:def function="TradeAddress(address)">
|
||||
<ram:PostcodeCode py:if="address.postal_code">${address.postal_code}</ram:PostcodeCode>
|
||||
<py:with vars="lines = (address.street or '').splitlines()">
|
||||
<ram:LineOne py:if="len(lines) > 0">${lines[0]}</ram:LineOne>
|
||||
<ram:LineTwo py:if="len(lines) > 1">${lines[1]}</ram:LineTwo>
|
||||
<ram:LineThree py:if="len(lines) > 2">${lines[2]}</ram:LineThree>
|
||||
<ram:LineOne py:if="len(lines) > 0">${this.quote_text(lines[0])}</ram:LineOne>
|
||||
<ram:LineTwo py:if="len(lines) > 1">${this.quote_text(lines[1])}</ram:LineTwo>
|
||||
<ram:LineThree py:if="len(lines) > 2">${(lines[2])}</ram:LineThree>
|
||||
</py:with>
|
||||
<ram:CityName py:if="address.city">${address.city}</ram:CityName>
|
||||
<ram:CityName py:if="address.city">${(address.city)}</ram:CityName>
|
||||
<ram:CountryID py:if="address.country">${address.country.code}</ram:CountryID>
|
||||
<ram:CountrySubDivisionName py:if="address.subdivision">${address.subdivision.name}</ram:CountrySubDivisionName>
|
||||
<ram:CountrySubDivisionName py:if="address.subdivision">${this.quote_text(address.subdivision.name)}</ram:CountrySubDivisionName>
|
||||
</py:def>
|
||||
<py:def function="TradeTax(tax, amount=None, base=None)">
|
||||
<ram:ApplicableTradeTax>
|
||||
|
@ -50,8 +50,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument>
|
||||
<ram:ID>${this.invoice.number}</ram:ID>
|
||||
<ram:Name py:if="this.invoice.description">${this.invoice.description}</ram:Name>
|
||||
<ram:ID>${this.quote_text(this.invoice.number)}</ram:ID>
|
||||
<ram:Name py:if="this.invoice.description">${this.quote_text(this.invoice.description)}</ram:Name>
|
||||
<ram:TypeCode>${this.type_code}</ram:TypeCode>
|
||||
<ram:IssueDateTime>
|
||||
${DateTime(this.invoice.invoice_date)}
|
||||
|
@ -71,8 +71,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:ID py:if="line.product and line.product.code">${line.product.code}</ram:ID>
|
||||
<ram:Name>${line.product.name if line.product else ''}</ram:Name>
|
||||
<ram:Description py:if="line.description">${line.description}</ram:Description>
|
||||
<ram:Name>${this.quote_text(line.product.name if line.product else '')}</ram:Name>
|
||||
<ram:Description py:if="line.description">${this.quote_text(line.description)}</ram:Description>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
|
@ -99,10 +99,10 @@ this repository contains the full copyright notices and license terms. -->
|
|||
${TradeParty(this.buyer_trade_party, this.buyer_trade_address, this.buyer_trade_tax_identifier)}
|
||||
</ram:BuyerTradeParty>
|
||||
<ram:SellerOrderReferencedDocument py:if="this.invoice.type == 'in'">
|
||||
<ram:IssuerAssignedID>${this.invoice.reference}</ram:IssuerAssignedID>
|
||||
<ram:IssuerAssignedID>${this.quote_text(this.invoice.reference)}</ram:IssuerAssignedID>
|
||||
</ram:SellerOrderReferencedDocument>
|
||||
<ram:BuyerOrderReferencedDocument py:if="this.invoice.type == 'out'">
|
||||
<ram:IssuerAssignedID>${this.invoice.reference}</ram:IssuerAssignedID>
|
||||
<ram:IssuerAssignedID>${this.quote_text(this.invoice.reference)}</ram:IssuerAssignedID>
|
||||
</ram:BuyerOrderReferencedDocument>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
|
@ -114,11 +114,26 @@ this repository contains the full copyright notices and license terms. -->
|
|||
</ram:ShipFromTradeParty>
|
||||
</ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:PaymentReference>${this.payment_reference}</ram:PaymentReference>
|
||||
<ram:PaymentReference>${this.quote_text(this.payment_reference)}</ram:PaymentReference>
|
||||
<ram:InvoiceCurrencyCode>${this.invoice.currency.code}</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:TypeCode>1</ram:TypeCode> <!-- Instrument not defined -->
|
||||
</ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<py:if test="len(this.company_bank_accounts()) == 0">
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:TypeCode>1</ram:TypeCode>
|
||||
</ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
</py:if>
|
||||
<py:for each="banknumber in this.company_bank_accounts()">
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:TypeCode>30</ram:TypeCode>
|
||||
<ram:Information>Wire transfer</ram:Information>
|
||||
<ram:PayeePartyCreditorFinancialAccount>
|
||||
<ram:IBANID>${banknumber.number_compact}</ram:IBANID>
|
||||
<ram:AccountName>${this.quote_text(banknumber.account.bank.party.rec_name)}</ram:AccountName>
|
||||
</ram:PayeePartyCreditorFinancialAccount>
|
||||
<ram:PayeeSpecifiedCreditorFinancialInstitution>
|
||||
<ram:BICID>${banknumber.account.bank.bic}</ram:BICID>
|
||||
</ram:PayeeSpecifiedCreditorFinancialInstitution>
|
||||
</ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
</py:for>
|
||||
<py:for each="tax in this.invoice.taxes">
|
||||
${TradeTax(tax.tax, tax.amount, tax.base)}
|
||||
</py:for>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue