File tree 1 file changed +4
-9
lines changed
plugins/parsers/psd-bank-pdf/src/main/kotlin
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import java.io.File
14
14
import java.text.NumberFormat
15
15
import java.text.ParseException
16
16
import java.time.LocalDate
17
+ import java.time.Month
17
18
import java.util.Locale
18
19
19
20
import kotlin.IllegalArgumentException
@@ -106,16 +107,10 @@ class PsdBankPdfParser : Logger, Parser() {
106
107
107
108
with (state) {
108
109
val fromDate = checkNotNull(from?.date)
110
+ val fromYear = if (fromDate.month == Month .DECEMBER ) fromDate.year + 1 else fromDate.year
109
111
110
- val postDate = LocalDate .of(fromDate.year, checkNotNull(postMonth), checkNotNull(postDay))
111
- if (postDate < fromDate) {
112
- postDate.plusYears(1 )
113
- }
114
-
115
- val valueDate = LocalDate .of(fromDate.year, checkNotNull(valueMonth), checkNotNull(valueDay))
116
- if (valueDate < fromDate) {
117
- valueDate.plusYears(1 )
118
- }
112
+ val postDate = LocalDate .of(fromYear, checkNotNull(postMonth), checkNotNull(postDay))
113
+ val valueDate = LocalDate .of(fromYear, checkNotNull(valueMonth), checkNotNull(valueDay))
119
114
120
115
bookings + = BookingItem (
121
116
postDate = postDate,
You can’t perform that action at this time.
0 commit comments