rubel007cse

Untitled

Sep 13th, 2020
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. from django.http import HttpResponseRedirect
  2. from django.shortcuts import render,redirect,get_object_or_404
  3. from django.contrib.auth.models import User
  4. from django.db.models import Sum
  5. from django.contrib import messages
  6. from graphos.sources.simple import SimpleDataSource
  7. from graphos.renderers.gchart import LineChart, BarChart
  8. from agents.models import NetellerDepositModel, SkrillDepositModel, SkrillSignUpModel, NetellerSignUpModel, AgentListModel, \
  9. AdminCommissionRuleModel,CustomCommissionRangesModel, NetReceiablesModel, PaymentRequestsModel, SupportModel,\
  10. SiteIdAssignModel, LastUpdateDates , AdmingMessagesForAgents
  11. from sadmin import Csvimports
  12. import datetime
  13. from decimal import *
  14. from django.db.models import Count
  15. from django.db.models.functions import Trunc
  16. from sadmin import RefCalcls
  17.  
  18.  
  19.  
  20. def clubowner(request):
  21. if 'agent_username' in request.session:
  22. agentSession = request.session['agent_username']
  23.  
  24. myclub = ['vd', 'snrerror', 'amirbd']
  25. cb_commission_rule = AdminCommissionRuleModel.objects.last()
  26. co_deal = Decimal(5.5)
  27. alldata = []
  28.  
  29. for netDeps in NetellerDepositModel.objects.filter(ndm_agent=myclub[0]):
  30. cof_deal = float(co_deal - Decimal(netDeps.ndm_FinalDeal))
  31.  
  32. if float(netDeps.ndm_Profit) * 1000 / float(netDeps.ndm_DepositAmount) > float(
  33. cb_commission_rule.adminCommissionRule_dirCommissionAmount):
  34. fc = round(cof_deal* float(netDeps.ndm_DepositAmount) / 1000, 2)
  35.  
  36. else:
  37. fc = round((float(netDeps.ndm_Profit) / float(
  38. cb_commission_rule.adminCommissionRule_dirCommissionAmount)) * cof_deal, 2)
  39.  
  40. alldata.append((netDeps.ndm_DepositAmount, netDeps.ndm_Profit, netDeps.ndm_FinalCommission,fc,netDeps.ndm_FinalDeal, cof_deal))
  41.  
  42.  
  43.  
  44. context = {
  45. "ok": 1,
  46. "data": set(alldata)
  47. }
  48. return render(request, 'agenttemplates/myclub.html', context)
  49. else:
  50. return redirect('login')
  51.  
  52. def test(request):
  53.  
  54. return render(request, 'sadmintemplates/test.html')
Add Comment
Please, Sign In to add comment