trips Package

models Module

class trips.models.StoreAccount(*args, **kwargs)[source]

A Communard-visible Wrapper for an Account.

This is used to allow Communards to select an Account for purchases made on store credit.

class trips.models.TripEntry(*args, **kwargs)[source]

Communard entries used as a pre-approval state for JournalEntries.

These are used to group together in-town purchases by Communards before the Entry is approved by an Accountant.

When approved, the TripEntry massages it’s data into a JournalEntry and Transactions so that the relevant Account balances are actually modified, then the TripEntry deletes itself.

approve_entry()[source]

Creating a JournalEntry Transactions and Receipts from the Entry.

This does not delete the entry, as should be done when an Entry is approved. You must manually delete the TripEntry.

Returns the created JournalEntry.

get_next_entry()[source]

Return the next Entry for Editing/Approval.

get_number()[source]

Generate an Entry Number using the number attribute.

class trips.models.TripReceipt(*args, **kwargs)[source]

Stores Receipts for an unapproved TripEntry.

class trips.models.TripStoreTransaction(*args, **kwargs)[source]

Represents a purchase at a StoreAccount for a TripEntry.

class trips.models.TripTransaction(*args, **kwargs)[source]

Represents the individual charges/returns for a TripEntry.

The creation of a TripTransaction does not affect Account balances, this only occurs when the related TripEntry is approved - by removing the TripEntry and TripTransactions and creating a JournalEntry and Transactions.

admin Module

forms Module

class trips.forms.TripEntryForm(*args, **kwargs)[source]

A From for TripEntries along with multiple TripReceipts.

views Module

class trips.views.AddTripEntryView[source]

Extend the AddApprovableEntryView to apply to TripEntries.

This view adds an additional formset, the TripStoreTransactionFormSet.

entry_class

alias of TripEntry

entry_form_class

alias of TripEntryForm

receipt_class

alias of TripReceipt

trips.views.add_trip_entry(request, entry_id=None, template_name='trips/form.html')[source]

Add, edit, approve or delete a TripEntry.

trips.views.list_trip_entries(request, *args, **kwargs)[source]

Retrieve every TripEntry.

trips.views.show_trip_entry(request, entry_id, template_name='trips/detail.html')[source]

View a TripEntry.