mirror of
https://github.com/nikdoof/pacmanager.git
synced 2026-01-30 09:48:21 +00:00
Switch to using modeldict for all PAC settings
This commit is contained in:
@@ -4,7 +4,6 @@ from uuid import uuid4
|
|||||||
import logging
|
import logging
|
||||||
from eveapi import EVEAPIConnection, Error
|
from eveapi import EVEAPIConnection, Error
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.timezone import utc
|
from django.utils.timezone import utc
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@@ -57,8 +56,9 @@ class MonthTotal(models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fees_due(self):
|
def fees_due(self):
|
||||||
threshold = getattr(settings, 'PAC_TAX_THRESHOLD', Decimal('200000000'))
|
from .conf import managerconf
|
||||||
calc = (self.tax / self.corporation.tax_rate) * getattr(settings, 'PAC_TAX_RATE', 10)
|
threshold = Decimal(managerconf.get('pac.tax_threshold', '200000000'))
|
||||||
|
calc = (self.tax / self.corporation.tax_rate) * int(managerconf.get('pac.tax_rate', '10'))
|
||||||
if calc > threshold: return round(calc, 2)
|
if calc > threshold: return round(calc, 2)
|
||||||
return threshold
|
return threshold
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from django.conf import settings
|
|
||||||
from django.utils.timezone import utc
|
from django.utils.timezone import utc
|
||||||
|
|
||||||
from eveapi import EVEAPIConnection, Error, Rowset
|
from eveapi import EVEAPIConnection, Error, Rowset
|
||||||
@@ -39,7 +38,7 @@ def import_wallet_journal(corporation_id):
|
|||||||
totals = {}
|
totals = {}
|
||||||
for record in rows:
|
for record in rows:
|
||||||
if int(record.refID) > corp.last_transaction:
|
if int(record.refID) > corp.last_transaction:
|
||||||
if int(record.refTypeID) in getattr(settings, 'PAC_TAX_REFIDS', [85, 99]):
|
if int(record.refTypeID) in [int(x.trim()) for x in managerconf.get('pac.tax_refids', '85,99').split(',')]:
|
||||||
#print record.refID, int(record.refTypeID), record.amount
|
#print record.refID, int(record.refTypeID), record.amount
|
||||||
dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc)
|
dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc)
|
||||||
if not totals.has_key('%s-%s' % (dt.year, dt.month)):
|
if not totals.has_key('%s-%s' % (dt.year, dt.month)):
|
||||||
|
|||||||
Reference in New Issue
Block a user