Download and list order documents as well as download, list, upload and delete category documents.
Plenty\Modules\Document\Contracts
public getDocumentPath(int $id):void
Get the path to a document
int | $id | The ID of the document |
public findById(int $id, array $columns = []):Document
Get a document
int | $id | The ID of the document |
array | $columns | The columns to be loaded |
public find(int $page = 1, int $itemsPerPage = 50, array $columns = [], array $with = []):PaginatedResult
List documents
int | $page | The page to get. The default page that will be returned is page 1. |
int | $itemsPerPage | The number of orders to be displayed per page. The default number of orders per page is 50. |
array | $columns | The columns to be loaded |
array | $with | The relations to be loaded. Possible value is "references". |
public uploadOrderDocuments(int $orderId, string $type, array $data):array
Upload order documents
int | $orderId | The ID of the order |
string | $type | The document type. Supported types are 'invoiceExternal', 'deliveryNote', 'poDeliveryNote', 'orderConfirmation', 'offer', 'dunningLetter', 'returnNote', 'successConfirmation', 'correction', 'creditNoteExternal', 'reorder', 'uploaded'. |
array | $data | The request data |
public deleteOrderDocument(int $orderId, int $documentId):bool
Delete order document
int | $orderId | The ID of the order |
int | $documentId | The ID of the document |
public archiveOrderDocument(int $orderId, int $documentId):void
Archive order document
int | $orderId | The ID of the order |
int | $documentId | The ID of the document |
public uploadCategoryDocuments(int $categoryId, array $data):array
Upload category documents
int | $categoryId | The ID of the category |
array | $data | The request data |
public deleteCategoryDocument(int $categoryId, int $documentId):bool
Delete a category document.
int | $categoryId | The ID of the category |
int | $documentId | The ID of the document |
public uploadOrderShippingPackageDocuments(int $packageId, string $type, string $document):array
Uploads documents
int | $packageId | |
string | $type | |
string | $document | base64 encoded document |
public findOrderShippingPackageDocuments(int $packageId, string $type):array
Find documents
int | $packageId | |
string | $type |
public findCurrentOrderDocument(int $orderId, string $type):Document
Finds the current order document
int | $orderId | |
string | $type |
public findRecentOrderDocument(int $orderId, string $type):Document
Finds order document.
int | $orderId | |
string | $type |
public deleteOrderShippingPackageDocuments(int $packageId):bool
Delets a document.
int | $packageId |
public getDocumentStorageObject($key):void
Gets a document storage object.
$key |
public uploadOrderReturnsDocuments(int $returnsId, string $document):Document
Uploads a specific document.
int | $returnsId | |
string | $document |
public getOrderReturnsDocumentById(int $returnsId, bool $withLabel = false):Document
Finds a document.
int | $returnsId | |
bool | $withLabel |
public generateOrderDocument(int $orderId, int $type, array $data):bool
Generate order document
int | $orderId | The ID of the order |
int | $type | The document type |
array | $data | The request data |
public clearCriteria():void
Resets all Criteria filters by creating a new instance of the builder object.
public applyCriteriaFromFilters():void
Applies criteria classes to the current repository.
public setFilters(array $filters = []):void
Sets the filter array.
array | $filters |
public getFilters():void
Returns the filter array.
public getConditions():void
Returns a collection of parsed filters as Condition object
public clearFilters():void
Clears the filter array.
The document model contains information about actual documents.
Plenty\Modules\Document\Models
Type | Name | Description |
---|---|---|
int | id | The ID of the document |
string | type | The type of the document. The following types are available:
|
int | number | The document number |
string | numberWithPrefix | The document number with prefix |
string | path | The path to the document |
int | userId | The ID of the user |
string | source | The source where the document was generated. Possible sources are 'klarna', 'soap', 'admin', 'hitmeister', 'paypal' and 'rest'. |
string | displayDate | The date displayed on the document |
string | content | The base64 encodedcontent of the document. |
createdAt | The time the document was created | |
updatedAt | The time the document was last updated | |
Collection | references | Collection of document references. The references available are:
|
Collection | contacts | Collection of contacts that are associated with the document |
Collection | orders | Collection of orders that are associated with the document |
Collection | webstores | Collection of webstores that are associated with the document |
Collection | categories | Collection of categories that are associated with the document |
public toArray()
Returns this model as an array.
The document reference model. A document reference allows you to assign a document to other models.
Plenty\Modules\Document\Models
Type | Name | Description |
---|---|---|
int | documentId | The ID of the document |
string | type | The reference type. The following reference types are available:
|
string | value | The reference value (e.g. the ID of another model) |
public toArray()
Returns this model as an array.