-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recurring Invoices + New Layout (#459)
- added aws SQS handler - added recurring invoice profiles - added new webhook handler - added new invoice page layout - removed invoice reminders - removed invoice one time schedules
- Loading branch information
Showing
223 changed files
with
5,385 additions
and
2,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[files] | ||
extend-exclude = ["**/bundle.js", "**/bundle.js.map"] | ||
extend-exclude = ["**/bundle.js", "**/bundle.js.map", "**/cal_filters.py"] | ||
|
||
[default] | ||
extend-ignore-identifiers-re = [ | ||
"zUfuhFKKZCbHTY6aRR46gxiqszMk5tcHjsVFxnUo8VMus4kHGVdIYVbOYYNlKmHV", | ||
"sha384-zUfuhFKKZCbHTY6aRR46gxiqszMk5tcHjsVFxnUo8VMus4kHGVdIYVbOYYNlKmHV" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
__version__ = "0.4.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.http import HttpResponse | ||
from django.shortcuts import render | ||
|
||
from backend.types.requests import WebRequest | ||
from backend.service.base.breadcrumbs import get_breadcrumbs | ||
|
||
|
||
def update_breadcrumbs_endpoint(request: WebRequest): | ||
url = request.GET.get("url") | ||
|
||
breadcrumb_dict: dict = get_breadcrumbs(url=url) | ||
return render( | ||
request, | ||
"base/breadcrumbs.html", | ||
{ | ||
"breadcrumb": breadcrumb_dict.get("breadcrumb"), | ||
"swapping": True, | ||
# "swap": True | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from django.contrib import messages | ||
from django.http import JsonResponse, QueryDict, HttpResponse, HttpResponseRedirect | ||
from django.shortcuts import render | ||
from django.urls import resolve, reverse | ||
from django.urls.exceptions import Resolver404 | ||
from django.views.decorators.http import require_http_methods | ||
|
||
from backend.decorators import web_require_scopes | ||
from backend.models import QuotaLimit, InvoiceRecurringProfile | ||
from backend.service.asyn_tasks.tasks import Task | ||
from backend.service.boto3.scheduler.delete_schedule import delete_boto_schedule | ||
from backend.types.requests import WebRequest | ||
|
||
|
||
@require_http_methods(["DELETE"]) | ||
@web_require_scopes("invoices:write", True, True) | ||
def delete_invoice_recurring_profile_endpoint(request: WebRequest): | ||
delete_items = QueryDict(request.body) | ||
|
||
redirect = delete_items.get("redirect", None) | ||
|
||
try: | ||
invoice_profile = InvoiceRecurringProfile.objects.get(id=delete_items.get("invoice_profile", "")) | ||
except InvoiceRecurringProfile.DoesNotExist: | ||
messages.error(request, "Invoice recurring profile Not Found") | ||
return render(request, "base/toasts.html") | ||
|
||
if not invoice_profile.has_access(request.user): | ||
messages.error(request, "You do not have permission to delete this Invoice recurring profile") | ||
return render(request, "base/toasts.html") | ||
|
||
# QuotaLimit.delete_quota_usage("invoices-count", request.user, invoice.id, invoice.date_created) | ||
|
||
Task().queue_task(delete_boto_schedule, "InvoiceRecurringSet", invoice_profile.id) | ||
|
||
invoice_profile.active = False | ||
invoice_profile.save() | ||
|
||
if request.htmx: | ||
if not redirect: | ||
messages.success(request, "Invoice profile deleted") | ||
return render(request, "base/toasts.html") | ||
|
||
try: | ||
resolve(redirect) | ||
response = HttpResponse(status=200) | ||
response["HX-Location"] = redirect | ||
return response | ||
except Resolver404: | ||
return HttpResponseRedirect(reverse("invoices:recurring:dashboard")) | ||
|
||
return JsonResponse({"message": "Invoice successfully deleted"}, status=200) |
Oops, something went wrong.