Общие функции работы с документами
Methods
- api.document.create(type, outletId, distributorId) → Document
- api.document.createCopy(docId) → Document
- api.document.defaultData(type, distributorId) → Document
- api.document.defaultRow(type) → DocumentRow
- api.document.documentIdList(type, outletId, dateOrPeriod) → IDList
- api.document.draftId(type, outletId, distributorId) → ID
- api.document.info(docId) → DocumentInfo
- api.document.isNotSent() → Boolean
- api.document.isSent(docId) → Boolean
- api.document.lastValidatedId(type, outletId, distributorId) → ID
- api.document.previousId(docId) → ID
- api.document.previousIdList(docIdList) → IDList
- api.document.printNumber(printFormName, idDoc, firmFieldName, numFieldName) → String
- api.document.storno(docId, check) → Boolean
- api.document.submit(document) → Boolean
- api.document.submitRow(docId, row) → Boolean
- api.document.validate(docId, check) → Boolean
- api.document.validatedIdList(conditions) → IDList
Methods description
-
create(type, outletId, distributorId) → Document
-
Создать черновик документа, если черновик уже имеется, то будет возвращён он
Parameters:
Name Type Description type DocType Тип документа
outletId ID Идентификатор ТТ
distributorId ID Идентификатор дистрибьютора
Return:
-
createCopy(docId) → Document
-
Создать черновик документа на основании другого документа
Parameters:
Name Type Description docId ID Идентификатор документа
Return:
-
defaultData(type, distributorId) → Document
-
Сформировать документ, заполненный по умолчанию
Parameters:
Name Type Description type DocType Тип документа
distributorId ID Идентификатор дистрибьютора
Return:
-
defaultRow(type) → DocumentRow
-
Сформировать строчку документа, заполненную по умолчанию
Parameters:
Name Type Description type DocType Тип документа
Return:
-
documentIdList(type, outletId, dateOrPeriod) → IDList
-
Получить идентификаторы документов
Parameters:
Name Type Argument Description type DocType | DocTypeList Тип или список типов документа
outletId ID Идентификатор ТТ
dateOrPeriod Date | Period optional Дата или период, если не задано, то текущая дата
Return:
-
draftId(type, outletId, distributorId) → ID
-
Получить идентификатор черновика документа
Parameters:
Name Type Description type DocType Тип документа
outletId ID Идентификатор ТТ
distributorId ID Идентификатор дистрибьютора
Return:
-
info(docId) → DocumentInfo
-
Получить информацию о документе
Parameters:
Name Type Description docId ID Идентификатор документа
Return:
-
isNotSent() → Boolean
-
Получить признак наличия не отправленных документов
Return:
Boolean -Признак наличия хотя бы одного не отправленного документа (валидированного и не удаленного)
-
isSent(docId) → Boolean
-
Получить признак того, что документ был отправлен в УС
Parameters:
Name Type Description docId ID Идентификатор документа
Return:
Boolean -
lastValidatedId(type, outletId, distributorId) → ID
-
Получить идентификатор последнего валидированного документа
Parameters:
Name Type Description type DocType Тип документа
outletId ID Идентификатор ТТ
distributorId ID Идентификатор дистрибьютора
Return:
-
previousId(docId) → ID
-
Получить идентификатор предыдущей версии документа
Parameters:
Name Type Description docId ID Идентификатор документа
Return:
-
previousIdList(docIdList) → IDList
-
Получить список идентификаторов предыдущих версии документа
Parameters:
Name Type Description docIdList IDList Список идентификаторов документов
Return:
-
printNumber(printFormName, idDoc, firmFieldName, numFieldName) → String
-
Сформировать и записать печатный номер документа
Parameters:
Name Type Argument Default Description printFormName String Ключ типа документа
idDoc ID Идентификатор документа
firmFieldName String optional "idFirm" Имя поля с идентификатором фирмы
numFieldName String optional Имя поля с номером
Return:
String -
storno(docId, check) → Boolean
-
Пометить документ на удаление
Parameters:
Name Type Argument Default Description docId ID Идентификатор документа
check Boolean optional true Флаг, делать проверки перед сохранением, при этом могут быть заданы вопросы или показаны сообщения пользователю
Return:
Boolean -
submit(document) → Boolean
-
Записать документ
Parameters:
Name Type Description document Document Документ для записи
Return:
Boolean -Результат выполнения операции
-
submitRow(docId, row) → Boolean
-
Записать строчку документа
Parameters:
Name Type Description docId String Идентификатор документа
row DocumentRow Строчка документа соответствующего типа
Return:
Boolean -
validate(docId, check) → Boolean
-
Валидировать документ
Parameters:
Name Type Argument Default Description docId ID Идентификатор документа
check Boolean optional true Флаг, делать проверки перед сохранением, при этом могут быть заданы вопросы или показаны сообщения пользователю
Return:
Boolean -
validatedIdList(conditions) → IDList
-
Получить идентификаторы валидированных документах
Parameters:
Name Type Description conditions ValidatedIdListConditions условия выборки валидированных документов
Return: