Версия: 6.x
burger close
Класс InventorizationApi
Граф наследования:InventorizationApi:
EntityList BaseModel

Подробное описание

Класс содержит API функции для работы с документом инвентаризации

Открытые члены

 __construct ()
 
 getDocumentPrintForm ($document_id, $document_type)
 
 getProductDoubles ($products)
 
 prepareProductsArray ($items, $warehouse_id=false, $recalculate=false)
 
 saveProducts ($products, $document_id, $document=null)
 
 updateLinkedDocuments ($document, $items, $links)
 
 getProductsByDocumentId ($document_id)
 
 getProductsTable ($document_id, $is_inventory=false, $items=null, $archived=false, $disable_edit=false)
 
 getAddedItems ($document_id, $is_inventory=false, $items=false)
 
 getProduct ($product_id)
 
 getProductOffers ($product_id)
 
 makeTotalInventorization ($current_warehouse, $offset, $inventory_id)
 
 getNewInventorization ($warehouse_id)
 
- Открытые члены унаследованные от EntityList
 __construct (AbstractObject $orm_element, array $options=[])
 
 setDefaultOrder ($order)
 
 getNameField ()
 
 setNameField ($field)
 
 setAliasField ($field)
 
 setSortField ($field)
 
 setIdField ($field)
 
 getIdField ()
 
 getSiteIdField ()
 
 setLoadOnDelete ($bool)
 
 setSiteContext ($site_id=null)
 
 getSiteContext ()
 
 setMultisite ($bool)
 
 isMultisite ()
 
 resetQueryObject ()
 
 getCleanQueryObject ()
 
 queryObj ()
 
 setQueryObj (\RS\Orm\Request $q)
 
 defAlias ()
 
 setFilter ($key, $value=null, $type= '=', $prefix= 'AND', array $options=[])
 
 clearFilter ()
 
 getList ($page=null, $page_size=null, $order=null)
 
 getListAsArray ($page=0, $page_size=0, $order= '')
 
 getListAsResource ($page=0, $page_size=0, $order= '')
 
 getPagedList ($page_size)
 
 loadAssocList ($key_field, $value=null)
 
 getAssocList ($key_field, $value=null)
 
 setOrder ($order=null, array $values=null)
 
 setGroup ($group=null)
 
 getListCount ()
 
 getFirst ()
 
 getOneItem ($id)
 
 getById ($id, $request=null)
 
 getElement ()
 
 setElement ($object)
 
 getElementClass ()
 
 getNewElement ()
 
 save ($id=null, array $user_post=[])
 
 addFilterControl (\RS\Html\Filter\Control $filter_control)
 
 addTableControl (\RS\Html\Table\Control $table_control)
 
 del (array $ids)
 
 multiDelete ($ids)
 
 getSelectList ($first=[])
 
 multieditFormView ($tpl_path, $formfile, array $addparam=[])
 
 multiUpdate (array $data, $ids=[])
 
 moveElement ($from, $to, $flag,\RS\Orm\Request $extra_expr=null)
 
 noWriteRights ($right=DefaultModuleRights::RIGHT_UPDATE)
 
 getIdByAlias ($alias_or_id, $alias_field=null)
 
 saveRequest ($key)
 
 getIdsByRequest (\RS\Orm\Request $request)
 
 __set ($name, $value)
 
 __get ($name)
 
 __isset ($name)
 
 __unset ($name)
 
- Открытые члены унаследованные от BaseModel
 addError ($message, $fieldname=null, $form=null)
 
 hasError ()
 
 getErrors ()
 
 cleanErrors ()
 
 getDisplayErrors ()
 
 getErrorsStr ()
 
 getFormErrors ($form, $separator= ', ')
 
 getNonFormErrors ($separator= ', ')
 
 exportErrors ()
 
 importErrors ($data)
 

Поля данных

 $items
 
 $inventarization
 
- Поля данных унаследованные от EntityList
const WHERE_CONDITION_VAR = 'where_conditions'
 
- Поля данных унаследованные от BaseModel
 $form_fieldname = []
 
 $errors_by_form = []
 
 $errors_non_form = []
 
 $errors = []
 

Защищенные данные

 $items_cache = []
 
- Защищенные данные унаследованные от EntityList
 $default_order
 
 $load_on_delete = false
 
 $id_field = 'id'
 
 $alias_field
 
 $sort_field
 
 $name_field
 
 $site_id_field = 'site_id'
 
 $is_multisite = false
 
 $site_context
 
 $def_table_alias = 'A'
 
 $obj
 
 $obj_instance
 
 $filter_active = false
 
 $multiedit_template = '%system%/coreobject/multiedit_form.tpl'
 
 $assocPlainList = []
 
 $parsePrefixes = ['&' => 'AND'
 
 $cache_alias = []
 
 $options = []
 
 $q
 
- Защищенные данные унаследованные от BaseModel
 $default_error_fieldname = 'Информация'
 

Дополнительные унаследованные члены

- Открытые статические члены унаследованные от EntityList
static getInstance ($key= 'default')
 
static staticSelectList ($first=[])
 
static getSavedRequest ($key, $default=null)
 
- Защищенные члены унаследованные от EntityList
 parseArrayFilter ($filters)
 
 filterLike ($key, $value, $type, $prefix, $options)
 
 filterIs ($key, $value, $type, $prefix, $options)
 
 filterFullText ($key, $value, $type, $prefix, $options)
 
 filterIn ($key, $value, $type, $prefix, $options)
 
 filterNotin ($key, $value, $type, $prefix, $options)
 
 filterDefault ($key, $value, $type, $prefix, $options)
 
 setPage ($page, $pageSize)
 
 moveArrayUp ($arr)
 
 moveArrayDown ($arr)
 
- Статические защищенные данные унаследованные от EntityList
static $instance = []
 

Конструктор(ы)

__construct ( )

Методы

getAddedItems (   $document_id,
  $is_inventory = false,
  $items = false 
)

Получить html с элементами input type="hidden" для вставки в форму документа

Аргументы
$document_id
bool$is_inventory
Возвращает
string
getDocumentPrintForm (   $document_id,
  $document_type 
)

Получить форму документа для печати

Аргументы
$document_id
Возвращает
string
getNewInventorization (   $warehouse_id)

Получить новый объект инвентаризации

Аргументы
integer$warehouse_id- id склада
Возвращает
Inventorization
getProduct (   $product_id)

Получить объект товара

Аргументы
$product_id
Возвращает
Product
getProductDoubles (   $products)

Получить одинаковые товары в документе, если есть

Аргументы
$products
Возвращает
array|bool
getProductOffers (   $product_id)

Получить комплектации товара

Аргументы
$product_id
Возвращает
array
getProductsByDocumentId (   $document_id)

Получить товары нужного документа

Аргументы
$document_id
Возвращает
array
getProductsTable (   $document_id,
  $is_inventory = false,
  $items = null,
  $archived = false,
  $disable_edit = false 
)

Получить html с таблицей товаров для вставки в форму документа

Аргументы
$document_id
bool$is_inventory
Возвращает
string
makeTotalInventorization (   $current_warehouse,
  $offset,
  $inventory_id 
)

Проводит инвентаризацию при включении складского учета

Аргументы
integer$current_warehouse- id склада, по которому идет инвентаризация
integer$offset- стартовая позиция для выборки товаров
integer$inventory_id- id текущей инвентаризации
Возвращает
bool|array
prepareProductsArray (   $items,
  $warehouse_id = false,
  $recalculate = false 
)

Подготоваить товары, пришедшие из POST, для записи

Аргументы
$items
bool$warehouse_id
bool$recalculate
Возвращает
array
saveProducts (   $products,
  $document_id,
  $document = null 
)

Сохранить товары

Аргументы
$products
$document_id
$document
Возвращает
bool
updateLinkedDocuments (   $document,
  $items,
  $links 
)

Обновляет связанный докумсент

Аргументы
$document
$items
$links

Поля

$inventarization
$items
$items_cache = []
protected