Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.http import HttpResponseRedirect
- from django.shortcuts import render,redirect,get_object_or_404
- from django.contrib.auth.models import User
- from django.db.models import Sum
- from django.contrib import messages
- from graphos.sources.simple import SimpleDataSource
- from graphos.renderers.gchart import LineChart, BarChart
- from agents.models import NetellerDepositModel, SkrillDepositModel, SkrillSignUpModel, NetellerSignUpModel, AgentListModel, \
- AdminCommissionRuleModel,CustomCommissionRangesModel, NetReceiablesModel, PaymentRequestsModel, SupportModel,\
- SiteIdAssignModel, LastUpdateDates , AdmingMessagesForAgents
- from sadmin import Csvimports
- import datetime
- from decimal import *
- from django.db.models import Count
- from django.db.models.functions import Trunc
- from sadmin import RefCalcls
- def clubowner(request):
- if 'agent_username' in request.session:
- agentSession = request.session['agent_username']
- myclub = ['vd', 'snrerror', 'amirbd']
- cb_commission_rule = AdminCommissionRuleModel.objects.last()
- co_deal = Decimal(5.5)
- alldata = []
- for netDeps in NetellerDepositModel.objects.filter(ndm_agent=myclub[0]):
- cof_deal = float(co_deal - Decimal(netDeps.ndm_FinalDeal))
- if float(netDeps.ndm_Profit) * 1000 / float(netDeps.ndm_DepositAmount) > float(
- cb_commission_rule.adminCommissionRule_dirCommissionAmount):
- fc = round(cof_deal* float(netDeps.ndm_DepositAmount) / 1000, 2)
- else:
- fc = round((float(netDeps.ndm_Profit) / float(
- cb_commission_rule.adminCommissionRule_dirCommissionAmount)) * cof_deal, 2)
- alldata.append((netDeps.ndm_DepositAmount, netDeps.ndm_Profit, netDeps.ndm_FinalCommission,fc,netDeps.ndm_FinalDeal, cof_deal))
- context = {
- "ok": 1,
- "data": set(alldata)
- }
- return render(request, 'agenttemplates/myclub.html', context)
- else:
- return redirect('login')
- def test(request):
- return render(request, 'sadmintemplates/test.html')
Add Comment
Please, Sign In to add comment