diff --git a/osinaweb/billing/add/urls.py b/osinaweb/billing/add/urls.py index e3be8608..400988ad 100644 --- a/osinaweb/billing/add/urls.py +++ b/osinaweb/billing/add/urls.py @@ -5,6 +5,8 @@ from billing.add import views urlpatterns = [ path('product', views.add_product, name='addproduct'), path('service', views.add_service, name='addservice'), + path('service//', views.add_service, name='addservice_with_customer'), + path('order//', views.add_order, name='addorder'), path('invoice-pdf//', views.add_invoice_pdf, name='addinvoice'), diff --git a/osinaweb/billing/add/views.py b/osinaweb/billing/add/views.py index 5d552753..2a1a32df 100644 --- a/osinaweb/billing/add/views.py +++ b/osinaweb/billing/add/views.py @@ -42,9 +42,14 @@ def add_product(request, *args, **kwargs): @staff_login_required -def add_service (request, *args, **kwargs): +def add_service(request, customer_id=None, *args, **kwargs): item_types = ProjectType.objects.all().order_by('name') customers = CustomerProfile.objects.all().order_by('user__first_name') + + selected_customer = None + if customer_id: + selected_customer = get_object_or_404(CustomerProfile, id=customer_id) + if request.method == 'POST': title = request.POST.get('title') description = request.POST.get('description') @@ -70,7 +75,8 @@ def add_service (request, *args, **kwargs): return redirect('items') context = { 'item_types' : item_types, - 'customers' : customers + 'customers' : customers, + 'selected_customer' : selected_customer, } return render(request, 'add_templates/add-service.html', context) diff --git a/osinaweb/billing/templates/add_templates/add-service.html b/osinaweb/billing/templates/add_templates/add-service.html index a05f106c..9513a307 100644 --- a/osinaweb/billing/templates/add_templates/add-service.html +++ b/osinaweb/billing/templates/add_templates/add-service.html @@ -26,16 +26,18 @@ -
- - -
+
+ + +
diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index b7d00295..11505e65 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -44,11 +44,17 @@ Project - + + + +