Class NextDueDate
Standard implementation of the plugin that calculates next due date for sales
Implements
Inherited Members
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
[NextDueDatePlugin("nextduedate", -1073741824)]
public class NextDueDate : NextDateBase, INextDueDatePlugin
Constructors
NextDueDate()
Standard implementation of the plugin that calculates next due date for sales
Declaration
public NextDueDate()
Fields
ProviderName
Standard implementation of the plugin that calculates next due date for sales
Declaration
public const string ProviderName = "nextduedate"
Field Value
| Type | Description |
|---|---|
| string |
Methods
BatchUpdateNextDueDateAsync(ProgressEstimateCallback, ProgressStepCallback, CancellationToken)
Update the Next Due Date date/appointmentId of all Sales; callable in unauthenticated mode
Declaration
public Task BatchUpdateNextDueDateAsync(ProgressEstimateCallback estimateCB, ProgressStepCallback stepCB, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ProgressEstimateCallback | estimateCB | Callback for setting the estimated total of the progress bar |
| ProgressStepCallback | stepCB | Callback for stepping the progress bar |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
This method uses the RawConnection mode of the ConnectionFactory so that it can be called during a database upgrade, when system users are unknown.
It looks at all relevant appointment records to set the next due date of each sale.CalculateNextDueDateAsync(int, CancellationToken)
Calculates the next due date for a given sale. This method takes into account the status of the sale.
Declaration
public Task<NextDateInfo> CalculateNextDueDateAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | Identifies the sale for which you want to calculate the next due date |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<NextDateInfo> | The DateTime representing the next due date for the supplied sale identifier |
Remarks
If a sale is stalled, the next due date will be the re-open date. If the sale is done, the next due date will be the sale date. The same is the case when no valid appointments can be found for a given sale.
GetNextDueAppointmentDateAsync(int, CancellationToken)
Gets the active date from the first appointment associated with the specified sale. This method does not take into account the status of the sale.
Declaration
public Task<NextDateInfo> GetNextDueAppointmentDateAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | Identifies the sale for which you want to calculate the next due date |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<NextDateInfo> | The DateTime representing the next due date for the supplied sale identifier |
Remarks
We loop through all the appointments for a sale and find the first one that has not been completed and is not a child appointment.
GetOrderbyField(AppointmentTableInfo)
Standard implementation of the plugin that calculates next due date for sales
Declaration
protected override FieldInfo GetOrderbyField(AppointmentTableInfo tableInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentTableInfo | tableInfo |
Returns
| Type | Description |
|---|---|
| FieldInfo |