diff --git a/osinaweb/billing/__pycache__/models.cpython-312.pyc b/osinaweb/billing/__pycache__/models.cpython-312.pyc index 7f78fd0c..ecfc6235 100644 Binary files a/osinaweb/billing/__pycache__/models.cpython-312.pyc and b/osinaweb/billing/__pycache__/models.cpython-312.pyc differ diff --git a/osinaweb/billing/__pycache__/urls.cpython-312.pyc b/osinaweb/billing/__pycache__/urls.cpython-312.pyc index 7688d1d4..412f0bc6 100644 Binary files a/osinaweb/billing/__pycache__/urls.cpython-312.pyc and b/osinaweb/billing/__pycache__/urls.cpython-312.pyc differ diff --git a/osinaweb/billing/__pycache__/views.cpython-312.pyc b/osinaweb/billing/__pycache__/views.cpython-312.pyc index 7c425a32..07bc1c03 100644 Binary files a/osinaweb/billing/__pycache__/views.cpython-312.pyc and b/osinaweb/billing/__pycache__/views.cpython-312.pyc differ diff --git a/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc b/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc index 1410fe79..eaa0a8cf 100644 Binary files a/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc and b/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc differ diff --git a/osinaweb/billing/add/__pycache__/views.cpython-312.pyc b/osinaweb/billing/add/__pycache__/views.cpython-312.pyc index dc3077a5..d87a2ed0 100644 Binary files a/osinaweb/billing/add/__pycache__/views.cpython-312.pyc and b/osinaweb/billing/add/__pycache__/views.cpython-312.pyc differ diff --git a/osinaweb/billing/add/urls.py b/osinaweb/billing/add/urls.py index 304ba24f..03d99eb7 100644 --- a/osinaweb/billing/add/urls.py +++ b/osinaweb/billing/add/urls.py @@ -6,5 +6,6 @@ urlpatterns = [ path('product', views.add_product, name='addproduct'), path('service', views.add_service, name='addservice'), path('order', views.add_order, name='addorder'), + path('invoice//', views.add_invoice_pdf, name='addinvoice'), ] diff --git a/osinaweb/billing/add/views.py b/osinaweb/billing/add/views.py index b208278b..13348202 100644 --- a/osinaweb/billing/add/views.py +++ b/osinaweb/billing/add/views.py @@ -173,7 +173,7 @@ def add_invoice_pdf(request, order_id): response = HttpResponse(pdf, content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="my_pdf.pdf"' - return response + return response
 diff --git a/osinaweb/billing/migrations/0042_order_due_date.py b/osinaweb/billing/migrations/0042_order_due_date.py new file mode 100644 index 00000000..2cb9b9b7 --- /dev/null +++ b/osinaweb/billing/migrations/0042_order_due_date.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.4 on 2024-04-24 12:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('billing', '0041_orderitem_active'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='due_date', + field=models.DateField(blank=True, null=True), + ), + ] diff --git a/osinaweb/billing/migrations/__pycache__/0040_rename_due_at_orderitem_end_at_and_more.cpython-312.pyc b/osinaweb/billing/migrations/__pycache__/0040_rename_due_at_orderitem_end_at_and_more.cpython-312.pyc new file mode 100644 index 00000000..a2ebcf02 Binary files /dev/null and b/osinaweb/billing/migrations/__pycache__/0040_rename_due_at_orderitem_end_at_and_more.cpython-312.pyc differ diff --git a/osinaweb/billing/migrations/__pycache__/0041_orderitem_active.cpython-312.pyc b/osinaweb/billing/migrations/__pycache__/0041_orderitem_active.cpython-312.pyc new file mode 100644 index 00000000..f13b1cdf Binary files /dev/null and b/osinaweb/billing/migrations/__pycache__/0041_orderitem_active.cpython-312.pyc differ diff --git a/osinaweb/billing/migrations/__pycache__/0042_order_due_date.cpython-312.pyc b/osinaweb/billing/migrations/__pycache__/0042_order_due_date.cpython-312.pyc new file mode 100644 index 00000000..fe36befe Binary files /dev/null and b/osinaweb/billing/migrations/__pycache__/0042_order_due_date.cpython-312.pyc differ diff --git a/osinaweb/billing/models.py b/osinaweb/billing/models.py index a96052b8..6522c06d 100644 --- a/osinaweb/billing/models.py +++ b/osinaweb/billing/models.py @@ -40,6 +40,7 @@ class Order(models.Model): business = models.ForeignKey(Business, on_delete=models.SET_NULL, null=True, blank=True) status = models.CharField(max_length=200, choices=STATUS, default='None') order_id = models.CharField(max_length=100, null=True, blank=True) + due_date = models.DateField(null=True, blank=True) @property def get_cart_total(self): orderitems = self.orderitem_set.all() diff --git a/osinaweb/billing/templates/add_templates/add-order.html b/osinaweb/billing/templates/add_templates/add-order.html index bcc9a220..c927ca21 100644 --- a/osinaweb/billing/templates/add_templates/add-order.html +++ b/osinaweb/billing/templates/add_templates/add-order.html @@ -34,8 +34,7 @@
diff --git a/osinaweb/billing/templates/listing_pages/orders.html b/osinaweb/billing/templates/listing_pages/orders.html index dc13d514..1f27d697 100644 --- a/osinaweb/billing/templates/listing_pages/orders.html +++ b/osinaweb/billing/templates/listing_pages/orders.html @@ -86,7 +86,7 @@ {% if order.status == 'Pending' and not order.invoice %} - + diff --git a/osinaweb/billing/urls.py b/osinaweb/billing/urls.py index 1de7f5b8..83109ae9 100644 --- a/osinaweb/billing/urls.py +++ b/osinaweb/billing/urls.py @@ -14,7 +14,6 @@ urlpatterns = [ # DETAILS path('invoice-details//', views.invoice_details, name='invoicedetails'), - path('fetch-customer-items//', views.fetch_customer_items, name='fetch_customer_items'), path('fetch-customer-businesses//', views.fetch_customer_businesses, name='fetch_customer_businesses'), ] diff --git a/osinaweb/billing/views.py b/osinaweb/billing/views.py index 38056455..dd31953c 100644 --- a/osinaweb/billing/views.py +++ b/osinaweb/billing/views.py @@ -85,3 +85,4 @@ def fetch_customer_businesses(request, customer_id): business_data = None return JsonResponse({'businesses': business_data}) + diff --git a/osinaweb/customercore/__pycache__/custom_context.cpython-312.pyc b/osinaweb/customercore/__pycache__/custom_context.cpython-312.pyc new file mode 100644 index 00000000..a4d04025 Binary files /dev/null and b/osinaweb/customercore/__pycache__/custom_context.cpython-312.pyc differ diff --git a/osinaweb/customercore/__pycache__/urls.cpython-312.pyc b/osinaweb/customercore/__pycache__/urls.cpython-312.pyc index 03734bb5..e7797912 100644 Binary files a/osinaweb/customercore/__pycache__/urls.cpython-312.pyc and b/osinaweb/customercore/__pycache__/urls.cpython-312.pyc differ diff --git a/osinaweb/customercore/__pycache__/views.cpython-312.pyc b/osinaweb/customercore/__pycache__/views.cpython-312.pyc index df8fa745..3457bec5 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-312.pyc and b/osinaweb/customercore/__pycache__/views.cpython-312.pyc differ diff --git a/osinaweb/customercore/templates/add_templates/customer-add-ticket.html b/osinaweb/customercore/templates/add_templates/customer-add-ticket.html new file mode 100644 index 00000000..04029264 --- /dev/null +++ b/osinaweb/customercore/templates/add_templates/customer-add-ticket.html @@ -0,0 +1,61 @@ +{% extends "customer_main.html" %} +{%load static%} + +{% block content %} + +
+
+

+ Open Ticket +

+ +
+ {% csrf_token %} + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + Upload + Document(s) + +
+
+
+ +
+ +
+
+
+
+ + + + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html b/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html new file mode 100644 index 00000000..d8287579 --- /dev/null +++ b/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html @@ -0,0 +1,175 @@ +{% extends "customer_main.html" %} +{%load static%} + +{% block content %} + +
+
+
+

Ticket: #2226663535

+ +
+
+

Closed by Linode at 20-4-24 16:30

+
+
+ + +
+ +
+
+
+ +
+
+ + +
+
+

Ositcom + Ltd + commented 2024-04-17 12:19

+ + + + + + + +
+ +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non purus consectetur + magna sodales fringilla. Suspendisse non imperdiet metus. Curabitur feugiat tristique + varius. Curabitur fermentum sapien nisi, sed suscipit odio luctus sed. Mauris pretium risus + a tincidunt facilisis. Aliquam quis odio in mi aliquet scelerisque et ut urna. Ut ultrices + turpis odio, id hendrerit lectus dignissim in. Donec at tortor quis dui auctor sodales porta + et purus. Aliquam at nunc sit amet tortor lacinia porttitor. Proin auctor, eros ac + sollicitudin iaculis, felis quam vulputate ante, eu varius dolor arcu non enim. Vestibulum + ornare dapibus risus, id eleifend ipsum. Aliquam metus urna, bibendum quis cursus vitae, + placerat sit amet felis. Aliquam tellus ex, pretium id gravida id, vulputate et velit. + Phasellus leo felis, lobortis ut dolor eget, viverra aliquet ligula. Aliquam molestie ac + eros et fermentum. +

+ +
+
+
+ + + +
+ + + + +
+
+
+ +
+
+ + +
+ + + +
+
+ + + + + +
+ + +
+ +
+ +
+
+
+
+ + + + + + + + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/customercore/templates/invoice-payment.html b/osinaweb/customercore/templates/invoice-payment.html new file mode 100644 index 00000000..7501569a --- /dev/null +++ b/osinaweb/customercore/templates/invoice-payment.html @@ -0,0 +1,117 @@ +{% extends "customer_main.html" %} +{%load static%} + +{% block modules_section %} + +{% endblock modules_section %} + +{% block content %} + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ + +
+ + +
+

Due Date: {{invoice.order.due_date}}

+

Invoice ${{invoice.invoice_number}}

+
+ +
+

Bill To:

+

{{invoice.order.customer.user.first_name}} {{invoice.order.customer.user.last_name}}

+

{{invoice.order.customer.mobile_number}}

+

{{invoice.order.customer.user.email}}

+
+ +
+

Invoice Items

+
+ + +
+
    + {% for item in invoice.order.orderitem_set.all %} +
  • {{item.item.title}}
  • + {% endfor %} +
+ +
+

Total: ${{invoice.order.get_cart_total}}

+
+
+
+ +
+

Payment Powered By

+ +
+
+ + + + +
+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/customercore/templates/listing_pages/customer-invoices.html b/osinaweb/customercore/templates/listing_pages/customer-invoices.html index 76e45116..99b091b6 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-invoices.html +++ b/osinaweb/customercore/templates/listing_pages/customer-invoices.html @@ -13,21 +13,22 @@ - Due Date + ID - Title + Due Date - Description + Items Status - + Amount @@ -38,35 +39,58 @@ + {% for invoice in invoices %} -

20-2-2024

+

{{invoice.invoice_number}}

-

Invoice 1

+

{{invoice.order.due_date}}

-

Invoice description section

+
+ +
- -

Pending

+ +

{{invoice.order.status}}

-

200

+

${{invoice.order.get_cart_total}}

-
- + + + {% if not invoice.order.status == 'Completed' %} + + + + {% endif %}
+ {% endfor %} diff --git a/osinaweb/customercore/templates/listing_pages/customer-orders.html b/osinaweb/customercore/templates/listing_pages/customer-orders.html index 891afe32..42e44180 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-orders.html +++ b/osinaweb/customercore/templates/listing_pages/customer-orders.html @@ -41,17 +41,17 @@ {% for order in orders %} -

{{order.order_id}}

+

{{order.order_id}}

{% for item in order.orderitem_set.all %} -

{{item.item.title}}

+

{{item.item.title}}

{% endfor %} -

${{order.get_cart_total}}

+

${{order.get_cart_total}}

diff --git a/osinaweb/customercore/templates/listing_pages/customer-tickets.html b/osinaweb/customercore/templates/listing_pages/customer-tickets.html new file mode 100644 index 00000000..0de1c871 --- /dev/null +++ b/osinaweb/customercore/templates/listing_pages/customer-tickets.html @@ -0,0 +1,95 @@ +{% extends "customer_main.html" %} +{%load static%} + +{% block content %} + +
+
+

My Tickets

+ + +
+
+
+

Open Ticktes

+

Closed Ticktes

+
+ + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Subject + + Ticket ID + + Regarding + + Date Created + + Last Updated + + Updated By +
+ +

My Account Balance

+
+
+

22666766

+
+

Django

+
+

20-2-2024

+
+

20-2-2024

+
+

Ositcom Ltd

+
+
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/osinaweb/customercore/templates/payment.html b/osinaweb/customercore/templates/payment.html index c7b23be0..cd609d27 100644 --- a/osinaweb/customercore/templates/payment.html +++ b/osinaweb/customercore/templates/payment.html @@ -15,8 +15,10 @@
+ +
+ class="w-full flex flex-col items-center justify-between rounded-tl-md rounded-lb-none xxlg1:rounded-l-md h-full rounded-tr-md xxlg1:rounded-tr-none gap-8 overflow-hidden relative bg-gradient-to-b from-gray-400 via-gray-500 to-blue-950">
@@ -31,28 +33,46 @@
- +
+ -
-

{{item.title}}

-

${{item.amount}}

+
+ - +
+

{{item.title}}

+

$

+ + +
+ +
+

Payment Powered By

+ +
-
-
+
+ +
@@ -60,8 +80,8 @@
- + @@ -69,7 +89,12 @@ + + + + + {% endblock %} \ No newline at end of file diff --git a/osinaweb/customercore/urls.py b/osinaweb/customercore/urls.py index fe75ce60..9e9c0252 100644 --- a/osinaweb/customercore/urls.py +++ b/osinaweb/customercore/urls.py @@ -3,14 +3,22 @@ from . import views urlpatterns = [ - # LISTING path('redirect-osimenu/', views.redirect_osimenu, name='redirectosimenu'), path('redirect-osicard/', views.redirect_osicard, name='redirectosicard'), + # ADD + path('customer-add-ticket/', views.customer_add_ticket, name='customeraddticket'), + + # LISTING path('my-invoices/', views.customer_invoices, name='customerinvoices'), path('products/', views.all_products, name='products'), path('my-orders/', views.customer_orders, name='customerorders'), + path('my-tickets/', views.customer_tickets, name='customertickets'), + + + # DETAILS + path('inner-customer-ticket/', views.inner_customer_ticket, name='innercustomerticket'), # PRODUCTS URL @@ -27,4 +35,7 @@ urlpatterns = [ path('payment/osimenu-basic/', views.buy_free_osimenu, name='buyfreeosimenu'), path('payment/osicard-basic/', views.buy_free_osicard, name='buyfreeosicard'), + + path('invoice-payment//', views.invoice_payment, name='invoicepayment'), + path('initiate_invoice_checkout/', views.initiate_invoice_checkout, name='initiateinvoicecheckout'), ] diff --git a/osinaweb/customercore/views.py b/osinaweb/customercore/views.py index 694ce424..979dc12d 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -27,13 +27,27 @@ def redirect_osicard(request): +# ADD @customer_login_required -def customer_invoices(request, *args, **kwargs): +def customer_add_ticket(request, *args, **kwargs): context = { } + return render(request, 'add_templates/customer-add-ticket.html', context) + + + +# LISTING +@customer_login_required +def customer_invoices(request, *args, **kwargs): + invoices = Invoice.objects.filter(order__customer = request.user.customerprofile) + + context = { + 'invoices' : invoices, + } + return render(request, 'listing_pages/customer-invoices.html', context) @@ -61,6 +75,27 @@ def customer_orders(request, *args, **kwargs): return render(request, 'listing_pages/customer-orders.html', context) +@customer_login_required +def customer_tickets(request, *args, **kwargs): + + context = { + + } + + return render(request, 'listing_pages/customer-tickets.html', context) + + + + +# DETAILS +def inner_customer_ticket(request, *args, **kwargs): + + context = { + + } + + return render(request, 'details_templates/inner-customer-ticket.html', context) + @@ -128,10 +163,13 @@ def dedicated_servers_plans(request, *args, **kwargs): def payment(request, item_id): item = get_object_or_404(Item, id=item_id) cycles = RecurringCycle.objects.filter(item = item) + + selected_cycle = None context = { 'item' : item, 'cycles' : cycles, + 'selected_cycle': selected_cycle, } return render(request, 'payment.html', context) @@ -356,4 +394,70 @@ def buy_free_osicard(request): response = requests.post(api_url, json=api_data) print(response) - return redirect('customerorders') \ No newline at end of file + return redirect('customerorders') + + +@customer_login_required +def invoice_payment(request, invoice_id): + invoice = get_object_or_404(Invoice, id = invoice_id) + + context = { + 'invoice' : invoice, + } + + return render(request, 'invoice-payment.html', context) + + +@customer_login_required +def initiate_invoice_checkout(request): + api_username = 'merchant.TEST06127800' + api_password = '37846250a67c70e7fe9f82cf6ca81f93' + merchant_id = 'TEST06127800' + merchant_name = 'Ositcom Sal' + + customer = request.user.customerprofile + + data = json.loads(request.body) + invoice_id = data.get('invoice_id') + + invoice = get_object_or_404(Invoice, id=invoice_id) + + + order = invoice.order + order_id = order.order_id + + price = order.get_cart_total + + + payload = { + 'apiOperation': 'INITIATE_CHECKOUT', + 'apiUsername': api_username, + 'apiPassword': api_password, + 'merchant': merchant_id, + 'interaction.operation': 'PURCHASE', + 'interaction.merchant.name': merchant_name, + 'order.id': order_id, + 'order.amount': price, + 'order.currency': 'USD', + 'order.description': 'description_of_order', + 'order.notificationUrl' : 'https://newosina.osinode.com/webhooks/', + 'interaction.returnUrl' : f"https://newosina.osinode.com/check-order-status/{merchant_id}/{order_id}/" + } + + try: + response = requests.post('https://creditlibanais-netcommerce.gateway.mastercard.com/api/nvp/version/78', data=payload) + + print('Response Content:', response.text) + + if response.status_code == 200: + response_data = response.text + parsed_data = dict(item.split('=') for item in response_data.split('&')) + session_id = parsed_data.get('session.id') + return JsonResponse({'session_id': session_id}, status=200) + + else: + print('Response Status Code:', response.status_code) + return JsonResponse({'error': 'Failed to initiate checkout'}, status=500) + except Exception as e: + print('Exception:', e) + return JsonResponse({'error': 'Internal Server Error'}, status=500) \ No newline at end of file diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 6948f832..4008f834 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/urls.cpython-312.pyc b/osinaweb/osinacore/__pycache__/urls.cpython-312.pyc index 89278a3a..d3725d1c 100644 Binary files a/osinaweb/osinacore/__pycache__/urls.cpython-312.pyc and b/osinaweb/osinacore/__pycache__/urls.cpython-312.pyc differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-312.pyc b/osinaweb/osinacore/__pycache__/views.cpython-312.pyc index 5b800884..89c46d17 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-312.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-312.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/urls.cpython-312.pyc b/osinaweb/osinacore/add/__pycache__/urls.cpython-312.pyc index eb73bc8a..1cd61b4c 100644 Binary files a/osinaweb/osinacore/add/__pycache__/urls.cpython-312.pyc and b/osinaweb/osinacore/add/__pycache__/urls.cpython-312.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/views.cpython-312.pyc b/osinaweb/osinacore/add/__pycache__/views.cpython-312.pyc index 8c6f2065..e4e15b84 100644 Binary files a/osinaweb/osinacore/add/__pycache__/views.cpython-312.pyc and b/osinaweb/osinacore/add/__pycache__/views.cpython-312.pyc differ diff --git a/osinaweb/osinacore/add/urls.py b/osinaweb/osinacore/add/urls.py index 7af80a63..1b3c12d1 100644 --- a/osinaweb/osinacore/add/urls.py +++ b/osinaweb/osinacore/add/urls.py @@ -27,7 +27,7 @@ urlpatterns = [ path('reference/', views.add_reference_modal, name='addreferencemodal'), path('tag/', views.add_tag_modal, name='addtagmodal'), path('reaction///', views.add_reaction, name='add_reaction'), - + path('add-ticket/', views.add_ticket, name='addticket'), ] \ No newline at end of file diff --git a/osinaweb/osinacore/add/views.py b/osinaweb/osinacore/add/views.py index 554278de..8b21c8a6 100644 --- a/osinaweb/osinacore/add/views.py +++ b/osinaweb/osinacore/add/views.py @@ -593,7 +593,17 @@ def add_reaction(request, status_id, emoji): # If the user hasn't reacted yet, create a new reaction new_reaction = Reaction.objects.create(status=status, emoji=emoji, user=user) return JsonResponse({'message': 'Reaction added successfully.'}) + + + +@staff_login_required +def add_ticket(request, *args, **kwargs): + + context = { + + } + return render(request, 'add_templates/add-ticket.html', context) diff --git a/osinaweb/osinacore/templates/add_templates/add-ticket.html b/osinaweb/osinacore/templates/add_templates/add-ticket.html new file mode 100644 index 00000000..2029ef5c --- /dev/null +++ b/osinaweb/osinacore/templates/add_templates/add-ticket.html @@ -0,0 +1,62 @@ +{% extends "add-edit-main.html" %} +{%load static%} +{% block content %} + +
+
+

+ Add Ticket +

+ +
+ {% csrf_token %} + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + Upload + Document(s) + +
+
+
+ +
+ +
+
+
+
+ + + + + + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/osinacore/templates/customer_index.html b/osinaweb/osinacore/templates/customer_index.html index 92882248..7a4e8ac3 100644 --- a/osinaweb/osinacore/templates/customer_index.html +++ b/osinaweb/osinacore/templates/customer_index.html @@ -59,37 +59,32 @@

Tickets

-
+
- - @@ -98,40 +93,29 @@ - - @@ -197,6 +181,64 @@
- Client - - Last Update + Subject - Last Reply + Ticket ID - Subject + Regarding - Department + Date Created - Status + + Last Updated - Actions + Updated By
-

Emile Elliye

+ +

My Account Balance

+
-

20-1-2024

+

22666766

-

20-2-2024

+

Django

-

Add Customer Template

+

20-2-2024

-

Informatique

-
-

Closed

+

20-2-2024

-
- -
- -
-
-
- -
-
+

Ositcom Ltd

+ + + +
+

Other Ways to Get Help

+ +
+
+
+ + + +
+ +

Guides & Tutorials

+ +

View Osina guides and tutorials for all experience levels.

+
+ +
+
+ + + +
+ +

Community Q&A

+ +

Ask questions, find answers, and connect with other members of the Ositcom community.

+
+ + +
+
+ + + +
+ +

Ositcom Status Page

+ +

Get Updates on Ositcom incidents and maintenance.

+
+ +
+
+ + + + +
+ +

Customer Support

+ +

View or open Ositcom Support tickets.

+
+
+
diff --git a/osinaweb/osinacore/templates/customer_main.html b/osinaweb/osinacore/templates/customer_main.html index bd445bd5..9d50451a 100644 --- a/osinaweb/osinacore/templates/customer_main.html +++ b/osinaweb/osinacore/templates/customer_main.html @@ -50,12 +50,14 @@

Projects

-
- - - -

Tickets

-
+ +
+ + + +

Tickets

+
+
@@ -208,17 +210,18 @@
-
-
- - +
diff --git a/osinaweb/osinacore/templates/details_templates/project-details.html b/osinaweb/osinacore/templates/details_templates/project-details.html index 9f92763c..ddc8f97f 100644 --- a/osinaweb/osinacore/templates/details_templates/project-details.html +++ b/osinaweb/osinacore/templates/details_templates/project-details.html @@ -86,13 +86,13 @@

Client: {{project.customer.user.first_name}} + class="text-secondosiblue text-xl font-semibold">{{project.customer.user.first_name}} {{project.customer.user.last_name}}

Project Manager: {{project.manager.user.first_name}} + class="text-secondosiblue text-xl font-semibold">{{project.manager.user.first_name}} {{project.manager.last_name}}

@@ -100,7 +100,7 @@

Member(s): {% for member in project.members.all %} - + {{member.user.first_name}} {{member.user.last_name}} {% if not forloop.last %}, {% endif %} {% endfor %}

@@ -109,7 +109,7 @@

Type: {% for type in project.project_type.all %} - + {{type.name}} {% if not forloop.last %}, {% endif %} {% endfor %}

@@ -134,12 +134,12 @@

Start Date: {{project.start_date}}

+ class="text-secondosiblue text-xl font-semibold startDate">{{project.start_date}}

End Date: {{project.end_date}}

+ class="text-secondosiblue text-xl font-semibold endDate">{{project.end_date}}

@@ -147,7 +147,7 @@

Project Details:

-

+

{{project.details}}

@@ -215,7 +215,7 @@ {% for requirement in project.projectrequirement_set.all %} -

{{requirement.content}}

+

{{requirement.content}}

@@ -226,7 +226,7 @@ class="fas fa-angle-double-right"> {% endfor %} {%else%} -

None

+

None

{% endif %} @@ -255,7 +255,7 @@ {% endfor %} {% else %} - + No Requirements at the moment @@ -308,21 +308,21 @@ {% for credential in project.projectcredential_set.all %} -

{{credential.emailorusername}}

+

{{credential.emailorusername}}

- {{credential.password}} + {{credential.password}} - {{credential.usedfor}} + {{credential.usedfor}} {% endfor %} {% else %} - + No Available Credentials @@ -375,21 +375,21 @@ {% for file in project.projectfile_set.all %} -

{{file.name}}

+

{{file.name}}

- {{file.file}} + {{file.file}} - {{file.date}} + {{file.date}} {% endfor %} {% else %} - + No Available Files diff --git a/osinaweb/osinacore/templates/details_templates/ticket-details.html b/osinaweb/osinacore/templates/details_templates/ticket-details.html new file mode 100644 index 00000000..624dcf24 --- /dev/null +++ b/osinaweb/osinacore/templates/details_templates/ticket-details.html @@ -0,0 +1,179 @@ +{% extends "main.html" %} +{%load static%} +{% block content %} + +
+
+

Ticket: #2226663535

+ +
+
+

Closed by Linode at 20-4-24 16:30

+
+
+ + +
+ +
+
+
+ +
+
+ + +
+
+

Ositcom + Ltd + commented 2024-04-17 12:19

+ + + + + + + +
+ +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non purus consectetur + magna sodales fringilla. Suspendisse non imperdiet metus. Curabitur feugiat tristique + varius. Curabitur fermentum sapien nisi, sed suscipit odio luctus sed. Mauris pretium risus + a tincidunt facilisis. Aliquam quis odio in mi aliquet scelerisque et ut urna. Ut ultrices + turpis odio, id hendrerit lectus dignissim in. Donec at tortor quis dui auctor sodales porta + et purus. Aliquam at nunc sit amet tortor lacinia porttitor. Proin auctor, eros ac + sollicitudin iaculis, felis quam vulputate ante, eu varius dolor arcu non enim. Vestibulum + ornare dapibus risus, id eleifend ipsum. Aliquam metus urna, bibendum quis cursus vitae, + placerat sit amet felis. Aliquam tellus ex, pretium id gravida id, vulputate et velit. + Phasellus leo felis, lobortis ut dolor eget, viverra aliquet ligula. Aliquam molestie ac + eros et fermentum. +

+ +
+
+
+ + + +
+
+
+ +
+
+ +
+
+

Scott + Customer Support commented 2024-04-17 12:19

+ + + + + + + +
+ +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non purus consectetur + magna sodales fringilla. Suspendisse non imperdiet metus. Curabitur feugiat tristique + varius. Curabitur fermentum sapien nisi, sed suscipit odio luctus sed. Mauris pretium risus + a tincidunt facilisis. Aliquam quis odio in mi aliquet scelerisque et ut urna. Ut ultrices + turpis odio, id hendrerit lectus dignissim in. Donec at tortor quis dui auctor sodales porta + et purus. +

+ +
+ How + did I do? + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+
+
+
+ + + + +
+
+
+ +
+
+ + +
+ + + +
+
+ + + + + +
+ + + + +
+
+
+
+
+ + + + + + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/osinacore/templates/listing_pages/tickets.html b/osinaweb/osinacore/templates/listing_pages/tickets.html new file mode 100644 index 00000000..cc2d83d0 --- /dev/null +++ b/osinaweb/osinacore/templates/listing_pages/tickets.html @@ -0,0 +1,134 @@ +{% extends "main.html" %} +{%load static%} +{% block content %} + + +
+
+

Tags

+ + +
+
+
+ + +
+
+ +
+ + +
+
+
+

Open Ticktes

+

Closed Ticktes

+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Subject + + Ticket ID + + Regarding + + Date Created + + Last Updated + + Updated By + + Actions +
+

My + Account Balance

+
+

22666766

+
+

Django

+
+

20-2-2024

+
+

20-2-2024

+
+

Ositcom Ltd

+
+ +
+
+
+
+
+ + +{% endblock %} \ No newline at end of file diff --git a/osinaweb/osinacore/templates/main.html b/osinaweb/osinacore/templates/main.html index 48ea1443..c7a00beb 100644 --- a/osinaweb/osinacore/templates/main.html +++ b/osinaweb/osinacore/templates/main.html @@ -163,7 +163,7 @@
- +

Tickets

@@ -452,7 +452,7 @@
- +

My Tickets

@@ -637,35 +637,51 @@
-
-
-
-
- user-image -
-
-
-

{{request.user.first_name}} {{request.user.last_name}}

- - +
+ +
+
+

1

+
+
+ + +
- -
diff --git a/osinaweb/osinacore/urls.py b/osinaweb/osinacore/urls.py index 845fa47b..114350c5 100644 --- a/osinaweb/osinacore/urls.py +++ b/osinaweb/osinacore/urls.py @@ -38,6 +38,7 @@ urlpatterns = [ #Listing Templates path('customers/', views.customers, name='customers'), + path('tickets/', views.tickets, name='tickets'), path('businesses/', views.businesses, name='businesses'), path('staffs/', views.staffs, name='users'), path('my-projects/', views.my_projects, name='my-projects'), @@ -53,6 +54,7 @@ urlpatterns = [ #Details Templates path('customers//', views.customerdetails, name='customerdetails'), + path('ticket-details/', views.ticket_details, name='ticketdetails'), path('businesses//', views.businessdetails, name='businessdetails'), path('staffs//', views.staffdetails, name='userdetails'), path('projectdetails//', views.projectdetails, name='detailed-project'), diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index d8750480..0bce1001 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -255,6 +255,16 @@ def customers(request, *args, **kwargs): return render(request, 'listing_pages/customers.html', context) +@staff_login_required +def tickets(request, *args, **kwargs): + + context = { + + } + + return render(request, 'listing_pages/tickets.html', context) + + @staff_login_required def businesses(request): businesses = Business.objects.all().order_by('-business_id') @@ -439,6 +449,17 @@ def customerdetails(request, customer_id): } return render(request, 'details_templates/customer-details.html', context) + +@staff_login_required +def ticket_details(request): + + context = { + + } + + return render(request, 'details_templates/ticket-details.html', context) + + @staff_login_required def businessdetails(request, business_id): business = get_object_or_404(Business, business_id=business_id) diff --git a/osinaweb/osinaweb/__pycache__/settings.cpython-312.pyc b/osinaweb/osinaweb/__pycache__/settings.cpython-312.pyc index 56e0940a..a7f0ce10 100644 Binary files a/osinaweb/osinaweb/__pycache__/settings.cpython-312.pyc and b/osinaweb/osinaweb/__pycache__/settings.cpython-312.pyc differ diff --git a/osinaweb/static/dist/output.css b/osinaweb/static/dist/output.css index 35f92c80..81bf2392 100644 --- a/osinaweb/static/dist/output.css +++ b/osinaweb/static/dist/output.css @@ -702,6 +702,10 @@ video { right: -2.5rem; } +.-right-2 { + right: -0.5rem; +} + .-right-40 { right: -10rem; } @@ -722,6 +726,10 @@ video { top: -3rem; } +.-top-2 { + top: -0.5rem; +} + .-top-\[54px\] { top: -54px; } @@ -794,6 +802,10 @@ video { right: 1.25rem; } +.right-\[-5px\] { + right: -5px; +} + .top-0 { top: 0px; } @@ -822,6 +834,10 @@ video { top: 1.25rem; } +.top-\[-5px\] { + top: -5px; +} + .top-\[14px\] { top: 14px; } @@ -1076,6 +1092,14 @@ video { height: 150px; } +.h-\[16px\] { + height: 16px; +} + +.h-\[20px\] { + height: 20px; +} + .h-\[210px\] { height: 210px; } @@ -1174,6 +1198,10 @@ video { max-height: 50px; } +.min-h-\[200px\] { + min-height: 200px; +} + .w-1 { width: 0.25rem; } @@ -1182,6 +1210,10 @@ video { width: 2.5rem; } +.w-14 { + width: 3.5rem; +} + .w-4 { width: 1rem; } @@ -1226,6 +1258,10 @@ video { width: 150px; } +.w-\[16px\] { + width: 16px; +} + .w-\[180px\] { width: 180px; } @@ -1330,6 +1366,10 @@ video { width: 85%; } +.w-\[90\%\] { + width: 90%; +} + .w-\[95\%\] { width: 95%; } @@ -1439,6 +1479,16 @@ video { animation: bounceX 4s infinite; } +@keyframes spin { + to { + transform: rotate(360deg); + } +} + +.animate-spin { + animation: spin 1s linear infinite; +} + .cursor-default { cursor: default; } @@ -1695,6 +1745,10 @@ video { border-bottom-left-radius: 0.375rem; } +.rounded-bl-none { + border-bottom-left-radius: 0px; +} + .rounded-bl-xl { border-bottom-left-radius: 0.75rem; } @@ -1711,6 +1765,10 @@ video { border-top-left-radius: 0.375rem; } +.rounded-tl-none { + border-top-left-radius: 0px; +} + .rounded-tr-md { border-top-right-radius: 0.375rem; } @@ -2301,6 +2359,14 @@ video { --tw-gradient-to: #fff var(--tw-gradient-to-position); } +.fill-osiblue { + fill: #20336b; +} + +.fill-secondosiblue { + fill: #374a7a; +} + .stroke-black { stroke: #000; } @@ -2483,6 +2549,10 @@ video { padding-top: 0.75rem; } +.pt-5 { + padding-top: 1.25rem; +} + .pt-9 { padding-top: 2.25rem; } @@ -2606,6 +2676,10 @@ video { text-transform: uppercase; } +.leading-7 { + line-height: 1.75rem; +} + .leading-8 { line-height: 2rem; } @@ -3156,6 +3230,11 @@ video { color: rgb(146 156 183 / var(--tw-text-opacity)); } +.hover\:text-gray-200:hover { + --tw-text-opacity: 1; + color: rgb(229 231 235 / var(--tw-text-opacity)); +} + .hover\:text-gray-500:hover { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); @@ -3206,7 +3285,18 @@ video { color: rgb(255 255 255 / var(--tw-text-opacity)); } +@media (prefers-color-scheme: dark) { + .dark\:text-gray-600 { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); + } +} + @media (min-width: 650px) { + .s\:mt-10 { + margin-top: 2.5rem; + } + .s\:mt-5 { margin-top: 1.25rem; } @@ -3235,6 +3325,10 @@ video { height: 55px; } + .s\:h-\[60px\] { + height: 60px; + } + .s\:h-\[90px\] { height: 90px; } @@ -3267,10 +3361,22 @@ video { width: 500px; } + .s\:w-\[50px\] { + width: 50px; + } + .s\:w-\[550px\] { width: 550px; } + .s\:w-\[60px\] { + width: 60px; + } + + .s\:w-\[85\%\] { + width: 85%; + } + .s\:w-\[90px\] { width: 90px; } @@ -3585,6 +3691,10 @@ video { height: 500px; } + .xxlg1\:h-full { + height: 100%; + } + .xxlg1\:w-\[74\.5\%\] { width: 74.5%; } @@ -3604,6 +3714,24 @@ video { .xxlg1\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } + + .xxlg1\:rounded-l-md { + border-top-left-radius: 0.375rem; + border-bottom-left-radius: 0.375rem; + } + + .xxlg1\:rounded-r-md { + border-top-right-radius: 0.375rem; + border-bottom-right-radius: 0.375rem; + } + + .xxlg1\:rounded-bl-none { + border-bottom-left-radius: 0px; + } + + .xxlg1\:rounded-tr-none { + border-top-right-radius: 0px; + } } @media (min-width: 1390px) { @@ -3640,6 +3768,10 @@ video { width: 550px; } + .xll\:w-\[75\%\] { + width: 75%; + } + .xll\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } diff --git a/osinaweb/static/images/.DS_Store b/osinaweb/static/images/.DS_Store index fbab9770..01ade923 100644 Binary files a/osinaweb/static/images/.DS_Store and b/osinaweb/static/images/.DS_Store differ diff --git a/osinaweb/static/images/icons/happy-icon.png b/osinaweb/static/images/icons/happy-icon.png new file mode 100644 index 00000000..1f02dcee Binary files /dev/null and b/osinaweb/static/images/icons/happy-icon.png differ diff --git a/osinaweb/static/images/icons/neutral-icon.png b/osinaweb/static/images/icons/neutral-icon.png new file mode 100644 index 00000000..bedd7864 Binary files /dev/null and b/osinaweb/static/images/icons/neutral-icon.png differ diff --git a/osinaweb/static/images/icons/unhappy-icon.png b/osinaweb/static/images/icons/unhappy-icon.png new file mode 100644 index 00000000..192a8992 Binary files /dev/null and b/osinaweb/static/images/icons/unhappy-icon.png differ diff --git a/osinaweb/static/images/netcommerce-logo.png b/osinaweb/static/images/netcommerce-logo.png new file mode 100644 index 00000000..5944988d Binary files /dev/null and b/osinaweb/static/images/netcommerce-logo.png differ diff --git a/osinaweb/static/images/netcommercelogo.gif b/osinaweb/static/images/netcommercelogo.gif deleted file mode 100644 index ba7ee573..00000000 Binary files a/osinaweb/static/images/netcommercelogo.gif and /dev/null differ diff --git a/osinaweb/static/images/ositcom_logos/osinablue.png b/osinaweb/static/images/ositcom_logos/osinablue.png index 487ccf1a..256240d0 100644 Binary files a/osinaweb/static/images/ositcom_logos/osinablue.png and b/osinaweb/static/images/ositcom_logos/osinablue.png differ diff --git a/osinaweb/static/images/ositcom_logos/osinawhite.png b/osinaweb/static/images/ositcom_logos/osinawhite.png index aa2f5a9c..a9ed6e46 100644 Binary files a/osinaweb/static/images/ositcom_logos/osinawhite.png and b/osinaweb/static/images/ositcom_logos/osinawhite.png differ diff --git a/osinaweb/static/images/uploaded_images/invoice_33_2.31.49PM.pdf b/osinaweb/static/images/uploaded_images/invoice_33_2.31.49PM.pdf new file mode 100644 index 00000000..7e3e688c Binary files /dev/null and b/osinaweb/static/images/uploaded_images/invoice_33_2.31.49PM.pdf differ diff --git a/osinaweb/static/images/uploaded_images/unhappy-icon.png b/osinaweb/static/images/uploaded_images/unhappy-icon.png new file mode 100644 index 00000000..192a8992 Binary files /dev/null and b/osinaweb/static/images/uploaded_images/unhappy-icon.png differ diff --git a/osinaweb/static/js/customer_dashboard/invoice-payment.js b/osinaweb/static/js/customer_dashboard/invoice-payment.js new file mode 100644 index 00000000..bdab328e --- /dev/null +++ b/osinaweb/static/js/customer_dashboard/invoice-payment.js @@ -0,0 +1,63 @@ +const paymentContent = document.getElementById('paymentContent'); +const paymentLoader = document.getElementById('paymentLoader'); +const invoice_id = document.getElementById('invoiceId').textContent; + +function initiateInvoiceCheckout(invoice_id) { + const csrftoken = getCookie('csrftoken'); + console.log(invoice_id); + + console.log('CSRF Token:', csrftoken); + + paymentLoader.classList.remove('hidden'); + + fetch('/initiate_invoice_checkout/', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-CSRFToken': csrftoken, + }, + body: JSON.stringify({ invoice_id: invoice_id }), + }) + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }) + .then(data => { + console.log("Session ID: " + data.session_id); + // Update Checkout session with the fetched session ID and show the embedded page + Checkout.configure({ + session: { + id: data.session_id, + } + }); + $('#paymentContent').empty(); + Checkout.showEmbeddedPage('#paymentContent'); + sessionStorage.clear(); + + paymentLoader.classList.add('hidden'); + }) + .catch(error => { + console.error('There was a problem with the fetch operation:', error); + + paymentLoader.classList.add('hidden'); + }); +} + +function getCookie(name) { + let cookieValue = null; + if (document.cookie && document.cookie !== '') { + const cookies = document.cookie.split(';'); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].trim(); + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} + +initiateInvoiceCheckout(invoice_id); diff --git a/osinaweb/static/js/customer_dashboard/payment-pricing.js b/osinaweb/static/js/customer_dashboard/payment-pricing.js new file mode 100644 index 00000000..1f60b40a --- /dev/null +++ b/osinaweb/static/js/customer_dashboard/payment-pricing.js @@ -0,0 +1,13 @@ +// TO CHANGE THE PRICE BASED ON THE CHOSEN CYCLE FROM THE SELECT TAG +function updateCyclePrice() { + var selectedOption = document.getElementById('cycle').options[document.getElementById('cycle').selectedIndex]; + var cyclePrice = parseFloat(selectedOption.getAttribute('data-cycle-price')); + document.getElementById('cyclePrice').textContent = cyclePrice.toFixed(2); +} + +document.getElementById('cycle').addEventListener('change', updateCyclePrice); + +// Trigger the change event when the page loads to display the cycle price of the selected option by default +window.addEventListener('load', function () { + updateCyclePrice(); +}); \ No newline at end of file diff --git a/osinaweb/static/js/customer_dashboard/payment.js b/osinaweb/static/js/customer_dashboard/payment.js index 6b5e47b4..b59adbfb 100644 --- a/osinaweb/static/js/customer_dashboard/payment.js +++ b/osinaweb/static/js/customer_dashboard/payment.js @@ -1,4 +1,5 @@ const paymentContent = document.getElementById('paymentContent'); +const paymentLoader = document.getElementById('paymentLoader'); const item_id = document.getElementById('itemId').textContent; function initiateCheckout(item_id, selectedCycleId) { @@ -8,13 +9,15 @@ function initiateCheckout(item_id, selectedCycleId) { console.log('CSRF Token:', csrftoken); + paymentLoader.classList.remove('hidden'); + fetch('/initiate_checkout/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrftoken, }, - body: JSON.stringify({ item_id: item_id, cycle_id: selectedCycleId }), // Include selected cycle ID in the request body + body: JSON.stringify({ item_id: item_id, cycle_id: selectedCycleId }), }) .then(response => { if (!response.ok) { @@ -23,7 +26,6 @@ function initiateCheckout(item_id, selectedCycleId) { return response.json(); }) .then(data => { - // Handle success response console.log("Session ID: " + data.session_id); // Update Checkout session with the fetched session ID and show the embedded page Checkout.configure({ @@ -34,9 +36,13 @@ function initiateCheckout(item_id, selectedCycleId) { $('#paymentContent').empty(); Checkout.showEmbeddedPage('#paymentContent'); sessionStorage.clear(); + + paymentLoader.classList.add('hidden'); }) .catch(error => { console.error('There was a problem with the fetch operation:', error); + + paymentLoader.classList.add('hidden'); }); } diff --git a/osinaweb/static/js/customer_dashboard/ticket-details.js b/osinaweb/static/js/customer_dashboard/ticket-details.js new file mode 100644 index 00000000..adaf9764 --- /dev/null +++ b/osinaweb/static/js/customer_dashboard/ticket-details.js @@ -0,0 +1,28 @@ +document.addEventListener("DOMContentLoaded", function () { + const toggleButtons = document.querySelectorAll('.toggleReply'); + + toggleButtons.forEach(button => { + button.addEventListener('click', function () { + const replyContainer = this.closest('.replyContainer'); + const reply = replyContainer.querySelector('.reply'); + const arrowUp = replyContainer.querySelector('.arrowUp'); + const arrowDown = replyContainer.querySelector('.arrowDown'); + + reply.classList.toggle('hidden'); + + if (reply.classList.contains('hidden')) { + arrowUp.classList.add('hidden'); + arrowDown.classList.remove('hidden'); + } else { + arrowUp.classList.remove('hidden'); + arrowDown.classList.add('hidden'); + } + + if (!reply.classList.contains('hidden')) { + replyContainer.classList.add('shadow-md'); + } else { + replyContainer.classList.remove('shadow-md'); + } + }); + }); +});