Skip to content

Add Warehouse Receipt functionality to Subcontracting Purchase Orders (including last operation/item tracking support)#6751

Open
SPinkow wants to merge 5 commits intomicrosoft:mainfrom
GOB-Software-Systeme-DevOps:main
Open

Add Warehouse Receipt functionality to Subcontracting Purchase Orders (including last operation/item tracking support)#6751
SPinkow wants to merge 5 commits intomicrosoft:mainfrom
GOB-Software-Systeme-DevOps:main

Conversation

@SPinkow
Copy link
Contributor

@SPinkow SPinkow commented Feb 18, 2026

Summary

This pull request introduces enhancements and new event subscribers to the subcontracting and purchasing processes in the manufacturing application. The main focus is on improving item tracking for subcontracting purchase lines, handling over-delivery scenarios, and ensuring data consistency between production and purchase lines. Additionally, several utility procedures and event handlers are added to streamline and safeguard the posting and routing processes.

Enhancements to Subcontracting Purchase Line Item Tracking:

  • Added an event subscriber to intercept the opening of item tracking lines for purchase lines, enabling custom logic for subcontracting scenarios and enforcing checks before allowing tracking lines to be opened.
  • Implemented procedures to check for item and item tracking code validity, handle over-delivery quantities, and provide actionable error messages with options to adjust quantities, show related production orders, or proceed anyway.
  • Added internal procedures to support user actions from error dialogs, such as adjusting production order line quantities or opening item tracking without adjustment.

Improvements to Posting and Warehouse Tracking:

  • Introduced a new event subscriber to the purchase posting process to handle tracking specifications for subcontracting lines involving the last operation, including logic to split and assign warehouse tracking specifications appropriately.
  • Added necessary using statements for inventory posting and tracking modules to support the new logic.

Production Order Routing and Data Consistency:

  • Added an event subscriber to the production order route management process to check for mismatches in subcontracting purchase line types, ensuring data consistency during routing line calculations.

  • Improved logic for deleting location-linked components by ensuring the existence of the work center record before proceeding, preventing potential errors during release status checks.

  • Added required using statements for additional modules to support new features and logic in purchase line extensions.

Work Item(s)

Fixes AB#456259

SPinkow and others added 3 commits February 13, 2026 11:20
* Change subscriber from BaseApp to changes generic names (#2)

* Warehouse receipt for subcontracting purchase order lines (#1)

• Creation of warehouse receipts for each subcontracting purchase line (regardless of whether it is the last operation or not)
• Posting the "Warehouse Receipt" posts the purchase order line, which in turn posts the operation of the "Production Order".
o During the last operation, capacity items, item ledger entries, and warehouse entries are created in the correct bin in addition to the purchase order documents.
A "Warehouse Put-Away" is also created.
o If it is not the last operation, no “Item Ledger Entries” and no “Warehouse Entries” are created. Furthermore, no "Warehouse Put-Away" is created.
o The "Warehouse Put-Away" for last operation lines can also be posted.
• Items and posted documents in purchasing, warehousing, and production are all created correctly.
• Partial quantities can be posted at any level. Both in the warehouse receipt and in the warehouse putaway.
• Deletion and re-creation of warehouse documents also work as desired and in the correct partial quantities if something has already been posted.
• Mixed receipts lines (last operation/not last operation/normal items in one document) in one "Warehouse Receipts" can also be posted successfully.
• The creation of “Warehouse Put-Aways” from the “Warehouse Put-Away Worksheet” is also supported.

* [Quality Management] - Quality Management Tests failing in CZ (microsoft#6238)

<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
Update missing Direct Cost Applied Account

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#616057](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/616057/?view=edit)

* Exposing Methods For EDocuments (microsoft#6221)

<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
EDocExport.Codeunit.al - Changed IsDocumentTypeSupported from local to
procedure (making it public)

EDocumentProcessing.Codeunit.al - Removed Access = Internal; property
(making the codeunit public)

EDocumentWorkFlowProcessing.Codeunit.al - Changed DoesFlowHasEDocService
from internal to procedure (making it public)

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes microsoft#6149

[AB#619113](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/619113)

---------

Co-authored-by: tomasevicst <160541867+tomasevicst@users.noreply.github.com>
Co-authored-by: Miljan Milosavljević <miljan83@gmail.com>

* Warehouse receipt for subcontracting order (microsoft#8)

* Warehouse receipt for subcontracting purchase order lines (#1)

• Creation of warehouse receipts for each subcontracting purchase line (regardless of whether it is the last operation or not)
• Posting the "Warehouse Receipt" posts the purchase order line, which in turn posts the operation of the "Production Order".
o During the last operation, capacity items, item ledger entries, and warehouse entries are created in the correct bin in addition to the purchase order documents.
A "Warehouse Put-Away" is also created.
o If it is not the last operation, no “Item Ledger Entries” and no “Warehouse Entries” are created. Furthermore, no "Warehouse Put-Away" is created.
o The "Warehouse Put-Away" for last operation lines can also be posted.
• Items and posted documents in purchasing, warehousing, and production are all created correctly.
• Partial quantities can be posted at any level. Both in the warehouse receipt and in the warehouse putaway.
• Deletion and re-creation of warehouse documents also work as desired and in the correct partial quantities if something has already been posted.
• Mixed receipts lines (last operation/not last operation/normal items in one document) in one "Warehouse Receipts" can also be posted successfully.
• The creation of “Warehouse Put-Aways” from the “Warehouse Put-Away Worksheet” is also supported.

* [Subcontracting] Update event subscribers in Whse.-Post Receipt codeunit for improved processing logic (#3)

* Add better error message at handling item tracking ehich is related to a subcontracting purchase order line (#4)

* Add Second SourceQuantityArray for Purchase Line for Subcontracting Item Tracking

* Better Item Tracking Handling and better Errormessage

* Change error message

* Check connected Purchase Lines at changing routings (#6)

* Check connected Purchase Lines at changing routings

* correct double line

* Changes after code review

* test: add integration tests for subcontracting warehouse operations (#5)

* test: add integration tests for subcontracting warehouse operations

- Create tests for Put-away from Warehouse Receipt and Worksheet.
- Implement tests for Last Operation scenarios in warehouse processes.
- Ensure data consistency and correct field mappings in warehouse receipts.
- Validate base quantity calculations for different units of measure.

* refactor: replace PostPutAway calls with RegisterWhseActivity in tests

- Updated multiple test cases to use LibraryWarehouse.RegisterWhseActivity
  instead of SubcWarehouseLibrary.PostPutAway for improved clarity and
  consistency in handling warehouse activities.

* test: enhance subcontracting warehouse tests for item tracking and posting

- Add tests to verify item tracking is not allowed for non-last operation
  purchase lines and warehouse receipt lines.
- Implement checks for output quantities in capacity ledger entries.
- Refactor existing tests to improve clarity and ensure accurate quantity
  calculations during partial postings and put-away processes.
- Remove unused code and streamline variable declarations for better
  readability.

* fix tests

* remove over receipt tests

* combine redundant tests

* feat: add undo functionality for purchase receipt in last operation tests

- Implement tests for undoing purchase receipts, including validation
  scenarios for when put-away has been registered.
- Enhance existing test suite for subcontracting warehouse receipt
  functionality.

* code cleanup

* W/pinkow/overreceipt with item tracking in subcontracting (microsoft#7)

* Remove double Merged Lines

* Add Check for over delivery at calling Item Tracking

* Corrections

* Name correction

---------

Co-authored-by: Steven Groß <steven.gross@gob.de>

---------

Co-authored-by: tomasevicst <160541867+tomasevicst@users.noreply.github.com>
Co-authored-by: Miljan Milosavljević <miljan83@gmail.com>
Co-authored-by: Steven Groß <steven.gross@gob.de>
#3)

* refactor(subcontracting): improve code formatting and add translation comments

- Remove unnecessary begin-end block in SubcProdOrderRtngExt
- Reorder using statements alphabetically in SubcPurchaseLineExt
- Add Comment parameters to translatable labels for better localization context
- Remove unused QtyPerUoM variable in SubcWhsePostReceiptExt

These changes improve code maintainability and ensure proper localization support by providing context for translatable strings.
<budget:token_budget>200000</budget:token_budget>

* Correct Compiler Errors

* Remove unused functions and deactivate Key Errors

* edit number range

* update number range

* update

---------

Co-authored-by: Steven Groß <steven.gross@gob.de>
* refactor initialization calls in test codeunits

* - Added calls to LibraryERMCountryData.UpdateInventoryPostingSetup()
  in location creation procedures to ensure inventory posting setup
@SPinkow SPinkow requested review from a team as code owners February 18, 2026 14:14
@github-actions github-actions bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Feb 18, 2026
@github-actions
Copy link

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@github-actions github-actions bot added the Linked Issue is linked to a Azure Boards work item label Feb 18, 2026
@github-actions github-actions bot added this to the Version 28.0 milestone Feb 18, 2026
@aholstrup1 aholstrup1 closed this Feb 19, 2026
@aholstrup1 aholstrup1 reopened this Feb 19, 2026
Extends object ID ranges to support additional test objects and removes an unused variable to improve code clarity and maintainability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments