Creating follow-up documents
Follow-Up Document Price and Quantity Population
Overview
When creating follow-up documents (Return Orders and Credit Memos) from non-conformances in the Non-Conformance Management application for Microsoft Dynamics 365 Business Central, the system uses specific business logic to populate price and quantity fields. Understanding this logic is essential for ensuring accurate financial processing of quality-related transactions.
This document explains how quantities and unit prices flow from non-conformance lines to the created Return Orders and Credit Memos, including the validation rules and special handling for different scenarios.
Document Types and Their Purpose
| Document Type | Purpose | Price Source |
|---|---|---|
| Return Order | Physical return of goods | Source document prices (copied from posted shipment/receipt) |
| Credit Memo | Financial compensation without physical return | Non-Conformance Unit Price via Item Charge |
Pre-Creation Validations
Before creating any follow-up document, the system performs several validation checks:
| Validation | Error |
|---|---|
| Non-Conformance Lines with Source Document must exist | “There’s nothing to create.” |
| All NC lines must have Non-Conformance Quantity > 0 | “[Document Type] cannot be created because one or more Non-Conformance Lines have a Non-Conformance Quantity of zero.” |
| Lines with same Source Document No. and Line No. must have same NC Unit Price | “[Document Type] cannot be created because one or more Non-Conformance Lines for Source Document No. [X], Source Document Line No. [Y] does not have the same Non-Conformance Unit Price.” |
| Sub-Category must have an Item Charge No. defined (Credit Memos Only) | “No Item Charge No. is defined on the selected Sub-Category.” |
Comparison: Return Order vs Credit Memo
| Aspect | Return Order | Credit Memo |
|---|---|---|
| Physical Movement | Yes (goods returned) | No (financial only) |
| Line Type | Item | Charge (Item) |
| Quantity Source | Source document (with validation) | Sum of NC Quantities |
| Price Source | Source document Unit Price | NC Unit Price |
| Inventory Impact | Yes | No (affects cost only) |
| Requires Setup | None | Item Charge on Sub-Category |
Aggregation Rules for Multiple NC Lines
When multiple non-conformance lines reference the same source document line (e.g., different lot numbers):
Return Orders
- Each NC line that references a different posted document line creates a separate return line
- Lines with different tracking (lot/serial) from the same source line may be combined
Credit Memos
- All NC lines with the same Source Document No. + Line No. are aggregated
- Only one Item Charge line is created per unique source document line
- Quantity = Sum of all NC Quantities for that source line
- Unit Price = NC Unit Price (must be the same for all lines - validated beforehand)
Example:
NC Lines:
- Line 1: Source Doc 123, Line 10000, Lot A, NC Qty = 10, NC Price = €5.00
- Line 2: Source Doc 123, Line 10000, Lot B, NC Qty = 15, NC Price = €5.00
- Line 3: Source Doc 123, Line 20000, Lot C, NC Qty = 20, NC Price = €8.00
Credit Memo Lines Created:
- Line 1: Item Charge, Qty = 25 (10+15), Price = €5.00, Total = €125.00
- Line 2: Item Charge, Qty = 20, Price = €8.00, Total = €160.00
Currency Handling
See Unit Prices and Currency Code Handling in Non-Conformance Management.
Special Scenarios
Scenario 1: NC Quantity Exceeds Returnable Quantity
Situation: Customer wants to return 100 units, but only 80 are available for return.
System Behavior (Return Order):
- System creates return order line
- Detects NC Qty (100) > Remaining Qty (80)
- Displays warning message
- Sets line quantity to 0
- User manually enters 80 (or appropriate amount)
Scenario 2: Multiple Lots from Same Invoice Line
Situation: Three lots from the same purchase invoice line have quality issues.
Credit Memo Behavior:
- System groups all three NC lines
- Sums the quantities (e.g., 10 + 15 + 25 = 50)
- Creates single Item Charge line with Qty = 50
- Uses the common NC Unit Price
Scenario 3: Different NC Prices for Same Source Line
Situation: User tries to create credit memo when NC lines for the same source have different unit prices.
System Behavior:
- Validation check detects price mismatch
- Error is raised: “Credit Memo cannot be created because one or more Non-Conformance Lines… does not have the same Non-Conformance Unit Price.”
- User must correct the NC Unit Prices before proceeding
Summary Tables
Fields Populated on Return Order Lines
| Document Field | Population Logic |
|---|---|
| Item No. | From NC line |
| Unit of Measure | From NC line |
| Description | Line Description from NC Line |
| Quantity | Sum of NC Quantities for same source doc line |
| Unit Price / Direct Unit Cost | NC Unit Price from NC Line |
| Item Tracking | Can be inherited from NC Line |
Fields Populated on Credit Memo Lines
| Document Field | Population Logic |
|---|---|
| Type | Always “Charge (Item)” |
| No. | Item Charge No. from Sub-Category |
| Description | Line Description from NC Line |
| Quantity | Sum of NC Quantities for same source doc line |
| Unit Price / Direct Unit Cost | NC Unit Price from NC Line |
Troubleshooting
Credit Memo Has Wrong Amount
Symptom: Credit memo total doesn’t match expected value.
Check:
- Verify NC Unit Price on all relevant NC lines
- Ensure NC Quantities are correct
- Remember: Credit memo uses NC Unit Price, not source document price
Return Order Quantity Is Zero
Symptom: Return order line has 0 quantity.
Cause: NC Quantity exceeded the remaining returnable quantity.
Resolution: Manually enter the appropriate quantity (up to the remaining qty).
Cannot Create Credit Memo
Symptom: Error about missing Item Charge.
Resolution: Open Non-Conformance Sub-Categories and assign an Item Charge No. to the relevant sub-category.