endi.models.accounting package

Submodules

endi.models.accounting.accounting_closures module

class endi.models.accounting.accounting_closures.AccountingClosure(**kwargs)

Bases : Base

Accounting closure class to store information about closures :param year: year of the closure :param active: default value will be false, value will be true after cosure :param datetime: the date and time where it has been closed (if empty, was never closed)

active
datetime
id
year

endi.models.accounting.balance_sheet_measures module

class endi.models.accounting.balance_sheet_measures.ActiveBalanceSheetMeasureType(**kwargs)

Bases : BalanceSheetMeasureType

account_prefix
active
category
category_id
id
invert_default_cd_or_dc
is_total
label
measures
order
total_type
type_
class endi.models.accounting.balance_sheet_measures.BalanceSheetMeasure(**kwargs)

Bases : BaseAccountingMeasure

Stores a treasury_measure measure associated to a given company

grid_id
id
label
measure_type
measure_type_id
order
type_
value
class endi.models.accounting.balance_sheet_measures.BalanceSheetMeasureGrid(**kwargs)

Bases : BaseAccountingMeasureGrid

A grid of measures, one grid per month/year couple

company
company_id
date
datetime
classmethod get_grid_from_year(company_id, year)
id
classmethod last(company_id)
measures
type_
upload
upload_id
class endi.models.accounting.balance_sheet_measures.BalanceSheetMeasureType(**kwargs)

Bases : BaseAccountingMeasureType

Balance sheet measure type

account_prefix
active
category
category_id
static default_sign()
id
invert_default_cd_or_dc
is_total
label
measures
order
total_type
type_
class endi.models.accounting.balance_sheet_measures.PassiveBalanceSheetMeasureType(**kwargs)

Bases : BalanceSheetMeasureType

account_prefix
active
category
category_id
id
invert_default_cd_or_dc
is_total
label
measures
order
total_type
type_

endi.models.accounting.base module

Base measure types

Used for IncomeStatementMeasures, TreasuryMeasures …

class endi.models.accounting.base.BaseAccountingMeasure(**kwargs)

Bases : Base

Stores an accounting measure associated to a given grid

classmethod get_measure_types(grid_id)

Collect all measure types used in the given grid

get_value()
grid_id
id
label
measure_type
measure_type_id
order
type_
value
class endi.models.accounting.base.BaseAccountingMeasureGrid(**kwargs)

Bases : Base

A grid of measures, one grid per month/year couple

company
company_id
datetime
get_company_id()
get_measure_by_type(measure_type_id)
classmethod get_years(company_id=None)
id
measures
type_
upload
upload_id
class endi.models.accounting.base.BaseAccountingMeasureType(**kwargs)

Bases : Base

account_prefix
active
category
category_id
compute_total(category_totals)

Compile a total value based on the given category totals

Paramètres:

category_totals (dict) – Totals stored by category labels

Renvoie:

The compiled total

Type renvoyé:

int

static default_sign()
classmethod get_by_category(category_id, key=None)

Collect BaseAccountingMeasureType associated to the given category

Paramètres:
  • category_id (int) – The id to check for

  • key (str) – The key to load (if we want to restrict the query

Type renvoyé:

list

get_categories()

Return the categories configured in case of a total type

Type renvoyé:

list of BaseAccountingMeasureTypeCategory instances

get_categories_labels()

Return the labels of the categories attached to this instance :rtype: list

classmethod get_next_order()
Renvoie:

The next available order

Type renvoyé:

int

classmethod get_next_order_by_category(category_id)
Paramètres:

category_id (int) – The id of the category to check for

Renvoie:

The next order available in types from the given category

Type renvoyé:

int

classmethod get_types(active=True, keys=())
id
classmethod insert(item, new_order)

Place the item at the given index in the hierarchy of items of the same category

Paramètres:
  • item (obj) – The item to place

  • new_order (int) – The index where to place the item

invert_default_cd_or_dc
property is_computed_total
Renvoie:

True if this type is a computed total (mix of other values)

Type renvoyé:

bool

is_total
label
match(account)

Check if the current Type definition matches the given account number

Paramètres:

account (str) – A string representing an accounting account (e.g: 42500000)

Renvoie:

True or False if it matches

Type renvoyé:

bool

measures
move_down()

Move the current instance down in the category’s order

move_up()

Move the current instance up in the category’s order

order
classmethod reorder(category_id)

Regenerate order attributes :param int category_id: The category to manage

sign()
total_type
type_
class endi.models.accounting.base.BaseAccountingMeasureTypeCategory(**kwargs)

Bases : Base

Base Categories for joining the different measure types

active
attached_types
classmethod get_by_label(label, active=True)
Paramètres:
  • label (str) – The label to retrieve

  • active (bool) – Only check in active items

Renvoie:

An IncomeStatementMeasureTypeCategory or None

Type renvoyé:

class or None

classmethod get_categories(active=True, keys=())
Paramètres:
  • active (bool) – Only load active categories

  • keys (tuple) – The keys to load (list of str)

Renvoie:

BaseAccountingMeasureTypeCategory ordered by order key

Type renvoyé:

list

classmethod get_next_order()
Renvoie:

The next available order

Type renvoyé:

int

id
classmethod insert(item, new_order)

Place the item at the given index

Paramètres:
  • item (obj) – The item to move

  • new_order (int) – The new index of the item

label
move_down()

Move the current instance down in the category’s order

move_up()

Move the current instance up in the category’s order

order
classmethod reorder()

Regenerate order attributes

type_

endi.models.accounting.bookeeping module

class endi.models.accounting.bookeeping.CustomInvoiceBookEntryModule(**kwargs)

Bases : Base

An Invoice Export module configuration

Paramètres:
  • compte_cg_credit – The account used for “credit”

  • compte_cg_debit – The account used for “debit”

  • label_template – The label template used for this module

  • percentage (int) – The percentage that should be used in this module

active
compte_cg_credit
compte_cg_debit
custom
doctype
enabled
classmethod get_by_name(name, prefix='')
classmethod get_percentage(key, prefix='')
help_msg = 'Configurez des modules de contribution personnalisés.\nCeux-ci viennent apporter de nouvelles lignes de contribution dans les exports des factures.\n        <h4>Configuration</h4>        <ul>         <li>Un titre</li>        <li>Le compte général auquel la contribution est associé</li>        <li>Le compte de contrepartie</li>        <li>Un gabarit pour la génération des libellés (voir ci-dessous pour les variables associées)</li>        <li>Un taux de contribution (pourcentage prélevé sur le <b>HT</b>)        </li>        </ul>        <p>        Pour chaque module, 8 lignes seront générées (4 lignes analytiques et 4 lignes générales).\n        Le montant du débit et du crédit seront calculés selon le pourcentage indiqué (taux de contribution).        </p>\n        <h4>Variables utilisables dans les gabarits de libellés</h4>        <p>Il est possible de personaliser les libellés comptables à l\'aide d\'un gabarit. Plusieurs variables sont disponibles :</p>        <ul>        <li><code>{invoice.customer.label}</code> : nom du client facturé</li>        <li><code>{invoice.customer.code}</code> : code du client facturé</li>        <li><code>{company.name}</code> : nom de l\'enseigne destinataire du paiement</li>        <li><code>{company.code_compta}</code> : code analytique de l\'enseigne destinataire du paiement</li>        <li><code>{invoice.official_number}</code> : numéro de facture (pour tronquer à 9 caractères : <code>{invoice.official_number:.9}</code>)</li>        </ul>\n        <p>NB : Penser à séparer les variables, par exemple par des espaces, sous peine de libellés peu lisibles.</p>        <h4>Utilisation des variables</h4>        ex : "Contribution {entreprise.name} {client.name} {numero_facture}"\n    '
id
label_template
name
percentage
classmethod query(include_inactive=False, *args)

return a query

title

endi.models.accounting.general_ledger_account_wordings module

class endi.models.accounting.general_ledger_account_wordings.GeneralLedgerAccountWording(**kwargs)

Bases : Base

Model storing correspondences between account number and wording to display in the general ledger view :param account_number: account number :param wording: corresponding wording

account_number
id
wording

endi.models.accounting.income_statement_measures module

class endi.models.accounting.income_statement_measures.IncomeStatementMeasure(**kwargs)

Bases : BaseAccountingMeasure

Stores a income_statement measure associated to a given company

grid_id
id
label
measure_type
measure_type_id
order
type_
value
class endi.models.accounting.income_statement_measures.IncomeStatementMeasureGrid(**kwargs)

Bases : BaseAccountingMeasureGrid

A grid of measures, one grid per month/year couple

company
company_id
datetime
id
measures
month
type_
updated_at
upload
upload_id
year
class endi.models.accounting.income_statement_measures.IncomeStatementMeasureType(**kwargs)

Bases : BaseAccountingMeasureType

IncomeStatement measure type

account_prefix
active
category
category_id
static default_sign()
id
invert_default_cd_or_dc
is_total
label
measures
order
total_type
type_
class endi.models.accounting.income_statement_measures.IncomeStatementMeasureTypeCategory(**kwargs)

Bases : BaseAccountingMeasureTypeCategory

Categories joining different IncomeStatementMeasureTypes

active
attached_types
id
label
order
type_

endi.models.accounting.operations module

class endi.models.accounting.operations.AccountingOperation(**kwargs)

Bases : Base

analytical_account
balance
company
company_id
credit
date
debit
general_account
id
label
total()
upload_id
class endi.models.accounting.operations.AccountingOperationUpload(**kwargs)

Bases : Base, TimeStampedMixin

Represent a newly parsed file

ANALYTICAL_BALANCE = 'analytical_balance'
GENERAL_LEDGER = 'general_ledger'
SYNCHRONIZED_ACCOUNTING = 'synchronized_accounting'
created_at
date
filename
filetype
property filetype_label
id
md5sum
measure_grids
operations
updated_at

endi.models.accounting.services module

class endi.models.accounting.services.BalanceSheetMeasureGridService

Bases : BaseAccountingMeasureGridService

classmethod get_grid_from_year(grid_class, company_id, year)
classmethod get_years(grid_class, company_id=None)
classmethod last(grid_class, company_id)
class endi.models.accounting.services.BaseAccountingMeasureGridService

Bases : object

classmethod get_measure_by_type(grid, measure_type_id)
class endi.models.accounting.services.BaseAccountingMeasureService

Bases : object

classmethod get_measure_types(measure_class, grid_id, type_class)
class endi.models.accounting.services.IncomeStatementMeasureGridService

Bases : BaseAccountingMeasureGridService

classmethod get_years(grid_class, company_id=None)
class endi.models.accounting.services.TreasuryMeasureGridService

Bases : BaseAccountingMeasureGridService

classmethod get_years(grid_class, company_id=None)
classmethod last(grid_class, company_id)

endi.models.accounting.treasury_measures module

class endi.models.accounting.treasury_measures.TreasuryMeasure(**kwargs)

Bases : BaseAccountingMeasure

Stores a treasury_measure measure associated to a given company

grid_id
id
label
measure_type
measure_type_id
order
type_
value
class endi.models.accounting.treasury_measures.TreasuryMeasureGrid(**kwargs)

Bases : BaseAccountingMeasureGrid

A grid of measures, one grid per month/year couple

company
company_id
date
datetime
id
classmethod last(company_id)
measures
type_
upload
upload_id
class endi.models.accounting.treasury_measures.TreasuryMeasureType(**kwargs)

Bases : BaseAccountingMeasureType

Treasury measure type

account_prefix
active
category
category_id
static default_sign()
id
invert_default_cd_or_dc
is_total
label
measures
order
total_type
type_
class endi.models.accounting.treasury_measures.TreasuryMeasureTypeCategory(**kwargs)

Bases : BaseAccountingMeasureTypeCategory

Categories joining different TreasuryMeasureTypes

active
attached_types
id
label
order
type_

endi.models.accounting.types module

Module contents