New changes.

main
nataly 1 year ago
parent 81b59f4871
commit 2ab9337c0c

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

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

@ -72,16 +72,16 @@ def fetch_customer_businesses(request, customer_id):
except CustomerProfile.DoesNotExist:
customer_profile = None
if customer_profile and customer_profile.business:
# Retrieve the associated business
business = customer_profile.business
# Create a dictionary representation of the business
business_data = {
'id': business.id,
'name': business.name,
# Include other fields if needed
}
if customer_profile:
businesses = Business.objects.filter(customer=customer_profile)
# Create a list to hold dictionary representations of each business
business_data = []
for business in businesses:
business_data.append({
'id': business.id,
'name': business.name,
})
else:
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 */
.selectedEpic {
color: white !important;
color: #374a7a !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