Skip to content

Commit

Permalink
Add CIF number for spanish companies (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Moutard authored May 28, 2019
1 parent 8952a5b commit 5cf29e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/sepa.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
created: '',
transactionCount: 0,
initiatorName: '',
/**
* Used by spanish companies it's mandatory for SEPA in spain.
*/
cifNumber: '',
controlSum: 0,
batchBooking: false,
grouping: 'MIXD',
Expand Down Expand Up @@ -224,7 +228,12 @@
r(grpHdr, 'Grpg', this.grouping);
}

r(grpHdr, 'InitgPty', 'Nm', this.initiatorName);
var n = createXMLHelper(doc, true, false);
var initgPty = n(grpHdr, 'InitgPty');
r(initgPty, 'Nm', this.initiatorName);
if (this.cifNumber) {
r(initgPty, 'Id', 'OrgId', 'Othr', 'Id', this.cifNumber);
}

return grpHdr;
},
Expand Down

0 comments on commit 5cf29e6

Please sign in to comment.