-
Notifications
You must be signed in to change notification settings - Fork 4
/
report_profit.go
107 lines (93 loc) · 4.38 KB
/
report_profit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package moysklad
import "github.com/shopspring/decimal"
// Profit общие поля для структур отчёта "Прибыльность"
type Profit struct {
Margin decimal.Decimal `json:"margin"`
Profit decimal.Decimal `json:"profit"`
ReturnAvgCheck decimal.Decimal `json:"returnAvgCheck"`
ReturnCostSum decimal.Decimal `json:"returnCostSum"`
ReturnSum decimal.Decimal `json:"returnSum"`
SalesAvgCheck decimal.Decimal `json:"salesAvgCheck"`
SellCostSum decimal.Decimal `json:"sellCostSum"`
SellSum decimal.Decimal `json:"sellSum"`
ReturnCount float64 `json:"returnCount"`
SalesCount float64 `json:"salesCount"`
}
// ProfitByAssortment Прибыльность по товарам
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-towaram
type ProfitByAssortment struct {
Assortment ProfitReportAssortment `json:"assortment"`
SellCostSum decimal.Decimal `json:"sellCostSum"`
Profit decimal.Decimal `json:"profit"`
ReturnCost decimal.Decimal `json:"returnCost"`
ReturnCostSum decimal.Decimal `json:"returnCostSum"`
ReturnPrice decimal.Decimal `json:"returnPrice"`
ReturnSum decimal.Decimal `json:"returnSum"`
SellCost decimal.Decimal `json:"sellCost"`
Margin decimal.Decimal `json:"margin"`
SellPrice decimal.Decimal `json:"SellPrice"`
SellSum decimal.Decimal `json:"sellSum"`
ReturnQuantity float64 `json:"returnQuantity"`
SellQuantity float64 `json:"sellQuantity"`
}
// ProfitReportAssortment Структура объекта assortment
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-struktura-ob-ekta-assortment
type ProfitReportAssortment struct {
Image Meta `json:"image"`
MetaName
Uom MetaName `json:"uom,omitempty"`
Code string `json:"code"`
Article string `json:"article"`
}
// ProfitByCounterparty Прибыльность по покупателям
// Ключевое слово: salesbyCounterparty
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-pokupatelqm
type ProfitByCounterparty struct {
Counterparty MetaName `json:"counterparty"`
Profit
}
func (r ProfitByCounterparty) MetaType() MetaType {
return MetaTypeReportProfitByCounterparty
}
// ProfitByEmployee Прибыльность по сотрудникам
// Ключевое слово: salesbyemployee
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-sotrudnikam
type ProfitByEmployee struct {
Employee MetaName `json:"employee"`
Profit
}
func (r ProfitByEmployee) MetaType() MetaType {
return MetaTypeReportProfitByEmployee
}
// ProfitByProduct Прибыльность по товарам
// Ключевое слово: salesbyproduct
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-towaram
type ProfitByProduct struct {
ProfitByAssortment
}
func (r ProfitByProduct) MetaType() MetaType {
return MetaTypeReportProfitByProduct
}
// ProfitBySalesChannel Прибыльность по каналам продаж
// Ключевое слово: salesbysaleschannel
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-kanalam-prodazh
type ProfitBySalesChannel struct {
SalesChannel struct {
Meta Meta `json:"meta"`
Name string `json:"name"`
Type SalesChannelType `json:"type"`
} `json:"salesChannel"`
Profit
}
func (r ProfitBySalesChannel) MetaType() MetaType {
return MetaTypeReportProfitBySalesChannel
}
// ProfitByVariant Прибыльность по модификациям
// Ключевое слово: salesbyvariant
// Документация МойСклад: https://dev.moysklad.ru/doc/api/remap/1.2/reports/#otchety-otchet-pribyl-nost-poluchit-pribyl-nost-po-modifikaciqm
type ProfitByVariant struct {
ProfitByAssortment
}
func (r ProfitByVariant) MetaType() MetaType {
return MetaTypeReportProfitByVariant
}