# Cost transactions

## Cost transactions

A direct cost transaction records an additional cost and allocates it to one or more sales-order or
purchase-order lines in Job Profitability.
The allocation connects the cost with the order lines used to review direct cost and margin.
A provider is the account associated with the charge.

| If you need to… | Go to |
|---|---|
| Find the list or start a new allocation | [Find or start a cost transaction](#find-or-start-a-cost-transaction) |
| Enter the cost, provider, date, and destination | [Enter the transaction details](#enter-the-transaction-details) |
| Allocate items or products across order lines | [Allocate the order lines](#allocate-the-order-lines) |
| Review, remove a line, or save | [Review, remove, and save the allocation](#review-remove-and-save-the-allocation) |
| Continue with payment work | [Payables](doc:payables) |
| Review the surrounding job-profitability record | [Job Profitability record](doc:job-profitability-record) |

## Before you start

Prerequisites

| Have this ready | Why it matters here |
|---|---|
| The sales order or purchase order you are allocating to | It supplies the order lines available for the allocation. |
| The provider account | The transaction records the provider against the cost. |
| The cost type, title, amount, invoice date, and invoice number | These identify the cost transaction and support its later review. |
| Access to edit the transaction | **Save** and **Save and Close** are available only when editing is allowed. |

The **Cost Type** and **Provider** choices come from lists returned for the current setup.
The **Sales Order / Purchase Order (PO)** choice set also comes from the corresponding order lookup.
Use the records returned by the corresponding lookup.

The form requires **Cost Type**, **Transaction Title**, **Amount**, **Invoice Date**, **Provider**, and the
order destination.
**Invoice No.**, `Cost Classification`, and **Comment** are optional on the form.

The form is available when the feature is included and the page is available.
When the feature is not included, the page shows the subscription-upgrade surface.

> **Note:** The destination readout follows the allocation route: **Sales Order** on the sales-order form and
> **Purchase Order (PO)** on the purchase-order form.

**Result:** You have the order, provider, cost information, and edit access needed to complete the allocation.

## Find or start a cost transaction

A cost-transaction list brings together saved additional direct costs and provides the entry point for a new
sales-order or purchase-order allocation.

Prerequisites

- You know whether the cost belongs to a sales order or a purchase order.

Steps

1. Open **Additional Direct Cost**.
2. Use the list headers to identify a record: `Cost Transaction No.`, **Transaction Title**, **Amount**,
   `Sales Job(s)`, `Amount (€)`, `Amount (ج.م.‏)`, **Cost Type**, **Provider**, and **Invoice No.**
3. Use the visible list tools when needed: **Refresh**, **Table Layout**, or **Settings**.
4. Select the list tab that matches the records you need.

   | If you need to… | Select |
   |---|---|
   | Review every additional direct cost | **All** |
   | Review payable costs | **Payable** |
   | Review paid costs | **Paid** |

5. Choose the allocation route that matches the order type.

   | Allocation you need | Route |
   |---|---|
   | Sales-order allocation | `/finance/payables/cost-transaction/newAllocatioToSales` |
   | Purchase-order allocation | Purchase-order allocation form |
   | Existing transaction | Existing cost transaction record |

6. Open an existing transaction from the list when you need to review or change a saved record.

![Review the list headers and list tools before opening a transaction.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/8cf52205ac5a85560b07233a57ab2dd7.png)

**Result:** The selected list tab remains available for lookup, or the selected allocation form opens.

## Enter the transaction details

The transaction-details form identifies the cost, its provider, its destination, and the information needed to
review the charge later.

Prerequisites

- You have opened the sales-order or purchase-order allocation form.
- You have the cost information and provider account ready.

Steps

1. Select the cost category in **Cost Type**.
2. Select the classification that matches the charge.

   | Choose this option | Use it for |
   |---|---|
   | **Additional Landed Cost** | An inbound additional cost. |
   | **Delivery Costs** | A delivery charge. |
3. Enter the name of the charge in **Transaction Title**.
4. Enter the charge in **Amount**.
5. Select the invoice date in **Invoice Date**.
6. Enter the supplier's reference in **Invoice No.** when one is available.
7. Select the account in **Provider**.
8. Select **Sales Order / Purchase Order (PO)**. The list contains **Orders**.
9. Review the destination readout for the route you opened.

   | Form opened for | Destination readout |
   |---|---|
   | Sales-order allocation | **Sales Order** |
   | Purchase-order allocation | **Purchase Order (PO)** |

10. Enter any additional explanation in **Comment**.

On both allocation forms, **Cost Type**, **Transaction Title**, **Amount**, **Invoice Date**, and **Provider**
carry required markers.
The amount accepts values from `0`, and the invoice date cannot be later than today.
The title and invoice number use the form's character validation.
For an existing record whose currency differs from the branch currency, the form can show the amount in branch
currency when the invoice date has not changed.

![Check the sales-order form fields, required markers, and allocation headers.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/5eeb0064e51492ee6fb6090c77881513.png)

![Check the sales-order cost type and classification choices.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/4385380d6167e244abdbeee94d2a9822.png)

![Check the purchase-order form fields and order-line headers.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/07091aa3233a9a768a5faa19179d2ae5.png)

**Result:** The transaction identity, classification, amount, date, provider, destination context, and comment are
ready for allocation.

## Allocate the order lines

An allocation row connects part of the transaction amount to an item or product on the selected order.

Prerequisites

- The form has an order list available.
- You have completed the transaction details.

Steps

1. Select an allocation method in **Allocation Method** when more than one allocation detail exists.

   | Choose this option | Use it for |
   |---|---|
   | **Manual** | Enter the allocation percentage and amount yourself. |
   | **Equal Split** | Divide the allocation equally across the details. |
   | **Sales price** | Allocate according to sales price. |

2. Select the item source for the allocation route when the order list contains entries.

   | Allocation route | Select |
   |---|---|
   | Sales-order allocation | **Items** |
   | Purchase-order allocation | **Products** |
3. Select the rows to add in the picker.
4. Review the allocation rows and their values.

   | Column set | Headers |
   |---|---|
   | Shared columns | **Item Price (EUR)**, `Allocation%`, **Allocation Amount** |
   | Sales-order-specific columns | `Vendor Order No.`, **Job No.**, **Job Title** |
   | Purchase-order-specific columns | **PO No.**, **Package No**, **Package Title** |

5. Enter the percentage in `Allocation%` when the selected method permits manual editing.
6. Review **Allocation Amount** after the percentage is calculated.
7. Check the total allocation percentage before saving.

The total must equal `100%`.
If the total differs from `100%`, the form shows `The total must equal 100%`.

**Result:** The order lines show their allocation percentages and amounts, ready for review and saving.

## Review, remove, and save the allocation

Reviewing the allocation before saving keeps the cost attached to the intended order lines and classification.

Prerequisites

- The transaction details are complete.
- The allocation rows and total are ready for review.

Steps

1. Select **Additional Landed Cost** or **Delivery Costs** to confirm the classification.
2. Review the allocation percentage and amount for each row.
3. Open the row's delete action when an allocation row is not needed.
4. Read `Are you sure you want to delete this item?`.
5. Choose the action that matches what you need to do next.

   | Action | Use it when you need to… | Result |
   |---|---|---|
   | **No** | Keep the selected allocation row | The confirmation closes and the row remains. |
   | **Yes** | Remove the selected allocation row | The row is removed and the allocation percentage is recalculated. |
   | **Save** | Save the transaction and continue on the form | The transaction is validated and saved. |
   | **Save and Close** | Save the transaction and leave the form | The transaction is validated, saved, and the form closes. |

After a successful create or update, the page uses `Your request was completed successfully`.
If the save request fails, the page uses `An error occurred while processing your request`.

**Result:** The transaction is saved, or the selected allocation row is removed before you save.
If a validation message stops the save, continue with [When validation stops the save](#when-validation-stops-the-save).

## When validation stops the save

Use the message on screen to correct the value or selection named by the validation.

| Message | Corrective action |
|---|---|
| `Please Solve the Following Issues :` | Review the validation messages listed with it. |
| `Please select at least one order.` | Select an order destination. |
| `Please select at least one item/product.` | Add at least one item or product. |
| `Please enter the percentage value or delete unused items.` | Enter a positive allocation percentage or remove the unused row. |
| `Please adjust cost allocation.` | Adjust the allocation until the total is `100%`. |
| `Please enter valid amount.` | Enter an amount greater than `0`. |
| `Please choose cost type.` | Select a value in **Cost Type**. |
| `Please choose provider.` | Select a value in **Provider**. |
| `Please enter Transaction Title.` | Enter a value in **Transaction Title**. |
| `Please choose payment due date.` | Select a value in **Invoice Date**. |
| `Just '-' '_' and '.' are the only characters that are accepted.` | Remove other characters from **Transaction Title**. |
| `This Field Is Required` | Complete the required field marked on the form. |
| `Just '_' '-' And '.' Characters Accepted` | Remove other characters from the validated title field. |
| `The total must equal 100%  ` | Adjust the allocation percentages until the total equals `100%`. |
| `Are you sure you want to delete this item?` | Select **No** to keep the row or **Yes** to remove it. |
| `Your request was completed successfully` | Continue from the saved transaction. |
| `An error occurred while processing your request` | Correct the transaction details and try the save again. |

Account, contact, and shared-component messages belong to their owning pages.
Continue with [Accounts](doc:accounts), [Create an account](doc:create-account), or [Libraries and files](doc:libraries-files)
when that separate surface shows the message.

**Result:** You have a correction for each validation or save message listed on this page.
Return to [Review, remove, and save the allocation](#review-remove-and-save-the-allocation) after correcting the value.

## After saving

An existing cost transaction can continue into payment work through its **Payments** tab.

Prerequisites

- The transaction has an ID and has been saved.

Steps

1. Open the saved transaction.
2. Select **Payments**.
3. Select the plus icon at the right side of the **Payments** tab when the transaction is not fully paid.

The **Payments** tab contains the payables list for the transaction.
Continue with [Payables](doc:payables) for payment work and [Job Profitability](doc:job-profitability-overview)
for the surrounding profitability view.

**Result:** The saved transaction is available for its payment work and related job-profitability review.
