# Path: core/const.py
# class AccountType:
#     """Enum of all possible account types.
# 
#     * ``Asset``
#     * ``Liability``
#     * ``Income``
#     * ``Expense``
# 
#     Special values:
# 
#     * ``All``: set containing all account types
#     * ``InOrder``: all account type in "sort" order.
#     """
#     Asset = 'asset'
#     Liability = 'liability'
#     Income = 'income'
#     Expense = 'expense'
#     InOrder = [Asset, Liability, Income, Expense]
#     All = set(InOrder)


from datetime import timedelta
from core.trans import trget, tr
from .column import Column
from ..const import AccountType
from .report import Report, get_delta_perc
        start_amount = entries.normal_balance(start_date - timedelta(1))
        start_amount_native = entries.normal_balance(start_date - timedelta(1), currency)
        end_amount = entries.normal_balance(end_date)
        end_amount_native = entries.normal_balance(end_date, currency)
        delta = end_amount - start_amount

        # Amounts for totals are converted in the document's currency
        node.start_amount = start_amount_native
        node.end_amount = end_amount_native

        # Amounts for display are kept in the account's currency
        node.start = self.document.format_amount(start_amount)
        node.end = self.document.format_amount(end_amount)
        node.delta = self.document.format_amount(delta)
        node.delta_perc = get_delta_perc(delta, start_amount)

    def _make_node(self, name):
        node = Report._make_node(self, name)
        node.start = ''
        node.end = ''
        node.delta = ''
        node.delta_perc = ''
        node.start_amount = 0
        node.end_amount = 0
        return node

    def _refresh(self):
        self.clear()
        self.has_multiple_currencies = self.document.accounts.has_multiple_currencies()
        self.assets = self.make_type_node(tr('ASSETS'), AccountType.Asset)

# Path: core/const.py
# class AccountType:
#     """Enum of all possible account types.
# 
#     * ``Asset``
#     * ``Liability``
#     * ``Income``
#     * ``Expense``
# 
#     Special values:
# 
#     * ``All``: set containing all account types
#     * ``InOrder``: all account type in "sort" order.
#     """
#     Asset = 'asset'
#     Liability = 'liability'
#     Income = 'income'
#     Expense = 'expense'
#     InOrder = [Asset, Liability, Income, Expense]
#     All = set(InOrder)


# Path: core/gui/balance_sheet.py
from datetime import timedelta
from core.trans import trget, tr
from .column import Column
from ..const import AccountType
from .report import Report, get_delta_perc

        start_amount = entries.normal_balance(start_date - timedelta(1))
        start_amount_native = entries.normal_balance(start_date - timedelta(1), currency)
        end_amount = entries.normal_balance(end_date)
        end_amount_native = entries.normal_balance(end_date, currency)
        delta = end_amount - start_amount

        # Amounts for totals are converted in the document's currency
        node.start_amount = start_amount_native
        node.end_amount = end_amount_native

        # Amounts for display are kept in the account's currency
        node.start = self.document.format_amount(start_amount)
        node.end = self.document.format_amount(end_amount)
        node.delta = self.document.format_amount(delta)
        node.delta_perc = get_delta_perc(delta, start_amount)

    def _make_node(self, name):
        node = Report._make_node(self, name)
        node.start = ''
        node.end = ''
        node.delta = ''
        node.delta_perc = ''
        node.start_amount = 0
        node.end_amount = 0
        return node

    def _refresh(self):
        self.clear()
        self.has_multiple_currencies = self.document.accounts.has_multiple_currencies()
        self.assets = self.make_type_node(tr('ASSETS'), AccountType.Asset)

        self.liabilities = self.make_type_node(tr('LIABILITIES'), AccountType.Liability)