mirror of
https://github.com/nikdoof/pacmanager.git
synced 2025-12-13 07:32:15 +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
|
||||
from eveapi import EVEAPIConnection, Error
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils.timezone import utc
|
||||
from django.contrib.auth.models import User
|
||||
@@ -57,8 +56,9 @@ class MonthTotal(models.Model):
|
||||
|
||||
@property
|
||||
def fees_due(self):
|
||||
threshold = getattr(settings, 'PAC_TAX_THRESHOLD', Decimal('200000000'))
|
||||
calc = (self.tax / self.corporation.tax_rate) * getattr(settings, 'PAC_TAX_RATE', 10)
|
||||
from .conf import managerconf
|
||||
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)
|
||||
return threshold
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.utils.timezone import utc
|
||||
|
||||
from eveapi import EVEAPIConnection, Error, Rowset
|
||||
@@ -39,7 +38,7 @@ def import_wallet_journal(corporation_id):
|
||||
totals = {}
|
||||
for record in rows:
|
||||
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
|
||||
dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc)
|
||||
if not totals.has_key('%s-%s' % (dt.year, dt.month)):
|
||||
|
||||
Reference in New Issue
Block a user