ITK-dev-shared-components 2.16.2__tar.gz → 2.17.0__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 (54) hide show
  1. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/PKG-INFO +1 -1
  2. itk_dev_shared_components-2.17.0/itk_dev_shared_components/boliglaan/common.py +80 -0
  3. itk_dev_shared_components-2.17.0/itk_dev_shared_components/boliglaan/login.py +37 -0
  4. itk_dev_shared_components-2.17.0/itk_dev_shared_components/boliglaan/search/search_advis.py +110 -0
  5. itk_dev_shared_components-2.17.0/itk_dev_shared_components/sap/__init__.py +0 -0
  6. itk_dev_shared_components-2.17.0/itk_dev_shared_components/smtp/__init__.py +0 -0
  7. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components.egg-info/PKG-INFO +1 -1
  8. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components.egg-info/SOURCES.txt +5 -0
  9. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/pyproject.toml +1 -1
  10. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/LICENSE +0 -0
  11. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/README.md +0 -0
  12. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/__init__.py +0 -0
  13. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/eflyt → itk_dev_shared_components-2.17.0/itk_dev_shared_components/boliglaan}/__init__.py +0 -0
  14. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/getorganized → itk_dev_shared_components-2.17.0/itk_dev_shared_components/boliglaan/search}/__init__.py +0 -0
  15. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/graph → itk_dev_shared_components-2.17.0/itk_dev_shared_components/eflyt}/__init__.py +0 -0
  16. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/eflyt/eflyt_case.py +0 -0
  17. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/eflyt/eflyt_letter.py +0 -0
  18. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/eflyt/eflyt_login.py +0 -0
  19. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/eflyt/eflyt_search.py +0 -0
  20. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/eflyt/eflyt_util.py +0 -0
  21. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/misc → itk_dev_shared_components-2.17.0/itk_dev_shared_components/getorganized}/__init__.py +0 -0
  22. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/getorganized/go_api.py +0 -0
  23. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/sap → itk_dev_shared_components-2.17.0/itk_dev_shared_components/graph}/__init__.py +0 -0
  24. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/graph/authentication.py +0 -0
  25. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/graph/common.py +0 -0
  26. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/graph/file.py +0 -0
  27. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/graph/mail.py +0 -0
  28. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/graph/site.py +0 -0
  29. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/__init__.py +0 -0
  30. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/authentication.py +0 -0
  31. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/cpr.py +0 -0
  32. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/nova_cases.py +0 -0
  33. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/nova_documents.py +0 -0
  34. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/nova_notes.py +0 -0
  35. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/nova_objects.py +0 -0
  36. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/nova_tasks.py +0 -0
  37. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/kmd_nova/util.py +0 -0
  38. {itk_dev_shared_components-2.16.2/itk_dev_shared_components/smtp → itk_dev_shared_components-2.17.0/itk_dev_shared_components/misc}/__init__.py +0 -0
  39. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/misc/address_lookup.py +0 -0
  40. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/misc/cpr_util.py +0 -0
  41. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/misc/cvr_lookup.py +0 -0
  42. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/misc/file_util.py +0 -0
  43. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/fmcacov.py +0 -0
  44. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/gridview_util.py +0 -0
  45. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/multi_session.py +0 -0
  46. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/opret_kundekontakt.py +0 -0
  47. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/sap_login.py +0 -0
  48. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/sap_util.py +0 -0
  49. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/sap/tree_util.py +0 -0
  50. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components/smtp/smtp_util.py +0 -0
  51. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components.egg-info/dependency_links.txt +0 -0
  52. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components.egg-info/requires.txt +0 -0
  53. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/itk_dev_shared_components.egg-info/top_level.txt +0 -0
  54. {itk_dev_shared_components-2.16.2 → itk_dev_shared_components-2.17.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itk_dev_shared_components
3
- Version: 2.16.2
3
+ Version: 2.17.0
4
4
  Summary: Shared components to use in RPA projects
5
5
  Author-email: ITK Development <itk-rpa@mkb.aarhus.dk>
6
6
  Project-URL: Homepage, https://github.com/itk-dev-rpa/itk-dev-shared-components
@@ -0,0 +1,80 @@
1
+ """This module contains functions to perform common actions in Boliglån."""
2
+
3
+ import time
4
+ from typing import Literal
5
+
6
+ import uiautomation
7
+ from uiautomation import PatternId
8
+
9
+
10
+ TabName = Literal["Låneoplysninger", "Advis", "Låneafvikling", "Dokumenter", "Dokumentunderskrifter", "Hændelser"]
11
+
12
+
13
+ def get_boliglaan() -> uiautomation.WindowControl:
14
+ """Get the Boliglån main window."""
15
+ return uiautomation.WindowControl(Name="KMD Boliglån", searchDepth=1)
16
+
17
+
18
+ def get_tab(tab_name: TabName) -> uiautomation.TabItemControl:
19
+ """Get the tab with the given name."""
20
+ bolig = get_boliglaan()
21
+ tab_control = bolig.TabControl(AutomationId="DXTabControlTabControlMain", searchDepth=6)
22
+ return tab_control.TabItemControl(Name=f"DXTabItem{tab_name}", searchDepth=1)
23
+
24
+
25
+ def select_tab(tab_name: TabName):
26
+ """Select the tab with the given name."""
27
+ get_tab(tab_name).GetSelectionItemPattern().Select()
28
+
29
+
30
+ def pin_sidebar():
31
+ """Unfold the search side bar and pin it."""
32
+ boliglaan = get_boliglaan()
33
+ group = boliglaan.GroupControl(AutomationId="DockLayoutManager", searchDepth=2)
34
+
35
+ pane = group.CustomControl(AutomationId="PART_LeftAutoHideTrayPanel")
36
+ pane.GetPattern(PatternId.ExpandCollapsePattern).Expand()
37
+
38
+ group.ButtonControl(AutomationId="PART_PinButton").GetInvokePattern().Invoke()
39
+
40
+
41
+ def wait_for_case_load(cpr: str, case_number: str, timeout: int = 15):
42
+ """Wait for the case to load.
43
+
44
+ Args:
45
+ cpr: The cpr number of the case.
46
+ case_number: The case number to wait for.
47
+ timeout: The maximum number of seconds to wait. Defaults to 15.
48
+
49
+ Raises:
50
+ LookupError: If the cpr isn't loaded.
51
+ LookupError: If the case number isn't loaded.
52
+ """
53
+ boliglaan = get_boliglaan()
54
+
55
+ # Look for cpr
56
+ info_box = boliglaan.CustomControl(ClassName="LaanTagerOplysningerUserControl", searchDepth=6)
57
+ if not info_box.TextControl(RegexName=f"{cpr}.*", searchDepth=1).Exists(maxSearchSeconds=timeout):
58
+ raise LookupError(f"Cpr wasn't found: {cpr}")
59
+
60
+ # Look for case number
61
+ loan_tab = get_tab("Låneoplysninger")
62
+ loan_tab.GetSelectionItemPattern().Select()
63
+ info_group = loan_tab.GroupControl(Name="Andre oplysninger", searchDepth=3)
64
+
65
+ for _ in range(timeout):
66
+ case_number_value = info_group.TextControl(Name="Sagsnummer:").GetNextSiblingControl().Name
67
+ if case_number_value == case_number:
68
+ break
69
+ time.sleep(1)
70
+ else:
71
+ raise LookupError(f"Case number wasn't found: {case_number}")
72
+
73
+ print(f"Case loaded {cpr}, {case_number}")
74
+
75
+
76
+ def save_case():
77
+ """Save the case by clicking 'Gem/Dan brev...'."""
78
+ boliglaan = get_boliglaan()
79
+ toolbar = boliglaan.GroupControl(Name="None BarContainerControl", searchDepth=1)
80
+ toolbar.ButtonControl(Name="Gem/Dan brev...").GetInvokePattern().Invoke()
@@ -0,0 +1,37 @@
1
+ """This module handles opening and closing KMD Boliglån."""
2
+
3
+ import subprocess
4
+ import time
5
+ import os
6
+
7
+ import uiautomation
8
+
9
+
10
+ def login(username: str, password: str):
11
+ """Launch and login to KMD Boliglån."""
12
+ subprocess.Popen(r"C:\Program Files (x86)\KMD\KMD.LW.Boliglaan\KMD.LW.KMDBoliglaan.Client.exe") # pylint: disable=consider-using-with
13
+
14
+ kmd_logon = uiautomation.WindowControl(AutomationId="MainLogonWindow", searchDepth=1)
15
+
16
+ # Wait for logon window to load
17
+ for _ in range(5):
18
+ try:
19
+ if len(kmd_logon.ComboBoxControl(AutomationId="UserPwComboBoxCics").GetSelectionPattern().GetSelection()) == 1:
20
+ break
21
+ except LookupError:
22
+ pass
23
+ time.sleep(1)
24
+
25
+ kmd_logon.EditControl(AutomationId="UserPwTextBoxUserName").GetValuePattern().SetValue(username)
26
+ kmd_logon.EditControl(AutomationId="UserPwPasswordBoxPassword").GetValuePattern().SetValue(password)
27
+ kmd_logon.ButtonControl(AutomationId="UserPwLogonButton").GetInvokePattern().Invoke()
28
+
29
+ boliglaan = uiautomation.WindowControl(Name="KMD Boliglån", searchDepth=1)
30
+ if not boliglaan.Exists(maxSearchSeconds=30):
31
+ raise RuntimeError("Boliglån didn't appear within 30 seconds")
32
+
33
+
34
+ def kill_boliglaan():
35
+ """Kill KMD Logon and KMD Boliglån."""
36
+ os.system("taskkill /f /im KMD.LW.KMDBoliglaan.Client.exe")
37
+ os.system("taskkill /f /im KMD.YH.Security.Logon.Desktop.exe")
@@ -0,0 +1,110 @@
1
+ """This module contains functions to search for advis
2
+ and handling the advis search results.
3
+ """
4
+
5
+ from dataclasses import dataclass
6
+ from datetime import date
7
+ from typing import Literal
8
+
9
+ import uiautomation
10
+
11
+ from itk_dev_shared_components.boliglaan import common
12
+
13
+
14
+ AdvisType = Literal[
15
+ 'Eget oprettet advis',
16
+ 'Indbetaling mangler på lånet i KMD Boliglån',
17
+ 'Lånet er ikke pålignet',
18
+ 'Lånet har afstemningssaldo selvom restgæld er 0 kr.',
19
+ 'Lånet har status "Afvikling..."/Gældssaneret - ej pålignet',
20
+ 'Lånets saldo = 0 kr.',
21
+ 'Lånets saldo er negativ',
22
+ 'Rente og afdragsfrihed på 5 år udløber'
23
+ ]
24
+
25
+
26
+ @dataclass
27
+ class Advis:
28
+ """A dataclass representing an advis
29
+ from the advis search result.
30
+ """
31
+ date: date
32
+ cpr: str
33
+ case_number: str
34
+ type: str
35
+ state: str
36
+
37
+
38
+ def search_advis(cpr: str | None = None, date_from: date | None = None, date_to: date | None = None, types: tuple[AdvisType] | None = None):
39
+ """Search for advis.
40
+
41
+ Args:
42
+ cpr: The cpr to look for.
43
+ date_from: The date to search from.
44
+ date_to: The date to search to.
45
+ types: The types of advis to search for. If None all types are chosen.
46
+
47
+ Raises:
48
+ ValueError: If 'All' is not alone in the types list.
49
+ """
50
+ boliglaan = common.get_boliglaan()
51
+ boliglaan.SendKeys("{Ctrl}T")
52
+
53
+ popup = boliglaan.WindowControl(Name="Søg advis", searchDepth=1)
54
+
55
+ if cpr:
56
+ popup.TextControl(Name="Personnummer:").GetNextSiblingControl().GetValuePattern().SetValue(cpr)
57
+
58
+ if date_from:
59
+ popup.TextControl(Name="Dato fra:").GetNextSiblingControl().GetValuePattern().SetValue(date_from.strftime("%d-%m-%Y"))
60
+
61
+ if date_to:
62
+ popup.TextControl(Name="Dato til:").GetNextSiblingControl().GetValuePattern().SetValue(date_to.strftime("%d-%m-%Y"))
63
+
64
+ if types is None:
65
+ popup.CheckBoxControl(Name='Vælg alle').GetTogglePattern().SetToggleState(1)
66
+ else:
67
+ popup.CheckBoxControl(Name='Vælg alle').GetTogglePattern().SetToggleState(0)
68
+
69
+ for type_ in types:
70
+ popup.CheckBoxControl(Name=type_).GetTogglePattern().SetToggleState(1, waitTime=0)
71
+
72
+ popup.ButtonControl(Name="Søg").GetInvokePattern().Invoke()
73
+
74
+
75
+ def select_advis(cpr: str, case_number: str):
76
+ """Select the advis from the search list with the given cpr and case number."""
77
+ boliglaan = common.get_boliglaan()
78
+ rows = boliglaan.TabControl(Name="TabbedGroup", searchDepth=4).PaneControl(AutomationId="dataPresenter").GetChildren()
79
+
80
+ for row in rows:
81
+ row_case_number = row.CustomControl(foundIndex=2).GetPattern(uiautomation.PatternId.ValuePattern).Value
82
+ case_cpr = row.CustomControl(foundIndex=3).GetPattern(uiautomation.PatternId.ValuePattern).Value
83
+
84
+ if case_cpr == cpr and row_case_number == case_number:
85
+ row.DoubleClick(simulateMove=False)
86
+ return
87
+
88
+ raise LookupError(f"Couldn't find advis: {cpr} - {case_number}")
89
+
90
+
91
+ def get_advis_list() -> list[Advis]:
92
+ """Get the advis search result as a list of Advis objects."""
93
+ boliglaan = common.get_boliglaan()
94
+ rows = boliglaan.TabControl(Name="TabbedGroup", searchDepth=4).PaneControl(AutomationId="dataPresenter").GetChildren()
95
+
96
+ result = []
97
+
98
+ for row in rows:
99
+ date_str: str = row.CustomControl(foundIndex=1).GetPattern(uiautomation.PatternId.ValuePattern).Value
100
+ case_number = row.CustomControl(foundIndex=2).GetPattern(uiautomation.PatternId.ValuePattern).Value
101
+ cpr = row.CustomControl(foundIndex=3).GetPattern(uiautomation.PatternId.ValuePattern).Value
102
+ type_ = row.CustomControl(foundIndex=4).GetPattern(uiautomation.PatternId.ValuePattern).Value
103
+ state = row.CustomControl(foundIndex=5).GetPattern(uiautomation.PatternId.ValuePattern).Value
104
+
105
+ day, month, year = (int(part) for part in date_str.split("-"))
106
+ date_ = date(year, month, day)
107
+
108
+ result.append(Advis(date=date_, cpr=cpr, case_number=case_number, type=type_, state=state))
109
+
110
+ return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itk_dev_shared_components
3
- Version: 2.16.2
3
+ Version: 2.17.0
4
4
  Summary: Shared components to use in RPA projects
5
5
  Author-email: ITK Development <itk-rpa@mkb.aarhus.dk>
6
6
  Project-URL: Homepage, https://github.com/itk-dev-rpa/itk-dev-shared-components
@@ -7,6 +7,11 @@ itk_dev_shared_components.egg-info/SOURCES.txt
7
7
  itk_dev_shared_components.egg-info/dependency_links.txt
8
8
  itk_dev_shared_components.egg-info/requires.txt
9
9
  itk_dev_shared_components.egg-info/top_level.txt
10
+ itk_dev_shared_components/boliglaan/__init__.py
11
+ itk_dev_shared_components/boliglaan/common.py
12
+ itk_dev_shared_components/boliglaan/login.py
13
+ itk_dev_shared_components/boliglaan/search/__init__.py
14
+ itk_dev_shared_components/boliglaan/search/search_advis.py
10
15
  itk_dev_shared_components/eflyt/__init__.py
11
16
  itk_dev_shared_components/eflyt/eflyt_case.py
12
17
  itk_dev_shared_components/eflyt/eflyt_letter.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itk_dev_shared_components"
7
- version = "2.16.2"
7
+ version = "2.17.0"
8
8
  authors = [
9
9
  { name="ITK Development", email="itk-rpa@mkb.aarhus.dk" },
10
10
  ]