Class QuoteAgent
Proxy class for the Quote Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class QuoteAgent : IQuoteAgent, IAgent
Constructors
QuoteAgent(IFieldMetadataImplementation, IPriceListImplementation, IProductImplementation, IQuoteImplementation, IQuoteAlternativeImplementation, IQuoteConnectionImplementation, IQuoteEntityImplementation, IQuoteLineImplementation, IQuoteLineConfigurationImplementation, IQuoteVersionImplementation, IQuoteVersionAttachmentImplementation, ISoRequestItemsAccessor)
Proxy class for the Quote Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public QuoteAgent(IFieldMetadataImplementation fieldMetadataImplementation, IPriceListImplementation priceListImplementation, IProductImplementation productImplementation, IQuoteImplementation quoteImplementation, IQuoteAlternativeImplementation quoteAlternativeImplementation, IQuoteConnectionImplementation quoteConnectionImplementation, IQuoteEntityImplementation quoteEntityImplementation, IQuoteLineImplementation quoteLineImplementation, IQuoteLineConfigurationImplementation quoteLineConfigurationImplementation, IQuoteVersionImplementation quoteVersionImplementation, IQuoteVersionAttachmentImplementation quoteVersionAttachmentImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IFieldMetadataImplementation | fieldMetadataImplementation | |
| IPriceListImplementation | priceListImplementation | |
| IProductImplementation | productImplementation | |
| IQuoteImplementation | quoteImplementation | |
| IQuoteAlternativeImplementation | quoteAlternativeImplementation | |
| IQuoteConnectionImplementation | quoteConnectionImplementation | |
| IQuoteEntityImplementation | quoteEntityImplementation | |
| IQuoteLineImplementation | quoteLineImplementation | |
| IQuoteLineConfigurationImplementation | quoteLineConfigurationImplementation | |
| IQuoteVersionImplementation | quoteVersionImplementation | |
| IQuoteVersionAttachmentImplementation | quoteVersionAttachmentImplementation | |
| ISoRequestItemsAccessor | accessor |
QuoteAgent(IFieldMetadataImplementation, IPriceListImplementation, IProductImplementation, IQuoteImplementation, IQuoteAlternativeImplementation, IQuoteConnectionImplementation, IQuoteEntityImplementation, IQuoteLineImplementation, IQuoteLineConfigurationImplementation, IQuoteVersionImplementation, IQuoteVersionAttachmentImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the Quote Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public QuoteAgent(IFieldMetadataImplementation fieldMetadataImplementation, IPriceListImplementation priceListImplementation, IProductImplementation productImplementation, IQuoteImplementation quoteImplementation, IQuoteAlternativeImplementation quoteAlternativeImplementation, IQuoteConnectionImplementation quoteConnectionImplementation, IQuoteEntityImplementation quoteEntityImplementation, IQuoteLineImplementation quoteLineImplementation, IQuoteLineConfigurationImplementation quoteLineConfigurationImplementation, IQuoteVersionImplementation quoteVersionImplementation, IQuoteVersionAttachmentImplementation quoteVersionAttachmentImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| IFieldMetadataImplementation | fieldMetadataImplementation | |
| IPriceListImplementation | priceListImplementation | |
| IProductImplementation | productImplementation | |
| IQuoteImplementation | quoteImplementation | |
| IQuoteAlternativeImplementation | quoteAlternativeImplementation | |
| IQuoteConnectionImplementation | quoteConnectionImplementation | |
| IQuoteEntityImplementation | quoteEntityImplementation | |
| IQuoteLineImplementation | quoteLineImplementation | |
| IQuoteLineConfigurationImplementation | quoteLineConfigurationImplementation | |
| IQuoteVersionImplementation | quoteVersionImplementation | |
| IQuoteVersionAttachmentImplementation | quoteVersionAttachmentImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| IOnlineConfiguration | onlineConfiguration |
Methods
AddSaleTypeQuoteAttachmentAsync(int, int, CancellationToken)
Adds a new quote attachment document to a sale type
Declaration
public Task<int> AddSaleTypeQuoteAttachmentAsync(int saleTypeId, int documentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleTypeId | The ID of the sale type |
| int | documentId | The ID of the document |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | ID of the new sale type quote attachment row |
ApproveQuoteVersionAsync(int, string, int, string, CancellationToken)
Approves a quote version
Declaration
public Task<ApproveRejectResponse> ApproveQuoteVersionAsync(int quoteVersionId, string approvedByText, int approvedByAssociateId, string approvalText, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId to approve. |
| string | approvedByText | 'Approved by' prefix to ApprovalText used when creating appointment task to log approval. Must be passed since service does not know which language to use for 'Approved By' string. |
| int | approvedByAssociateId | AssociateId of the associate who approved the quote version. |
| string | approvalText | Approval text. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ApproveRejectResponse> | Response of the the operation |
CanConnectorProvideCapabilityAsync(int, string, CancellationToken)
Can the connector provide the capability
Declaration
public Task<bool> CanConnectorProvideCapabilityAsync(int quoteConnectionId, string capabilityName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| string | capabilityName | Capability name |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Capability name |
CancelApprovalRequestAsync(int, CancellationToken)
Cancel a pending quote approval request.
Declaration
public Task<PluginResponse> CancelApprovalRequestAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The quoteversion for which approval was previously sent. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | Response of the the operation |
CopyQuoteAlternativeAsync(int, int, string, CancellationToken)
Copy a quote alternative from the same sale and adds it to a version.
Declaration
public Task<QuoteAlternative> CopyQuoteAlternativeAsync(int quoteVersionId, int quoteAlternativeId, string quoteAlternativeName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId of the version to copy the alternative to. |
| int | quoteAlternativeId | QuoteAlternativeId of the alternative to make a copy of. |
| string | quoteAlternativeName | The name to set on the new alternative. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative> | The copied QuoteAlternative. |
CopySuperOfficePriceListAsync(int, string, DateTime, DateTime, int, bool, CancellationToken)
Create a copy of a PriceList in the SuperOffice database
Declaration
public Task<PriceList> CopySuperOfficePriceListAsync(int originalPriceListId, string newName, DateTime validFrom, DateTime validTo, int newCurrencyId, bool convertCurrency, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | originalPriceListId | Id of the PriceList to be copied |
| string | newName | Name of the copied PriceList |
| DateTime | validFrom | Start date for the new pricelist. |
| DateTime | validTo | End date for the new pricelist. |
| int | newCurrencyId | Currency id of the copied PriceList. If 0 or the same as the original the copied products will keep their prices and the currency will be the same as the original. |
| bool | convertCurrency | If true, product prices will be recalculated to the new currency. If false, product prices will be set to zero. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList> | The copied PriceList |
CreateAndSaveQuoteAsync(int, int, string, CancellationToken)
Creates a new quote on a sale.
Declaration
public Task<QuoteEntity> CreateAndSaveQuoteAsync(int saleId, int connectionId, string firstAlternativeName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | SaleId of the connected sale |
| int | connectionId | ConnectionId |
| string | firstAlternativeName | Name to be given to the default alternative |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteEntity> | Quote carrier |
CreateAndSaveQuoteFromSaleAsync(int, int, CancellationToken)
Creates a copy the active version with connected alternatives and quotelines from another sale.
Declaration
public Task<QuoteEntity> CreateAndSaveQuoteFromSaleAsync(int copyFromSaleId, int copyToSaleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | copyFromSaleId | Id of the sale to copy the active quote from. |
| int | copyToSaleId | Id of the sale to copy the active quote to. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteEntity> | The created Quote |
CreateAndSaveQuoteLinesAsync(int, string[], CancellationToken)
Create and save quotelines based on the product keys added
Declaration
public Task<int> CreateAndSaveQuoteLinesAsync(int quoteAlternativeId, string[] erpProductKeys, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Primary key of the alternative |
| string[] | erpProductKeys | Array of the product keys to add |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | Count of added quoteLines |
CreateAndSaveQuoteVersionAsync(int, CancellationToken)
Created a new QuoteVersion based on another QuoteVersion on the same Quote.
Declaration
public Task<QuoteVersion> CreateAndSaveQuoteVersionAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId of the version to copy the contents from. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersion> | The Quote version |
CreateConnectionFromConnectorNameAsync(string, CancellationToken)
Create a new connection.
Declaration
public Task<QuoteConnection> CreateConnectionFromConnectorNameAsync(string connectorName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | connectorName | The name of the connector to create this connection for. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection> | The created connection |
CreateDefaultPriceListAsync(CancellationToken)
Loading default values into a new PriceList.
Declaration
public Task<PriceList> CreateDefaultPriceListAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList> | New PriceList with default values |
CreateDefaultProductAsync(CancellationToken)
Loading default values into a new Product.
Declaration
public Task<Product> CreateDefaultProductAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Product> | New Product with default values |
CreateDefaultQuoteAlternativeAsync(CancellationToken)
Loading default values into a new QuoteAlternative.
Declaration
public Task<QuoteAlternative> CreateDefaultQuoteAlternativeAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative> | New QuoteAlternative with default values |
CreateOrUpdateQuoteVersionAttachmentsAsync(int, CancellationToken)
Look at the Quote version, related sale and sale type, and ensure that the correct QuoteVersionAttachment records exist. This method may create or delete records
Declaration
public Task<QuoteVersionAttachment[]> CreateOrUpdateQuoteVersionAttachmentsAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The ID of the quote version |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionAttachment[]> | The current attachments for the given Quote version, after all updates have been completed |
CreateQuoteAlternativeAsync(int, string, string, CancellationToken)
Create a new quote alternative on a version.
Declaration
public Task<QuoteAlternative> CreateQuoteAlternativeAsync(int quoteVersionId, string quoteAlternativeName, string quoteAlternativeDescription, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId of the version to create the alternative on. |
| string | quoteAlternativeName | The name to set on the new alternative. |
| string | quoteAlternativeDescription | The description to set on the new alternative. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative> | The newly created QuoteAlternative. |
CreateQuoteLineAsync(int, string, CancellationToken)
Create a quoteline based on a product key.
Declaration
public Task<QuoteLine> CreateQuoteLineAsync(int quoteAlternativeId, string eRPProductKey, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Primary key of the alternative |
| string | eRPProductKey | Primary key of the product in the ProductProvider |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine> | The updated quote line. |
CreateQuoteLineFromProductAsync(int, Product, CancellationToken)
Create a quoteline based on a product.
Declaration
public Task<QuoteLine> CreateQuoteLineFromProductAsync(int quoteAlternativeId, Product product, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Primary key of the alternative |
| Product | product | Product carrier |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine> | The updated quote line. |
DeleteConnectionAsync(int, CancellationToken)
Marks a connection as deleted.
Declaration
public Task DeleteConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | A void return |
DeletePriceListAsync(int, CancellationToken)
Deletes the PriceList
Declaration
public Task DeletePriceListAsync(int priceListId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | priceListId | The identity of the PriceList |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteProductAsync(int, CancellationToken)
Deletes the Product
Declaration
public Task DeleteProductAsync(int productId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | productId | The identity of the Product |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteQuoteAlternativeAsync(int, CancellationToken)
Delete a quote alternative
Declaration
public Task DeleteQuoteAlternativeAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Id of the quote alternative to delete. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | A void return |
DeleteQuoteAsync(int, CancellationToken)
Delete a Quote
Declaration
public Task DeleteQuoteAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteId | QuoteId of the Quote to delete. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
DeleteQuoteLineAsync(int, CancellationToken)
Deletes the QuoteLine in the SuperOffice database
Declaration
public Task DeleteQuoteLineAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteLineId | Primary key of the quoteline to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | Nothing |
DeleteQuoteLinesAsync(int[], CancellationToken)
Delete the QuoteLines in the SuperOffice database
Declaration
public Task DeleteQuoteLinesAsync(int[] quoteLineIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | quoteLineIds | Primary keys of the quotelines to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | Nothing |
DeleteSaleTypeQuoteAttachmentAsync(int, CancellationToken)
Deletes the sale type quote attachment with the given id
Declaration
public Task DeleteSaleTypeQuoteAttachmentAsync(int saleTypeQuoteAttachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleTypeQuoteAttachmentId | The ID of the sale type quote attachment row to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
FindProductAsync(int, string, string, CancellationToken)
Gets a product, from the ProductProvider
Declaration
public Task<Product[]> FindProductAsync(int quoteAlternativeId, string userInput, string priceListKey, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Quote alternative to search in. |
| string | userInput | search string |
| string | priceListKey | If the pricelist is null or empty, the function will search in all active pricelists. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Product[]> | Product array |
GenerateQuoteDocumentsAsync(int, int, bool, int, bool, string, CancellationToken)
Generate all the documents required to send the Quote as an email to the prospect - or an Order Confirmation; it just depends on the template id's for the lines doc and mail body. Quote version status is not changed by this method.
Declaration
public Task<QuotePublishDocuments> GenerateQuoteDocumentsAsync(int quoteVersionId, int emailBodyTemplateId, bool attachMainDocument, int quotedProductsTemplateId, bool includeAttachments, string rawMailSubject, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | VersionId of the quote to be sent; the status of the version will not be changed by calling this method |
| int | emailBodyTemplateId | Id of the template for the email body, must be nonzero and refer to either a Quote mail body or Order Confirmation mail body, with html content |
| bool | attachMainDocument | Should the main quote document be attached to the email; generally false for Order Confirmations |
| int | quotedProductsTemplateId | Id of the template for the quote- or order confirmation-lines; zero if no document should be produced |
| bool | includeAttachments | If true, then the currently specified (in the database) attachments will be included |
| string | rawMailSubject | Subject line for email, in the correct language, sent in here to have any template variables substituted |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuotePublishDocuments> | Carrier specifying the document id's of all the documents, as well as other results |
GetActivePriceListsAsync(int, string, CancellationToken)
Gets the available active PriceLists in a specific currency. Will return empty array if there is no PriceList with the stated currency available.
Declaration
public Task<PriceList[]> GetActivePriceListsAsync(int quoteConnectionId, string currency, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| string | currency | Iso currency like: USD or NOK. See http://www.currency-iso.org/dl_iso_table_a1.xls for details. Case insensitive. Will return empty array if there is no PriceList with the stated currency available. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList[]> | The PriceLists that supports a specific currency |
GetActivePriceListsByCurrencyIdAsync(int, int, CancellationToken)
Gets the available active PriceLists in a specific currency. Will return empty array if there is no PriceList with the stated currency available.
Declaration
public Task<PriceList[]> GetActivePriceListsByCurrencyIdAsync(int quoteConnectionId, int currencyId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| int | currencyId | SuperOffice currency id. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList[]> | The PriceLists that supports a specific currency |
GetAllAvailableQuoteConnectionsAsync(CancellationToken)
Get all available connections. Some installed connections may not be available to the user. Use GetAllAvailableQuoteConnectionsWithPriceLists if you need the pricelists on the connections as well.
Declaration
public Task<QuoteConnection[]> GetAllAvailableQuoteConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection[]> | List of connections |
GetAllAvailableQuoteConnectionsWithPriceListsAsync(CancellationToken)
Get all available connections. Some installed connections may not be available to the user. Includes pricelists for the connection. This is a heavy call
Declaration
public Task<QuoteConnection[]> GetAllAvailableQuoteConnectionsWithPriceListsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection[]> | List of connections |
GetAllInstalledQuoteConnectionsAsync(CancellationToken)
Get all installed connections. Some installed connections may not be available to the user.
Declaration
public Task<QuoteConnection[]> GetAllInstalledQuoteConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection[]> | List of connections |
GetAllPriceListsAsync(int, string, CancellationToken)
Gets the all PriceLists in all currencies, including those inactive. Will return empty array if there is no PriceList available.
Declaration
public Task<PriceList[]> GetAllPriceListsAsync(int quoteConnectionId, string currency, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| string | currency | Iso currency like: USD or NOK. See http://www.currency-iso.org/dl_iso_table_a1.xls for details. Case insensitive. Will return empty array if there is no PriceList with the stated currency available. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList[]> | The PriceLists that supports a specific currency |
GetAllPriceListsByCurrencyIdAsync(int, int, CancellationToken)
Gets the all PriceLists in all currencies, including those inactive. Will return empty array if there is no PriceList available.
Declaration
public Task<PriceList[]> GetAllPriceListsByCurrencyIdAsync(int quoteConnectionId, int currencyId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| int | currencyId | SuperOffice currency id. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList[]> | The PriceLists that supports a specific currency |
GetAllQuoteLineConfigurationsAsync(CancellationToken)
Returns all the configuration fields
Declaration
public Task<QuoteLineConfiguration[]> GetAllQuoteLineConfigurationsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration[]> | Array of QuoteLineConfigurations |
GetConfigurationFieldsAsync(int, string, CancellationToken)
Used by ADMIN. Asks for metadata needed to populate admin dialog that takes in the information needed to create a connection to an ERP system. The values entered in the dialog are stored in SuperOffice db and used when InitializeConnector is called by the client.
Declaration
public Task<FieldMetadataDictionary> GetConfigurationFieldsAsync(int connectionId, string connectorName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | connectionId | Id of an existing connection, if any. Initializes connection with current config values if non-zero. |
| string | connectorName | Name of the connector. Ignored if connectionId is non-zero. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<FieldMetadataDictionary> | carriers |
GetConnectionAsync(int, CancellationToken)
Returns the specified connection.
Declaration
public Task<QuoteConnection> GetConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection> | The connection |
GetConnectionConfigFieldsAsync(int, CancellationToken)
Returns the config fields for the connection.
Declaration
public Task<StringDictionary> GetConnectionConfigFieldsAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | Config Fields |
GetConnectionStartupErrorsAsync(CancellationToken)
Returns an array of PluginResponseInfos for all failed connection initializations.
Declaration
public Task<PluginResponse[]> GetConnectionStartupErrorsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse[]> | Array of PluginResponseInfos for each failed connection initialization. |
GetConnectionStartupResponseAsync(int, CancellationToken)
Returns the PluginResponseInfo for the connection initialization. Does not initialize the connection, just returns what happened when initialize was called.
Declaration
public Task<PluginResponse> GetConnectionStartupResponseAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | PluginResponseInfo for the connection initialization. |
GetConnectionsForAssociateAsync(int, CancellationToken)
Returns all connections available for the specified user.
Declaration
public Task<QuoteConnection[]> GetConnectionsForAssociateAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | Primary key of the user |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection[]> | The connections |
GetConnectorCapabilitiesAsync(int, CancellationToken)
Gets a list of connector capabilities
Declaration
public Task<string[]> GetConnectorCapabilitiesAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string[]> | Capabilities |
GetConnectorCapabilityNamesAsync(int, CancellationToken)
Gets a list of all possible connector capabilities
Declaration
public Task<string[]> GetConnectorCapabilityNamesAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string[]> | Capabilities names |
GetExtraInfoAsync(string, CancellationToken)
Converts an xml string into an object representation.
Declaration
public Task<ProductExtraDataField[]> GetExtraInfoAsync(string quoteLineExtraData, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | quoteLineExtraData | The extra data as xml. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ProductExtraDataField[]> | An object representation on the xml |
GetInUseQuoteLineConfigurationsAsync(CancellationToken)
Returns the configuration fields that should be visible in the GUI.
Declaration
public Task<QuoteLineConfiguration[]> GetInUseQuoteLineConfigurationsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration[]> | Array of QuoteLineConfigurations |
GetOrderConfirmationAsync(int, int, CancellationToken)
Get a base64-encoded data stream that is just the order confirmation document, for the given quote version; no permanent document is created or stored anywhere; the result is a PDF
Declaration
public Task<string> GetOrderConfirmationAsync(int quoteVersionId, int confirmationTemplateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | VersionId of the quote to be sent; the status of the version will not be changed by calling this method |
| int | confirmationTemplateId | Id of the template for the order confirmation lines document |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | Base64-encoded binary data, that is in fact a PDF document that should be shown to the user |
GetOrderStateAsync(int, CancellationToken)
If there is a problem with a quoteline, the error description shall be placed in the status and reason fields of the quoteline, if there is a problem with the alternative, the error description shall be placed in the status and reason fields of the alternative. A summary of all the problems (if any) should be placed in the response object. Requires that the Create-Order capability is true.
Declaration
public Task<PluginUrlResponse> GetOrderStateAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | the QuoteVersionId of the ordered version. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginUrlResponse> | The order state. If a new quoteversion is created, the QuoteVersionId will be found in Changes.AddedRecords. |
GetPriceListAsync(int, CancellationToken)
Gets a PriceList object.
Declaration
public Task<PriceList> GetPriceListAsync(int priceListId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | priceListId | The identifier of the PriceList object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList> | A single PriceList |
GetProductAsync(int, string, CancellationToken)
Get a product with the given key
Declaration
public Task<Product> GetProductAsync(int quoteConnectionId, string eRPProductKey, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | The connection this product comes from. |
| string | eRPProductKey | Primary key of the Product in the ProductProvider |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Product> |
GetProductFromDbIdAsync(int, CancellationToken)
Get a product with the given database id
Declaration
public Task<Product> GetProductFromDbIdAsync(int productId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | productId | The database id of the product |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Product> | The product info |
GetProductImageAsync(int, string, int, CancellationToken)
Gets an image connected to a product, from the ProductProvider
Declaration
public Task<string> GetProductImageAsync(int quoteConnectionId, string eRPProductKey, int rank, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | The connection this product comes from. |
| string | eRPProductKey | Primary key of the Product in the ProductProvider |
| int | rank | The rank of the image. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | The base64 encoded image as a string. |
GetQuoteAlternativeAsync(int, CancellationToken)
Gets a QuoteAlternative object.
Declaration
public Task<QuoteAlternative> GetQuoteAlternativeAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | The identifier of the QuoteAlternative object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative> | A single QuoteAlternative |
GetQuoteAlternativesAsync(int, CancellationToken)
Get all quote alternatives for a quote version
Declaration
public Task<QuoteAlternative[]> GetQuoteAlternativesAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId of the revison to get alternatives for. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative[]> | Array of Quote alternatives |
GetQuoteAsync(int, CancellationToken)
Get a Quote
Declaration
public Task<Quote> GetQuoteAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteId | QuoteId of the Quote to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Quote> | The Quote |
GetQuoteEntityAsync(int, CancellationToken)
Get a Quote
Declaration
public Task<QuoteEntity> GetQuoteEntityAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteId | QuoteId of the Quote to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteEntity> | The Quote |
GetQuoteEntityFromSaleIdAsync(int, CancellationToken)
Get a Quote for a sale
Declaration
public Task<QuoteEntity> GetQuoteEntityFromSaleIdAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | SaleId of the Quote to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteEntity> | The Quote |
GetQuoteFromSaleIdAsync(int, CancellationToken)
Get a Quote for a sale
Declaration
public Task<Quote> GetQuoteFromSaleIdAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | SaleId of the Quote to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Quote> | The Quote |
GetQuoteLineAsync(int, CancellationToken)
Get QuoteLine from database
Declaration
public Task<QuoteLine> GetQuoteLineAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteLineId | Primary key of the quoteline to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine> | The updated quote line (If the quoteline was new, it returns with id's set. |
GetQuoteLineConfigurationAsync(int, CancellationToken)
Returns the configuration field with the given id
Declaration
public Task<QuoteLineConfiguration> GetQuoteLineConfigurationAsync(int quoteLineConfigurationId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteLineConfigurationId | Id of the QuoteLineConfiguration to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration> | QuoteLineConfiguration |
GetQuoteLineConfigurationFromFieldNameAsync(string, CancellationToken)
Returns the configuration field with the given field name
Declaration
public Task<QuoteLineConfiguration> GetQuoteLineConfigurationFromFieldNameAsync(string fieldName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldName | Field name of the QuoteLineConfiguration to get. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration> | QuoteLineConfiguration |
GetQuoteLinesAsync(int, CancellationToken)
Get all QuoteLines from an alternative
Declaration
public Task<QuoteLine[]> GetQuoteLinesAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Id of the alternative to return the quotelines for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine[]> | QuoteLine array |
GetQuoteVersionAsync(int, CancellationToken)
Get a QuoteVersion
Declaration
public Task<QuoteVersion> GetQuoteVersionAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId to get information from |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersion> | Array of Quote versions |
GetQuoteVersionWorkflowButtonStatesAsync(int, int, CancellationToken)
Get all button states for the Quote version dialog.
Declaration
public Task<QuoteVersionWorkflowState> GetQuoteVersionWorkflowButtonStatesAsync(int quoteVersionId, int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | Id of the quote version to get the button states for. |
| int | quoteAlternativeId | Id of the active quote alternative id. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionWorkflowState> | Workflow state information |
GetQuoteVersionWorkflowImageStateAsync(int, CancellationToken)
Get state icon and name for the Quote version dialog header.
Declaration
public Task<QuoteVersionButtonState> GetQuoteVersionWorkflowImageStateAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | Id of the quote version to get the version state for. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionButtonState> | Image and state name information |
GetQuoteVersionWorkflowStateAsync(int, int, CancellationToken)
Get all button states for the Quote version dialog. Packages ImageState, Button states and status info into one call. Collects most important warnings/errors from across all quotelines/alternatives in this quote version.
Declaration
public Task<QuoteVersionWorkflowState> GetQuoteVersionWorkflowStateAsync(int quoteVersionId, int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | Id of the quote version to get the button states for. |
| int | quoteAlternativeId | Id of the active quote alternative id. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionWorkflowState> | Workflow state information |
GetQuoteVersionWorkflowStatusInfoAsync(int, CancellationToken)
Get status info for the Quote version dialog header. Collects most important warnings/errors from across all quotelines/alternatives in this quote version.
Declaration
public Task<QuoteVersionStatusInformation> GetQuoteVersionWorkflowStatusInfoAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | Id of the quote version to get the status info for. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionStatusInformation> | Most important status text + icon information. |
GetQuoteVersionsAsync(int, CancellationToken)
Get all quote versions for a sale
Declaration
public Task<QuoteVersion[]> GetQuoteVersionsAsync(int quoteId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteId | QuoteId of the quote to get versions from |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersion[]> | Array of Quote versions |
HasConnectionsAsync(CancellationToken)
Whether or not the system has any connections available for this user.
Declaration
public Task<PluginResponse> HasConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | The response |
IncludeQuoteVersionAttachmentAsync(int, int, bool, CancellationToken)
Toggle the 'included' state of a quote version attachment; will throw exceptions if called on locked versions
Declaration
public Task<bool> IncludeQuoteVersionAttachmentAsync(int quoteVersionId, int documentId, bool include, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The ID of the Quote version |
| int | documentId | The ID of the document |
| bool | include | Desired state |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | The new state |
MoveQuoteLineAsync(int, bool, CancellationToken)
Move quote line rank up/down
Declaration
public Task MoveQuoteLineAsync(int quoteLineId, bool direction, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteLineId | Id of quote line to move up/down |
| bool | direction | True is up, false is down |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | Void return |
PlaceOrderAsync(int, bool, string, string, string, CancellationToken)
Place an order in the ERP system.
Declaration
public Task<PluginUrlResponse> PlaceOrderAsync(int quoteAlternativeId, bool markSaleAsSold, string poNumber, string orderComment, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternativeId | Id of the alternative to place the order on. |
| bool | markSaleAsSold | Should the state of the owning Sale be set to sold |
| string | poNumber | Purchase order number, saved to Quote record |
| string | orderComment | Order comment, saved to Quote record |
| string | culture | Desired culture for email body and other culture-sensitive templates/content |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginUrlResponse> | Status for the placed order: OkWithInfo / Warn / Error with message or URL to open. |
RecalculateQuoteAlternativeAsync(int, CancellationToken)
When the user changes one or more values in a quoteline or a quoteAlternative, the connector gets to change the QuoteLines and the alternative, for instance calculate VAT. RecalculateQuoteAlternative shall be called when the user changes any of the following fields: Quantity, DiscountAmount, DiscountPercent, listprice (if allowed). RecalculateQuoteAlternative will calculate the TotalPrice and the VAT (if possible) for the lines and the alternative.
Declaration
public Task<QuoteAlternativeRecalculated> RecalculateQuoteAlternativeAsync(int quoteAlternative, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteAlternative | The alternative to be recalculated |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternativeRecalculated> | The updated quote version. |
RecalculateQuoteLineAsync(QuoteLine, string[], CancellationToken)
When the user changes one or more values in a quoteline, the connector gets to change the QuoteLine, for instance calculate VAT. Shall be called when the user changes any of the following fields: Quantity, DiscountAmount, DiscountPercent, ListPrice (if allowed). Will calculate the TotalPrice and the VAT (if possible) for the line.
Declaration
public Task<QuoteLine> RecalculateQuoteLineAsync(QuoteLine quoteLine, string[] changedFields, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteLine | quoteLine | The QuoteLine to recalculate |
| string[] | changedFields | The id of the changed fields in the form 'TableName.FieldName' |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine> | The updated quote line. |
RejectQuoteVersionAsync(int, string, int, string, CancellationToken)
Rejects a quote version
Declaration
public Task<ApproveRejectResponse> RejectQuoteVersionAsync(int quoteVersionId, string rejectedByText, int rejectedByAssociateId, string rejectionText, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId to approve. |
| string | rejectedByText | 'Rejected by' prefix to RejectionText used when creating appointment task to log rejection. Must be passed since service does not know which language to use for 'Rejected By' string. |
| int | rejectedByAssociateId | AssociateId of the associate who rejected the quote version. |
| string | rejectionText | Rejection text. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ApproveRejectResponse> | Response of the the operation |
RemoveProductAsync(int, CancellationToken)
Removes a product from the database
Declaration
public Task RemoveProductAsync(int productId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | productId | The database id of the product to remove |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
RequestApprovalAsync(int, int, string, CancellationToken)
Notifies specified associate that this quote needs approval.
Declaration
public Task<PluginResponse> RequestApprovalAsync(int quoteVersionId, int associateId, string comment, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The quoteversion to be approved. |
| int | associateId | The associate that should be notified. |
| string | comment | Details or reason for request |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | Response of the the operation |
RestoreConnectionAsync(int, CancellationToken)
Restores a connection marked as deleted.
Declaration
public Task RestoreConnectionAsync(int quoteConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection to restore |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | A void return |
SaveConnectionAsync(QuoteConnection, CancellationToken)
Saves a connection to the database.
Declaration
public Task<QuoteConnection> SaveConnectionAsync(QuoteConnection connection, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteConnection | connection | The connection to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteConnection> | The resulting connection. |
SaveConnectionConfigFieldsAsync(int, StringDictionary, CancellationToken)
Saves the connection config fields
Declaration
public Task<StringDictionary> SaveConnectionConfigFieldsAsync(int quoteConnectionId, StringDictionary connectionConfigFields, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteConnectionId | Primary key of the connection |
| StringDictionary | connectionConfigFields | ConnectionConfigFields to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | Config Fields |
SavePriceListAsync(PriceList, CancellationToken)
Updates the existing PriceList or creates a new PriceList if the id parameter is 0.
Declaration
public Task<PriceList> SavePriceListAsync(PriceList priceList, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PriceList | priceList | The PriceList that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PriceList> | New or updated PriceList |
SaveProductAsync(Product, CancellationToken)
Updates the existing Product or creates a new Product if the id parameter is 0.
Declaration
public Task<Product> SaveProductAsync(Product product, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Product | product | The Product that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Product> | New or updated Product |
SaveQuoteAlternativeAsync(QuoteAlternative, CancellationToken)
Updates the existing QuoteAlternative or creates a new QuoteAlternative if the id parameter is 0.
Declaration
public Task<QuoteAlternative> SaveQuoteAlternativeAsync(QuoteAlternative quoteAlternative, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteAlternative | quoteAlternative | The QuoteAlternative that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteAlternative> | New or updated QuoteAlternative |
SaveQuoteAsync(Quote, CancellationToken)
Saves a Quote
Declaration
public Task<Quote> SaveQuoteAsync(Quote quote, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Quote | quote | The Quote to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Quote> | The saved Quote |
SaveQuoteEntityAsync(QuoteEntity, CancellationToken)
Saves a QuoteEntity. Versions and alternatives will not be saved by this call.
Declaration
public Task<QuoteEntity> SaveQuoteEntityAsync(QuoteEntity quoteEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteEntity | quoteEntity | The Quote entity to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteEntity> | The saved Quote |
SaveQuoteLineAsync(QuoteLine, CancellationToken)
Saves the QuoteLine in the SuperOffice database
Declaration
public Task<QuoteLine> SaveQuoteLineAsync(QuoteLine quoteLine, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteLine | quoteLine | The QuoteLine to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine> | The updated quote line (If the quoteline was new, it returns with id's set. |
SaveQuoteLineConfigurationAsync(QuoteLineConfiguration, CancellationToken)
Save a QuoteLineConfiguration object. It is not possible to add a new configuration.
Declaration
public Task<QuoteLineConfiguration> SaveQuoteLineConfigurationAsync(QuoteLineConfiguration quoteLineConfiguration, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteLineConfiguration | quoteLineConfiguration | The QuoteLineConfiguration to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration> | The saved QuoteLineConfiguration. |
SaveQuoteLineConfigurationsAsync(QuoteLineConfiguration[], CancellationToken)
Save a collection of QuoteLineConfigurations. It is not possible to add a new configurations.
Declaration
public Task<QuoteLineConfiguration[]> SaveQuoteLineConfigurationsAsync(QuoteLineConfiguration[] quoteLineConfigurations, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteLineConfiguration[] | quoteLineConfigurations | The QuoteLineConfigurations to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLineConfiguration[]> | The saved QuoteLineConfigurations. |
SaveQuoteLinesAsync(QuoteLine[], CancellationToken)
Saves the QuoteLines in the SuperOffice database
Declaration
public Task<QuoteLine[]> SaveQuoteLinesAsync(QuoteLine[] quoteLines, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteLine[] | quoteLines | The QuoteLines to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteLine[]> | The updated quote lines (If the quoteline was new, it returns with id's set. |
SaveQuoteVersionAsync(QuoteVersion, CancellationToken)
Saves a quote version
Declaration
public Task<QuoteVersion> SaveQuoteVersionAsync(QuoteVersion quoteVersion, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| QuoteVersion | quoteVersion | The quote version to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersion> | The saved quote version |
SaveQuoteVersionNumberAsync(int, string, CancellationToken)
Save the quote version number if it is valid
Declaration
public Task<bool> SaveQuoteVersionNumberAsync(int quoteVersionId, string number, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | VersionId of the quote version |
| string | number | The number to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the number was valid and then saved |
SendQuoteVersionAsync(int, DateTime, DateTime, string, string, CancellationToken)
Send the quote to the user's customer. More parameters to be added later...
Declaration
public Task<PluginUrlResponse> SendQuoteVersionAsync(int quoteVersionId, DateTime expiryDate, DateTime followupDate, string followupText, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | QuoteVersionId of the quoteversion to send |
| DateTime | expiryDate | Date the quote expires |
| DateTime | followupDate | Date for the followup task, to remind the sales rep about the quote |
| string | followupText | The body text for the follwup appointment, resolved to the correct culture (no resources please) |
| string | culture | Desired culture for email body and other culture-sensitive templates/content |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginUrlResponse> | Response of the operation |
TestConnectionAsync(string, StringDictionary, CancellationToken)
Used by the Admin clients. Testing if the connection data is sufficient to get a connection with the ERP system. The Connector should try to do some operations to check if the connection has sufficient rights to run. The connection has not been created yet. TestConnection is called without InitializeConnector being called first.
Declaration
public Task<PluginResponse> TestConnectionAsync(string connectorName, StringDictionary connectionData, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | connectorName | Name of the connector. |
| StringDictionary | connectionData | Basically the name/value collection of the configuration data requested to create a connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | How the test went |
ToggleProductInAssortmentAsync(int, CancellationToken)
Toggles if the prdouct is in assortment or not
Declaration
public Task ToggleProductInAssortmentAsync(int productId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | productId | The database id of the product to toggle is assortment value of |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
ToggleQuoteVersionAttachmentIncludedAsync(int, CancellationToken)
Toggle the 'included' state of a quote version attachment
Declaration
public Task<bool> ToggleQuoteVersionAttachmentIncludedAsync(int quoteVersionAttachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionAttachmentId | The ID of the quote version attachment row |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | The new state |
ToggleSaleTypeQuoteAttachmentDefaultIncludedAsync(int, CancellationToken)
Toggle the 'default included' state of a sale type quote attachment
Declaration
public Task<bool> ToggleSaleTypeQuoteAttachmentDefaultIncludedAsync(int saleTypeQuoteAttachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleTypeQuoteAttachmentId | The ID of the sale type quote attachment row |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | The new state |
UpdateQuoteVersionPricesAsync(int, CancellationToken)
Update price on the all the quotelines for each alternative in the current quote version
Declaration
public Task<QuoteVersionValidated> UpdateQuoteVersionPricesAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The version to be update prices for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionValidated> | The updated quote version. |
ValidateQuoteVersionAsync(int, QuoteVersionButtonAction, CancellationToken)
When the user changes one or more values in a quoteline or a quoteAlternative, the connector gets to change the QuoteLines and the alternative, for instance calculate VAT. ValidateQuoteVersion shall be called when the user presses the validate button, presses the send button or closes the quote dialog. RecalculateQuoteAlternative should typically validate all alternatives, set values in extrafields, and set the state in the version.
Declaration
public Task<QuoteVersionValidated> ValidateQuoteVersionAsync(int quoteVersionId, QuoteVersionButtonAction action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quoteVersionId | The version to be validated |
| QuoteVersionButtonAction | action | The action, if any, related to the validate call, like PlaceOrder or SendQuote |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<QuoteVersionValidated> | The updated quote version. |