diff --git a/template/pain.001.001.03.xml b/template/pain.001.001.03.xml
index 29ea6d6124..c40cd32cd7 100644
--- a/template/pain.001.001.03.xml
+++ b/template/pain.001.001.03.xml
@@ -31,7 +31,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
diff --git a/template/pain.001.001.05.xml b/template/pain.001.001.05.xml
index db275a5448..13e576c039 100644
--- a/template/pain.001.001.05.xml
+++ b/template/pain.001.001.05.xml
@@ -12,7 +12,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
diff --git a/template/pain.001.003.03.xml b/template/pain.001.003.03.xml
index a54207760b..59ee0532ee 100644
--- a/template/pain.001.003.03.xml
+++ b/template/pain.001.003.03.xml
@@ -14,7 +14,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
${PartyIdentification(group.sepa_initiating_party, with_address=False)}
diff --git a/template/pain.008.001.02.xml b/template/pain.008.001.02.xml
index 1898b9a426..4d7b832240 100644
--- a/template/pain.008.001.02.xml
+++ b/template/pain.008.001.02.xml
@@ -31,7 +31,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
diff --git a/template/pain.008.001.04.xml b/template/pain.008.001.04.xml
index 57c680e8d1..3bc2413c15 100644
--- a/template/pain.008.001.04.xml
+++ b/template/pain.008.001.04.xml
@@ -12,7 +12,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
diff --git a/template/pain.008.003.02.xml b/template/pain.008.003.02.xml
index 21d70c832d..651c248568 100644
--- a/template/pain.008.003.02.xml
+++ b/template/pain.008.003.02.xml
@@ -14,7 +14,7 @@ this repository contains the full copyright notices and license terms. -->
${group.reference[:35]}
${datetime.datetime.now().isoformat()}
- ${len(group.payments)}
+ ${len(list(group.sepa_payments))}
${sum(p.amount for p in group.payments)}
${PartyIdentification(group.sepa_initiating_party, with_address=False)}