# Cost transactions

Use this page to find a cost transaction, enter its details, distribute its amount across order
lines, and save it for the Job Profitability flow.

## Cost transactions

A cost transaction is a payable cost associated with one or more order lines. A sales-order
allocation assigns it to sales-order lines; a purchase-order allocation assigns it to
purchase-order lines. In Job Profitability, the cost-transaction surface sits beside the
Profitability view.

The two allocation directions are:

| Allocation direction | Use it for |
| --- | --- |
| Sales-order allocation | Assigning a cost to sales-order lines. |
| Purchase-order allocation | Assigning a cost to purchase-order lines. |

The flow is organised around the transaction and the order lines that receive its amount:

```mermaid
flowchart LR
    C[Cost transaction] --> S[Sales-order lines]
    C --> P[Purchase-order lines]
    S --> J[Job Profitability]
    P --> J
```

| If you need to… | Go to |
| --- | --- |
| Understand the surrounding Job Profitability record | The Job Profitability record page |
| Find a cost transaction or choose an allocation route | [Find or start a cost transaction](#find-or-start-a-cost-transaction) |
| Enter the transaction identity and amount | [Enter the transaction details](#enter-the-transaction-details) |
| Choose order lines and distribute the cost | [Allocate the order lines](#allocate-the-order-lines) |
| Check, remove, or save an allocation | [Review, remove, and save the allocation](#review-remove-and-save-the-allocation) |
| Understand a validation message | [When validation stops the save](#when-validation-stops-the-save) |
| Continue from a saved record | [After saving](#after-saving) |
| Work with sales-order records and lines | The Sales job record page |
| Work with purchase-order records and lines | The Purchase job record page |
| Work with payable filters after saving | The Payables page |

## Before you start

Have the following ready before you enter or edit a cost transaction.

| What you need | What to check | Why it matters |
| --- | --- | --- |
| Subscription | The cost-transaction feature is included in your subscription. | The cost-transaction body and its actions depend on the subscription. |
| Page access | The cost-transaction page is available. | The transaction body is shown only when the page is available. |
| Record | A cost-transaction record exists when you are editing rather than creating. | The detail fields and saved-record tabs use that record. |
| Editing permission | You can edit the transaction. | **Save**, **Save and Close**, and allocation deletion depend on editing permission. |
| Order | A sales order or purchase order is available for the route you choose. | The order supplies the lines that receive the cost. |
| Provider | The provider exists as an account. | **Provider** selects from the available Accounts records. |
| Transaction information | The cost type, title, amount, invoice date, provider, invoice number, and comment. | These values identify the cost and support later review. |

The five required fields are **Cost Type**, **Transaction Title**, **Amount**, **Invoice Date**,
and **Provider**. Prepare the information for all five before you begin.

The sales-order route uses **Sales Order**. The purchase-order route uses **Purchase Order
(PO)**. The order and provider values are loaded from your available records, so select the
record that matches the invoice or supporting business document.

## Find or start a cost transaction

Use the cost-transaction list to review existing records or open the allocation route that
matches the order you need to charge.

**Prerequisites**

- You have the order and transaction information listed in [Before you start](#before-you-start).
- You know whether the cost belongs to a sales order or a purchase order.

**Steps**

1. Open the cost-transaction list from the Payables area.
2. Select **All**, **Payable**, or **Paid** to filter the list.
3. Compare the displayed row with your invoice.
4. Open the route that matches your task.

   | If you need to… | Open |
   | --- | --- |
   | Enter a cost for sales-order lines | Sales-order allocation surface |
   | Enter a cost for purchase-order lines | Purchase-order allocation surface |
   | Edit a saved cost transaction | Saved cost-transaction surface |

![Use the filters and column headers to find an existing cost transaction.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/988927b2e699a8d110394021d12d8f4c.png)

**Result:** The list or the selected cost-transaction surface is on screen. Continue with
[Enter the transaction details](#enter-the-transaction-details) when you are entering a new
transaction.

## Enter the transaction details

Enter the information that identifies the payable cost before distributing its amount across
order lines.

**Prerequisites**

- You have opened a sales-order or purchase-order allocation surface.
- You have the cost type, title, amount, invoice date, provider, and any invoice number or
  comment.

**Steps**

1. In **Cost Type**, select the cost type that matches the invoice. Available choices include
   **Documentations and Certificates**, **Freight**, **Packing**, **Transportation and
   Logistics**, **Custom Fees**, **Customs Clearence**, **Bank fees**, **Withholding Tax**,
    **Currency cost**, **Others**, **warranty**, and **LG fees**.
2. In **Cost Classification**, use the classification shown for the cost. The classification
   values are **Inbound Cost**, **Inventory Handling Cost**, and **Delivery Cost**; the entry
   surface presents **Additional Landed Cost** and **Delivery Costs** as its visible choices.
3. In **Transaction Title**, enter a title that identifies the transaction.
4. In **Amount**, enter the cost in the branch currency used by the transaction.
5. In **Invoice Date**, enter the invoice date.
6. In **Invoice No.**, enter the invoice number when one is available.
7. In **Provider**, select the account that issued the cost.
8. In **Comment**, enter any context that colleagues need when reviewing the transaction.

![Review the transaction fields before selecting sales-order lines.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/741bc812a9dc02499a2f67eb5f16c48b.png)

The sales-order and purchase-order routes use the same transaction fields. Keep the title,
amount, date, and provider aligned with the invoice so the saved cost remains identifiable when
the list is filtered later.

> **Note:** The complete Provider, Sales Order, and Purchase Order values come from your
> available records. Select the record that matches the transaction rather than relying on a
> remembered value.

**Result:** The transaction information is entered. Continue with
[Allocate the order lines](#allocate-the-order-lines).

## Allocate the order lines

Choose the order lines that receive the transaction and select how to distribute the amount.

**Prerequisites**

- The transaction details are entered.
- You have opened the correct allocation route.

**Steps**

1. In **Sales Order**, select the sales order when you are allocating a sales-order cost.
2. In **Purchase Order (PO)**, select the purchase order when you are allocating a
   purchase-order cost.
3. Select **Items** to open the relevant order-line selection.
4. Select the order lines that receive the cost.
5. Select an **Allocation Method** when more than one allocation detail is present.

   | Allocation Method | Use it when |
   | --- | --- |
   | **Manual** | You need to enter each allocation percentage and amount yourself. |
   | **Equal Split** | You want the transaction distributed equally across the selected lines. |
   | **Sales price** | You want the distribution based on sales price. |

6. Review the line information in the grid.

    Both allocation grids include **Item No.**, **Item Price (EUR)**, an allocation percentage,
    and **Allocation Amount**. The remaining columns depend on the allocation route:

    | Route | Additional columns |
    | --- | --- |
    | Sales-order allocation | **Vendor Order No.**, **Job No.**, **Job Title** |
    | Purchase-order allocation | **PO No.**, **Package No**, **Package Title** |

7. If **Manual** is selected, enter the manual allocation values.

   | For each allocation row, enter… | In |
   | --- | --- |
   | The allocation percentage | **Allocation percentage** |
   | The allocation amount | **Allocation amount** |

An allocation row accepts a minimum value of `0` for both **Allocation percentage** and
**Allocation amount**. Those two values are disabled unless **Manual** is the selected
allocation method. The **Items** surface is shown after an order is selected.

![Compare the purchase-order columns and allocation values.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/bbf0872dfe84f72e17edc7ac721008fa.png)

**Result:** The selected order lines appear in the allocation grid with a distribution method
and allocation values ready for review. Continue with
[Review, remove, and save the allocation](#review-remove-and-save-the-allocation).

## Review, remove, and save the allocation

Review the allocation before saving the transaction. Remove a row only when the allocation can
be deleted and you have editing permission.

**Prerequisites**

- At least one order line is selected.
- The transaction details and allocation values are entered.
- You have editing permission.

**Steps**

1. Review the allocation rows and check that the selected lines and amounts match the invoice.
2. Select the **Delete icon** for an unwanted allocation row.
3. At the confirmation prompt `Are you sure deleting this item?`, choose what to do.

   | If you want to… | Select |
   | --- | --- |
   | Keep the row | **No** |
   | Delete the row | **Yes** |

4. Choose a save action.

   | If you want to… | Select |
   | --- | --- |
   | Save the transaction and remain on the page | **Save** |
   | Save the transaction and request to leave the page | **Save and Close** |
5. Confirm the message `Your request was completed successfully` after a successful save.
6. If `An error occurred while processing your request` appears, correct the transaction or allocation values, then select **Save** or **Save and Close** again.

**Save** and **Save and Close** are available on a standalone page when editing mode is off,
the subscription includes the feature, and editing is allowed. The **Delete icon** is
available when the allocation is deletable and editing is allowed.

**Result:** The transaction is saved and a success message confirms completion. If the save-error
message appeared, the corrected values are resubmitted. With **Save and Close**, the page also
requests leaving the transaction surface. Continue with
[After saving](#after-saving).

## When validation stops the save

When the form stops a save, match the exact message to the value or selection that needs
correction before selecting **Save** or **Save and Close** again.

| Message | Corrective action |
| --- | --- |
| `Please Solve the Following Issues :` | Read the messages listed with the validation result and correct each named field or allocation. |
| `Please select at least one order.` | Select a sales order or purchase order. |
| `Please select at least one item/product.` | Select at least one item or product in **Items**. |
| `Please enter the percentage value or delete unused items.` | Enter the allocation percentage for each used row or remove the unused row. |
| `Please adjust cost allocation.` | Adjust the allocation values to match the transaction amount. |
| `Please enter valid amount.` | Correct **Amount** and enter a valid value. |
| `Please choose cost type.` | Select **Cost Type**. |
| `Please choose provider.` | Select **Provider**. |
| `Please enter Transaction Title.` | Enter **Transaction Title**. |
| `Please choose payment due date.` | Enter **Invoice Date**. |
| `Just '-' '_' and '.' are the only characters that are accepted.` | Remove characters that are not accepted from the affected text value. |
| `This Field Is Required` | Complete the field marked as required. |
| `Just '_' '-' And '.' Characters Accepted` | Keep only the accepted characters in the affected value. |
| `Input contains forbidden characters(< , >). Please remove them and try again.` | Remove `<` and `>` from the affected value. |
| `The total must equal 100%` | Adjust the allocation percentages until the total is 100%. |
| `An error occurred while processing your request` | Correct the transaction or allocation values, then select **Save** or **Save and Close** again. |

The form validates before it sends the save request. Return to
[Review, remove, and save the allocation](#review-remove-and-save-the-allocation) after you
correct a validation issue.

### Out of scope messages

The following messages belong to shared panels or other pages, not to the cost-transaction
save and validation flow.

| Owning page or panel | Class | Message |
| --- | --- | --- |
| Account details | successMessages | Your request was completed successfully |
| Account details | errorMessages | An account with this name already exists |
| Account details | errorMessages | An error occurred while processing your request |
| Account details | errorMessages | Error: Vendor not saved yet |
| Account details | errorMessages | Error: Client not saved yet |
| Account details | errorMessages | This Field Is Required |
| Attached documents | successMessages | Your request was completed successfully |
| Attached documents | errorMessages | An account with this name already exists |
| Attached documents | errorMessages | An error occurred while processing your request |
| Attached documents | errorMessages | Error: Vendor not saved yet |
| Attached documents | errorMessages | Error: Client not saved yet |
| Attached documents | errorMessages | This Field Is Required |
| Addresses | successMessages | Your request was completed successfully |
| Addresses | errorMessages | An account with this name already exists |
| Addresses | errorMessages | An error occurred while processing your request |
| Addresses | errorMessages | Error: Vendor not saved yet |
| Addresses | errorMessages | Error: Client not saved yet |
| Addresses | errorMessages | This Field Is Required |
| Address | successMessages | Your request was completed successfully |
| Address | errorMessages | An account with this name already exists |
| Address | errorMessages | An error occurred while processing your request |
| Address | errorMessages | Error: Vendor not saved yet |
| Address | errorMessages | Error: Client not saved yet |
| Address | errorMessages | This Field Is Required |
| Comments | successMessages | Your request was completed successfully |
| Comments | errorMessages | An account with this name already exists |
| Comments | errorMessages | An error occurred while processing your request |
| Comments | errorMessages | Error: Vendor not saved yet |
| Comments | errorMessages | Error: Client not saved yet |
| Comments | errorMessages | This Field Is Required |
| Avatar | successMessages | Your request was completed successfully |
| Avatar | errorMessages | An account with this name already exists |
| Avatar | errorMessages | An error occurred while processing your request |
| Avatar | errorMessages | Error: Vendor not saved yet |
| Avatar | errorMessages | Error: Client not saved yet |
| Avatar | errorMessages | This Field Is Required |
| Decreased table | successMessages | Your request was completed successfully |
| Decreased table | errorMessages | An account with this name already exists |
| Decreased table | errorMessages | An error occurred while processing your request |
| Decreased table | errorMessages | Error: Vendor not saved yet |
| Decreased table | errorMessages | Error: Client not saved yet |
| Decreased table | errorMessages | This Field Is Required |
| Not-found page | successMessages | Your request was completed successfully |
| Not-found page | errorMessages | An account with this name already exists |
| Not-found page | errorMessages | An error occurred while processing your request |
| Not-found page | errorMessages | Error: Vendor not saved yet |
| Not-found page | errorMessages | Error: Client not saved yet |
| Not-found page | errorMessages | This Field Is Required |
| Upload logo | successMessages | Your request was completed successfully |
| Upload logo | errorMessages | An account with this name already exists |
| Upload logo | errorMessages | An error occurred while processing your request |
| Upload logo | errorMessages | Error: Vendor not saved yet |
| Upload logo | errorMessages | Error: Client not saved yet |
| Upload logo | errorMessages | This Field Is Required |

The following messages are emitted by related pages or panels. Use the owning page or panel when
one of these messages appears:

| Owning page or panel | Message |
| --- | --- |
| Payables list | `Forbidden characters detected. Please remove them and try again.` |
| Contacts | `You already have a contact with this name` |
| Sales-job screen | `Required Receiving Date` |
| Sales-job screen | `Invalid input. The value must be greater than 0 and cannot exceed 999,999.00` |
| Sales-job screen | `Invalid input. Please enter a non-negative value` |
| Sales-job screen | `Custom fields saved successfully` |
| Sales-job screen | `Job updated successfully` |
| Sales-job screen | `Job deleted successfully` |
| Sales-job screen | `Job regretted successfully` |
| Sales-job screen | `Job cancelled successfully` |
| Sales-job screen | `Job missed successfully` |
| Sales-job screen | `Job reactivated successfully` |
| Sales-job screen | `Converted to offer successfully` |
| Sales-job screen | `Converted to inquiry successfully` |
| Sales-job screen | `Error saving custom fields` |
| Sales-job screen | `Cannot be un-delivered — a due invoice already exists` |
| Sales-job screen | `All offers must be in draft status to revert to inquiry` |
| Sales-job screen | `A project with this name already exists` |
| Sales-job screen | `Please save opened inquiry first` |
| Sales-job screen | `All inquiries must be in draft stage to revert to potential` |
| Offer panel | `Please save opened cost sheet first` |
| Payment milestone | `Please save opened cost sheet first` |
| Bill of materials | `Booked quantity for this job is greater than the required BOM quantity` |
| Bill of materials | `You cannot edit or delete the product after the purchase package is created` |
| Bill of materials | `Cannot be deleted. Product is in purchasing` |
| Bill of materials | `You cannot edit the product after the PO is created` |
| Products list | `This product is already included in BOM` |
| Products details | `The first variant cannot be deleted` |
| Products details | `An error occurred while connecting to your CRM system.` |
| Products details | `Please select one product` |
| MRQ details | `You cannot save without adding at least one product` |
| Tasks | `This record is related to saved data and cannot be deleted` |
| Activities | `Action not allowed` |
| Purchasing details | `Please enter at least one email` |
| Purchasing details | `Inquiry must have at least one item` |
| Purchasing details | `Offer must have at least one item` |
| Purchasing details | `Order must have at least one item` |
| Purchasing details | `Items labeled as ‘Ready for Shipment’ or ‘Delivered’ cannot be deleted` |
| Purchasing details | `Please select one or more items to create a RFQ.` |
| Deliveries and orders | `Error loading accounts` |
| Serial combinations | `Serial you have entered already exist and belong to same manufacturer` |
| Serial combinations | `There is error in serial you have entered` |
| Serial combinations | `Minimum: At least one serial` |
| L/G details | `Please Add Extension to activate the LG` |
| L/G details | `LG has one or more extensions or deductions and cannot be reverted to the requested stage` |
| L/G details | `Please choose a date after the current expiry date` |
| Activity panels | `One topic and at least one note is required` |
| Activity panels | `Please enter action for each milstone` |
| Activity panels | `Required Receiving After` |
| Purchasing details | `Package must have at least one item` |
| Purchasing details | `Required Offer Type` |
| Purchasing details | `Required Bid Due Date` |
| Payments | `Forbidden characters detected. Please remove them and try again.` |

## After saving

A saved cost transaction is the record you use to review the allocation and continue into
payment work.

**Prerequisites**

- You have selected **Save** or **Save and Close**.
- The transaction is saved.

**Steps**

1. Open the saved cost-transaction record.
2. Select **Payments** when the transaction is saved.
3. In the Payments surface, use **All**, **Payable**, **Paid**, **Upcoming**, **Not completely
   Allocated**, or **Completely Allocated** to filter payment records.
4. Select the new-payment icon when the transaction is saved, **Payments** is active, and the
   record is not totally paid.

**Result:** The saved cost-transaction record is on screen, and its **Payments** surface and
available payment filters can be used when their record conditions are met. The surrounding
Job Profitability views remain available from the Job Profitability area.
