# Inventory Value Determination & Cost Flow Behavior

### 1. Overview

This guide explains how inventory valuation, item costing, and asset value calculations behave within XoroERP. It covers cost hierarchy logic, purchase and manufacturing cost impact, inventory adjustments, valuation reporting, and transaction sequencing rules that determine inventory accuracy.

***

### 2. Functional Workflow

#### 2.1 Item Cost Determination Workflow

**Step 1: Item Creation**

* When an item is created, the system assigns a manually defined standard cost.

**Step 2: Inventory Transactions Occur**

* As transactions are recorded, the system evaluates available cost sources:
  * Standard cost (fallback when no history exists)
  * ​Average cost (moving average recalculated over time)
  * Last landed cost (latest receipt cost including reconciliation charges)

**Step 3: Transaction Cost Selection**

* The system applies the appropriate cost depending on transaction type and inventory history.

***

#### 2.2 Purchase Order and Item Receipt Cost Flow

**Step 1: Purchase Order Creation**

* Purchase orders default to the item’s standard cost unless manually overridden.

**Step 2: Item Receipt Creation**

* When an Item Receipt (IR) is recorded:
  * Inventory quantity increases.
  * ​Asset value increases.
  * ​Landed cost may include reconciliation charges.
  * ​Average cost is recalculated.

**Step 3: Cost Update**

* The moving average updates using total inventory value and quantity.

***

#### 2.3 Average Cost Calculation Workflow

* Average cost is calculated using:

**Total Asset Value ÷ Total On-Hand Quantity**

* When new inventory is received:
  * Existing inventory value is combined with new receipt value.
  * ​Quantity-weighted recalculation occurs.
  * ​Historical inventory continues to influence valuation.

***

#### 2.4 Invoice Consumption Workflow

* When an invoice is created:
  * Inventory quantity decreases.
  * ​Cost of Goods Sold (COGS) is calculated using the current average cost.
  * ​Remaining inventory value is reduced.
  * ​Average cost does not change.

***

#### 2.5 Manufacturing Order Cost Flow

**Production Transactions**

* Finished goods increase inventory quantity.
* Average cost is recalculated.

**Consumption Transactions**

* Raw materials decrease inventory quantity.
* Behaves similarly to invoice consumption.
* Average cost is not recalculated.

***

#### 2.6 Inventory Adjustment Workflow

* Three adjustment types are supported:
  * Quantity-only adjustment
  * ​Value-only adjustment
  * ​Quantity and value adjustment

**System Behavior**

* First-ever quantity adjustment uses standard cost.
* Later quantity adjustments use average cost.
* Value-based adjustments change inventory valuation.

***

#### 2.7 Inventory Valuation Monitoring Workflow

* Users review inventory valuation through the **Inventory Valuation Summary** report, which displays:
  * On-hand quantity
  * ​Total asset value
  * ​Average cost
* Any negative values indicate data integrity issues.

***

#### 2.8 Transaction Validation Workflow (Error Handling)

* When a transaction is saved:
  * System validates inventory and asset value impact.
  * ​If negative values would result, the system blocks the transaction.
  * ​Error Code 102 identifies the conflicting transaction.

***

#### 2.9 Item Receipt Merge Workflow

* When multiple Item Receipts are merged:
  * Transaction history is rewritten.
  * ​Inventory availability dates may shift.
  * ​Incorrect sequencing may invalidate prior sales.

***

### 3. Core Configuration Logic

#### 3.1 Cost Hierarchy Rules

* The system prioritizes cost sources based on availability:
  * Standard cost — used when no inventory history exists.
  * ​Average cost — used after inventory transactions occur.
  * ​Last landed cost — derived from the most recent item receipt.

***

#### 3.2 Purchase and Landed Cost Dependencies

* Purchase order price does not define final inventory cost.
* Reconciliation charges increase landed cost.
* Item receipts determine actual inventory valuation.

***

#### 3.3 Inventory Valuation Controls

* Inventory quantity and asset value must remain positive.
* Transaction sequence determines valuation accuracy.
* Inventory history cannot be safely modified retroactively.

***

#### 3.4 Manufacturing Cost Dependencies

* Production increases valuation.
* Consumption reduces quantity without repricing inventory.

***

#### 3.5 Transaction Sequencing Constraints

* Inventory must exist before invoicing.
* Backdated transactions may invalidate valuation.
* Merge operations must preserve original transaction order.

***

### 4. Transaction-Level Behavior

#### 4.1 When an Item Receipt Is Created

**System Behavior**

* Inventory quantity increases.
* Asset value increases.
* Landed cost may include reconciliation charges.
* Average cost recalculates.

***

#### 4.2 When an Invoice Is Created

**System Behavior**

* Inventory quantity decreases.
* COGS calculated using current average cost.
* Asset value reduced.
* Average cost unchanged.

***

#### 4.3 When Manufacturing Production Occurs

**System Behavior**

* Finished goods added to inventory.
* Average cost recalculated.

***

#### 4.4 When Manufacturing Consumption Occurs

**System Behavior**

* Raw materials reduced.
* Average cost unchanged.

***

#### 4.5 When Inventory Adjustment Occurs

**System Behavior**

* Quantity or value changes based on adjustment type.
* First adjustment may use standard cost.
* Value-based adjustments impact average cost.

***

#### 4.6 When Backdated Transactions Are Saved

**System Behavior**

* System checks for negative inventory impact.
* Transaction blocked if valuation becomes invalid.
* Error Code 102 displayed.

***

### 5. Structured Examples

**Example 1: Receiving Inventory at Higher Cost**

**Action:**\
Record an Item Receipt with higher cost than existing inventory.

**System Impact:**

* Inventory quantity increases.
* Asset value increases.
* Moving average cost rises.

***

**Example 2: Creating Invoice After Inventory Receipt**

**Action:**\
Invoice created after inventory exists.

**System Impact:**

* Inventory reduced.
* COGS recorded using average cost.
* Average cost unchanged.

***

**Example 3: Backdated Invoice Before Inventory Receipt**

**Action:**\
Invoice dated earlier than inventory receipt.

**System Impact:**

* Negative on-hand quantity.
* Negative asset value.
* Transaction may trigger Error Code 102.

***

**Example 4: Merging Item Receipts Using Incorrect Date**

**Action:**\
Merge multiple item receipts using the most recent date.

**System Impact:**

* Inventory availability shifted forward.
* Prior sales invalidated.
* Negative inventory risk introduced.

***

### 6. Important Rules & Constraints

* Average cost is quantity-weighted and continuously recalculated.
* Invoices never change average cost.
* Item receipts determine inventory valuation.
* Inventory must exist before invoicing.
* Negative asset value indicates transactional sequencing issues.
* First quantity adjustment uses standard cost.
* Inventory adjustments only affect cost when value is included.
* Merging item receipts must retain earliest transaction date.
* Backdated transactions can invalidate inventory history.

***

### 7. Best Practices

* Always verify transaction sequence before investigating valuation issues.
* Review full transaction history when analyzing cost discrepancies.
* Use value-based adjustments only when inventory repricing is required.
* Maintain correct transaction dates for inventory and sales.
* Educate users on proper item receipt merging procedures.
* Monitor inventory valuation reports regularly.

***

### 8. Common Mistakes & Pitfalls

| Situation / Mistake                                                                    | Result                                                                 |
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Creating invoices before inventory is received                                         | Negative on-hand quantity and negative asset value                     |
| Backdating transactions without verifying inventory availability                       | Transaction sequencing errors and valuation inconsistencies            |
| Assuming purchase order price equals final inventory cost                              | Incorrect expectation of inventory value due to reconciliation charges |
| Misinterpreting manufacturing consumption as cost-changing activity                    | Incorrect analysis of average cost changes                             |
| Performing the first inventory adjustment without understanding standard cost behavior | Unexpected inventory valuation results                                 |
| Merging item receipts using the most recent date instead of earliest date              | Invalidated historical sales and negative inventory scenarios          |
| Ignoring negative asset value in valuation reports                                     | Data integrity issues remain unresolved                                |
| Reviewing only current inventory value without checking transaction history            | Root cause of cost discrepancies not identified                        |

***

### 9. **Inventory Costing & Valuation FAQs (XoroERP)**

***

#### **Why does the system sometimes use standard cost instead of average cost?**

The system uses **standard cost** when there is no prior inventory history available for an item.

This typically happens when:

* The item is newly created
* No item receipt or inventory transaction has been recorded yet

**What users should do:**

* Ensure an **item receipt** is created before selling the item
* Verify that inventory history exists so average cost can be calculated

***

#### **Do invoices change the average cost of an item?**

No, invoices do not affect average cost.

Invoices only:

* Reduce inventory quantity
* Reduce inventory asset value using the existing average cost

**What users should do:**

* Do not expect average cost to change after sales
* Review purchase-related transactions if cost appears incorrect

***

#### **Which transactions impact average cost?**

Average cost is affected only by transactions that **introduce or adjust inventory value**, such as:

* Item Receipts
* Manufacturing Production
* Inventory Adjustments (with value)

**What users should do:**

* Check these transactions when average cost appears incorrect
* Ensure correct cost values are entered during receipts or adjustments

***

#### **Why does negative inventory occur?**

Negative inventory typically occurs when:

* Items are sold before they are received
* Transactions are backdated (e.g., invoice dated before item receipt)

**What users should do:**

* Ensure inventory is received before creating sales invoices
* Maintain correct transaction dates and sequence

***

#### **What is Error Code 102?**

Error Code 102 is a validation error that occurs when a transaction would result in:

* Negative inventory
* Negative inventory asset value

**What users should do:**

* Check if inventory is available before processing the transaction
* Verify transaction dates and sequence
* Correct backdated entries if necessary

***

#### **Can inventory adjustments change average cost?**

Yes, but only if the adjustment includes a **value change**.

* Quantity-only adjustments do not impact average cost
* Value-based adjustments update the average cost

**What users should do:**

* Use value-based adjustments when correcting cost
* Avoid unnecessary adjustments without understanding impact

***

#### **Why can merging item receipts cause valuation issues?**

Merging item receipts can overwrite original transaction dates.

This may:

* Disrupt transaction sequence
* Cause earlier sales to appear before inventory was received

***

#### **What users should do:**

* Avoid merging receipts if transactions are already processed
* Ensure original transaction dates are preserved

***

#### **What is last landed cost?**

Last landed cost refers to the **cost of the most recent item receipt**, including:

* Purchase cost
* Additional charges (freight, duty, etc.)

**What users should do:**

* Review last landed cost for recent purchase pricing
* Use it for reference, not as a replacement for average cost

***

#### **Does manufacturing consumption affect average cost?**

No, manufacturing consumption does not affect average cost.

Only **manufacturing production** (finished goods creation) impacts average cost.

**What users should do:**

* Review production transactions for cost changes
* Do not expect raw material consumption to affect item cost

***

#### **What should be checked first when inventory valuation appears incorrect?**

The first step is to check:

* **Transaction sequence**
* **Transaction dates**

Incorrect sequencing is the most common cause of valuation issues.

**What users should do:**

* Ensure item receipts occur before sales
* Review backdated transactions
* Correct any sequence inconsistencies

***

#### **Key Takeaway**

* Inventory valuation depends on **transaction order and cost-driving events**
* Sales do not affect cost—only inventory inflow and value adjustments do
* Maintaining correct transaction sequence is critical for accurate costing

***

### 10. Conclusion

Accurate inventory valuation in XoroERP depends on correct cost hierarchy usage, proper transaction sequencing, and consistent inventory history management. Understanding how item receipts, manufacturing activity, and inventory adjustments influence average cost ensures reliable asset valuation and financial reporting.

Following the defined workflows and constraints prevents negative inventory scenarios, valuation inconsistencies, and transactional errors, enabling stable inventory control and accurate cost tracking across operations.


---

# Agent Instructions: 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:

```
GET https://docs.xorosoft.com/xoroerp-1/connected-apps/xoro-shopify-implementation-deep-dive/inventory-value-determination-and-cost-flow-behavior.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
