endi.models.progress_invoicing.services package

Submodules

endi.models.progress_invoicing.services.invoicing module

class endi.models.progress_invoicing.services.invoicing.BaseProductService

Bases : object

classmethod on_before_commit(request, product, state='update', attributes=None)
classmethod sync_with_task(product, task_line_group=None) TaskLine
classmethod total_ht(product)
class endi.models.progress_invoicing.services.invoicing.ChapterService

Bases : object

classmethod sync_with_task(chapter, task=None, sync_products=True)
class endi.models.progress_invoicing.services.invoicing.PlanService

Bases : object

classmethod sync_with_task(plan, task=None)
class endi.models.progress_invoicing.services.invoicing.ProductService

Bases : BaseProductService

class endi.models.progress_invoicing.services.invoicing.WorkItemService

Bases : object

classmethod on_before_commit(request, work_item, state='update', attributes=None)

on before commit

  • we update the work locked status

  • we update the Task

classmethod total_ht(work_item)
classmethod total_ttc(work_item, ht=None)
classmethod total_tva(work_item, ht=None)
class endi.models.progress_invoicing.services.invoicing.WorkService

Bases : BaseProductService

classmethod on_before_commit(request, work, state='update', attributes=None)
classmethod total_ht(work)
classmethod unlock(work)

endi.models.progress_invoicing.services.status module

class endi.models.progress_invoicing.services.status.BaseProductStatusService

Bases : object

classmethod get_cost(status, ui_percentage, product, percent_left=None)

Calcule le total ht correspondant au pourcentage fourni

Cas 1 (on solde le produit) Si on atteint les 100%, on déduit le total déjà facturé du total à facturer

Cas 2 (facturation intermédiaire du produit) Sinon on calcule un montant en fonction du pourcentage

Paramètres:
  • status (obj) – The current ProgressInvoicingLineStatus

  • ui_percentage (float) – The percentage to apply

  • product (obj) – The product we are asking the cost for

  • percent_left (float) – The percentage to invoice before the

taskline we work on

classmethod get_current_percent_left(status)

Compute the percent left regarding the current status (also when an invoice is currently edited)

Type renvoyé:

float or None

classmethod get_or_create(status_class, source_task_line, chapter_status, percent_to_invoice)
classmethod invoiced_ht(status, product=None) int

Calcule le total ht déjà facturé Si un product est passé en paramètre, le calcul s’arrête avant ce produit

classmethod invoiced_percentage(status, product=None) int

Calcule le pourcentage déjà facturé Si un product est passé en paramètre, le calcul s’arrête avant ce product

Le pourcentage est exprimé au format UI (de 0 à 100 indépendamment de l’acompte)

classmethod is_completely_invoiced(status)
classmethod total_deposit(status)
classmethod total_ht_left(status)

Compute the total ht regarding the current status (also when an invoice is currently edited)

Type renvoyé:

int

classmethod total_ht_to_invoice(status)

Return the total ht to invoice

Paramètres:

status (obj) – The ProgressInvoicingLineStatus/

ProgressInvoicingGroupStatus

Renvoie:

The total ht to invoice in *10^5 format

Type renvoyé:

int

classmethod total_ttc_to_invoice(status)

Compute the total ttc to invoice

Paramètres:

status (obj) – The ProgressInvoicingLineStatus /

ProgressInvoicingGroupStatus

Renvoie:

The total ttc to invoice in *10^5 format

Type renvoyé:

int

classmethod tva_to_invoice(status)

Compute the tva amount to invoice

Paramètres:

status (obj) – The ProgressInvoicingLineStatus /

ProgressInvoicingGroupStatus

Renvoie:

The total tva to invoice in *10^5 format

Type renvoyé:

int

class endi.models.progress_invoicing.services.status.ChapterStatusService

Bases : object

classmethod get_or_create(status_class, business, source_task_line_group, **kwargs)

Get or create the status class related to the estimation « source_task_line »

classmethod is_completely_invoiced(status)
classmethod sync_with_plan(status, progress_invoicing_plan)

Sync the current chapter status with the given plan

Generates the ProgressInvoicingChapter

class endi.models.progress_invoicing.services.status.ProductStatusService

Bases : BaseProductStatusService

classmethod sync_with_plan(status, chapter)
class endi.models.progress_invoicing.services.status.WorkItemStatusService

Bases : object

classmethod get_cost(status, ui_percentage, work_item, percent_left=None)

Calcule le total ht correspondant au pourcentage fourni

Cas 1 (on solde le produit) Si on atteint les 100%, on déduit le total déjà facturé du total à facturer

Cas 2 (facturation intermédiaire du produit) Sinon on calcule un montant en fonction du pourcentage

Paramètres:
  • status (obj) – The current ProgressInvoicingWorkItemStatus

  • ui_percentage (float) – The percentage to apply

  • work_item (obj) – The wor k_item we are asking the cost for

  • percent_left (float) – The percentage to invoice before the

taskline we work on

classmethod get_or_create(status_class, price_study_work_item, work_status, percent_to_invoice)
classmethod invoiced_ht(status, work_item=None) int

Calcule le total ht déjà facturé Si un work_item est passé en paramètre, le calcul s’arrête avant ce produit

classmethod invoiced_percentage(status, work_item=None) int

Calcule le pourcentage déjà facturé Si un work_item est passé en paramètre, le calcul s’arrête avant ce work_item

Le pourcentage est exprimé au format UI (de 0 à 100 indépendamment de l’acompte)

classmethod is_completely_invoiced(status)
classmethod sync_with_plan(status, work)
classmethod total_deposit(status)
classmethod total_ht_left(status)

Compute the total ht regarding the current status (also when an invoice is currently edited)

Type renvoyé:

int

classmethod total_ht_to_invoice(status)

Return the total ht to invoice

Paramètres:

status (obj) – The ProgressInvoicingWorkItemStatus

Renvoie:

The total ht to invoice in *10^5 format

Type renvoyé:

int

classmethod total_ttc_to_invoice(status)

Compute the total ttc to invoice

Paramètres:

status (obj) – The ProgressInvoicingLineStatus /

ProgressInvoicingGroupStatus

Renvoie:

The total ttc to invoice in *10^5 format

Type renvoyé:

int

classmethod tva_to_invoice(status)

Compute the tva amount to invoice

Paramètres:

status (obj) – The ProgressInvoicingLineStatus /

ProgressInvoicingGroupStatus

Renvoie:

The total tva to invoice in *10^5 format

Type renvoyé:

int

class endi.models.progress_invoicing.services.status.WorkStatusService

Bases : BaseProductStatusService

classmethod get_cost(status, ui_percentage, work, percent_left=None)

Calcule le total ht correspondant au pourcentage fourni

Cas 1 (on solde le produit) Si on atteint les 100%, on déduit le total déjà facturé du total à facturer

Cas 2 (facturation intermédiaire du produit) Sinon on calcule un montant en fonction du pourcentage

Paramètres:
  • status (obj) – The current ProgressInvoicingLineStatus

  • ui_percentage (float) – The percentage to apply

  • product (obj) – The product we are asking the cost for

  • percent_left (float) – The percentage to invoice before the

taskline we work on

classmethod invoiced_ht(status, work=None)

Calcule le total ht déjà facturé Si un product est passé en paramètre, le calcul s’arrête avant ce produit

classmethod invoiced_percentage(status, product=None) int

Calcule le pourcentage déjà facturé Si un product est passé en paramètre, le calcul s’arrête avant ce product

Le pourcentage est exprimé au format UI (de 0 à 100 indépendamment de l’acompte)

classmethod is_completely_invoiced(status)
classmethod sync_with_plan(status, chapter)

Module contents