SalesPlan
statistics
сортировка по вкладу: **contribution,asc/desc** сортировка по эффективности: **perHour,asc/desc** (default: **contribution,desc**)
GET /api/v2/sales-plans/statistics/1999000050?sort=perHour,desc HTTP/1.1
Parameter | Description |
---|---|
|
sales plan id |
Parameter | Description |
---|---|
|
user list sort parameter |
HTTP/1.1 200 OK
{
"id" : 1999000050,
"startOn" : "01.02.2020",
"finishOn" : "01.03.2020",
"department" : {
"id" : 1000000003,
"name" : "Первый магазин"
},
"currentSum" : 50000.0,
"normCurrentSum" : 10000.0,
"differenceWithCurrentSum" : 40000.0,
"plannedSum" : 10000.0,
"optimisticSum" : 25000.0,
"percentageOfCompletionSum" : 500,
"todayCurrentSum" : null,
"percentageOfCompletionTodaySum" : null,
"todayPlannedSum" : null,
"todayOptimisticSum" : null,
"description" : "Test sales plan",
"usersEfficiency" : [ {
"user" : {
"id" : 1000000014,
"firstName" : "Тимофей",
"familyName" : "Кадын",
"patronymicName" : "Юрьевич",
"fullName" : "Кадын Тимофей Юрьевич",
"shortName" : "Кадын Т. Ю."
},
"contribution" : 1019.0,
"percentContribution" : 2.04,
"workedHours" : 2,
"workedMinutes" : 30,
"perHour" : 407.6
}, {
"user" : {
"id" : 1000000022,
"firstName" : "Тимофей",
"familyName" : "Кадын",
"patronymicName" : "Юрьевич",
"fullName" : "Кадын Тимофей Юрьевич",
"shortName" : "Кадын Т. Ю."
},
"contribution" : 5005.0,
"percentContribution" : 10.01,
"workedHours" : 31,
"workedMinutes" : 0,
"perHour" : 161.45
} ],
"salesPlanStatus" : "PAST"
}
Path | Type | Description |
---|---|---|
|
|
sales plan id |
|
|
start date of plan |
|
|
finish date of plan |
|
|
department |
|
|
department id |
|
|
department name |
|
|
description |
|
|
current sum |
|
|
planned sum |
|
|
optimistic sum |
|
|
percent of planned sum |
|
|
percent of optimistic sum |
|
|
today sum |
|
|
today sum percentage |
|
|
today plan |
|
|
today optimistic plan |
|
|
enum: DELETED, PAST, ACTIVE, FUTURE |
|
|
user efficiency |
|
|
user |
|
|
user id |
|
|
user first name |
|
|
user family name |
|
|
user patronymic name |
|
|
user contribution |
|
|
user percent contribution |
|
|
hours user worked |
|
|
minutes user worked |
|
|
user profit per hour |
recreate
Пересоздает планы, пересчитывая их текущие суммы, а также вклады пользователей
PUT /api/v2/sales-plans/recreate?startAtFrom=2025-08-01T00:00:00&startAtTo=2025-08-31T00:00:00 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Parameter | Description |
---|---|
|
Минимальная дата начала плана |
|
Максимальная дата начала плана |
HTTP/1.1 200 OK
get current
GET /api/v2/sales-plans/current HTTP/1.1
HTTP/1.1 200 OK
{
"id" : 1999000000,
"startOn" : "01.07.2025",
"finishOn" : "01.09.2025",
"department" : {
"id" : 1000000003,
"name" : "Первый магазин"
},
"currentSum" : 50000.0,
"normCurrentSum" : 920635.16,
"differenceWithCurrentSum" : null,
"plannedSum" : 1000000.0,
"optimisticSum" : null,
"percentageOfCompletionSum" : 5,
"todayCurrentSum" : 247200.0,
"percentageOfCompletionTodaySum" : null,
"todayPlannedSum" : 239440.0,
"todayOptimisticSum" : 0.0,
"description" : "Test sales plan",
"usersEfficiency" : null,
"salesPlanStatus" : null
}
Path | Type | Description |
---|---|---|
|
|
sales plan id |
|
|
start date of plan |
|
|
finish date of plan |
|
|
department |
|
|
department id |
|
|
department name |
|
|
description |
|
|
current sum |
|
|
planned sum |
|
|
optimistic sum |
|
|
percent of planned sum |
|
|
percent of optimistic sum |
|
|
today sum |
|
|
today sum percentage |
|
|
today plan |
|
|
today optimistic plan |
|
|
enum: DELETED, PAST, ACTIVE, FUTURE |
|
|
user efficiency |
|
|
user |
|
|
user id |
|
|
user first name |
|
|
user family name |
|
|
user patronymic name |
|
|
user contribution |
|
|
user percent contribution |
|
|
hours user worked |
|
|
minutes user worked |
|
|
user profit per hour |
get all by department
GET /api/v2/departments/1000000003/sales-plans?deleted=false HTTP/1.1
Parameter | Description |
---|---|
|
department id |
Parameter | Description |
---|---|
|
only deleted/not deleted plans. Value: true/false |
HTTP/1.1 200 OK
[ {
"id" : 2,
"startOn" : "01.02.2020",
"finishOn" : "29.02.2020"
}, {
"id" : 1000000001,
"startOn" : "01.01.2022",
"finishOn" : "01.02.2022"
}, {
"id" : 1999000000,
"startOn" : "01.07.2025",
"finishOn" : "01.09.2025"
} ]
Path | Type | Description |
---|---|---|
|
|
sales plan id |
|
|
start date of plan |
|
|
finish date of plan |
delete
Попытка удалить активный или уже удаленный план выкинет статус 409
DELETE /api/v2/sales-plans/6543000010 HTTP/1.1
Parameter | Description |
---|---|
|
sales plan id |