Beispiel #1
0
def test_SplitBookingView_2(browser, json_fixture):
    """It splits booking on form submit."""
    from sw.allotmentclub import Booking
    setUp()
    assert len(Booking.query().all()) == 30
    browser.login()
    json_fixture.ajax(browser)
    assert 'success' == browser.json['status']
    assert Booking.get(1).is_splitted is True
    assert len(Booking.query().all()) == 32
Beispiel #2
0
def test_SplitBookingView_3(browser, json_fixture):
    """It shows an error message if split failed."""
    from sw.allotmentclub import Booking
    setUp()
    assert len(Booking.query().all()) == 30
    browser.login()
    json_fixture.ajax(browser)
    assert 'error' == browser.json['status']
    expmsg = 'Neuer Wert muss gr\xf6\xdfer oder kleiner 0 sein.'
    assert expmsg == browser.json['msg']
    assert len(Booking.query().all()) == 30
    assert Booking.get(1).is_splitted is False
Beispiel #3
0
def test_import_sepa_creates_new_booking_entry_for_open_amount(database,
                                                               member):
    from ..account import import_transactions, SEPASammler, SEPASammlerEntry
    from ..account import BankingAccount, Booking
    account = BankingAccount.find_or_create(
        organization_id=1, number='3440000167')
    sammler = SEPASammler.create(
        pmtinfid='PII7ebef1ebc3ec4a5185583851c8f7dbb2',
        booking_day=datetime.datetime.now(),
        accounting_year=2018)
    SEPASammlerEntry.create(sepasammler=sammler, value=10000000)
    statements = [{
        'date': datetime.datetime.now(),
        'currency': 'EUR',
        'purpose': 'Energieabrechnung',
        'amount': Amount(2743.12, 'EUR'),
        'applicant_name': 'Verein',
        'posting_text': 'SAMMEL-LS-EINZUG',
        'applicant_iban': 'DE123456778899',
        'applicant_bin': 'NOLADE21HAL',
        'customer_reference': ('DATUM 14.06.2018, 14.28 UHR ANZAHL 9\n'
                               'PII7ebef1ebc3ec4a5185583851c8f7dbb2')
    }]
    assert 0 == Booking.query().count()
    import_transactions(statements, account)
    assert 3 == Booking.query().count()

    assert 27431200 == Booking.get(1).value
    assert 10000000 == Booking.get(2).value
    assert 17431200 == Booking.get(3).value

    assert 1 == Booking.get(2).splitted_from_id
    assert 1 == Booking.get(3).splitted_from_id

    assert 'SAMMEL-LS-EINZUG Verrechnet' == Booking.get(2).booking_text