diff --git a/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc b/osinaweb/billing/add/__pycache__/urls.cpython-312.pyc index 1928ca12..b201b650 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 78b9ab59..4f79a25a 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 e3be8608..97dc4702 100644 --- a/osinaweb/billing/add/urls.py +++ b/osinaweb/billing/add/urls.py @@ -7,8 +7,7 @@ urlpatterns = [ path('service', views.add_service, name='addservice'), path('order//', views.add_order, name='addorder'), - path('invoice-pdf//', views.add_invoice_pdf, name='addinvoice'), - path('payment-pdf//', views.add_payment_pdf, name='addpayment'), + path('service///', views.add_service_in_order, name='addserviceinorder'), diff --git a/osinaweb/billing/add/views.py b/osinaweb/billing/add/views.py index 628aabe3..8bec9843 100644 --- a/osinaweb/billing/add/views.py +++ b/osinaweb/billing/add/views.py @@ -8,7 +8,7 @@ import os from osinacore.decorators import * from django.core.files.base import ContentFile from django.db.models import Q -from weasyprint import HTML, CSS + @@ -213,116 +213,6 @@ def add_payment_comment_modal(request): -def add_invoice_pdf(request, order_id): - order = get_object_or_404(Order, id=order_id) - - current_year = str(timezone.now().year)[-2:] - last_invoice = Invoice.objects.all().last() - if last_invoice: - last_invoice_number = int(last_invoice.invoice_number.split('-')[1].split('+')[0]) - new_invoice_number = f"$0{current_year}-{last_invoice_number + 1}" - else: - new_invoice_number = f"$0{current_year}-1425" - - - - invoice = Invoice.objects.create( - invoice_number = new_invoice_number, - order=order, - date_created=datetime.now(), - ) - - template = get_template('details_templates/invoice-details.html') - context = {'order': order} - html_string = template.render(context) - - # Define the CSS string with Poppins font - css_string = ''' - @font-face { - font-family: 'Poppins'; - src: url('path_to_poppins_font_file.ttf') format('truetype'); /* Update the path to the font file */ - } - - body { - font-family: 'Poppins', sans-serif; /* Use Poppins font for the entire document */ - } - - /* Your existing CSS styles */ - /* Add or modify styles as needed */ - ''' - - # Generate PDF - pdf = HTML(string=html_string).write_pdf( - stylesheets=[ - CSS(string=css_string), - CSS(string='@page { margin: 30px; }') - ], - presentational_hints=True - ) - - filename = f'invoice_{invoice.invoice_number}.pdf' - pdf_content = ContentFile(pdf) - invoice.pdf.save(filename, pdf_content, save=True) - - - # Return PDF - response = HttpResponse(pdf, content_type='application/pdf') - response['Content-Disposition'] = 'attachment; filename="my_pdf.pdf"' - return response - - - - - - - -def add_payment_pdf(request, order_id): - order = get_object_or_404(Order, id=order_id) - payments = OrderPayment.objects.filter(order = order) - paid_amount = OrderPayment.objects.filter(order=order, date_paid__isnull=False).aggregate(total_paid=Sum('amount'))['total_paid'] or 0 - cart_total = order.get_cart_total - remaining_amount = cart_total - paid_amount - - - invoice = order.invoice - - # Render both invoice and payment details templates to HTML - invoice_template = get_template('details_templates/invoice-details.html') - payment_template = get_template('details_templates/payment-details.html') - invoice_html = invoice_template.render({'order': order}) - payment_html = payment_template.render({'order': order, 'payments':payments, 'remaining_amount':remaining_amount,}) - - # Combine the HTML content of both templates - combined_html = f"{invoice_html}
{payment_html}" - - # Define CSS - css_string = ''' - @font-face { - font-family: 'Poppins'; - src: url('path_to_poppins_font_file.ttf') format('truetype'); /* Update the path to the font file */ - } - - body { - font-family: 'Poppins', sans-serif; /* Use Poppins font for the entire document */ - } - - /* Your existing CSS styles */ - /* Add or modify styles as needed */ - ''' - - # Generate PDF - pdf = HTML(string=combined_html).write_pdf( - stylesheets=[ - CSS(string=css_string), - CSS(string='@page { margin: 30px; }') - ], - presentational_hints=True - ) - - # Return PDF - response = HttpResponse(pdf, content_type='application/pdf') - response['Content-Disposition'] = 'attachment; filename="my_pdf.pdf"' - return response diff --git a/osinaweb/customercore/__pycache__/views.cpython-312.pyc b/osinaweb/customercore/__pycache__/views.cpython-312.pyc index 3499ee7c..49bcc847 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/listing_pages/customer-projects.html b/osinaweb/customercore/templates/listing_pages/customer-projects.html index a08b985a..ccfa1251 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-projects.html +++ b/osinaweb/customercore/templates/listing_pages/customer-projects.html @@ -33,16 +33,14 @@
-

{{project.start_date}}

-

{{project.end_date}}

+

{{project.start_date}}

+

{{project.end_date}}

- -
-
+
@@ -53,6 +51,7 @@ - + + {% endblock content %} \ No newline at end of file diff --git a/osinaweb/customercore/templates/listing_pages/products.html b/osinaweb/customercore/templates/listing_pages/products.html index 1e37cd5c..28cd22b9 100644 --- a/osinaweb/customercore/templates/listing_pages/products.html +++ b/osinaweb/customercore/templates/listing_pages/products.html @@ -28,38 +28,44 @@
- @@ -106,42 +114,48 @@
-
-

Shared - Basic

- -
-

80%

-

$2.40/month

-

Regular Price: $12.00/month

-
-
- - @@ -160,55 +174,63 @@
-
-

- OSICLOUD 1

- -
-

30%

-

$46.16/month

-

Regular Price: $65.95/month

+ +
+

+ OSICLOUD 1

+ +
+

30%

+

$46.16/month

+

Regular Price: $65.95/month

+
-
- -
-

- OSICLOUD 2

+
-
-

30%

-

$53.86/month -

-

Regular Price: $76.95/month

+ +
+

+ OSICLOUD 2

+ +
+

30%

+

$53.86/month +

+

Regular Price: $76.95/month

+
-
- - @@ -226,58 +248,66 @@
-
-

- DEDICATED 1

- -
-

30%

-

$103.06/month -

-

Regular Price: $143.95/month

-
-
- - diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index bb6f86a7..5bbbef82 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-312.pyc b/osinaweb/osinacore/__pycache__/views.cpython-312.pyc index fd84b944..ba9c0f8b 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/templates/customer_main.html b/osinaweb/osinacore/templates/customer_main.html index 533fde89..fb7deefd 100644 --- a/osinaweb/osinacore/templates/customer_main.html +++ b/osinaweb/osinacore/templates/customer_main.html @@ -188,17 +188,9 @@
@@ -392,18 +392,9 @@
diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index 8d442925..b501de57 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -27,7 +27,8 @@
@@ -117,7 +118,7 @@ -
+
- - - - + + + {% endblock content %} \ No newline at end of file diff --git a/osinaweb/osinacore/templates/listing_pages/projects.html b/osinaweb/osinacore/templates/listing_pages/projects.html index a0039e76..245e21cb 100644 --- a/osinaweb/osinacore/templates/listing_pages/projects.html +++ b/osinaweb/osinacore/templates/listing_pages/projects.html @@ -78,18 +78,14 @@ class="w-full h-fit bg-white rounded-md shadow-md p-3 projectContainer"> - - - -

{{project.name}}

-

{{project.start_date}}

-

{{project.end_date}}

+

{{project.start_date}}

+

{{project.end_date}}

diff --git a/osinaweb/osinacore/templates/projects-by-status.html b/osinaweb/osinacore/templates/projects-by-status.html index 36e2f7a9..9115b1a2 100644 --- a/osinaweb/osinacore/templates/projects-by-status.html +++ b/osinaweb/osinacore/templates/projects-by-status.html @@ -4,9 +4,6 @@