Documentation

Invoices (new)

New invoices is a separate type of entity that replaces previously existing invoices.

Like a smart process

New invoices is a captured SPA type, excluding the details. That's why the same methods applicable to handling SPAs are used for the new invoices as well. Input parameters is the difference.

Many methods require entityTypeId. You need to pass entityTypeId for new invoices as this parameter value. You can find the value entityTypeId for new invoices, as well as other constants specific to this entity type in the constant list.

Also, the values for entityTypeId, entityTypeName and ownerType can be retrieved via the method crm.enum.ownertype (see fields ID, SYMBOL_CODE, SYMBOL_CODE_SHORT).


crm.type.*

You cannot read/edit/delete new invoices using the method crm.type.*. Any attempts will result in returned error.


Managing new invoice items - crm.item.*

The methods crm.item.* allow to read/edit/delete items for new invoices. Handling new invoices is the same as stipulated in the documentation. Pass the value, applicable to the new invoices as the parameter entityTypeId.


Managing product SKUs - crm.item.productrow.*

The methods crm.item.productrow.* can manage product SKUs, bound to an invoice. They can be handled in the similar manner as SPA items. Pass the short-form symbolic code for new invoices (SI) as the parameter ownerType.


Managing stages - crm.status.*

The methods crm.status.* can manage new invoice stages. Values for the fields ENTITY_ID and STATUS_ID are generated using the same principle applicable to the SPAs.

Use the method crm.status.entity.types to get the value for ENTITY_ID for the new invoices and find a subarray with ENTITY_TYPE_ID that match with entityTypeId for the new invoices. The ID key will contain the necessary value to be entered as ENTITY_ID in other methods.


crm.category.*

New invoices are based on Smart process automation, they can work with pipelines. However, its not recommended to use the methods crm.category.* for handling pipelines/categories for the new invoices, because they do not use pipelines. UI won't show any changes.


Invoice details settings - crm.item.details.configuration.*

The methods crm.item.details.configuration.* can manage details settings for the new invoices. You need to pass value applicable to the new invoice in entityTypeId.


Item events for new invoice

Adding/editing/deleting item for the new invoice throws events, identical to events for SPA. Returns a new invoice CRM ID (entityTypeId) as the value for ENTITY_TYPE_ID.


UI embeddings

Embedding codes are generated as per standard procedure as well as for other entities; however, SMART_INVOICE is used as string value.

  • CRM_SMART_INVOICE_LIST_TOOLBAR - toolbar button inside invoice list
  • CRM_SMART_INVOICE_DETAIL_TOOLBAR - toolbar button inside invoice details
  • CRM_SMART_INVOICE_DOCUMENTGENERATOR_BUTTON - menu item in the "Document" button inside invoice details

... and etc.



© «Bitrix24», 2001-2022
Up