django_program.manage.views_purchase_orders

Views for purchase order management in the organizer dashboard.

Classes

PurchaseOrderCancelView

Cancel a purchase order (POST-only).

PurchaseOrderCreateView

Create a new purchase order with line items.

PurchaseOrderDetailView

Display full details of a purchase order with payments and credit notes.

PurchaseOrderInvoiceView

Generate and download a PO invoice as PDF.

PurchaseOrderIssueCreditView

Issue a credit note against a purchase order (POST-only).

PurchaseOrderListView

List all purchase orders for the current conference.

PurchaseOrderQBOInvoiceView

Create and send a QuickBooks Online Invoice for a purchase order (POST-only).

PurchaseOrderRecordPaymentView

Record a payment against a purchase order (POST-only).

PurchaseOrderSendView

Mark a draft purchase order as sent (POST-only).

PurchaseOrderStripeInvoiceView

Create and send a Stripe Invoice for a purchase order (POST-only).

class django_program.manage.views_purchase_orders.PurchaseOrderListView[source]

Bases: ConferencePermissionMixin, ListView

List all purchase orders for the current conference.

Supports optional filtering by status via the ?status= query parameter.

template_name = 'django_program/manage/purchase_order_list.html'
context_object_name = 'purchase_orders'
paginate_by = 50
get_context_data(**kwargs)[source]

Add active_nav and status filter choices to the template context.

Parameters:

kwargs (object)

Return type:

dict[str, object]

get_queryset()[source]

Return purchase orders for the current conference, optionally filtered by status.

Annotates _annotated_total_paid and _annotated_total_credited so that balance_due can be computed without per-row aggregate queries.

Return type:

QuerySet

class django_program.manage.views_purchase_orders.PurchaseOrderDetailView[source]

Bases: ConferencePermissionMixin, DetailView

Display full details of a purchase order with payments and credit notes.

template_name = 'django_program/manage/purchase_order_detail.html'
context_object_name = 'purchase_order'
get_context_data(**kwargs)[source]

Add active_nav, line items, payments, and credit notes to context.

Parameters:

kwargs (object)

Return type:

dict[str, object]

get_queryset()[source]

Scope to the current conference.

Return type:

QuerySet

class django_program.manage.views_purchase_orders.PurchaseOrderCreateView[source]

Bases: ConferencePermissionMixin, View

Create a new purchase order with line items.

GET renders the create form. POST validates input and creates the PO via the service layer, then redirects to the detail view.

get(request, **kwargs)[source]

Render the blank purchase order form.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

post(request, **kwargs)[source]

Validate and create a purchase order from form data.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderRecordPaymentView[source]

Bases: ConferencePermissionMixin, View

Record a payment against a purchase order (POST-only).

post(request, **kwargs)[source]

Validate and record a payment.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderIssueCreditView[source]

Bases: ConferencePermissionMixin, View

Issue a credit note against a purchase order (POST-only).

post(request, **kwargs)[source]

Validate and issue a credit note.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderCancelView[source]

Bases: ConferencePermissionMixin, View

Cancel a purchase order (POST-only).

post(request, **kwargs)[source]

Cancel the purchase order.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderSendView[source]

Bases: ConferencePermissionMixin, View

Mark a draft purchase order as sent (POST-only).

post(request, **kwargs)[source]

Transition the PO from draft to sent.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderInvoiceView[source]

Bases: ConferencePermissionMixin, View

Generate and download a PO invoice as PDF.

get(request, **kwargs)[source]

Generate the invoice PDF and return it as a downloadable attachment.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderStripeInvoiceView[source]

Bases: ConferencePermissionMixin, View

Create and send a Stripe Invoice for a purchase order (POST-only).

Uses the conference’s Stripe keys to create a hosted invoice that the customer can pay via card or ACH. Sets the PO status to SENT on success.

post(request, **kwargs)[source]

Create a Stripe invoice and redirect back to the PO detail page.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_purchase_orders.PurchaseOrderQBOInvoiceView[source]

Bases: ConferencePermissionMixin, View

Create and send a QuickBooks Online Invoice for a purchase order (POST-only).

Uses the conference’s QBO credentials to create an invoice via the QBO REST API and optionally emails it to the customer. Sets the PO status to SENT on success if currently in draft.

post(request, **kwargs)[source]

Create a QBO invoice and redirect back to the PO detail page.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse