geer-builder 1.2.952 → 1.2.953

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,24 +125,33 @@ export default {
125
125
  : null;
126
126
  if (!choice) return [];
127
127
 
128
+ var main_account_number = choice.account_number;
129
+ var accounts = [];
130
+
128
131
  // Source 1: additional_account saved on the order
129
132
  if (choice.additional_account && choice.additional_account.length > 0)
130
133
  {
131
- return choice.additional_account;
134
+ accounts = choice.additional_account;
132
135
  }
133
-
134
136
  // Source 2: fallback to public_settings.manual_payment_additional_account filtered by bank_id
135
- if (this.public_settings
137
+ else if (this.public_settings
136
138
  && this.public_settings.manual_payment_additional_account
137
139
  && this.public_settings.manual_payment_additional_account.length > 0)
138
140
  {
139
141
  var bank_id = choice.bank_id;
140
- return this.public_settings.manual_payment_additional_account.filter(function(acc) {
142
+ accounts = this.public_settings.manual_payment_additional_account.filter(function(acc) {
141
143
  return acc.bank_id === bank_id;
142
144
  });
143
145
  }
144
146
 
145
- return [];
147
+ // Remove duplicates: exclude accounts with same account_number as the main account
148
+ var seen = {};
149
+ seen[main_account_number] = true;
150
+ return accounts.filter(function(acc) {
151
+ if (seen[acc.account_number]) return false;
152
+ seen[acc.account_number] = true;
153
+ return true;
154
+ });
146
155
  }
147
156
  },
148
157
  methods:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.952",
3
+ "version": "1.2.953",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {