> For the complete documentation index, see [llms.txt](https://kb.bevica.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.bevica.com/documentation/guides/sales/sales_and_purchasing_reason_codes.md).

# Sales and Purchasing Reason Codes

Shared setup and usage of reason codes across sales and purchasing.

There has always been confusion about the differences between the different number of **Reason Codes** in the system. Functionality does overlap so we'd recommend understanding the options and choosing the most appropriate code for the job.

* **Reason Codes** exist on document headers and relate to the document as a whole. They are used to help explain why the document was created and posted. They are designed to help identify financial postings and entries.
* **Return Reason Codes** relate to line details on documents and, most obviously, are added to stock return type documents / journal lines to help with auditing and reporting.
* **Sales Line Reason Code**, as the name suggests they are added to item lines on sales documents. They are used to help explain why a sales line has been created and can also be used to confirm that a line can be sold at zero price.

For other features against these fields see:

[Microsoft: Setting Up Source Codes and Reason Codes for Audit Trails](https://learn.microsoft.com/en-gb/dynamics365/business-central/finance-setup-trail-codes)

[Return Reasons and stock write-off](/documentation/guides/items-and-inventory/return_reasons_and_stock_write-off.md)

[Sales Line Reason Codes](/documentation/guides/sales/sales_line_reason_codes.md)

[Checking zero priced sales lines](/documentation/guides/sales/check_zero_priced_sales_lines.md)

### Reason Code

Use reason codes to help find and filter posted financial entries, i.e. at the end of the month you want to see how many Posted Credit Memos you have posted by type. Reason Code can be edited on these pages:

**Documents**

* Sales Invoice
* Sales Credit Memo
* Sales Journal
* Purchase Invoice
* Purchase Credit Memo
* Purchase Journal
* General Journal
* General Journal Batch

**Journals (Item based)**

* Item Journal
* Item Journal Batch
* Physical Inventory Journal
* Recurring Item Journal
* Item Reclass. Journal
* Standard Item Journal

{% hint style="info" %}
Note

Despite a **Reason Code** field being on journal lines it does not post to **Item Ledger Entries.** It posts to General Ledger Entries.
{% endhint %}

Reason Code is available on the following posted entry pages for information:

* General Ledger Entries
* Vendor Ledger Entries
* Detailed Vendor Ledger Entries
* Phy. Inventory Ledger Entries
* Value Entries
* Customer Ledger Entries
* Detailed Customer Ledger Entries

### Return Reason Code

Return Reason Codes are typically used on sales return documents and to report on miscellaneous Item Journal positive and negative adjustments, i.e. breakages, mis-pick corrections.

Return Reason Code also have additional functionality directly related to managing stock returns into the business on Sales Return Orders, see [Return Reasons and Stock Write-off](/documentation/guides/items-and-inventory/return_reasons_and_stock_write-off.md)

Return Reason Code can be edited on these pages' subform:

**Documents**

* Sale Order
* Sales Invoice
* Sales Return Order
* Sales Credit Memo
* Purchase Order
* Purchase Invoice
* Purchase Return Order

Return Reason Code is available on the following posted pages for information:

**Documents**

* Open Sales Lines
* Posted Sales Shipment subform
* Posted Sales Invoice subform
* Posted Sales Credit Memo subform
* Posted Return Receipt subform
* Posted Sales Shipment Lines
* Posted Sales Invoice Lines
* Posted Sales Credit Memo Lines
* Posted Purchase Receipt subform
* Posted Purchase Invoice subform
* Posted Purchase Cr. Memo subform
* Posted Return Shipment subform

**Entries**

* Item Ledger Entries
* Value Entries

### Sales Line Reason Code

Use Sales Line Reason Codes to report on individual document lines and miscellaneous Item Journal postings. For example, an alternative item is delivered, a zero price is confirmed, an item is sold as part of a bigger campaign/promotion, mis-pick corrections.

Sales Line Reason Codes have additional functionality, they can also be used to provide user confirmation that a sales line has a zero price. See [Checking Zero priced sales lines](/documentation/guides/sales/check_zero_priced_sales_lines.md)

Sales Line Reason Code can be edited on these pages' subform:

**Documents**

* Sale Order
* Sales Invoice
* Sales Return Order
* Sales Credit Memo
* Sales Quote

Sales Line Reason Code is available on the following pages for information:

**Documents**

* Open Sales Lines
* Posted Sales Shipment subform
* Posted Sales Invoice subform
* Posted Sales Credit Memo subform
* Posted Return Receipt subform
* Posted Sales Shipment Lines
* Posted Sales Invoice Lines
* Posted Sales Credit Memo Lines

**Entries**

* Item Ledger Entries (where Entry Type = Sales)

{% hint style="success" %}
Note

Use the Item Ledger Entry page in **Analysis mode** to report on the number of 'Sales' lines in a month by Sales Document Line Reason Code.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kb.bevica.com/documentation/guides/sales/sales_and_purchasing_reason_codes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
