Repository navigation
Add BCApps 7070 subscription customer dataset task #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Customer cannot be changed on a contract with closed subscription lines | ||
|
|
||
| ## Describe the issue | ||
|
|
||
| When a customer contract contains closed subscription lines—lines marked as **Closed = Yes** after invoicing past their end date—changing the **Sell-to Customer** or **Bill-to Customer** on the contract header fails with a blocking error. | ||
|
|
||
| This is inconsistent with terminated lines that are not closed (**Closed = No**), which allow the customer to be changed. Users must otherwise reopen each closed line, change the customer, and close every line again. | ||
|
|
||
| ## Expected behavior | ||
|
|
||
| Changing the Sell-to or Bill-to customer on a contract header succeeds regardless of whether closed subscription lines exist. Terminated lines with **Closed = Yes** and **Closed = No** behave identically for a header-level customer change. | ||
|
|
||
| ## Steps to reproduce | ||
|
|
||
| 1. Create a customer contract with at least one subscription or contract line. | ||
| 2. Set the **Subscription Line End Date** to a date in the past, for example `31 January 2026`. | ||
| 3. Invoice the line fully through its end date. | ||
| 4. Run **Update Subscription Line Dates**. | ||
| 5. Verify that the contract line is marked **Closed = Yes** and moved to **Closed Lines**. | ||
| 6. Change the **Sell-to Customer** or **Bill-to Customer** on the contract header. | ||
|
|
||
| The change is blocked with this error: | ||
|
|
||
| > Subscription Lines for closed contract lines may not be edited. Remove the "Finished" indicator in the contract to be able to edit the Subscription Line. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -469,7 +469,7 @@ function Get-RepoCloneInfo { | |
| return @{ | ||
| Url = 'https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_git/NAV' | ||
| Token = $env:ADO_TOKEN | ||
| SparseCheckoutPaths = @('App/Apps', 'App/Layers') | ||
| SparseCheckoutPaths = @('App/Apps', 'App/Internal/Apps', 'App/Layers') | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rebase went wrong? |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -544,6 +544,14 @@ function Get-BCBenchArtifactConfig { | |
|
|
||
| if ($Country -ne 'w1') { throw "Approved BC artifacts are only configured for w1, not $Country." } | ||
|
|
||
| [hashtable] $pinnedInsiderUrls = @{ | ||
| '29.0' = 'https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.54011.55007/w1' | ||
| '30.0' = 'https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/30.0.55015.0/w1' | ||
| } | ||
|
Comment on lines
+547
to
+550
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, my PR went in first, this is now changed to a json file |
||
| if ($pinnedInsiderUrls.ContainsKey($Version)) { | ||
| return @{ artifactUrl = $pinnedInsiderUrls[$Version]; accept_insiderEula = $true } | ||
| } | ||
|
|
||
| [hashtable] $pinnedUrls = @{ | ||
| '24.0' = 'https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.0.16410.31330/w1' | ||
| '24.2' = 'https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.2.20227.31325/w1' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import json | ||
| import shutil | ||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
| ROOT = Path(__file__).parent.parent | ||
| UTILS_MODULE = ROOT / "scripts" / "BCBenchUtils.psm1" | ||
|
|
||
|
|
||
| def get_artifact_config(category: str, version: str) -> dict[str, object]: | ||
| pwsh = shutil.which("pwsh") | ||
| if not pwsh: | ||
| pytest.skip("PowerShell is required") | ||
|
|
||
| command = f"Import-Module '{UTILS_MODULE}' -Force -DisableNameChecking; Get-BCBenchArtifactConfig -Category '{category}' -Version '{version}' | ConvertTo-Json -Compress" | ||
| result = subprocess.run( | ||
| [pwsh, "-NoProfile", "-Command", command], | ||
| capture_output=True, | ||
| text=True, | ||
| encoding="utf-8", | ||
| check=True, | ||
| ) | ||
| return json.loads(result.stdout) | ||
|
|
||
|
|
||
| def test_released_bug_fix_uses_pinned_artifact(): | ||
| assert get_artifact_config("bug-fix", "27.2") == { | ||
| "accept_insiderEula": False, | ||
| "artifactUrl": "https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.2.42879.54576/w1", | ||
| } | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| ("version", "url"), | ||
| [ | ||
| ("29.0", "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.54011.55007/w1"), | ||
| ("30.0", "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/30.0.55015.0/w1"), | ||
| ], | ||
| ) | ||
| def test_insider_bug_fix_uses_pinned_artifact(version: str, url: str): | ||
| assert get_artifact_config("bug-fix", version) == { | ||
| "accept_insiderEula": True, | ||
| "artifactUrl": url, | ||
| } | ||
|
|
||
|
|
||
| def test_setup_paths_cover_internal_apps(): | ||
| utils_module = UTILS_MODULE.read_text(encoding="utf-8") | ||
|
|
||
| assert "'App/Internal/Apps'" in utils_module |
Uh oh!
There was an error while loading. Please reload this page.