oneCInteraction 1.2.1__tar.gz → 1.2.2__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 (27) hide show
  1. {onecinteraction-1.2.1/src/oneCInteraction.egg-info → onecinteraction-1.2.2}/PKG-INFO +1 -1
  2. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/discounts.py +17 -4
  3. {onecinteraction-1.2.1 → onecinteraction-1.2.2/src/oneCInteraction.egg-info}/PKG-INFO +1 -1
  4. onecinteraction-1.2.2/src/oneCInteraction.egg-info/scm_version.json +8 -0
  5. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/tests/test_lib.py +5 -1
  6. onecinteraction-1.2.1/src/oneCInteraction.egg-info/scm_version.json +0 -8
  7. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/.github/workflows/publish.yml +0 -0
  8. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/.gitignore +0 -0
  9. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/LICENSE +0 -0
  10. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/README.md +0 -0
  11. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/pyproject.toml +0 -0
  12. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/setup.cfg +0 -0
  13. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/__init__.py +0 -0
  14. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/categories.py +0 -0
  15. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/characteristics.py +0 -0
  16. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/connection.py +0 -0
  17. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/customers.py +0 -0
  18. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/groups.py +0 -0
  19. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/log.py +0 -0
  20. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/nomenclature.py +0 -0
  21. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/orders.py +0 -0
  22. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction/structures.py +0 -0
  23. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction.egg-info/SOURCES.txt +0 -0
  24. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction.egg-info/dependency_links.txt +0 -0
  25. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction.egg-info/requires.txt +0 -0
  26. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction.egg-info/scm_file_list.json +0 -0
  27. {onecinteraction-1.2.1 → onecinteraction-1.2.2}/src/oneCInteraction.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oneCInteraction
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
@@ -10,16 +10,22 @@ class DiscountsManager:
10
10
  def c_v8(self):
11
11
  return self.c_connection.c_v8
12
12
 
13
- def get_active_groups(self) -> list:
14
- """Retrieves and groups all active nomenclature discounts into DiscountGroup structures."""
13
+ def get_active_groups(self, s_discount_type_codeIn: str = None) -> list:
14
+ """Retrieves and groups active nomenclature discounts into DiscountGroup structures.
15
+ If s_discount_type_codeIn is specified, only returns groups matching that discount type code.
16
+ """
15
17
  if not self.c_v8:
16
18
  log_sys("Failed to get active discount groups: No connection to 1C.", 1)
17
19
  return []
18
20
 
19
21
  try:
20
- log_sys("Fetching active nomenclature discounts from 1C...")
22
+ if s_discount_type_codeIn is not None:
23
+ log_sys(f"Fetching active nomenclature discounts from 1C filtered by type code: '{s_discount_type_codeIn}'...")
24
+ else:
25
+ log_sys("Fetching active nomenclature discounts from 1C...")
21
26
  query = self.c_v8.NewObject("Query")
22
- query.Text = """
27
+
28
+ query_text = """
23
29
  SELECT
24
30
  Скидки.Регистратор.Номер КАК DocNumber,
25
31
  ISNULL(Скидки.Регистратор.ТипСкидкиНаценки.Наименование, "Знижка") КАК DiscountName,
@@ -36,8 +42,15 @@ class DiscountsManager:
36
42
  Скидки.ПроцентСкидкиНаценки > 0
37
43
  """
38
44
 
45
+ if s_discount_type_codeIn is not None:
46
+ query_text += "\n AND Скидки.Регистратор.ТипСкидкиНаценки.Код = &DiscountTypeCode"
47
+
48
+ query.Text = query_text
49
+
39
50
  c_currDate = datetime.now(self.c_connection.tz_kiev).replace(tzinfo=None)
40
51
  query.SetParameter("CurrentDate", c_currDate)
52
+ if s_discount_type_codeIn is not None:
53
+ query.SetParameter("DiscountTypeCode", s_discount_type_codeIn)
41
54
 
42
55
  c_result = query.Execute()
43
56
  if c_result is None or c_result.IsEmpty():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oneCInteraction
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.2.2",
3
+ "distance": 0,
4
+ "node": "g20b3b63d3a854a5d08a4e7d8ff79d678622966c4",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-07-13"
8
+ }
@@ -116,7 +116,11 @@ try:
116
116
  # Test DiscountsManager when connection is not active
117
117
  discounts_res = c_conn.discounts.get_active_groups()
118
118
  assert isinstance(discounts_res, list) and len(discounts_res) == 0, f"Expected empty list since connection is not active, got {discounts_res}"
119
- print("Success: DiscountsManager.get_active_groups tested with no active connection.")
119
+
120
+ discounts_res_filtered = c_conn.discounts.get_active_groups("B2B")
121
+ assert isinstance(discounts_res_filtered, list) and len(discounts_res_filtered) == 0, f"Expected empty list since connection is not active, got {discounts_res_filtered}"
122
+
123
+ print("Success: DiscountsManager.get_active_groups tested with no active connection (with and without s_discount_type_codeIn parameter).")
120
124
 
121
125
  # Test CustomersManager when connection is not active
122
126
  cust_res = c_conn.customers.get("CUST001")
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.2.1",
3
- "distance": 0,
4
- "node": "g091321de2f563ed05b75c38b33a5e1982999ef72",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-07-11"
8
- }
File without changes