Class: Kit

Kit

new Kit()

Kit class

Extends

Members

addBarcode

Adds a barcode

addCode

Adds a QR code to the kit

canReleaseCustody

Checks if custody can be released for a kit (based on status)

canTakeCustody

Checks if custody can be taken for a kit (based on status)

canTransferCustody

Checks if custody can be transferred for a kit (based on status)

clearFlag

Clears the flag of an item

clearLabel

Clears the label of an item

duplicate

Duplicates an item a number of times

isDirty

Checks if the Kits is dirty and needs saving

isEmpty

Checks if the kit is empty

releaseCustody

Releases custody of a kit (and all items in it) at a certain location Puts it in the available status again

removeCode

Removes a QR code from the kit

setFlag

Sets the flag of an item

setLabel

Sets the label of an item

takeCustody

Takes custody of a kit (and all items in it) Puts it in the in_custody status

transferCustody

Transfers custody of a kit (and all items in it) Keeps it in the in_custody status

updateFields

Update fields of a document

Methods

inherited addComment(comment, skipRead){promise}

Adds a comment by string

Name Type Description
comment
skipRead

addItems(items, skipRead){promise}

addItems; adds a bunch of Items to the transaction using a list of item ids

Name Type Description
items
skipRead

inherited attach(attachmentId, skipRead){promise}

attaches an Attachment object

Name Type Description
attachmentId
skipRead

canCheckout(){boolean}

Checks if a Kit can be checked out (based on status)

inherited canDelete(){promise}

Checks via the api if we can delete the document

canReserve(){boolean}

Checks if a Kit can be reserved (based on status)

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

inherited create(skipRead){promise}

Creates an object by the default api.create

Name Type Description
skipRead

skips reading the response via _fromJson (false)

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

isValid(){boolean}

Checks if the Kit has any validation errors

isValidName(){Boolean}

Checks if name is valid

isValidNameAsync(){promise}

Check if name is valid and isn't already used

moveItem(item, toPos, skipRead){promise}

moveItem; moves an Item in a kit to another position

Name Type Description
item
toPos
skipRead

inherited reload(_fields){promise}

Reloads the object from db

Name Type Description
_fields

removeItems(items, skipRead){promise}

removeItems; removes a bunch of Items from the transaction using a list of item ids

Name Type Description
items

(can be null)

skipRead

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