diff --git a/osinaweb/billing/add/__pycache__/urls.cpython-311.pyc b/osinaweb/billing/add/__pycache__/urls.cpython-311.pyc index e9444126..86ce99da 100644 Binary files a/osinaweb/billing/add/__pycache__/urls.cpython-311.pyc and b/osinaweb/billing/add/__pycache__/urls.cpython-311.pyc differ diff --git a/osinaweb/billing/add/__pycache__/views.cpython-311.pyc b/osinaweb/billing/add/__pycache__/views.cpython-311.pyc index c6643443..733b30e4 100644 Binary files a/osinaweb/billing/add/__pycache__/views.cpython-311.pyc and b/osinaweb/billing/add/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/billing/add/urls.py b/osinaweb/billing/add/urls.py index 860eb6fe..5b2bd54d 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 c1b41a70..e0882a59 100644 --- a/osinaweb/billing/add/views.py +++ b/osinaweb/billing/add/views.py @@ -8,7 +8,6 @@ import os from osinacore.decorators import * from django.core.files.base import ContentFile from django.db.models import Q -from weasyprint import HTML, CSS @staff_login_required @@ -211,116 +210,7 @@ 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__/admin.cpython-311.pyc b/osinaweb/customercore/__pycache__/admin.cpython-311.pyc index db35170f..22a6fcf7 100644 Binary files a/osinaweb/customercore/__pycache__/admin.cpython-311.pyc and b/osinaweb/customercore/__pycache__/admin.cpython-311.pyc differ diff --git a/osinaweb/customercore/__pycache__/custom_context.cpython-311.pyc b/osinaweb/customercore/__pycache__/custom_context.cpython-311.pyc index 4ca9a6e0..4b4208cd 100644 Binary files a/osinaweb/customercore/__pycache__/custom_context.cpython-311.pyc and b/osinaweb/customercore/__pycache__/custom_context.cpython-311.pyc differ diff --git a/osinaweb/customercore/__pycache__/models.cpython-311.pyc b/osinaweb/customercore/__pycache__/models.cpython-311.pyc index 60c28783..5c3f4b4d 100644 Binary files a/osinaweb/customercore/__pycache__/models.cpython-311.pyc and b/osinaweb/customercore/__pycache__/models.cpython-311.pyc differ diff --git a/osinaweb/customercore/__pycache__/views.cpython-311.pyc b/osinaweb/customercore/__pycache__/views.cpython-311.pyc index ed6228da..b7ee1110 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-311.pyc and b/osinaweb/customercore/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0012_ticket_ticket_members.cpython-311.pyc b/osinaweb/customercore/migrations/__pycache__/0012_ticket_ticket_members.cpython-311.pyc new file mode 100644 index 00000000..53990d45 Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0012_ticket_ticket_members.cpython-311.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0013_alter_ticket_ticket_members.cpython-311.pyc b/osinaweb/customercore/migrations/__pycache__/0013_alter_ticket_ticket_members.cpython-311.pyc new file mode 100644 index 00000000..288db245 Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0013_alter_ticket_ticket_members.cpython-311.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0014_remove_ticket_department_ticket_department.cpython-311.pyc b/osinaweb/customercore/migrations/__pycache__/0014_remove_ticket_department_ticket_department.cpython-311.pyc new file mode 100644 index 00000000..11839586 Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0014_remove_ticket_department_ticket_department.cpython-311.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0015_rename_department_ticket_departments.cpython-311.pyc b/osinaweb/customercore/migrations/__pycache__/0015_rename_department_ticket_departments.cpython-311.pyc new file mode 100644 index 00000000..148cc92f Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0015_rename_department_ticket_departments.cpython-311.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0016_rename_ticketstatusupdate_ticketstatus.cpython-311.pyc b/osinaweb/customercore/migrations/__pycache__/0016_rename_ticketstatusupdate_ticketstatus.cpython-311.pyc new file mode 100644 index 00000000..ab4e95e0 Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0016_rename_ticketstatusupdate_ticketstatus.cpython-311.pyc differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 97d1cc77..6794d59e 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/input.css b/osinaweb/input.css index 0071fbed..ad982bd3 100644 --- a/osinaweb/input.css +++ b/osinaweb/input.css @@ -15,6 +15,14 @@ background: #5a5a5a00; } +.rtl { + direction: rtl; +} + +.ltr { + direction: ltr; +} + /* SCROLL BAR OF REACTION DETAILS POPUP */ .reactionDetails::-webkit-scrollbar { diff --git a/osinaweb/osinacore/__pycache__/views.cpython-311.pyc b/osinaweb/osinacore/__pycache__/views.cpython-311.pyc index c095373f..2b0b0159 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-311.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/urls.cpython-311.pyc b/osinaweb/osinacore/add/__pycache__/urls.cpython-311.pyc index fafb3a57..63571b53 100644 Binary files a/osinaweb/osinacore/add/__pycache__/urls.cpython-311.pyc and b/osinaweb/osinacore/add/__pycache__/urls.cpython-311.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/views.cpython-311.pyc b/osinaweb/osinacore/add/__pycache__/views.cpython-311.pyc index 7dcde46a..5b99f612 100644 Binary files a/osinaweb/osinacore/add/__pycache__/views.cpython-311.pyc and b/osinaweb/osinacore/add/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/osinacore/add/urls.py b/osinaweb/osinacore/add/urls.py index d891802e..74e96abf 100644 --- a/osinaweb/osinacore/add/urls.py +++ b/osinaweb/osinacore/add/urls.py @@ -5,7 +5,6 @@ from . import views urlpatterns = [ path('status/', views.add_status_modal, name='addstatusmodal'), - path('customer/', views.add_customer, name='addcustomer'), path('business/', views.add_business, name='addbusiness'), path('staff/', views.add_staff, name='adduser'), @@ -18,6 +17,7 @@ urlpatterns = [ path('task//', views.add_task, name='addprojecttask'), path('task///', views.add_task, name='adduserstorytask'), path('point//', views.add_point_modal, name='addpointmodal'), + path('taskpoint//', views.save_point_modal, name='savepointmodal'), path('epic//', views.add_epic, name='addepic'), path('note/', views.add_note_modal, name='addnotemodal'), path('dailyreport/', views.add_daily_report, name='adddailyreport'), @@ -30,5 +30,5 @@ urlpatterns = [ path('reaction///', views.add_reaction, name='add_reaction'), path('ticket//', views.add_ticket, name='addticket'), path('ticketupdate//', views.add_ticket_update, name='addticketupdate'), - + path('add_project_momber', views.add_project_member_modal, name='addprojectmembermodal'), ] \ No newline at end of file diff --git a/osinaweb/osinacore/add/views.py b/osinaweb/osinacore/add/views.py index 758ee733..ef3a5f0c 100644 --- a/osinaweb/osinacore/add/views.py +++ b/osinaweb/osinacore/add/views.py @@ -284,6 +284,15 @@ def add_credential_modal(request, *args, **kwargs): return render(request, 'add_templates/add-credentials-modal.html', context) +@staff_login_required +def add_project_member_modal(request, *args, **kwargs): + + context = { + + } + return render(request, 'add_templates/add-project-member-modal.html', context) + + @staff_login_required @@ -389,6 +398,25 @@ def add_point_modal(request, task_id): +@staff_login_required +def save_point_modal(request, task_id): + task = get_object_or_404(Task, task_id=task_id) + if request.method == 'POST': + text = request.POST.get('text') + point = Point( + text = text, + task = task, + status='Not Completed' + ) + point.save() + return JsonResponse({'success': True, 'message': 'Point saved successfully.'}) + + context = { + 'task' : task, + + } + return render(request, 'add_templates/add-point-modal.html', context) + @staff_login_required diff --git a/osinaweb/osinacore/edit/__pycache__/urls.cpython-311.pyc b/osinaweb/osinacore/edit/__pycache__/urls.cpython-311.pyc index bd808bfb..e6b0f326 100644 Binary files a/osinaweb/osinacore/edit/__pycache__/urls.cpython-311.pyc and b/osinaweb/osinacore/edit/__pycache__/urls.cpython-311.pyc differ diff --git a/osinaweb/osinacore/edit/__pycache__/views.cpython-311.pyc b/osinaweb/osinacore/edit/__pycache__/views.cpython-311.pyc index 4e07b8e1..6e93c8d2 100644 Binary files a/osinaweb/osinacore/edit/__pycache__/views.cpython-311.pyc and b/osinaweb/osinacore/edit/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/osinacore/edit/urls.py b/osinaweb/osinacore/edit/urls.py index 33bb189d..aa4de05a 100644 --- a/osinaweb/osinacore/edit/urls.py +++ b/osinaweb/osinacore/edit/urls.py @@ -5,6 +5,7 @@ from . import views urlpatterns = [ path('customer//', views.edit_customer, name='editcustomer'), + path('customerstatus', views.edit_customer_status_modal, name='editcustomerstatusmodal'), path('business//', views.edit_business, name='editbusiness'), path('staff//', views.edit_staff, name='editstaff'), path('project//', views.edit_project, name='editproject'), diff --git a/osinaweb/osinacore/edit/views.py b/osinaweb/osinacore/edit/views.py index 2d96c4e4..b36b7c4d 100644 --- a/osinaweb/osinacore/edit/views.py +++ b/osinaweb/osinacore/edit/views.py @@ -43,6 +43,14 @@ def edit_customer(request, customer_id): } return render(request, 'edit_templates/edit-customer.html', context) +@staff_login_required +def edit_customer_status_modal(request): + + context = { + + } + + return render(request, 'edit_templates/edit-customer-status-modal.html', context) diff --git a/osinaweb/osinacore/templates/add_templates/add-point-modal.html b/osinaweb/osinacore/templates/add_templates/add-point-modal.html index d5c91300..1bc9469a 100644 --- a/osinaweb/osinacore/templates/add_templates/add-point-modal.html +++ b/osinaweb/osinacore/templates/add_templates/add-point-modal.html @@ -14,28 +14,45 @@ -
+ {% csrf_token %}

Add Point

+ class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4" required id="pointInput">
- -

- -

- -
+
+ + class="w-fit bg-osiblue border border-osiblue rounded-md text-white px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save and Continue
+ + + \ No newline at end of file diff --git a/osinaweb/osinacore/templates/add_templates/add-project-member-modal.html b/osinaweb/osinacore/templates/add_templates/add-project-member-modal.html new file mode 100644 index 00000000..9548f934 --- /dev/null +++ b/osinaweb/osinacore/templates/add_templates/add-project-member-modal.html @@ -0,0 +1,36 @@ +{% load static %} + + + + + + + + Osina + + + + + + + +
+ {% csrf_token %} +

Add Member

+ +
+ + +
+
+ +
+
+ + + \ No newline at end of file diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index d87fd3cf..d095ea9a 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -27,7 +27,7 @@
diff --git a/osinaweb/osinacore/templates/details_templates/project-details.html b/osinaweb/osinacore/templates/details_templates/project-details.html index 5eff031d..456d9860 100644 --- a/osinaweb/osinacore/templates/details_templates/project-details.html +++ b/osinaweb/osinacore/templates/details_templates/project-details.html @@ -7,7 +7,7 @@
-
- - @@ -43,9 +31,8 @@
-
-
+
+
-
- @@ -89,8 +70,8 @@

Project Manager:

-
-
+
+
{% if project.manager.image %} {% else %} @@ -104,14 +85,25 @@
-
-

Member(s):

-
+
+
+
+

Members

+
+ + +
+ +
{% for member in members %}
+ class="w-fit flex flex-col gap-2 px-5 py-3 bg-gray-100 rounded-md shadow-md">
-
+
{% if member.image %} {% else %} @@ -125,7 +117,9 @@
{% if request.user.is_superuser %} -

Working Hours: {{member.total_time_worked_hours}}hr {{member.total_time_worked_minutes}}min {{member.total_time_worked_seconds}}sec

+

Working Hours: + {{member.total_time_worked_hours}}hr {{member.total_time_worked_minutes}}min + {{member.total_time_worked_seconds}}sec

{% endif %}
{% endfor %} @@ -133,7 +127,7 @@
-
+

Type: {% for type in project.project_type.all %} @@ -489,6 +483,12 @@

+ + +
diff --git a/osinaweb/osinacore/templates/details_templates/ticket-details.html b/osinaweb/osinacore/templates/details_templates/ticket-details.html index bdcdb388..63c6c9cb 100644 --- a/osinaweb/osinacore/templates/details_templates/ticket-details.html +++ b/osinaweb/osinacore/templates/details_templates/ticket-details.html @@ -166,9 +166,91 @@
- +
+
+
+ + + + +
+ +
+ + + + + +
+ +
+ + + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + +
+
-
-
-
- - + {% endblock %} \ No newline at end of file diff --git a/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html b/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html index 5a587d37..53a4265b 100644 --- a/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html +++ b/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html @@ -19,10 +19,10 @@

Update Customer Status

diff --git a/osinaweb/osinacore/templates/listing_pages/customers.html b/osinaweb/osinacore/templates/listing_pages/customers.html index bd65611f..bcfbe88f 100644 --- a/osinaweb/osinacore/templates/listing_pages/customers.html +++ b/osinaweb/osinacore/templates/listing_pages/customers.html @@ -68,16 +68,17 @@

{{customer.user.username}}

- - + +

{{customer.status}}

{% if customer.business_set.all %} - {% for business in customer.business_set.all %} -

{{business.name}}

- {% endfor %} + {% for business in customer.business_set.all %} +

{{business.name}}

+ {% endfor %} {% else %}

None

{% endif %} @@ -87,26 +88,36 @@ diff --git a/osinaweb/osinacore/templates/listing_pages/projects.html b/osinaweb/osinacore/templates/listing_pages/projects.html index 40ebf4b7..8cefc5c7 100644 --- a/osinaweb/osinacore/templates/listing_pages/projects.html +++ b/osinaweb/osinacore/templates/listing_pages/projects.html @@ -66,7 +66,7 @@
-
Edit - +
@@ -230,8 +230,8 @@ Edit - +
diff --git a/osinaweb/osinacore/templates/projects-by-status.html b/osinaweb/osinacore/templates/projects-by-status.html index 6503eb75..4f17553b 100644 --- a/osinaweb/osinacore/templates/projects-by-status.html +++ b/osinaweb/osinacore/templates/projects-by-status.html @@ -1,7 +1,6 @@ {% load static %} {% for project in filtered_projects %} -
@@ -56,8 +55,8 @@ Edit - +
@@ -93,5 +92,18 @@
+{% endfor %} + + + + -{% endfor %} \ No newline at end of file + \ No newline at end of file diff --git a/osinaweb/static/dist/output.css b/osinaweb/static/dist/output.css index 7d975d9b..816b82c9 100644 --- a/osinaweb/static/dist/output.css +++ b/osinaweb/static/dist/output.css @@ -3081,6 +3081,14 @@ video { background: #5a5a5a00; } +.rtl { + direction: rtl; +} + +.ltr { + direction: ltr; +} + /* SCROLL BAR OF REACTION DETAILS POPUP */ .reactionDetails::-webkit-scrollbar { @@ -3418,6 +3426,10 @@ video { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } +.hover\:bg-opacity-50:hover { + --tw-bg-opacity: 0.5; +} + .hover\:bg-opacity-60:hover { --tw-bg-opacity: 0.6; } @@ -3694,10 +3706,6 @@ video { display: none; } - .md\:h-\[70px\] { - height: 70px; - } - .md\:w-\[250px\] { width: 250px; } @@ -3723,11 +3731,6 @@ video { flex-direction: row; } - .md\:py-1 { - padding-top: 0.25rem; - padding-bottom: 0.25rem; - } - .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -3956,14 +3959,6 @@ video { } @media (min-width: 1600px) { - .xll\:flex { - display: flex; - } - - .xll\:hidden { - display: none; - } - .xll\:w-\[550px\] { width: 550px; } diff --git a/osinaweb/static/js/pop-modals.js b/osinaweb/static/js/pop-modals.js index c53968a5..4a53e1b2 100644 --- a/osinaweb/static/js/pop-modals.js +++ b/osinaweb/static/js/pop-modals.js @@ -73,11 +73,11 @@ document.addEventListener("DOMContentLoaded", function () { addButtonClickListener("addPaymentMethodButton", "500px", "400px"); addButtonClickListener("updateOrderStatusButton", "400px", "160px"); addButtonClickListener("editProjectStatusButton", "400px", "220px"); + addButtonClickListener("editCustomerStatusButton", "400px", "160px"); + addButtonClickListener("addProjectMemberModal", "400px", "230px"); - - - - + + // DELETE BUTTONS diff --git a/osinaweb/static/js/text-editor.js b/osinaweb/static/js/text-editor.js new file mode 100644 index 00000000..0dae8870 --- /dev/null +++ b/osinaweb/static/js/text-editor.js @@ -0,0 +1,11 @@ +document.getElementById('rtlButton').addEventListener('click', function() { + const editor = document.getElementById('textEditor'); + editor.classList.remove('ltr'); + editor.classList.add('rtl'); +}); + +document.getElementById('ltrButton').addEventListener('click', function() { + const editor = document.getElementById('textEditor'); + editor.classList.remove('rtl'); + editor.classList.add('ltr'); +}); \ No newline at end of file