Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.12.1] - 2025-08-07

### Fixed

- SAP: Dismiss popup when opening an inactive FP.

## [2.12.0] - 2025-06-17

### Added
Expand Down Expand Up @@ -226,7 +232,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[Unreleased]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/compare/2.12.0...HEAD
[Unreleased]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/compare/2.12.1...HEAD
[2.12.1]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.12.1
[2.12.0]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.12.0
[2.11.1]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.11.1
[2.11.0]: https://github.com/itk-dev-rpa/ITK-dev-shared-components/releases/tag/2.11.0
Expand Down
21 changes: 14 additions & 7 deletions itk_dev_shared_components/sap/fmcacov.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,34 @@ def open_forretningspartner(session, fp: str) -> None:
fp: The forretningspartner number.

Raises:
ValueError: If the forretningspartner wasn't found.
LookupError: If the forretningspartner wasn't found.
"""
session.StartTransaction('fmcacov')

# Find forretningspartner
session.findById("wnd[0]/usr/ctxtGPART_DYN").text = fp
session.findById("wnd[0]").sendVKey(0)

# Detect window "Forretningspartner * Entries"
if session.findById('wnd[1]/usr', False) is not None:
# Pop-up detected
for row_id in range(3, 5):
# Detect popup
popup = session.findById('wnd[1]', False)

# Inactive FP popup
if popup and popup.Text == "BP inactive":
# Click 'OK'
session.FindById("wnd[1]/tbar[0]/btn[25]").press()

# "Forretningspartner 2 Entries" popup
elif popup and popup.Text == 'Forretningspartner 2 Entries':
# Look for matching fp number
for row_id in (3, 4):
fp_row = session.FindById(f'wnd[1]/usr/lbl[103,{row_id}]')
if fp_row.text == fp:
fp_row.SetFocus()
# Press 'Accept' button.
session.FindById('wnd[1]/tbar[0]/btn[0]').press()
break
else:
# Range exhausted
raise ValueError(f"Forretningspartner '{fp}' was not found in pop-up.")
raise LookupError(f"Forretningspartner '{fp}' was not found in pop-up.")


def dismiss_key_popup(session, fp: str = "25564617") -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "itk_dev_shared_components"
version = "2.12.0"
version = "2.12.1"
authors = [
{ name="ITK Development", email="itk-rpa@mkb.aarhus.dk" },
]
Expand Down
Loading