oneCInteraction 1.2.2__tar.gz → 1.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {onecinteraction-1.2.2/src/oneCInteraction.egg-info → onecinteraction-1.2.3}/PKG-INFO +22 -2
  2. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/README.md +21 -1
  3. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/discounts.py +1 -0
  4. {onecinteraction-1.2.2 → onecinteraction-1.2.3/src/oneCInteraction.egg-info}/PKG-INFO +22 -2
  5. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/scm_version.json +2 -2
  6. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/.github/workflows/publish.yml +0 -0
  7. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/.gitignore +0 -0
  8. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/LICENSE +0 -0
  9. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/pyproject.toml +0 -0
  10. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/setup.cfg +0 -0
  11. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/__init__.py +0 -0
  12. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/categories.py +0 -0
  13. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/characteristics.py +0 -0
  14. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/connection.py +0 -0
  15. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/customers.py +0 -0
  16. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/groups.py +0 -0
  17. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/log.py +0 -0
  18. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/nomenclature.py +0 -0
  19. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/orders.py +0 -0
  20. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction/structures.py +0 -0
  21. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/SOURCES.txt +0 -0
  22. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/dependency_links.txt +0 -0
  23. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/requires.txt +0 -0
  24. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/scm_file_list.json +0 -0
  25. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/src/oneCInteraction.egg-info/top_level.txt +0 -0
  26. {onecinteraction-1.2.2 → onecinteraction-1.2.3}/tests/test_lib.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oneCInteraction
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: A Python library for interacting with 1C:Enterprise databases via COM connection.
5
5
  Author: agcl
6
6
  Classifier: Programming Language :: Python :: 3
@@ -47,6 +47,7 @@ The library is built on the principle of composition: the main `Connection` clas
47
47
  - `Connection.characteristics` (`CharacteristicsManager`) — reads properties of product variants.
48
48
  - `Connection.orders` (`OrdersManager`) — handles creation and updates of customer orders.
49
49
  - `Connection.customers` (`CustomersManager`) — manages customers/counterparties.
50
+ - `Connection.discounts` (`DiscountsManager`) — manages discount groups and active nomenclature discounts.
50
51
 
51
52
  ---
52
53
 
@@ -155,6 +156,14 @@ A buyer's order.
155
156
 
156
157
  Calling `str(order_obj)` returns a nicely formatted HTML string suitable for sending to a Telegram bot.
157
158
 
159
+ #### `DiscountGroup`
160
+ Represents a group of nomenclature discounts.
161
+ - `s_name` (str): Discount group name or comment.
162
+ - `s_document_number` (str): Number of the document that set the discount in 1C.
163
+ - `s_discount_type_code` (str): Discount type code (e.g. `"B2B"`).
164
+ - `n_discount_percent` (float): Discount percentage.
165
+ - `l_nomenclatures` (list of dict): List of products in the discount group (each product is a dict with keys `"code"`, `"name"`, `"uuid"`, and `"char_name"`).
166
+
158
167
  ---
159
168
 
160
169
  ### 3. Nomenclature Manager `NomenclatureManager` (`Connection.nomenclature`)
@@ -239,7 +248,18 @@ Defined in [customers.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionL
239
248
 
240
249
  ---
241
250
 
242
- ### 9. Logging (`log.py`)
251
+ ### 9. Discounts Manager `DiscountsManager` (`Connection.discounts`)
252
+ Defined in [discounts.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/discounts.py).
253
+
254
+ - `get_active_groups(s_discount_type_codeIn: str = None) -> list`
255
+ Retrieves active discount groups and returns them as a list of `DiscountGroup` objects.
256
+ - If `s_discount_type_codeIn` is specified, only returns groups matching that discount type code.
257
+ - Queries active discounts from the `СкидкиНаценкиНоменклатуры` information register.
258
+ - Only retrieves discounts where the percentage is greater than zero and the registrar document's end date (`ДатаОкончания`) is either not set or is greater than or equal to the current date.
259
+
260
+ ---
261
+
262
+ ### 10. Logging (`log.py`)
243
263
  Defined in [log.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/log.py).
244
264
 
245
265
  All actions are logged automatically. The library resolves the root directory of the project that imported it and stores log files in the relative path `log/system/[calling_module_name].log`.
@@ -32,6 +32,7 @@ The library is built on the principle of composition: the main `Connection` clas
32
32
  - `Connection.characteristics` (`CharacteristicsManager`) — reads properties of product variants.
33
33
  - `Connection.orders` (`OrdersManager`) — handles creation and updates of customer orders.
34
34
  - `Connection.customers` (`CustomersManager`) — manages customers/counterparties.
35
+ - `Connection.discounts` (`DiscountsManager`) — manages discount groups and active nomenclature discounts.
35
36
 
36
37
  ---
37
38
 
@@ -140,6 +141,14 @@ A buyer's order.
140
141
 
141
142
  Calling `str(order_obj)` returns a nicely formatted HTML string suitable for sending to a Telegram bot.
142
143
 
144
+ #### `DiscountGroup`
145
+ Represents a group of nomenclature discounts.
146
+ - `s_name` (str): Discount group name or comment.
147
+ - `s_document_number` (str): Number of the document that set the discount in 1C.
148
+ - `s_discount_type_code` (str): Discount type code (e.g. `"B2B"`).
149
+ - `n_discount_percent` (float): Discount percentage.
150
+ - `l_nomenclatures` (list of dict): List of products in the discount group (each product is a dict with keys `"code"`, `"name"`, `"uuid"`, and `"char_name"`).
151
+
143
152
  ---
144
153
 
145
154
  ### 3. Nomenclature Manager `NomenclatureManager` (`Connection.nomenclature`)
@@ -224,7 +233,18 @@ Defined in [customers.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionL
224
233
 
225
234
  ---
226
235
 
227
- ### 9. Logging (`log.py`)
236
+ ### 9. Discounts Manager `DiscountsManager` (`Connection.discounts`)
237
+ Defined in [discounts.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/discounts.py).
238
+
239
+ - `get_active_groups(s_discount_type_codeIn: str = None) -> list`
240
+ Retrieves active discount groups and returns them as a list of `DiscountGroup` objects.
241
+ - If `s_discount_type_codeIn` is specified, only returns groups matching that discount type code.
242
+ - Queries active discounts from the `СкидкиНаценкиНоменклатуры` information register.
243
+ - Only retrieves discounts where the percentage is greater than zero and the registrar document's end date (`ДатаОкончания`) is either not set or is greater than or equal to the current date.
244
+
245
+ ---
246
+
247
+ ### 10. Logging (`log.py`)
228
248
  Defined in [log.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/log.py).
229
249
 
230
250
  All actions are logged automatically. The library resolves the root directory of the project that imported it and stores log files in the relative path `log/system/[calling_module_name].log`.
@@ -40,6 +40,7 @@ class DiscountsManager:
40
40
  РегистрСведений.СкидкиНаценкиНоменклатуры.СрезПоследних(&CurrentDate, ) КАК Скидки
41
41
  WHERE
42
42
  Скидки.ПроцентСкидкиНаценки > 0
43
+ AND (Скидки.Регистратор.ДатаОкончания = DATETIME(1, 1, 1) OR Скидки.Регистратор.ДатаОкончания >= &CurrentDate)
43
44
  """
44
45
 
45
46
  if s_discount_type_codeIn is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oneCInteraction
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: A Python library for interacting with 1C:Enterprise databases via COM connection.
5
5
  Author: agcl
6
6
  Classifier: Programming Language :: Python :: 3
@@ -47,6 +47,7 @@ The library is built on the principle of composition: the main `Connection` clas
47
47
  - `Connection.characteristics` (`CharacteristicsManager`) — reads properties of product variants.
48
48
  - `Connection.orders` (`OrdersManager`) — handles creation and updates of customer orders.
49
49
  - `Connection.customers` (`CustomersManager`) — manages customers/counterparties.
50
+ - `Connection.discounts` (`DiscountsManager`) — manages discount groups and active nomenclature discounts.
50
51
 
51
52
  ---
52
53
 
@@ -155,6 +156,14 @@ A buyer's order.
155
156
 
156
157
  Calling `str(order_obj)` returns a nicely formatted HTML string suitable for sending to a Telegram bot.
157
158
 
159
+ #### `DiscountGroup`
160
+ Represents a group of nomenclature discounts.
161
+ - `s_name` (str): Discount group name or comment.
162
+ - `s_document_number` (str): Number of the document that set the discount in 1C.
163
+ - `s_discount_type_code` (str): Discount type code (e.g. `"B2B"`).
164
+ - `n_discount_percent` (float): Discount percentage.
165
+ - `l_nomenclatures` (list of dict): List of products in the discount group (each product is a dict with keys `"code"`, `"name"`, `"uuid"`, and `"char_name"`).
166
+
158
167
  ---
159
168
 
160
169
  ### 3. Nomenclature Manager `NomenclatureManager` (`Connection.nomenclature`)
@@ -239,7 +248,18 @@ Defined in [customers.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionL
239
248
 
240
249
  ---
241
250
 
242
- ### 9. Logging (`log.py`)
251
+ ### 9. Discounts Manager `DiscountsManager` (`Connection.discounts`)
252
+ Defined in [discounts.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/discounts.py).
253
+
254
+ - `get_active_groups(s_discount_type_codeIn: str = None) -> list`
255
+ Retrieves active discount groups and returns them as a list of `DiscountGroup` objects.
256
+ - If `s_discount_type_codeIn` is specified, only returns groups matching that discount type code.
257
+ - Queries active discounts from the `СкидкиНаценкиНоменклатуры` information register.
258
+ - Only retrieves discounts where the percentage is greater than zero and the registrar document's end date (`ДатаОкончания`) is either not set or is greater than or equal to the current date.
259
+
260
+ ---
261
+
262
+ ### 10. Logging (`log.py`)
243
263
  Defined in [log.py](file:///c:/Users/agcl/PycharmProjects/oneCInteractionLib/src/oneCInteraction/log.py).
244
264
 
245
265
  All actions are logged automatically. The library resolves the root directory of the project that imported it and stores log files in the relative path `log/system/[calling_module_name].log`.
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "1.2.2",
2
+ "tag": "1.2.3",
3
3
  "distance": 0,
4
- "node": "g20b3b63d3a854a5d08a4e7d8ff79d678622966c4",
4
+ "node": "gf2c9f1c0e0280923eb11b1c941bd21defdb76dd6",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-07-13"
File without changes