SalesPlan

statistics

сортировка по вкладу: **contribution,asc/desc**
сортировка по эффективности: **perHour,asc/desc**
(default: **contribution,desc**)
request
GET /api/v2/sales-plans/statistics/1999000050?sort=perHour,desc HTTP/1.1
Table 363. /api/v2/sales-plans/statistics/{salesPlanId}
Parameter Description

salesPlanId

sales plan id

Parameter Description

sort

user list sort parameter

response
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"
}
Table 364. response description
Path Type Description

id

Number

sales plan id

startOn

String

start date of plan

finishOn

String

finish date of plan

department

Object

department

department.id

Number

department id

department.name

String

department name

description

String

description

currentSum

Number

current sum

plannedSum

Number

planned sum

optimisticSum

Number

optimistic sum

plannedSumPercentage

Number

percent of planned sum

optimisticSumPercentage

Number

percent of optimistic sum

todaySum

Number

today sum

todaySumPercentage

Number

today sum percentage

todayPlan

Number

today plan

todayOptimisticPlan

Number

today optimistic plan

status

String

enum: DELETED, PAST, ACTIVE, FUTURE

usersEfficiency

Array

user efficiency

usersEfficiency.user

Object

user

usersEfficiency.user.id

Number

user id

usersEfficiency.user.firstName

String

user first name

usersEfficiency.user.familyName

String

user family name

usersEfficiency.user.patronymicName

String

user patronymic name

usersEfficiency.contribution

Number

user contribution

usersEfficiency.percentContribution

Number

user percent contribution

usersEfficiency.workedHours

Number

hours user worked

usersEfficiency.workedMinutes

Number

minutes user worked

usersEfficiency.perHour

Number

user profit per hour

recreate

Пересоздает планы, пересчитывая их текущие суммы, а также вклады пользователей
request
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

startAtFrom

Минимальная дата начала плана

startAtTo

Максимальная дата начала плана

response
HTTP/1.1 200 OK

get current

request
GET /api/v2/sales-plans/current HTTP/1.1
response
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
}
Table 365. response description
Path Type Description

id

Number

sales plan id

startOn

String

start date of plan

finishOn

String

finish date of plan

department

Object

department

department.id

Number

department id

department.name

String

department name

description

String

description

currentSum

Number

current sum

plannedSum

Number

planned sum

optimisticSum

Number

optimistic sum

plannedSumPercentage

Number

percent of planned sum

optimisticSumPercentage

Number

percent of optimistic sum

todaySum

Number

today sum

todaySumPercentage

Number

today sum percentage

todayPlan

Number

today plan

todayOptimisticPlan

Number

today optimistic plan

status

String

enum: DELETED, PAST, ACTIVE, FUTURE

usersEfficiency

Array

user efficiency

usersEfficiency.user

Object

user

usersEfficiency.user.id

Number

user id

usersEfficiency.user.firstName

String

user first name

usersEfficiency.user.familyName

String

user family name

usersEfficiency.user.patronymicName

String

user patronymic name

usersEfficiency.contribution

Number

user contribution

usersEfficiency.percentContribution

Number

user percent contribution

usersEfficiency.workedHours

Number

hours user worked

usersEfficiency.workedMinutes

Number

minutes user worked

usersEfficiency.perHour

Number

user profit per hour

get all by department

GET /api/v2/departments/1000000003/sales-plans?deleted=false HTTP/1.1
Table 366. /api/v2/departments/{departmentId}/sales-plans
Parameter Description

departmentId

department id

Parameter Description

deleted

only deleted/not deleted plans. Value: true/false

response
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"
} ]
Table 367. response description
Path Type Description

id

Number

sales plan id

startOn

String

start date of plan

finishOn

String

finish date of plan

delete

Попытка удалить активный или уже удаленный план выкинет статус 409
request
DELETE /api/v2/sales-plans/6543000010 HTTP/1.1
Table 368. /api/v2/sales-plans/{salesPlanId}
Parameter Description

salesPlanId

sales plan id