Skip to content
Closed
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
1 change: 1 addition & 0 deletions dataset/bcbench.jsonl

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions dataset/problemstatement/microsoftInternal__NAV-246904/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Posting a mileage expense report fails because the calculated amount is not rounded

## Reproduction steps

1. In a US-localized company, open **Expense Agent Setup**.
2. Set **Standard Rate of Mileage** to `4.32` and select a valid **Default Mileage UOM**.
3. Ensure an expense user exists with a valid employee posting group and expense posting account.
4. Ensure a company-paid expense payment method exists.
5. Create or open an **Expense Category** with **Expense Detail Required** set to **Mileage**, and assign the company-paid payment method.
6. Create a new **Expense Report** for the expense user.
7. Add a line with the mileage expense category.
8. Enter mileage with two decimal places, for example `28.11`, and complete any required trip description or location fields.
9. Submit and approve the expense report.
10. Open the approved expense report and choose **Post**.

## Expected behavior

The mileage amount is rounded using the applicable currency amount-rounding precision, and the expense report posts successfully.

## Actual behavior

Posting fails because the calculated mileage amount retains excess decimal precision:

> Amount 121.42 needs to be rounded in Gen. Journal Line Journal Template Name='', Journal Batch Name='', Line No.='0'.
10 changes: 9 additions & 1 deletion scripts/BCBenchUtils.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
}
Expand Down Expand Up @@ -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'
}
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'
Expand Down
4 changes: 2 additions & 2 deletions scripts/Download-BCSymbols.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Write-Log "Resolved BC version $version for InstanceId $InstanceId" -Level Info

Import-Module BcContainerHelper -Force -DisableNameChecking

[string] $artifactUrl = Get-BCArtifactUrl -version $version -country $Country -select 'Latest'
if (-not $artifactUrl) { throw "No BC artifact URL resolved for version $version ($Country)" }
[hashtable] $artifactConfig = Get-BCBenchArtifactConfig -Category $Category -Version $version -Country $Country
[string] $artifactUrl = $artifactConfig.artifactUrl
Write-Log "Downloading artifact: $artifactUrl" -Level Info

$paths = Download-Artifacts -artifactUrl $artifactUrl -includePlatform
Expand Down
52 changes: 52 additions & 0 deletions tests/test_artifact_config.py
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
Loading