Skip to content

Commit

Permalink
ISR participant number of the creditor agent is a mandatory field
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwul committed Jun 17, 2024
1 parent f19959d commit c5a550c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions l10n_ch_pain_direct_debit/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,12 @@ def generate_party_agent(
party_agent_clearing_identification.text = (
partner_bank.acc_number.replace(" ", "")[4:9]
)
if self.company_partner_bank_id.acc_type == 'postal':
ccp_other = etree.SubElement(party_agent_institution, "Othr")
ccp_other_id = etree.SubElement(ccp_other, "Id")
ref_subparts = self.company_partner_bank_id.l10n_ch_postal.split("-")
ccp_other_id.text = (
ref_subparts[0] + ref_subparts[1].rjust(6, "0") + ref_subparts[2]
)
ccp_other = etree.SubElement(party_agent_institution, "Othr")
ccp_other_id = etree.SubElement(ccp_other, "Id")
ref_subparts = self.company_partner_bank_id.l10n_ch_postal.split("-")
ccp_other_id.text = (
ref_subparts[0] + ref_subparts[1].rjust(6, "0") + ref_subparts[2]
)

res = True
else:
Expand Down

0 comments on commit c5a550c

Please sign in to comment.