endi.models.task.services package¶
Submodules¶
endi.models.task.services.estimation module¶
- class endi.models.task.services.estimation.EstimationInvoicingService¶
Bases :
objectService managing invoice generation for estimations
- classmethod gen_deposit_invoice(request, estimation, user)¶
Generate a deposit invoice based on the given estimation
- Paramètres:
estimation (obj) – The estimation we’re starting from
user (obj) – The user generating the new document
- Renvoie:
A new Invoice / InternalInvoice
- Type renvoyé:
class:Invoice
- classmethod gen_intermediate_invoice(request, estimation, payment_line, user)¶
Generate an intermediate invoice based on the given payment_line definition
- Paramètres:
estimation (obj) – The estimation we’re starting from
payment_line (obj) – The PaymentLine describing the invoice
user (obj) – The user generating the new document
- Renvoie:
A new Invoice/InternalInvoice object
- Type renvoyé:
class:Invoice
- classmethod gen_sold_invoice(request, estimation, user)¶
Generate a sold invoice based on the given estimation definition
- Paramètres:
estimation (obj) – The estimation we’re starting from
user (obj) – The user generating the new document
- Renvoie:
A new Invoice/Internal object
- Type renvoyé:
class:Invoice
- classmethod gen_sold_price_study(request, estimation, invoice, intermediate_task_lines)¶
Generate a price study attached to the sold invoice compiling the estimation informations and the intermediary invoices
- class endi.models.task.services.estimation.EstimationService¶
Bases :
TaskService- classmethod cache_totals(request, task_obj)¶
- classmethod duplicate(request, original, user, **kw)¶
Base duplicate tool common for all invoice/estimation types
- classmethod get_customer_task_factory(customer)¶
return the appropriate task factory for the given customer
- classmethod on_before_commit(request, task, action: str, changes: dict)¶
Run some actions before modifications applied to the Task are run
- classmethod update_payment_lines(estimation, request, payment_times=None)¶
Update the payment lines
- Paramètres:
estimation (obj) – Estimation instance
provided params are used to know what to update, we use the estimation’s attributes
- class endi.models.task.services.estimation.InternalEstimationInvoicingService¶
Bases :
EstimationInvoicingService
- class endi.models.task.services.estimation.InternalEstimationProcessService¶
Bases :
InternalProcessService
- class endi.models.task.services.estimation.InternalEstimationService¶
Bases :
EstimationService
endi.models.task.services.invoice module¶
- class endi.models.task.services.invoice.CancelInvoiceService¶
Bases :
TaskService- classmethod get_customer_task_factory(customer)¶
return the appropriate task factory for the given customer
- classmethod get_price_study(task)¶
- classmethod has_price_study(task)¶
- class endi.models.task.services.invoice.InternalCancelInvoiceProcessService¶
Bases :
InternalProcessService
- class endi.models.task.services.invoice.InternalInvoiceProcessService¶
Bases :
InternalProcessService
- class endi.models.task.services.invoice.InternalInvoiceService¶
Bases :
InvoiceService
- class endi.models.task.services.invoice.InvoiceService¶
Bases :
TaskService- classmethod duplicate(request, original, user, **kw)¶
Base duplicate tool common for all invoice/estimation types
- classmethod gen_cancelinvoice(request, invoice, user)¶
- classmethod get_customer_task_factory(customer)¶
return the appropriate task factory for the given customer
endi.models.task.services.invoice_official_number module¶
- class endi.models.task.services.invoice_official_number.InternalInvoiceNumberService¶
Bases :
AbstractNumberService- classmethod get_sequences_map()¶
- returns: must include following keys“SEQGLOBAL”, “SEQYEAR”,
“SEQMONTH”, “SEQMONTHANA”
- class endi.models.task.services.invoice_official_number.InvoiceNumberService¶
Bases :
AbstractNumberService- classmethod get_sequences_map()¶
- returns: must include following keys“SEQGLOBAL”, “SEQYEAR”,
“SEQMONTH”, “SEQMONTHANA”
endi.models.task.services.payment module¶
- class endi.models.task.services.payment.InternalPaymentRecordService(context, request)¶
Bases :
object- add(invoice, params)¶
Record a new payment instance
- Paramètres:
user (obj) – The User asking for recording
invoice (obj) – The associated invoice object
params (dict) – params used to generate the payment
- delete(payment)¶
Delete an existing payment
- Paramètres:
payment (obj) – The InternalPayment instance to delete
- Renvoie:
True/False if the deletion succeeded
- Type renvoyé:
endi.models.task.services.task module¶
- class endi.models.task.services.task.DiscountLineService¶
Bases :
object- classmethod from_price_study_discount(price_study_discount)¶
- classmethod on_before_commit(request, discount, state, attributes=None)¶
Handle actions before commit
- Paramètres:
(default None)
- class endi.models.task.services.task.InternalProcessService¶
Bases :
objectManage the processing of internal documents inside enDI
- classmethod sync_with_customer(document, request)¶
Synchronize the current internal document creating its counterpart in the customer’s environment
- Paramètres:
request (obj) – The PyramidRequest
document (obj) – The endi internal Task instance
- class endi.models.task.services.task.PostTTCLineService¶
Bases :
object- classmethod on_before_commit(request, post_ttc_line, state, attributes=None)¶
Handle actions before commit
- class endi.models.task.services.task.TaskLineGroupService¶
Bases :
object- classmethod duplicate(group)¶
- classmethod from_price_study_product(group_class, product)¶
- classmethod from_sale_product_work(group_class, product, document=None)¶
- classmethod gen_cancelinvoice_group(request, group)¶
- classmethod on_before_commit(request, task_line_group, state, attributes=None)¶
Handle actions before commit
- Paramètres:
(default None)
- class endi.models.task.services.task.TaskLineService¶
Bases :
object- classmethod duplicate(task_line)¶
- classmethod from_price_study_product(line_class, product)¶
- classmethod from_price_study_work(line_class, product_work)¶
- classmethod from_price_study_work_item(line_class, work_item)¶
- classmethod from_sale_product(line_class, sale_product, document=None)¶
- classmethod from_sale_product_work_item(line_class, work_item, document=None)¶
- classmethod gen_cancelinvoice_line(task_line)¶
- classmethod on_before_commit(request, task_line, state, attributes=None)¶
Handle actions before commit
- class endi.models.task.services.task.TaskService¶
Bases :
object- classmethod cache_totals(request, task_obj)¶
- classmethod duplicate(request, original, user, **kw)¶
Base duplicate tool common for all invoice/estimation types
- classmethod find_task_status_date(taskclass, official_number: str, year: Optional[int] = None)¶
Query the database to retrieve a task with the given number and year and returns its status_date
- classmethod format_amount(task, amount, trim=True, grouping=True, precision=2)¶
Return a formatted amount in the context of the current task
if the amount is not supposed to be trimmed, we retrieve the Task’s decimal_to_show and pass it to the format_amount function
- Paramètres:
task (obj) – Instance of class <endi.models.task.Task>
amount (int) – The amount for format
- classmethod get_customer_task_factory(customer)¶
return the appropriate task factory for the given customer
- classmethod get_rate(task, rate_name: str) float¶
Récupère un taux à appliquer en fonction du nom du module d’écriture comptable concerné
- Paramètres:
task (obj) – Facture/Avoir
rate_name (str) – Le nom du module d’écriture pour lequel on
récupère le taux
- Type renvoyé:
float or None
- classmethod get_rate_level(task, rate_name: str) str¶
Récupère le niveau auquel le taux à appliquer est défini
- Paramètres:
task (obj) – Facture/Avoir
rate_name (str) – Le nom du module d’écriture pour lequel on
récupère le taux
- Type renvoyé:
float or None
- classmethod get_task_class()¶
- classmethod get_tva_objects(task_obj)¶
- Paramètres:
task_obj – The Task object we want to collect tvas for
- Renvoie:
tva stored by amount
- Type renvoyé:
- static get_valid_estimations(cls, *args)¶
- classmethod get_valid_invoices(task_cls, *args, **kwargs)¶
- classmethod get_waiting_estimations(*args)¶
- classmethod get_waiting_invoices(task_cls, *args)¶
- classmethod json_totals(request, task) dict¶
Build a dict with the different computed values concerning this task
- Paramètres:
request (obj) – The pyramid request
task (obj) – Task instance
- models = None¶
- classmethod on_before_commit(request, task, action: str, changes: dict)¶
Run some actions before modifications applied to the Task are run
- classmethod post_duplicate(request, original, created, user, **kw)¶
To be called by subclasses
- classmethod set_price_study(request, task)¶
Initialize a price study using the task’s current datas
- classmethod set_progress_invoicing_plan(request, task)¶
Initialize a price study using the task’s current datas
- classmethod unset_price_study(request, task)¶
Remove the price study and ensure the task has the appropriate line groups
- classmethod unset_progress_invoicing_plan(request, task)¶
Remove the price study and ensure the task has the appropriate line groups