Class: Item

Item

Item

new Item()

Item represents a single piece of equipment

Properties:
Name Type Description
name string

the name of the item

status string

the status of the item in an order, or expired

brand string

the item brand

model string

the item model

warrantyDate moment

the item warranty date

purchaseDate moment

the item purchase date

purchasePrice string

the item purchase price

codes Array

the item qr codes

location string

the item location primary key (empty if in_custody)

category string

the item category primary key

geo Array

the item geo position in lat lng array

address string

the item geo position address

order string

the order pk, if the item is currently in an order

kit string

the kit pk, if the item is currently in a kit

custody string

the customer pk, if the item is currently in custody of someone

cover string

the attachment pk of the main image

catalog string

the catalog pk, if the item was made based on a product in the catalog

Extends

Members

addBarcode

Adds a barcode

addCode

Adds a QR code to the item

canChangeCategory

Checks if the item can be moved to another category

canCheckin

Checks if an item can be checked in (based on status)

canCheckout

Checks if an item can be checked out (based on status)

canDelete

Checks if an item can be deleted

canExpire

Checks if an item can be expired (based on status)

canGoToCheckout

Checks if we can go to the checkout of an item (based on status)

canReleaseCustody

Checks if custody can be released for an item (based on status)

canReserve

Checks if an item can be reserved (based on status)

canTakeCustody

Checks if custody can be taken for an item (based on status)

canTransferCustody

Checks if custody can be transferred for an item (based on status)

canUndoExpire

Checks if an item can be made available again (based on status)

changeCategory

Moves the item to another category

changeLocation

Change the location of an item

clearFlag

Clears the flag of an item

clearLabel

Clears the label of an item

duplicate

Duplicates an item a number of times

expire

Expires an item, puts it in the expired status

getAvailabilities

Checks if the Item is unavailable between from / to dates (optional)

getDepreciation

Get a list depreciations

getLastNumber

Gets the last number for items with this name

isDirty

Checks if the item is dirty and needs saving

isEmpty

Checks if the item is empty

releaseCustody

Releases custody of an item at a certain location Puts it in the available status again

removeBarcode

Removes a barcode

removeCode

Removes a QR code from the item

setFlag

Sets the flag of an item

setLabel

Sets the label of an item

takeCustody

Takes custody of an item Puts it in the in_custody status

transferCustody

Transfers custody of an item Keeps it in the in_custody status

undoExpire

Un-expires an item, puts it in the available status again

updateBasicFields

Updates the basic fields of an item

updateFields

Update fields of a document

updateGeo

Updates the geo position of an item

Methods

inherited addComment(comment, skipRead){promise}

Adds a comment by string

Name Type Description
comment
skipRead

inherited attach(attachmentId, skipRead){promise}

attaches an Attachment object

Name Type Description
attachmentId
skipRead

inherited clearCover(skipRead){promise}

Clears the cover image

Name Type Description
skipRead

inherited clearField(field, skipRead)

Clears a custom field

Name Type Description
field
skipRead

create(skipRead){promise}

Creates an Item

Name Type Description
skipRead

skips reading the response via _fromJson (false)

createMultiple(times, autoNumber, startFrom){promise}

Creates multiple instances of the same item

Name Type Description
times
autoNumber
startFrom

inherited delete(){promise}

Deletes an object by the default api.delete

inherited deleteComment(id, skipRead){promise}

Deletes a Comment by id

Name Type Description
id
skipRead

inherited detach(attachmentId, skipRead){promise}

detaches an Attachment by kvId (guid)

Name Type Description
attachmentId
skipRead

inherited discardChanges(){promise}

Discards any changes made to the object from the previously loaded raw response or resets it when no old raw response was found

inherited existsInDb(){boolean}

Checks if the document exists in the database

inherited get(_fields){promise}

Gets an object by the default api.get

Name Type Description
_fields

inherited isValid(){boolean}

Checks if the object is valid

inherited reload(_fields){promise}

Reloads the object from db

Name Type Description
_fields

inherited reset(){promise}

Resets the object

inherited setCover(att, skipRead){promise}

Set the cover image to an Attachment

Name Type Description
att
skipRead

inherited setField(field, value, skipRead){promise}

Sets a custom field

Name Type Description
field
value
skipRead

inherited setFields(fields, skipRead){promise}

Sets multiple custom fields in a single call

Name Type Description
fields
skipRead

inherited update(skipRead){promise}

Updates an object by the default api.update

Name Type Description
skipRead

skips reading the response via _fromJson (false)

inherited updateComment(id, comment, skipRead){promise}

Updates a comment by id

Name Type Description
id
comment
skipRead