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

wrong booking date #20

Open
svenjeppsson opened this issue Jan 23, 2019 · 1 comment
Open

wrong booking date #20

svenjeppsson opened this issue Jan 23, 2019 · 1 comment

Comments

@svenjeppsson
Copy link

I have a situation that I already have descripted here:
Originally posted by @svenjeppsson in #19 (comment)

Found the reason:

go-hbci/swift/mt940.go

Lines 243 to 246 in d1fd34b

monthDiff := int(math.Abs(float64(t.ValutaDate.Month() - t.BookingDate.Month())))
if monthDiff > 1 {
t.BookingDate = domain.NewShortDate(t.BookingDate.AddDate(1, 0, 0))
}

ValutaDate ist 1.1.2019
BookingDate is actually 28.12.2018
diffdrences of month is 11
So this logic make the booking to 28.12.2020

I guess it is not so easy to just turn the add 1 year int subtract on yes.
What are the other situations?

Is there no booking year in the mt940 data?

@svenjeppsson
Copy link
Author

I have a solution for this, i will fix that in my fork

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

1 participant