Skip to content

Commit

Permalink
[FIX] account_statement_import_txt_xlsx: handle empty value (debit or…
Browse files Browse the repository at this point in the history
… credit)
  • Loading branch information
norlinhenrik committed Feb 4, 2024
1 parent db84c00 commit 24c744a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ def _parse_decimal(self, value, mapping):
return value
elif isinstance(value, float):
return Decimal(value)
elif not value:
return
thousands, decimal = mapping._get_float_separators()
value = value.replace(thousands, "")
value = value.replace(decimal, ".")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"Date","Label","Debit","Credit","Balance","Partner Name","Bank Account"
"12/15/2018","Credit 20.00","0.00","20.00","-10.00","John Doe","123456789"
"12/15/2018","Debit test empty, Credit test integer",,"20","-10.00","John Doe","123456789"
"12/15/2018","Credit 13.50","0.00","-13.50","-23.50","John Doe","123456789"
"12/15/2018","Debit 33.50","-33.50","0.00","10.00","Azure Interior",""
"12/15/2018","Debit 1500","1,500.00","0.00","1,510.00","Azure Interior",""

0 comments on commit 24c744a

Please sign in to comment.