File tree 2 files changed +22
-7
lines changed
2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -1079,13 +1079,14 @@ def parseTransaction(cls, txn_ofx):
1079
1079
if cls .fail_fast :
1080
1080
raise
1081
1081
1082
- checknum_tag = txn_ofx .find ('checknum' )
1083
- if hasattr (checknum_tag , 'contents' ):
1084
- try :
1085
- transaction .checknum = checknum_tag .contents [0 ].strip ()
1086
- except IndexError :
1087
- raise OfxParserException (six .u ("Empty Check (or other reference) \
1088
- number" ))
1082
+ for check_field in ('checknum' , 'chknum' ):
1083
+ checknum_tag = txn_ofx .find (check_field )
1084
+ if hasattr (checknum_tag , 'contents' ):
1085
+ try :
1086
+ transaction .checknum = checknum_tag .contents [0 ].strip ()
1087
+ except IndexError :
1088
+ raise OfxParserException (six .u ("Empty Check (or other reference) \
1089
+ number" ))
1089
1090
1090
1091
return transaction
1091
1092
Original file line number Diff line number Diff line change @@ -449,6 +449,20 @@ def testThatParseTransactionWithFieldCheckNum(self):
449
449
transaction = OfxParser .parseTransaction (txn .find ('stmttrn' ))
450
450
self .assertEqual ('700' , transaction .checknum )
451
451
452
+ def testThatParseTransactionWithFieldChkNum (self ):
453
+ input = '''
454
+ <STMTTRN>
455
+ <TRNTYPE>CHECK
456
+ <DTPOSTED>20231121
457
+ <TRNAMT>-113.71
458
+ <FITID>0000489
459
+ <CHKNUM>1932
460
+ </STMTTRN>
461
+ '''
462
+ txn = soup_maker (input )
463
+ transaction = OfxParser .parseTransaction (txn .find ('stmttrn' ))
464
+ self .assertEqual ('1932' , transaction .checknum )
465
+
452
466
def testThatParseTransactionWithCommaAsDecimalPoint (self ):
453
467
input = '''
454
468
<STMTTRN>
You can’t perform that action at this time.
0 commit comments