Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative Debit #34

Closed
LQkkeN opened this issue Aug 20, 2019 · 7 comments
Closed

Negative Debit #34

LQkkeN opened this issue Aug 20, 2019 · 7 comments

Comments

@LQkkeN
Copy link

LQkkeN commented Aug 20, 2019

I have a case like this: :61:1908150815D-104,12NMSCNONREF//010F214191270328

It fails to parse correctly, likely because of the D-104,12. I'm not certain that's correct or not though. I guess it comes down to the - being allowed or not. Perhaps you've seen such a case before?

@bumi
Copy link
Contributor

bumi commented Jan 7, 2020

sorry for the late reply.
sadly I do not know about that case. Do you know if some MT940 specs supports this?

@LQkkeN
Copy link
Author

LQkkeN commented Jan 7, 2020

This is my only experience with the format, so I unfortunately don't 😕

@Uepsilon
Copy link
Contributor

Uepsilon commented Jan 7, 2020

I don't think that the - is a negative sign but is the placeholder for the currency (not valid though). the amount itself cannot be negative as it's numerical.

i like that source for quick reference: https://www.kontopruef.de/mt940s.shtml

@LQkkeN
Copy link
Author

LQkkeN commented Jan 7, 2020

I ended up doing this on each line:

# Replace `D-100,00` with `RD100,00`
content.gsub!(/D-/, 'RD')

# Replace `C-100,00` with `RC100,00`
content.gsub!(/C-/, 'RC')

And it has worked so far 🤷‍♂

@bumi
Copy link
Contributor

bumi commented Jan 7, 2020

👍

@bumi bumi closed this as completed Jan 7, 2020
@Uepsilon
Copy link
Contributor

Uepsilon commented Jan 7, 2020

@LQkkeN have you checked if the - is really meant to be a negative sign and not a broken currency? if so all is well but if not this makes things worse as you return incorrect statements

@LQkkeN
Copy link
Author

LQkkeN commented Jan 7, 2020

Yes 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants