Exemplo n.º 1
0
def get_districts_from_city(request, city_id=None):
    district_list = hlp.get_list(model_class=District,city__id=city_id).order_by("name")
    return JsonResponse({'district_list': json.dumps([{
                'name': district.name,
                'id': district.id,
            }
            for district in district_list
        ])})
Exemplo n.º 2
0
def get_employee_list_report(**kwargs):
    from office.models import Employee
    results = {}
    results['qs'] = hlp.get_list(Employee).order_by('first_name')
    results['title'] = 'Çalışan Listesi '
    results['date'] = datetime.date.today().strftime('%d.%m.%Y')
    results['total'] = results['qs'].count()
    return results
Exemplo n.º 3
0
def get_partner_list_report(**kwargs):
    import case.models as case_models
    results = {}
    results['qs'] = hlp.get_list(case_models.Partner, ).order_by('first_name')
    results['title'] = 'Ortak Listesi '
    results['date'] = datetime.date.today().strftime('%d.%m.%Y')
    results['total'] = results['qs'].count()
    return results
Exemplo n.º 4
0
def get_case_list_report(**kwargs):
    import case.models as case_models
    results = {}
    results['qs'] = hlp.get_list(case_models.Case, ).order_by('-date')
    results['title'] = 'Dava Listesi '
    results['date'] = datetime.date.today().strftime('%d.%m.%Y')
    results['total'] = results['qs'].count()
    return results
Exemplo n.º 5
0
def all_events(request):
    queryset = hlp.get_list(Event)
    result = []
    for event in queryset:
        result.append(
            {
                "id":event.id,
                "slug":event.slug,
                "url":'/user_calendar/%s/update'%event.slug,
                "publicId":event.id,
                "title":event.title,
                "start":event.start,
                "end":event.end,
                "backgroundColor":event.backgroundColor,
                "borderColor":event.borderColor,
                "editable":event.editable,
            }
        )
    return JsonResponse(result, safe=False)
Exemplo n.º 6
0
def get_chart_employee(slug):
    employee = Employee.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, employee=employee).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 7
0
def get_chart_other(slug):
    other = Other.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, expense__other=other).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 8
0
def get_chart_tax(slug):
    tax = Tax.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, expense__tax=tax).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 9
0
def get_chart_office(slug):
    office = Office.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, expense__office=office).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 10
0
def get_chart_expense(slug):
    expense = Expense.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, expense=expense).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 11
0
def get_chart_partner(slug):
    partner = Partner.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, case__partner=partner).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)
Exemplo n.º 12
0
def get_chart_client(slug):
    client = Client.objects.get(slug=slug)
    transactions = hlp.get_list(Transaction, case__client=client).values(
        'amount', 'type', 'date').order_by('-date')[:7]
    return list(transactions)