django_program.registration.purchase_order

Purchase order and corporate invoicing models.

Supports offline corporate purchases where organizations pay via wire transfer, ACH, check, or other non-card methods. Each purchase order tracks line items, partial payments, and credit notes independently of the cart/checkout flow.

Classes

PurchaseOrder

A corporate purchase order for bulk or invoiced ticket purchases.

PurchaseOrderCreditNote

A credit note issued against a purchase order.

PurchaseOrderLineItem

A single line item on a purchase order.

PurchaseOrderPayment

A payment recorded against a purchase order.

class django_program.registration.purchase_order.PurchaseOrder[source]

Bases: Model

A corporate purchase order for bulk or invoiced ticket purchases.

Purchase orders exist outside the normal cart/checkout flow and support partial payments over time via wire, ACH, check, or Stripe. The balance_due property tracks the remaining amount after payments and credit notes.

class Status[source]

Bases: TextChoices

Lifecycle states for a purchase order.

DRAFT = 'draft'
SENT = 'sent'
PARTIALLY_PAID = 'partially_paid'
PAID = 'paid'
OVERPAID = 'overpaid'
CANCELLED = 'cancelled'
__new__(value)
conference

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

organization_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

contact_email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

contact_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_address

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stripe_invoice_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stripe_invoice_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

qbo_invoice_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

qbo_invoice_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

notes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

reference

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

subtotal

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property total_paid: Decimal

Return the sum of all recorded payment amounts.

Uses the _annotated_total_paid annotation when available (set by list views) to avoid per-row aggregate queries.

property total_credited: Decimal

Return the sum of all credit note amounts.

Uses the _annotated_total_credited annotation when available (set by list views) to avoid per-row aggregate queries.

property balance_due: Decimal

Return the outstanding balance after payments and credit notes.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

conference_id
created_by_id
credit_notes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

line_items

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
payments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class django_program.registration.purchase_order.PurchaseOrderLineItem[source]

Bases: Model

A single line item on a purchase order.

Each line references an optional ticket type or add-on for traceability, but the description and pricing are snapshotted at creation time.

purchase_order

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unit_price

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

line_total

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ticket_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

addon

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

addon_id
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
purchase_order_id
ticket_type_id
class django_program.registration.purchase_order.PurchaseOrderPayment[source]

Bases: Model

A payment recorded against a purchase order.

Tracks individual payments received via wire transfer, ACH, check, Stripe, or other methods. Multiple payments can be recorded as partial payments arrive.

class Method[source]

Bases: TextChoices

Supported payment methods for purchase orders.

WIRE = 'wire'
ACH = 'ach'
CHECK = 'check'
STRIPE = 'stripe'
OTHER = 'other'
__new__(value)
purchase_order

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

amount

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

reference

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

method

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

entered_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

payment_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

note

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

entered_by_id
get_method_display(*, field=<django.db.models.fields.CharField: method>)
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_payment_date(*, field=<django.db.models.fields.DateField: payment_date>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_payment_date(*, field=<django.db.models.fields.DateField: payment_date>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
purchase_order_id
class django_program.registration.purchase_order.PurchaseOrderCreditNote[source]

Bases: Model

A credit note issued against a purchase order.

Reduces the effective balance due on the purchase order. Used for adjustments, corrections, or partial cancellations.

purchase_order

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

amount

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

reason

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

issued_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

issued_by_id
objects = <django.db.models.manager.Manager object>
purchase_order_id