Replaced now() with localdate() when finding the default period in the view of the cash reports.
This commit is contained in:
parent
e48460b9bb
commit
097e699ccf
@ -22,8 +22,9 @@
|
|||||||
from django.http import HttpResponseRedirect, HttpResponse
|
from django.http import HttpResponseRedirect, HttpResponse
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils import dateformat, timezone
|
from django.utils import dateformat
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
|
from django.utils.timezone import localdate
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
from django.views.decorators.http import require_GET
|
from django.views.decorators.http import require_GET
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ def cash_home(request):
|
|||||||
and month.
|
and month.
|
||||||
"""
|
"""
|
||||||
subject_code = settings.ACCOUNTING["DEFAULT_CASH_SUBJECT"]
|
subject_code = settings.ACCOUNTING["DEFAULT_CASH_SUBJECT"]
|
||||||
period_spec = dateformat.format(timezone.now(), "Y-m")
|
period_spec = dateformat.format(localdate(), "Y-m")
|
||||||
return HttpResponseRedirect(
|
return HttpResponseRedirect(
|
||||||
reverse("accounting:cash", args=(subject_code, period_spec)))
|
reverse("accounting:cash", args=(subject_code, period_spec)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user