fix accounting fields
This commit is contained in:
parent
44ff50d0f6
commit
77cc2ed0f5
@ -1,8 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from django.contrib.auth.decorators import login_required, permission_required
|
from django.contrib.auth.decorators import login_required, permission_required
|
||||||
from django.db.models import Sum
|
from django.db.models import Sum
|
||||||
from django.http import HttpResponse
|
|
||||||
from django.shortcuts import render, redirect
|
from django.shortcuts import render, redirect
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
@ -13,7 +13,6 @@ from rest_framework import viewsets
|
|||||||
|
|
||||||
from billard.models import LocationData, Location, Client, Accounting
|
from billard.models import LocationData, Location, Client, Accounting
|
||||||
from billard.serializers import LocationDataSerializer, ClientUpdateLastSeenSerializer
|
from billard.serializers import LocationDataSerializer, ClientUpdateLastSeenSerializer
|
||||||
from billard.tasks import process_location_data
|
|
||||||
from .forms import UserInformationUpdateForm
|
from .forms import UserInformationUpdateForm
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -101,6 +100,8 @@ def account_modal_confirm_view(request, loc_pk, pks):
|
|||||||
for pk in pks.split(','):
|
for pk in pks.split(','):
|
||||||
account = Accounting.objects.get(pk=pk)
|
account = Accounting.objects.get(pk=pk)
|
||||||
account.reporter_uuid = None
|
account.reporter_uuid = None
|
||||||
|
account.account_tst = datetime.now()
|
||||||
|
account.billed = True
|
||||||
account.save()
|
account.save()
|
||||||
return redirect('billard:location_detail', pk=loc_pk)
|
return redirect('billard:location_detail', pk=loc_pk)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user