diff --git a/line.py b/line.py
index 7c877bc..3031fea 100644
--- a/line.py
+++ b/line.py
@@ -733,7 +733,12 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
lines = Line2.search(query)
for line3 in lines:
- balance += getattr(line3, credit_name) - getattr(line3, debit_name)
+ line_credit = getattr(line3, credit_name)
+ line_debit = getattr(line3, debit_name)
+
+ if (line_credit is not None) or (line_debit is not None):
+ balance += line_credit - line_debit
+
if line3.id == line.id:
break
return balance
diff --git a/view/line_list.xml b/view/line_list.xml
index 9bef16b..fffc0ac 100644
--- a/view/line_list.xml
+++ b/view/line_list.xml
@@ -13,6 +13,5 @@ full copyright notices and license terms. -->
-
diff --git a/wizard_booking.py b/wizard_booking.py
index 27304c9..5c58a69 100644
--- a/wizard_booking.py
+++ b/wizard_booking.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
-# This file is part of the cashbook-module from m-ds for Tryton.
+# This file is part of the cashbook-module from m-ds.de for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, StateTransition, Button
-from trytond.i18n import gettext
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.pyson import Eval, Bool, If, And
diff --git a/wizard_booking.xml b/wizard_booking.xml
index 1a62755..8c9c0bd 100644
--- a/wizard_booking.xml
+++ b/wizard_booking.xml
@@ -1,5 +1,5 @@
-
diff --git a/wizard_openline.py b/wizard_openline.py
index c20fc6a..770c3da 100644
--- a/wizard_openline.py
+++ b/wizard_openline.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# This file is part of the cashbook-module from m-ds for Tryton.
+# This file is part of the cashbook-module from m-ds.de for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
diff --git a/wizard_openline.xml b/wizard_openline.xml
index 7894e2e..760ad94 100644
--- a/wizard_openline.xml
+++ b/wizard_openline.xml
@@ -1,5 +1,5 @@
-
diff --git a/wizard_runreport.py b/wizard_runreport.py
index 97a1ea8..b864e1f 100644
--- a/wizard_runreport.py
+++ b/wizard_runreport.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
-# This file is part of the cashbook-module from m-ds for Tryton.
+# This file is part of the cashbook-module from m-ds.de for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.pyson import PYSONEncoder
-from trytond.wizard import Wizard, StateView, StateTransition, StateReport, Button
-from trytond.i18n import gettext
+from trytond.wizard import Wizard, StateView, StateReport, Button
from trytond.pool import Pool
from trytond.pyson import Eval, Bool
from trytond.transaction import Transaction
diff --git a/wizard_runreport.xml b/wizard_runreport.xml
index e2a21ab..e7158e0 100644
--- a/wizard_runreport.xml
+++ b/wizard_runreport.xml
@@ -1,5 +1,5 @@
-