docs: def get_unpaid_items(self, acc: Account) -> list:
          """
          Returns unpaid items of the invoice in payback priority order.
          :param acc: Account
          :return: list (AccountEntry, Decimal) in payback priority order
          """
          unpaid_items = []
          for item, bal in self.get_item_balances(acc):
              assert isinstance(item, AccountEntry)
              if self.type == INVOICE_DEFAULT:
                  if bal > Decimal(0):
                      unpaid_items.append((item.type.payback_priority, item, bal))
              elif self.type == INVOICE_CREDIT_NOTE:
                  if bal < Decimal(0):
                      unpaid_items.append((item.type.payback_priority, item, bal))
              else:
                  raise Exception('jacc.models.Invoice.get_unpaid_items() unimplemented for invoice type {}'.format(self.type))
          return [i[1:] for i in sorted(unpaid_items, key=lambda x: x[0])]