Apply surcharges for documents
You can apply surcharges to sales and purchase documents either manually using the Calculate Surcharge action or automatically when documents are released, depending on your surcharge setup configuration.
The system applies surcharges based on a deterministic selection process that considers multiple criteria including customer or vendor assignment, shipping details, location, exclusion rules, weights, and dates. Only one surcharge line is created by the surcharge rule based on priority ranking. For a single surcharge configuration, only one surcharge line can qualify. However, multiple surcharges may apply to the same document.
The system evaluates all active surcharge rules, applies the selection criteria, and creates the appropriate surcharge lines on the document. The surcharge code shows the code of the applied surcharge configuration.
The Quantity and Unit Price or Direct Unit Cost field values are set based on the surcharge configuration. If the line type is Item Charge, the item charge assignments are automatically applied according to the configured method.
A document surcharge or a document allowance is one line for the document. A line surcharge or a line allowance is a separate linked line under each qualifying item line.
Calculate surcharges manually
For sales and purchase documents, the Calculate Surcharges action is always available. You can use this action to preview all applicable surcharges before releasing the document, allowing you to review the impact in advance.
To calculate surcharges manually, use the Calculate Surcharges action on the document header. You can perform this action only when the document is not released.
The same action creates line surcharges. On an order, it updates the ship or receive quantity on the linked lines. When at least one surcharge is applied, the system returns: "Surcharges calculated successfully."
Calculate surcharges on release
When the Sales Document Surcharge Creation Method or Purchase Document Surcharge Creation Method field value is set to On Release on the Surcharges Setup page, the system automatically calculates and applies surcharges when you release the document.
Calculate surcharges immediately
The Immediate creation method applies only to a line surcharge or a line allowance. It does not apply to a document surcharge or a document allowance.
When Sales Line Surcharge Creation Method or Purchase Line Surcharge Creation Method is Immediate on the Surcharges Setup page, the system inserts or updates the linked line as soon as you change the quantity or the location on the item line. You do not have to release the document or run Calculate Surcharge. Releasing an order, quote, or invoice also creates the linked lines.
Line surcharges are linked to parent item lines
The system inserts the linked line directly under the parent item line. A line surcharge posts as shipped or received when the parent line is shipped or received. A document surcharge does not.
After a linked line exists, a later change to the parent quantity or location updates that line even when the creation method is not Immediate.
The linked line uses the item charge or G/L account from the surcharge header. Before anything is shipped or received, its quantity is the parent line quantity. For Amount Per Weight Unit, the quantity is the weight of that quantity, using the Sales Weight Type or Purchase Weight Type field value. For example, a value of 1.00 per kilogram on an item with a gross weight of 25 and a quantity of 10 inserts a linked line with quantity 250.
The Location Code and Surcharge Code field values on the linked line come from the parent line and the surcharge. The Surcharge Code field on the document line is not editable.
You cannot change Quantity, Qty. to Ship, Qty. to Invoice, or Qty. to Assign on an item charge surcharge line on an order. On an invoice, you cannot change Quantity on that line. The system returns: "You cannot modify quantity fields on a surcharge line (Surcharge Code …). The system recalculates these values automatically when the document is released or posted." A G/L account surcharge line is not blocked by this check. Quote lines are not blocked by it.
You cannot insert a document line between a parent item line and its surcharge lines.
When you change the currency code, ship-to address, or customer, and Business Central rewrites the document lines, the system removes the line surcharges. Run Calculate Surcharge or release the document to create them again. They are not rewritten as ordinary item charge lines.
Reopen documents with surcharges
When you reopen a released document that contains surcharge lines, the system automatically deletes all existing unposted surcharge lines. The system recalculates and recreates the surcharges when you release the document again or when you use the Calculate Surcharges action.
Bypass surcharges
You can bypass surcharge calculations on a specific document, for example a special delivery order. The Bypass Surcharges field is on the Invoice Details FastTab of the sales or purchase document, after Payment Terms Code. You can change it only while the document is open. On orders, the caption is Bypass Surcharges. The same field is on invoices, quotes, credit memos, and return orders.
| Option | Result |
|---|---|
| Blank | Surcharges calculate in the normal way. |
| All | The system removes document surcharges and line surcharges, and it does not calculate new ones. |
| Document | The system removes document surcharges and document allowances. Line surcharges continue to calculate. |
| Line | The system removes line surcharges and line allowances. Document surcharges continue to calculate. |
Changing the field removes only the surcharge type you bypass, and only lines that have not been posted. The other type stays on the document. When a targeted line is already partially shipped or received, the system keeps that posted quantity and shows one of these messages:
- "One or more surcharge lines have already been partially shipped and cannot be removed. Only unshipped surcharge lines will be removed."
- "One or more surcharge lines have already been partially received and cannot be removed. Only unreceived surcharge lines will be removed."
- "One or more surcharge lines have already been partially received as returns and cannot be removed. Only surcharge lines that are not yet received will be removed."
- "One or more surcharge lines have already been partially shipped as returns and cannot be removed. Only surcharge lines that are not yet shipped will be removed."
Exclude from surcharge
You can exclude specific document lines from surcharge calculation by setting the Exclude from Surcharge field value to Yes. The system automatically sets this value from the item record, but you can change it manually if needed.
Excluded lines are not considered in total weight threshold calculations and are skipped during item charge assignments. As a result, these lines do not incur any additional costs or sales value entries related to surcharges.
Calculate surcharges after partial invoicing
When you post an invoice for a document and one or more lines still have open quantities, the system continues to calculate surcharges for the remaining quantities. This behavior assumes that surcharges should apply to any quantities that are still to be shipped or received.
You can prevent additional surcharges from being inserted for a partially invoiced document in the following ways:
Prevent specific surcharges
To stop certain surcharges from being applied after the first invoice posting, set the Once per Document field value in the surcharge configuration to Yes. With this setting, the surcharge is applied only during the first invoice posting for the document.
Prevent specific document lines
To prevent specific document lines from influencing surcharge calculations, set the Exclude from Surcharge field value to Yes on those lines.
Prevent all surcharges
To stop all surcharges from being calculated for the document, set the Bypass Surcharges field value to All. To stop only document surcharges, set it to Document. To stop only line surcharges, set it to Line.