Модель Cassa (инфо. о кассе)
Модель Cassa — представляет кассы в программе vetmanager
* @property integer $id //ID * @property string $title // Название кассы * @property integer $assigned_user_id // ID владельца из таблицы user * @property string $inventarization_date // Дата * @property integer $client_cass // Прием оплаты со счетов значения: 1 - можно оплачивать счета в эту кассу, 0 - нет * @property integer $main_cassa // Главная касса * @property integer(0,1) $is_blocked // Заблокирована или нет * @property integer $has_unfinished_docs // Есть незаконченные документы * @property enum(‘active’,’deactivated’, ‘deleted’) $status // Статус * @property integer $clinic_id // ИД клиники, к которой привязана касса * @property float $summa_cash // Сумма наличных средств на текущий момент в кассе * @property float $summa_cashless // Сумма безналичных средств в кассе * @property integer(0,1) $is_system // Является системной
Модель Departments - отделы
* @property integer $id //ID @property string $title // Название отдела * @property string $tax_type_number_title // НДС * @property integer $tax_type_number // ID НДС * @property integer $number // Порядковый номер * @property integer $tax_system // поле number из таблицы fiscal_tax_systems * @property string $tax_system_title // поле title из таблицы fiscal_tax_systems * @property string $print_type // тип печати * @property integer $clinic_id // ID клиники
Модель DepartmentToDocument - таблица линковки отделов к товарам/группам товаров/комбинациям
* @property integer $id //ID @property integer $clinic_id // ID клиники * @property integer $department_id // ID отдела @property string $document_type // тип документа значения: good good_group good_tag * @property integer $document_id // ID документа, в зависимости от document_type будет good - (ID из таблицы good) / good_group - (ID из таблицы good_group) / good_tag - (ID из таблицы good_tag)
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Departments' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": "2",
"departments": [
{
"id": "1",
"title": "department 01",
"tax_type_number_title": "НДС 10%",
"tax_type_number": "2",
"number": "1",
"tax_system": "1",
"tax_system_title": "ОСН",
"print_type": "combination_header_as_service",
"clinic_id": "1"
},
{
"id": "2",
"title": "department 02",
"tax_type_number_title": "НДС 0%",
"tax_type_number": "5",
"number": "2",
"tax_system": "4",
"tax_system_title": "УСН доход-расход",
"print_type": "combination_header_as_service",
"clinic_id": "1"
}
]
}
}Пример запроса
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/DepartmentToDocument' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": "1",
"departmentToDocument": [
{
"id": "1",
"clinic_id": "1",
"department_id": "2",
"document_type": "good",
"document_id": "5379"
}
]
}
}Модель Cassaclose(Закрытие кассы)
Модель Cassaclose — представляет Закрытие кассы
* @property integer $id //ID
* @property string $date // Дата создания
* @property integer $id_cassa // ID из модели Cassa
* @property enum('exec', 'save') $status // Статус документа
* @property integer $closed_user_id // ID user, закрывший кассу
* @property integer $amount // Сумма наличных средств на момент закрытия
* @property integer $amount_cashless // Сумма безналичных средств на момент закрытияМодель Cassarashod(Расходный ордер)
Модель Cassarashod — представляет Расходный ордер
* @property integer $id // ID документа
* @property timestamp $date // Дата создания
* @property string $invoice // Счет
* @property integer $id_user // ID владельца кассы
* @property double $summa // Сумма
* @property string $descr // Описание
* @property integer $id_cassa // ID кассы
* @property enum('exec','save','deleted') $status // статус документа
* @property integer $prihod_id // ID приходной накладной, если расходный ордер создавали на основании него
* @property integer $recipient_of_funds // ID контрагента, модель Suppliers
* @property integer $operation_type_id // ID операции расходов
* @property integer $document_type_id // ID типа входящего документа, из справочника "Вид входящего документа"
* @property integer $document_date // Дата входящего документаПример cassa
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Cassa' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": "4",
"cassa": [
{
"id": "1",
"title": "Банк безнал. (системная касса клиники №1)",
"assigned_user_id": "1",
"inventarization_date": "2021-06-04 16:52:47",
"client_cass": "0",
"main_cassa": "0",
"is_blocked": "0",
"has_unfinished_docs": "0",
"status": "active",
"clinic_id": "1",
"summa_cash": "0.0000000000",
"summa_cashless": "0.0000000000",
"is_system": "1",
"show_in_cashflow": "0"
},
{
"id": "2",
"title": "Новая касса",
"assigned_user_id": "1",
"inventarization_date": "2021-06-22 16:20:22",
"client_cass": "1",
"main_cassa": "0",
"is_blocked": "0",
"has_unfinished_docs": "0",
"status": "active",
"clinic_id": "1",
"summa_cash": "0.0000000000",
"summa_cashless": "0.0000000000",
"is_system": "0",
"show_in_cashflow": "1"
},
{
"id": "3",
"title": "касса1",
"assigned_user_id": "1",
"inventarization_date": "2021-09-23 10:49:00",
"client_cass": "1",
"main_cassa": "0",
"is_blocked": "0",
"has_unfinished_docs": "0",
"status": "active",
"clinic_id": "1",
"summa_cash": "998099.0000000000",
"summa_cashless": "0.0000000000",
"is_system": "0",
"show_in_cashflow": "1"
},
{
"id": "4",
"title": "касса2",
"assigned_user_id": "1",
"inventarization_date": "2021-09-23 10:49:57",
"client_cass": "0",
"main_cassa": "0",
"is_blocked": "0",
"has_unfinished_docs": "0",
"status": "active",
"clinic_id": "1",
"summa_cash": "0.0000000000",
"summa_cashless": "0.0000000000",
"is_system": "0",
"show_in_cashflow": "1"
}
]
}
}Пример Cassaclose
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Cassaclose/1' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"cassaclose": {
"id": "1",
"date": "2021-09-23 12:34:47",
"id_cassa": "3",
"status": "exec",
"closed_user_id": "1",
"amount": "998169.0000000000",
"amount_cashless": "0.0000000000",
"closedUser": {
"id": "1",
"last_name": "admin",
"first_name": "",
"middle_name": "",
"login": "admin",
"passwd": "9205814c8bc98857f5e07f3bae30ad68",
"position_id": "8",
"email": "email1@mail.ru",
"phone": "00000000000",
"cell_phone": "0000000000",
"address": "Address 1",
"role_id": "7",
"is_active": "1",
"calc_percents": "1",
"nickname": "admin",
"youtrack_login": "",
"youtrack_password": "",
"last_change_pwd_date": "0000-00-00",
"is_limited": "0",
"carrotquest_id": "two:1",
"sip_number": "",
"user_inn": ""
},
"idCassa": {
"id": "3",
"title": "касса1",
"assigned_user_id": "1",
"inventarization_date": "2021-09-23 12:34:47",
"client_cass": "1",
"main_cassa": "0",
"is_blocked": "0",
"has_unfinished_docs": "0",
"status": "active",
"clinic_id": "1",
"summa_cash": "998169.0000000000",
"summa_cashless": "0.0000000000",
"is_system": "0",
"show_in_cashflow": "1"
},
"payments": [
{
"id": "3",
"amount": "70.0000000000",
"status": "exec",
"cassa_id": "3",
"cassaclose_id": "1",
"create_date": "2021-09-23 10:52:33",
"payed_user": "1",
"description": "",
"payment_type": "cash",
"invoice_id": "3",
"parent_id": "0"
}
]
}
}
}Пример Cassarashod
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Cassarashod/1' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"cassarashod": {
"id": "1",
"date": "2015-02-24 14:17:30",
"invoice": "123",
"id_user": "1",
"summa": "0.0000000000",
"descr": "description",
"id_cassa": "1",
"status": "exec",
"prihod_id": "1",
"recipient_of_funds": "4",
"operation_type_id": "0",
"document_type_id": null,
"document_date": "0000-00-00 00:00:00",
"summa_cashless": "123456.0000000000",
"responsible_user_id": "0",
"create_date": "2015-02-24 14:17:30",
"RecipientOfFunds": {
"id": "4",
"contact_person": "1",
"company_name": "1",
"city_id": "145",
"address": "",
"phone": "",
"mail": "",
"inn": null,
"bank_ik": null,
"bank_account": null,
"bank_account_corr": null,
"bank_name": null,
"person_type": "legal_person",
"view_in_modules": "prihod,rashod,cassarashod",
"status": "ACTIVE",
"note": null
}
}
}
}