New changes.

main
nataly 1 year ago
parent 81b59f4871
commit 2ab9337c0c

@ -7,5 +7,4 @@ urlpatterns = [
path('service', views.add_service, name='addservice'), path('service', views.add_service, name='addservice'),
path('order', views.add_order, name='addorder'), path('order', views.add_order, name='addorder'),
path('invoice/<int:order_id>/', views.add_invoice_pdf, name='addinvoice'), path('invoice/<int:order_id>/', views.add_invoice_pdf, name='addinvoice'),
] ]

@ -8,7 +8,6 @@ import os
from weasyprint import HTML, CSS from weasyprint import HTML, CSS
def add_product (request, *args, **kwargs): def add_product (request, *args, **kwargs):
item_types = ProjectType.objects.all().order_by('name') item_types = ProjectType.objects.all().order_by('name')
if request.method == 'POST': if request.method == 'POST':
@ -174,3 +173,8 @@ def add_invoice_pdf(request, order_id):
response['Content-Disposition'] = 'attachment; filename="my_pdf.pdf"' response['Content-Disposition'] = 'attachment; filename="my_pdf.pdf"'
return response return response

@ -72,16 +72,16 @@ def fetch_customer_businesses(request, customer_id):
except CustomerProfile.DoesNotExist: except CustomerProfile.DoesNotExist:
customer_profile = None customer_profile = None
if customer_profile and customer_profile.business: if customer_profile:
# Retrieve the associated business businesses = Business.objects.filter(customer=customer_profile)
business = customer_profile.business # Create a list to hold dictionary representations of each business
# Create a dictionary representation of the business business_data = []
business_data = { for business in businesses:
business_data.append({
'id': business.id, 'id': business.id,
'name': business.name, 'name': business.name,
# Include other fields if needed })
}
else: else:
business_data = None business_data = None
return JsonResponse({'business': business_data}) return JsonResponse({'businesses': business_data})

Binary file not shown.

@ -70,7 +70,7 @@
/* GIVE THIS CLASS TO THE SELECTED EPIC IN PROJECT DETAILS PAGE */ /* GIVE THIS CLASS TO THE SELECTED EPIC IN PROJECT DETAILS PAGE */
.selectedEpic { .selectedEpic {
color: white !important; color: #374a7a !important;
font-weight: bold !important; font-weight: bold !important;
} }

@ -0,0 +1,23 @@
# Generated by Django 4.2.5 on 2024-04-18 08:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('osinacore', '0065_alter_customerprofile_status'),
]
operations = [
migrations.RemoveField(
model_name='customerprofile',
name='business',
),
migrations.AddField(
model_name='business',
name='customer',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='osinacore.customerprofile'),
),
]

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save