endi.models.progress_invoicing package¶
Subpackages¶
- endi.models.progress_invoicing.services package
- Submodules
- endi.models.progress_invoicing.services.invoicing module
- endi.models.progress_invoicing.services.status module
BaseProductStatusServiceBaseProductStatusService.get_cost()BaseProductStatusService.get_current_percent_left()BaseProductStatusService.get_or_create()BaseProductStatusService.invoiced_ht()BaseProductStatusService.invoiced_percentage()BaseProductStatusService.is_completely_invoiced()BaseProductStatusService.total_deposit()BaseProductStatusService.total_ht_left()BaseProductStatusService.total_ht_to_invoice()BaseProductStatusService.total_ttc_to_invoice()BaseProductStatusService.tva_to_invoice()
ChapterStatusServiceProductStatusServiceWorkItemStatusServiceWorkItemStatusService.get_cost()WorkItemStatusService.get_or_create()WorkItemStatusService.invoiced_ht()WorkItemStatusService.invoiced_percentage()WorkItemStatusService.is_completely_invoiced()WorkItemStatusService.sync_with_plan()WorkItemStatusService.total_deposit()WorkItemStatusService.total_ht_left()WorkItemStatusService.total_ht_to_invoice()WorkItemStatusService.total_ttc_to_invoice()WorkItemStatusService.tva_to_invoice()
WorkStatusService
- Module contents
Submodules¶
endi.models.progress_invoicing.invoicing module¶
Progress invoicing Invoicing models¶
Models bound to an invoice that stores the data related to progressing invoice Final Invoice are kept in sync with the model here under
Main schema
- Invoice <-> ProgressInvoicingPlan
- TaskLineGroup <-> ProgressInvoicingChapter
- TaskLine <-> ProgressInvoicingProduct
- ProgressInvoicingWork
ProgressInvoicingWorkItem
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingBaseProduct(**kwargs)¶
Bases :
Base,TimeStampedMixin- already_invoiced¶
- base_status_id¶
- chapter¶
- chapter_id¶
- created_at¶
- gen_cancelinvoice_product()¶
- get_percent_left()¶
- id¶
- on_before_commit(request, state='update', attributes=None)¶
Méthode lancée avant de commiter la transaction qui modifie l’élément courant
- order¶
- percentage¶
- property plan¶
- status¶
- sync_with_task(task_line_group=None)¶
Generates the TaskLine/TaskLineGroup based on the current ProgressInvoicingPlan
- property task¶
- task_line¶
- task_line_id¶
- type_¶
- updated_at¶
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingChapter(**kwargs)¶
Bases :
Base,TimeStampedMixin- created_at¶
- gen_cancelinvoice_chapter(cinv_plan)¶
- id¶
- order¶
- plan¶
- plan_id¶
- products¶
- status¶
- status_id¶
- sync_with_task(task=None)¶
Generates the TaskLine/TaskLineGroup based on the current ProgressInvoicingPlan
- property task¶
- task_line_group¶
- task_line_group_id¶
- updated_at¶
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingPlan(**kwargs)¶
Bases :
BaseAssociated to an invoice
- business¶
- business_id¶
- chapters¶
- gen_cancelinvoice_plan(cancelinvoice)¶
- has_deposit()¶
- id¶
- sync_with_task(task=None)¶
Generates the TaskLine/TaskLineGroup based on the current ProgressInvoicingPlan
- task¶
- task_id¶
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingProduct(**kwargs)¶
Bases :
ProgressInvoicingBaseProduct- already_invoiced¶
- base_status_id¶
- chapter¶
- chapter_id¶
- created_at¶
- id¶
- order¶
- percentage¶
- status¶
- task_line¶
- task_line_id¶
- type_¶
- updated_at¶
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingWork(**kwargs)¶
Bases :
ProgressInvoicingBaseProduct- already_invoiced¶
- base_status_id¶
- chapter¶
- chapter_id¶
- created_at¶
- gen_cancelinvoice_product()¶
- get_percent_left()¶
- id¶
- items¶
- locked¶
- order¶
- percentage¶
- status¶
- task_line¶
- task_line_id¶
- type_¶
- unlock()¶
- updated_at¶
- class endi.models.progress_invoicing.invoicing.ProgressInvoicingWorkItem(**kwargs)¶
Bases :
Base,TimeStampedMixin- already_invoiced¶
- base_status_id¶
- created_at¶
- gen_cancelinvoice_work_item()¶
- get_percent_left()¶
- id¶
- on_before_commit(request, state='update', attributes=None)¶
Méthode lancée avant de commiter la transaction qui modifie l’élément courant
- order¶
- percentage¶
- property plan¶
- status¶
- property task¶
- total_ttc(ht=None) int¶
Compute the total ttc
- Paramètres:
ht (int) – HT already computed (to avoid too much compute)
- total_tva(ht=None) int¶
Compute the amount of Tva
- Paramètres:
ht (int) – HT already computed (to avoid too much compute)
- updated_at¶
- work¶
- work_id¶
endi.models.progress_invoicing.status module¶
Progress Invoicing Status models
In a business this models are used
To store the percentages that should be invoiced
- To link invoicing elements with the original estimation’s (or price_study in case
of WorkItems) elements
PriceStudy <-> Estimation <-> Business
PriceStudyChapter <-> TaskLineGroup <-> ProgressInvoicingChapterStatus
PriceStudyProduct <-> TaskLine <-> ProgressInvoicingProductStatus PriceStudyWork ProgressInvoicingWorkStatus
PriceStudyWorkItem <———-> ProgressInvoicingWorkItem
- class endi.models.progress_invoicing.status.ProgressInvoicingBaseProductStatus(**kwargs)¶
Bases :
BaseBase Progress Invoicing Status used to remember which percentage of which element has been invoiced yet
Linked to a Chapter status
Uses two reference percentage
percent_left
starts at 100% and correspond to the progress invoicing (discussed with the customer)
percent_to_invoice
100% - account_percent and correspond to the percentage to be considered in the progress invoicing
- chapter_status¶
- chapter_status_id¶
- get_cost(ui_percentage, product, percent_left)¶
Compute the cost corresponding to ui_percentage for the given product
- classmethod get_or_create(source_task_line, chapter_status, percent_to_invoice)¶
Retrieve or create a new status entry for the given source item
- get_percent_left()¶
Compute the percent left regarding the current status (also when an invoice is currently edited)
- Type renvoyé:
float or None
- has_deposit()¶
Return True if a deposit has been deduced from the original HT amount
- id¶
- invoiced_elements¶
- invoiced_ht(product=None)¶
Compute the total ht that was already invoiced Before product if provided
- Paramètres:
product (obj) – ProgressInvoicingProduct
- invoiced_percentage(product=None)¶
Compute the percentage that was already invoiced Before product if provided
- Paramètres:
product (obj) – ProgressInvoicingProduct
- is_completely_invoiced()¶
- percent_left¶
- percent_to_invoice¶
- source_task_line¶
- source_task_line_id¶
- sync_with_plan(progress_invoicing_chapter)¶
Sync the current product status with the given plan
Generates the ProgressInvoicingProduct
- total_deposit()¶
- total_ht_left()¶
Compute the total ht regarding the current status (also when an invoice is currently edited)
- Type renvoyé:
- total_ht_to_invoice()¶
Compute the total ht to invoice without deposit amount
- Renvoie:
The HT amount in 10^5 format
- Type renvoyé:
- total_ttc_to_invoice()¶
Compute the total ttc to invoice without deposit amount
- Renvoie:
The ttc amount in 10^5 format
- Type renvoyé:
- tva_to_invoice()¶
Compute the tva to invoice without deposit amount
- Renvoie:
The tva amount in 10^5 format
- Type renvoyé:
- type_¶
- class endi.models.progress_invoicing.status.ProgressInvoicingChapterStatus(**kwargs)¶
Bases :
BaseInvoicing Status corresponding to a TaskLineGroup / Chapter
Linked to a business
Used to keep a reference to the original Estimation(s) Structure
- business¶
- business_id¶
- classmethod get_or_create(business, task_line_group)¶
Retrieve or create a new status entry for the given source item
- Paramètres:
business (obj) – The current Business we’re working in
task_line_group (obj) – The original Estimation’s TaskLineGroup we refer to
- id¶
- invoiced_elements¶
- is_completely_invoiced()¶
- product_statuses¶
- source_task_line_group¶
- source_task_line_group_id¶
- sync_with_plan(progress_invoicing_plan)¶
Sync the current chapter status with the given plan
Generates the ProgressInvoicingChapter associated to it and all of its products
- class endi.models.progress_invoicing.status.ProgressInvoicingProductStatus(**kwargs)¶
Bases :
ProgressInvoicingBaseProductStatusStatus attached to a single product TaskLine (not one associated to a PriceStudyWorkItem)
- chapter_status¶
- chapter_status_id¶
- id¶
- invoiced_elements¶
- percent_left¶
- percent_to_invoice¶
- source_task_line¶
- source_task_line_id¶
- type_¶
- class endi.models.progress_invoicing.status.ProgressInvoicingWorkItemStatus(**kwargs)¶
Bases :
Base- get_cost(ui_percentage, work_item, percent_left)¶
Compute the cost corresponding to ui_percentage for the given work_item
- classmethod get_or_create(price_study_work_item, work_status, percent_to_invoice)¶
Get or create a new instance associated to a price_study_work_item and a work_status
- get_percent_left()¶
Compute the percent left regarding the current status (also when an invoice is currently edited)
- Type renvoyé:
float or None
- has_deposit()¶
Return True if a deposit has been deduced from the original HT amount
- id¶
- invoiced_elements¶
- invoiced_ht(work_item=None)¶
Compute the total ht that was already invoiced Before work_item if provided
- Paramètres:
work_item (obj) – ProgressInvoicingWorkITem
- invoiced_percentage(work_item=None)¶
Compute the percentage that was already invoiced Before work_item if provided
- Paramètres:
work_item (obj) – ProgressInvoicingWorkITem
- is_completely_invoiced()¶
- percent_left¶
- percent_to_invoice¶
- price_study_work_item¶
- price_study_work_item_id¶
- sync_with_plan(progress_invoicing_work)¶
Sync the current work_item status with the given plan
Generates the ProgressInvoicingWorkITem
- total_deposit()¶
- total_ht_left()¶
Compute the total ht regarding the current status (also when an invoice is currently edited)
- Type renvoyé:
- total_ht_to_invoice()¶
Compute the total ht to invoice without deposit amount
- Renvoie:
The HT amount in 10^5 format
- Type renvoyé:
- total_ttc_to_invoice()¶
Compute the total ttc to invoice without deposit amount
- Renvoie:
The ttc amount in 10^5 format
- Type renvoyé:
- tva_to_invoice()¶
Compute the tva to invoice without deposit amount
- Renvoie:
The tva amount in 10^5 format
- Type renvoyé:
- work_status¶
- work_status_id¶