td class="lines-num lines-num-new">
-    if end:
772
-        dt = parse_datetime(end)
773
-        if dt:
774
-            qs = qs.filter(paid_at__lte=dt)
775
-
776
-    response = HttpResponse(content_type="text/csv")
777
-    response["Content-Disposition"] = "attachment; filename=payouts.csv"
778
-    writer = csv.writer(response)
779
-    writer.writerow(["organization", "customer", "amount", "currency", "paid_at", "reference", "pickup_id"]) 
780
-    for p in qs.iterator():
781
-        writer.writerow([
782
-            p.organization.code,
783
-            p.customer.name,
784
-            p.amount,
785
-            p.currency_code,
786
-            p.paid_at.isoformat(),
787
-            p.reference,
788
-            p.pickup_id or "",
789
-        ])
790
-    return response
734
+# Billing-related views moved to billing/views.py
791 735
 
792 736
 
793 737
 # Documents UI --------------------------------------------------------------
@@ -1024,3 +968,36 @@ def service_toggle_enabled(request, pk: int):
1024 968
         item.save(update_fields=["is_enabled"])
1025 969
         messages.success(request, f"Service '{item.title}' {'enabled' if item.is_enabled else 'disabled'}.")
1026 970
     return redirect("recycle_core:services_list")
971
+
972
+
973
+@require_POST
974
+@owner_required
975
+def services_reorder(request):
976
+    """Reorder ProvidedService.display_order for the current organization.
977
+
978
+    Expects JSON body with {"ids": [<service_id>, ...]} in the new order (top→bottom).
979
+    """
980
+    try:
981
+        data = json.loads(request.body.decode("utf-8"))
982
+        ids = data.get("ids", [])
983
+        if not isinstance(ids, list):
984
+            return JsonResponse({"ok": False, "error": "Invalid payload."}, status=400)
985
+    except Exception:
986
+        return JsonResponse({"ok": False, "error": "Malformed JSON."}, status=400)
987
+
988
+    org = getattr(request, "org", None)
989
+    # Fetch only services belonging to this org and requested ids
990
+    qs = ProvidedService.objects.filter(organization=org, id__in=ids)
991
+    existing = {obj.id: obj for obj in qs}
992
+
993
+    # Enforce order based on the incoming list; skip unknown ids
994
+    with transaction.atomic():
995
+        for idx, sid in enumerate(ids):
996
+            obj = existing.get(sid)
997
+            if not obj:
998
+                continue
999
+            if obj.display_order != idx:
1000
+                obj.display_order = idx
1001
+                obj.save(update_fields=["display_order"])
1002
+
1003
+    return JsonResponse({"ok": True})

+ 1 - 4
recycle_core/views_api.py

@@ -22,10 +22,6 @@ from .models import (
22 22
     PickupItem,
23 23
     WeighTicket,
24 24
     WeighLine,
25
-    Invoice,
26
-    InvoiceLine,
27
-    Payment,
28
-    Payout,
29 25
     ScrapListing,
30 26
     ScrapListingItem,
31 27
     ScrapBid,
@@ -34,6 +30,7 @@ from .models import (
34 30
     Document,
35 31
     AuditLog,
36 32
 )
33
+from billing.models import Invoice, InvoiceLine, Payment, Payout
37 34
 from .serializers import (
38 35
     OrganizationSerializer,
39 36
     MaterialCategorySerializer,

golf/tge - Gogs: Simplico Git Service

Нема описа

login.html 893B

12345678910111213141516171819202122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Tiger Muay Thai E Leaning</title>
  8. <link rel="stylesheet" href="./css/main.css">
  9. <link rel="preconnect" href="https://fonts.googleapis.com">
  10. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  11. <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=Poppins&display=swap"
  12. rel="stylesheet">
  13. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
  14. integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
  15. crossorigin="anonymous" referrerpolicy="no-referrer" />
  16. </head>
  17. <body>
  18. </body>
  19. </html>