mirror of
https://github.com/nikdoof/pacmanager.git
synced 2025-12-17 20:09:23 +00:00
Auto create summaries for the current month on corp processing.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from django.utils.timezone import utc
|
from django.utils.timezone import utc, now
|
||||||
|
|
||||||
from eveapi import EVEAPIConnection, Error, Rowset
|
from eveapi import EVEAPIConnection, Error, Rowset
|
||||||
from .conf import managerconf
|
from .conf import managerconf
|
||||||
@@ -58,6 +58,8 @@ def import_wallet_journal(corporation_id):
|
|||||||
|
|
||||||
def process_corps():
|
def process_corps():
|
||||||
for corp in Corporation.objects.all():
|
for corp in Corporation.objects.all():
|
||||||
|
dt = now()
|
||||||
|
MonthTotal.objects.get_or_create(corporation=corp, year=dt.year, month=dt.month)
|
||||||
if corp.keys.count():
|
if corp.keys.count():
|
||||||
logging.info('Processing %s' % corp.name)
|
logging.info('Processing %s' % corp.name)
|
||||||
import_wallet_journal(corp.id)
|
import_wallet_journal(corp.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user