Render one AdrLine per street line in SEPA messages

Closes #13834
This commit is contained in:
Cédric Krier
2025-01-25 01:00:09 +01:00
parent a3e5faac0c
commit 8770a0183f
2 changed files with 11 additions and 4 deletions
@@ -49,8 +49,11 @@ this repository contains the full copyright notices and license terms. -->
</py:def>
<py:def function="PostalAddress(address)">
<Ctry py:if="address.country">${normalize('NFKD', address.country.code).encode('ascii', 'replace')}</Ctry>
<AdrLine py:if="address.street">${normalize('NFKD', ' '.join(address.street.splitlines()[0:1])).encode('ascii', 'replace')[:70]}</AdrLine>
<AdrLine py:if="address.street and len(address.street.splitlines()) > 1">${normalize('NFKD', ' '.join(address.street.splitlines()[1:])).encode('ascii', 'replace')[:70]}</AdrLine>
<py:if test="address.street">
<py:for each="line in address.street.splitlines()[1:8]">
<AdrLine py:if="address.street">${normalize('NFKD', line).encode('ascii', 'replace')[:70]}</AdrLine>
</py:for>
</py:if>
</py:def>
<py:def function="Account(account_number, with_ccy=True)">
<Id>
@@ -48,13 +48,17 @@ this repository contains the full copyright notices and license terms. -->
<!-- AdrTp -->
<!-- Dept -->
<!-- SubDept -->
<StrtNm py:if="address.street">${address.street[:70]}</StrtNm>
<StrtNm py:if="address.street">${address.street.splitlines()[0:1][:70]}</StrtNm>
<!-- BldgNb -->
<PstCd py:if="address.postal_code">${address.postal_code[:16]}</PstCd>
<TwnNm py:if="address.city">${address.city[:35]}</TwnNm>
<CtrySubDvsn py:if="address.subdivision">${address.subdivision.rec_name[:35]}</CtrySubDvsn>
<Ctry py:if="address.country">${address.country.code}</Ctry>
<!-- AdrLine -->
<py:if test="address.street">
<py:for each="line in address.street.splitlines()[1:8]">
<AdrLine py:if="line">${line[:70]}</AdrLine>
</py:for>
</py:if>
</py:def>
<py:def function="Account(account_number, currency=True)">
<Id>