Skip to content

Commit

Permalink
Camt structure fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaprasadmg committed Mar 6, 2018
1 parent 944f391 commit 77cf103
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ archive:
replacements:
amd64: 64-bit
darwin: macOS
linux: Tux
linux: Linux
windows: Windows
files:
- config.yaml
- LICENSE
- LICENSE
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# csvToCamt
Convert CSV correction files to CAMT format

Get binaries from [release page](https://github.com/krishnaprasadmg/csvToCamt/releases/tag/v0.1.1)
Get binaries from [release page](https://github.com/krishnaprasadmg/csvToCamt/releases/tag/v0.1.2)

# Example

Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ camt:
CamtPmtInfId: "57KK"
CamtPmtMtd: "TRF"
CamtChrgBr: "SLEV"
CamtRef: "Beitragsnachweis"
CamtRef: "Negativzinsen Rueckzahlung"
CamtEndToEnd: "NEGINT/0000"
CamtCd: "PAYR"

Expand Down
14 changes: 7 additions & 7 deletions utils/camt.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (c *CamtDocument) AddHeaders(totalAmount float64, nOfTxs int) {
ReqdExctnDt.CreateCharData(tm.Format("2006-01-02"))

Dbtr := PmtInf.CreateElement("Dbtr")
Dbtr.AddChild(Nm)
Dbtr.AddChild(Nm.Copy())

DbtrAcct := PmtInf.CreateElement("DbtrAcct")
Id := DbtrAcct.CreateElement("Id")
Expand All @@ -90,30 +90,30 @@ func (c *CamtDocument) AddTransactionData(transactionData map[string]*Transactio
EndToEndId := PmtId.CreateElement("PmtId")
EndToEndId.CreateCharData(config.GetString("camt.CamtEndToEnd") + data.endToEnd)

Amt := c.cstmrCdtTrfInitn.CreateElement("Amt")
Amt := CdtTrfTxInf.CreateElement("Amt")
InstdAmt := Amt.CreateElement("InstdAmt")
InstdAmt.CreateAttr("Ccy", "EUR")
InstdAmt.CreateCharData(data.amount)

CdtrAgt := c.cstmrCdtTrfInitn.CreateElement("CdtrAgt")
CdtrAgt := CdtTrfTxInf.CreateElement("CdtrAgt")
FinInstnId := CdtrAgt.CreateElement("FinInstnId")
BIC := FinInstnId.CreateElement("BIC")
BIC.CreateCharData(data.bic)

Cdtr := c.cstmrCdtTrfInitn.CreateElement("Cdtr")
Cdtr := CdtTrfTxInf.CreateElement("Cdtr")
Nm := Cdtr.CreateElement("Nm")
Nm.CreateCharData(data.bankName)

CdtrAcct := c.cstmrCdtTrfInitn.CreateElement("CdtrAcct")
CdtrAcct := CdtTrfTxInf.CreateElement("CdtrAcct")
Id := CdtrAcct.CreateElement("Id")
IBAN := Id.CreateElement("IBAN")
IBAN.CreateCharData(data.iban)

Purp := c.cstmrCdtTrfInitn.CreateElement("Purp")
Purp := CdtTrfTxInf.CreateElement("Purp")
Cd := Purp.CreateElement("Purp")
Cd.CreateCharData(config.GetString("camt.CamtCd"))

RmtInf := c.cstmrCdtTrfInitn.CreateElement("RmtInf")
RmtInf := CdtTrfTxInf.CreateElement("RmtInf")
Ustrd := RmtInf.CreateElement("Ustrd")
Ustrd.CreateCharData(config.GetString("camt.CamtRef"))
}
Expand Down

0 comments on commit 77cf103

Please sign in to comment.