コード例 #1
0
def rigid_pl(request, year=0):
    year = u.cleanYear(year)
    r_pl = r_p()

    #売上総利益
    netRevenue = r_pl.getNetRevenue(year)
    costOfSales = r_pl.getCostOfSales(year)
    grossMarginList = []
    for i in range(12):
        grossMarginList.append(netRevenue['total'][i] - costOfSales['total'][i])
    grossMargin = {
        '収益': netRevenue,
        '売上原価': costOfSales,
        '売上総利益': grossMarginList,
    }
    #
    # #限界利益
    # taxAndFocedCost = r_pl.getTaxAndForcedCost(year)
    # lifeCost = r_pl.getLifeCost(year)
    # limitIncomeList = []
    # for i in range(12):
    #     limitIncomeList.append(grossMarginList[i] - taxAndFocedCost[i] - lifeCost[i])
    # limitIncome = {
    #     '一般費':  taxAndFocedCost,
    #     '生活費':  lifeCost,
    #     '限界利益':limitIncomeList,
    # }
    #
    # #その他の収益・費用等
    # nonOperatingCost = r_pl.getNonOperatingCost(year)
    # nonOperatingIncome = r_pl.getNonOperatingIncome(year)
    # entertainmentCost = r_pl.getEntertainmentCost(year)
    #
    # netIncomeList = []
    # for i in range(12):
    #     netIncomeList.append(
    #             limitIncomeList[i]
    #          -  nonOperatingCost[i]
    #          +  nonOperatingIncome[i]
    #          -  entertainmentCost[i]
    #     )
    # netIncome = {
    #     '営業外収益': nonOperatingIncome,
    #     '営業外費用': nonOperatingCost,
    #     '娯楽費': entertainmentCost,
    #     '当月純利益': netIncomeList,
    # }

    yearList = u.getSelectableYearList()
    context = {
        'year_list': yearList,
        '売上総利益': grossMargin,
        # '限界利益': limitIncome,
        # '当月純利益': netIncome,
        # 'month_list': getMonthList(),
        # 'view_name': 'sdss 2.0 Rigid PL view',
        # 'target_year': str(year),
        # 'message': '',
    }
    return render(request, 'rigid_pl.html', context)
コード例 #2
0
def asset_suii(request, year=0):
    year = u.cleanYear(year)
    bs = b()
    bslist = bs.getMiddleYearStatement(year, 0)
    bslist.pop('自己資本', 'no match')
    bslist.pop('他人資本', 'no match')
    bslist.pop('評価換算差額等', 'no match')
    bslist.pop('固定資産', 'no match')
    # yearList = ['2019', '2018',]
    yearList = u.getSelectableYearList()
    monthList = getMonthList()
    colors = (
        (0,153,255,10),
        (0,204,204,10),
        (0.204,153,10),
        (0,0,102,10),
        (0,51,51,10),
        (51,0,51,10),
        (102,0,0,10),
        (102,102,0,10),
        (255,102,0,10),
    )
    context = {
        'label': monthList,
        'bs_list': bslist,
        'year_list': yearList,
        'colors': colors,
        'view_name': 'sdss 2.0 Asset Summary Suii',
        'target_year': str(year),
        'message': '',
    }
    return render(request, 'asset_suii.html', context)
コード例 #3
0
def journal(request):
    # | uid | date | group_id | br_acc_bot_name | br_amount | ... |
    # TODO extract year, month ...etc
    journal_qs = db.Journal.objects.order_by('-date')
    journal_list = getJournalList(journal_qs)
    # yearList = ['2019', '2018',]
    yearList = u.getSelectableYearList()
    context = {
        'journal_list': journal_list,
        'year_list':    yearList,
        'view_name':    'sdss 2.0 journal view',''
        'message': '',
    }
    return render(request, 'journal.html', context)
コード例 #4
0
def pl(request, year=0):
    year = u.cleanYear(year)
    pl = p()
    pllist = pl.getBottomYearStatement(year)
    # yearList = ['2019', '2018',]
    yearList = u.getSelectableYearList()
    context = {
        'year_list': yearList,
        'pl_list': pllist,
        #'month_list': getMonthList(),
        'month_list': getMonthListAndTotal(),
        'view_name': 'sdss 2.0 PL view',
        'target_year': str(year),
        'message': '',
    }
    return render(request, 'pl.html', context)
コード例 #5
0
def detail(request, mid_class_uid=1, year=0):
    year = u.cleanYear(year)
    d_class = d()
    # selectable_year_list = ['2019', '2018',]
    selectable_year_list = u.getSelectableYearList()
    month_list = range(1,13) # =['1','2', .. '12']
    mid_class_list = d_class.getTopMidAccList()
    acc_amount_list = d_class.getClassificationDetail(mid_class_uid, year)
    mid_class_name = d_class.getMidClassName(mid_class_uid)
    context = {
        'year': year,
        'month_list': month_list,
        'selectable_year_list': selectable_year_list,
        'mid_class_name': mid_class_name,
        'mid_class_list': mid_class_list,
        'acc_amount_list': acc_amount_list,
    }
    return render(request, 'detail.html', context)
コード例 #6
0
def bs(request, year=0):
    # |       |   10    |    11   |    12   |
    # | ICOCA |   2,100 |   5,900 |   9,200 |
    # |  現金  |  13,110 |  24,670 |     ... |
    year = u.cleanYear(year)
    bs_class = b()
    bslist = bs_class.getBottomYearStatement(year)
    # yearList = ['2019', '2018',]
    yearList = u.getSelectableYearList()
    context = {
        'bs_list': list,
        'year_list': yearList,
        'bs_mid_list': bslist,
        'month_list': getMonthList(),
        'view_name': 'sdss 2.0 BS view',
        'target_year': str(year),
        'message': '',
    }
    return render(request, 'bs.html', context)
コード例 #7
0
def summary(request, year=0):
    year = u.cleanYear(year)
    bs = b()
    pl = p()
    bslist = bs.getMiddleYearStatement(year)
    pllist = pl.getMiddleYearStatement(year)
    # yearList = ['2019', '2018',]
    yearList = u.getSelectableYearList()
    context = {
        'bs_list': bslist,
        'pl_list': pllist,
        'month_list': getMonthList(),
        'month_list_total': getMonthListAndTotal(),
        'year_list': yearList,
        'view_name': 'sdss 2.0 PL BS summary view',
        'target_year': str(year),
        'message': '',
    }
    return render(request, 'summary.html', context)