Part of stoqlib.domain.till View In Hierarchy
The operations that are recorded in a Till:
Each operation is associated with a TillEntry
.
You can only open a Till once per day, and you cannot open a new till before you closed the previously opened one.
Instance Variables | initial_cash_amount | The total amount we have in the moment we are opening the till. |
final_cash_amount | The total amount we have in the moment we are closing the till. | |
opening_date | When the till was opened or None if it has not yet been opened. | |
closing_date | When the till was closed or None if it has not yet been closed | |
station | the station associated with the till, eg the computer which opened it. | |
Class Variables | STATUS_PENDING | this till is created, but not yet opened |
STATUS_OPEN | this till is opened and we can make sales for it. | |
STATUS_CLOSED | end of the day, the till is closed and no more financial operations can be done in this store. |
Class Method | get_current | Fetches the Till for the current station. |
Class Method | get_last_opened | Fetches the last Till which was opened. |
Method | open_till | Open the till. |
Method | close_till | This method close the current till operation with the confirmed |
Method | add_entry | Adds an entry to the till. |
Method | add_debit_entry | Add debit to the till |
Method | add_credit_entry | Add credit to the till |
Method | needs_closing | Checks if there's an open till that needs to be closed before |
Method | get_balance | Returns the balance of all till operations plus the initial amount |
Method | get_cash_amount | Returns the total cash amount on the till. That includes "extra" |
Method | get_entries | Fetches all the entries related to this till |
Method | get_credits_total | Calculates the total credit for all entries in this till |
Method | get_debits_total | Calculates the total debit for all entries in this till |
Method | _get_last_closed_till | Undocumented |
Method | _add_till_entry | Undocumented |
Inherited from Domain:
Method | __init__ | Undocumented |
Method | _create | Undocumented |
Method | user | Undocumented |
Class Method | iselect | Like select, but search on the adapter implementing the interface iface |
Class Method | iselectBy | Like selectBy, but search on the adapter implementing the interface iface |
Class Method | iselectOne | Like selectOne, but search on the adapter implementing the interface iface |
Class Method | iselectOneBy | Like selectOneBy, but search on the adapter implementing the interface iface |
Class Method | iget | Like get, but gets on the adapter implementing the interface iface |
Inherited from AbstractModel (via Domain, BaseDomain):
Method | __ne__ | Undocumented |
Method | __eq__ | Undocumented |
Method | _SO_setValue | Undocumented |
Method | clone | Get a persistent copy of an existent object. Remember that we can |
Method | get_connection | Undocumented |
Inherited from AdaptableORMObject (via Domain):
Class Method | registerFacet | Registers a facet for class cls. |
Inherited from Adaptable (via Domain, AdaptableORMObject):
Class Method | getFacetType | Fetches a facet type associated with an interface, or raise |
Class Method | getFacetTypes | Returns facet classes for this object |
Method | addFacet | Adds a facet implementing iface for the current object |
Method | removeFacet | Removes a facet from the current object |
Method | getFacets | Gets a list of facets assoicated with the current object. |
Parameters | conn | a database connection |
Returns | a Till instance or None |
Parameters | conn | a database connection |
It can only be done once per day. The final cash amount of the previous till will be used as the initial value in this one after opening it.
Parameters | removed |
Parameters | payment | |
Returns | till entry representing the added debit
(type: TillEntry
) |
Parameters | value | amount to add |
reason | description of payment | |
Returns | till entry representing the added debit
(type: TillEntry
) |
Parameters | value | amount to add |
reason | description of payment | |
Returns | till entry representing the added credit
(type: TillEntry
) |
Returns | True if it needs to be closed, otherwise false |
Returns | the balance (type: currency ) |
Returns | the cash amount on the till (type: currency ) |
Returns | all entries
(type: sequence of TillEntry
) |
Returns | total credit (type: currency ) |