Пример #1
0
def fms_items_1382_12_3():
    return [
        {
            'ien': '95817232',
            'fy': 12,
            'qtr': 3,
            'cp_nbr': '1382',
            'seq_nbr': '0155',
            'fyqseq': '1230155',
            'txn_type': 'A',
            'obl_amt': '7242',
            'obl_date': vista_utils.to_py_date('3120402'),
            'obl_nbr': 'D25025',
            'txn_amt': '7242',
        },
        {
            'ien': '95765346',
            'fy': 12,
            'qtr': 3,
            'cp_nbr': '1382',
            'seq_nbr': '0232',
            'fyqseq': '1230232',
            'txn_type': 'O',
            'obl_amt': '364.28',
            'obl_date': vista_utils.to_py_date('3120606'),
            'obl_nbr': 'R24911',
            'txn_amt': '364.28',
        },
    ]
Пример #2
0
def fms_items_1382_13():
    return [
        {
            'ien': '95434961',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0637',
            'fyqseq': '1240637',
            'txn_type': 'A',
            'obl_amt': '874.86',
            'obl_date': vista_utils.to_py_date('3121015'),
            'obl_nbr': 'D25025',
            'txn_amt': '874.86',
        },
        {
            'ien': '95432617',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0640',
            'fyqseq': '1240640',
            'txn_type': 'A',
            'obl_amt': '-40',
            'obl_date': vista_utils.to_py_date('3121029'),
            'obl_nbr': 'D25025',
            'txn_amt': '-40',
        },
        {
            'ien': '95429240',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0641',
            'fyqseq': '1240641',
            'txn_type': 'A',
            'obl_amt': '-52596.08',
            'obl_date': vista_utils.to_py_date('3121113'),
            'obl_nbr': 'D20032-1',
            'txn_amt': '-52596.08',
        },
        {
            'ien': '95436544',
            'fy': 13,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0003',
            'fyqseq': '1310003',
            'txn_type': 'A',
            'obl_amt': '-8469.86',
            'obl_date': None,
            'obl_nbr': 'ADJ002',
            'txn_amt': '-8469.86',
        },
    ]
Пример #3
0
def fms_items_1382_12_4():
    return [
        {
            'ien': '95720469',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0304',
            'fyqseq': '1240304',
            'txn_type': 'A',
            'obl_amt': '176472.00',
            'obl_date': None,
            'obl_nbr': 'B0523F',
            'txn_amt': '176472.00',
        },
        {
            'ien': '95718275',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0311',
            'fyqseq': '1240311',
            'txn_type': 'A',
            'obl_amt': '-281.99',
            'obl_date': vista_utils.to_py_date('3120717'),
            'obl_nbr': 'D25025',
            'txn_amt': '-281.99',
        },
        {
            'ien': '95670819',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0383',
            'fyqseq': '1240383',
            'txn_type': 'O',
            'obl_amt': '455078.52',
            'obl_date': vista_utils.to_py_date('3120926'),
            'obl_nbr': 'D20032',
            'txn_amt': '455078.52',
        },
        {
            'ien': '95670796',
            'fy': 12,
            'qtr': 4,
            'cp_nbr': '1382',
            'seq_nbr': '0384',
            'fyqseq': '1240384',
            'txn_type': 'O',
            'obl_amt': None,
            'obl_date': None,
            'obl_nbr': 'D20032',
            'txn_amt': '0',
        },
    ]
Пример #4
0
def fms_items_1382_12_2():
    return [
        {
            'ien': '95864913',
            'fy': 12,
            'qtr': 2,
            'cp_nbr': '1382',
            'seq_nbr': '0062',
            'fyqseq': '1220062',
            'txn_type': 'A',
            'obl_amt': None,
            'obl_date': None,
            'obl_nbr': 'QTRADJ',
            'txn_amt': '0',
        },
        {
            'ien': '95857527',
            'fy': 12,
            'qtr': 2,
            'cp_nbr': '1382',
            'seq_nbr': '0076',
            'fyqseq': '1220076',
            'txn_type': 'A',
            'obl_amt': '7242',
            'obl_date': vista_utils.to_py_date('3120117'),
            'obl_nbr': 'D25025',
            'txn_amt': '7242',
        },
    ]
Пример #5
0
def __load(vista_data, current_balances):
    line_items = []
    for vista_line_item in vista_data:
        vista_line_item = vista_line_item[0:10] + vista_line_item[11:]
        line_item = dict(zip(FIELD_NAMES, vista_line_item))

        # Get rid of the lines with no meaningful content
        if __skip(line_item):
            continue

        # Handle empty amts
        if line_item['obl_amt'] == ' ':
            line_item['obl_amt'] = None
        if line_item['txn_amt'] == ' ':
            line_item['txn_amt'] = None

        # Handle the Vista obl_date
        line_item['obl_date'] = vista_utils.to_py_date(line_item['obl_date'])

        # Calculate the balances
        line_item['cp_bal'] = ''
        line_item['unobl_bal'] = ''
        __set_balances(line_item, current_balances)

        # Set the statuses
        __set_statuses(line_item)

        # Handle the weird OBLs with obl_amts in last field
        if len(vista_line_item) >= 15:
            if len(line_item['obl_amt_2']) != 0 and line_item['obl_amt_2'] != 'X':
                line_item['obl_amt'] = line_item['obl_amt_2']

        # Convert the txn_nbr into fyqseq, etc.
        __replace_txn_nbr(line_item)

        # Get rid of the extra fields we needed to calc the balances and statuses
        __skim(line_item)

        line_items.append(line_item)
    return line_items
Пример #6
0
def fms_items_1382_12_1():
    return [
        {
            'ien': '96224134',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0001',
            'fyqseq': '1210001',
            'txn_type': 'CA',
            'obl_amt': '0',
            'obl_date': None,
            'obl_nbr': ' ',
            'txn_amt': '0',
        },
        {
            'ien': '96224118',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0002',
            'fyqseq': '1210002',
            'txn_type': 'O',
            'obl_amt': '6666',
            'obl_date': vista_utils.to_py_date('3111005'),
            'obl_nbr': 'D27012',
            'txn_amt': '6666',
        },
        {
            'ien': '96041404',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0009',
            'fyqseq': '1210009',
            'txn_type': 'CA',
            'obl_amt': None,
            'obl_date': None,
            'obl_nbr': ' ',
        'txn_amt': None,
        },
        {
            'ien': '95958457',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0011',
            'fyqseq': '1210011',
            'txn_type': 'O',
            'obl_amt': '560',
            'obl_date': vista_utils.to_py_date('3111003'),
            'obl_nbr': 'D25011',
            'txn_amt': '560',
        },
        {
            'ien': '95877740',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0021',
            'fyqseq': '1210021',
            'txn_type': 'O',
            'obl_amt': '12368',
            'obl_date': vista_utils.to_py_date('3111104'),
            'obl_nbr': 'D25025',
            'txn_amt': '12368',
        },
        {
            'ien': '95876936',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0029',
            'fyqseq': '1210029',
            'txn_type': 'A',
            'obl_amt': '-40',
            'obl_date': vista_utils.to_py_date('3111031'),
            'obl_nbr': 'D25011',
            'txn_amt': '-40',
        },
        {
            'ien': '95873815',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0033',
            'fyqseq': '1210033',
            'txn_type': 'A',
            'obl_amt': '-240',
            'obl_date': vista_utils.to_py_date('3111125'),
            'obl_nbr': 'D25011',
            'txn_amt': '-240',
        },
        {
            'ien': '95871250',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0038',
            'fyqseq': '1210038',
            'txn_type': 'C',
            'obl_amt': '157655',
            'obl_date': vista_utils.to_py_date('3111206'),
            'obl_nbr': '506FC9276',
            'txn_amt': '157655',
        },
        {
            'ien': '95870938',
            'fy': 12,
            'qtr': 1,
            'cp_nbr': '1382',
            'seq_nbr': '0043',
            'fyqseq': '1210043',
            'txn_type': 'A',
            'obl_amt': '-1207',
            'obl_date': vista_utils.to_py_date('3111208'),
            'obl_nbr': 'D25025',
            'txn_amt': '-1207',
        }
    ]