Acquire.Accounting._receipt module

class Receipt(credit_note=None, authorisation=None, receipted_value=None)[source]

Bases: object

This class holds the receipt for a provisional transaction. This is sent by the credited account to receipt that the service has been performed, and thus payment that is held as liability should now be paid. OR it sends back the fact that the service was not performed, and so the refund should be issued

authorisation()[source]

Return the authorisation for the receipt

Returns:Authorisation for the receipt
Return type:Authorisation
static create(credit_notes, authorisation, receipted_value=None)[source]

Construct a series of receipts from the passed credit notes, each of which is authorised using the passed authorisation. If ‘receipted_value’ is specified, then the sum total of receipts will equal ‘receipted_value’. This cannot be greater than the sum of the passed credit notes. If it is less then the value, then the difference is subtracted from the first receipts returned

Parameters:
  • credit_notes (list) – List of credit notes to receipt
  • autorisation (Authorisation) – Authorisation for credit notes
  • receipted_value – Total value to receipt
credit_account_uid()[source]

Return the UID of the account to which this receipt will credit value

Returns:UID of account to credit
Return type:str
credit_note()[source]

Return the credit note that this is a receipt for

Returns:credit note related to this receipt
Return type:CreditNote
debit_account_uid()[source]

Return the UID of the account from which this receipt will debit value

Returns:UID of account to debit
Return type:str
debit_note_uid()[source]

Return the UID of the debit note that this is a receipt for

Returns:Debit note UID
Return type:str
static from_data(data)[source]

Return a Receipt from the passed JSON-decoded dictionary

Parameters:data (dict) – JSON dictionary to create object
Returns:Receipt created from JSON
Return type:Receipt
is_null()[source]

Return whether or not this Receipt is null

Returns:True if reecipt null, else False
Return type:bool
provisional_value()[source]

Return the original (provisional) value of the transaction

Returns:Value of this receipt
Return type:Decimal
receipted_value()[source]

Return the receipted value. This is guaranteed to be less than or equal to the provisional value in the attached CreditNote

Returns:Receipted value
Return type:Decimal
to_data()[source]

Return the data for this object as a dictionary that can be serialised to JSON

Returns:Dictionary created from this object
Return type:dict
transaction()[source]

Return a transaction that corresponds to the real transfer of value between the debit and credit accounts. The value of the transaction is the actual receipted value

Returns:Transaction corresponding to this receipt
Return type:Transaction
transaction_uid()[source]

Return the UID of the provisional transaction for which this is the receipt. The transaction UID is the same as the UID for the original debit note

Returns:UID of transaction
Return type:str
value()[source]

Return the original (provisional) value of the transaction

Returns:Value of this receipt
Return type:Decimal