# DTS | Adminstrative Action

{% hint style="danger" %}
When a user has incorrectly entered multiple restocks and attempted to resolve the issue themselves.

Ex.&#x20;

* Transaction 1: incorrect unit cost
* Transaction 2: negative unit cost and negative quantity

Resulting in extreme inaccurate unit cost and quantity
{% endhint %}

## Do research of Inventory Item

### Step 1 - Check audit log of Inventory Item

Look for the audit log record that was before the accidental restock entry. Take notes on these fields and what values were there.&#x20;

Example:

* Unit Cost - `$799.0000`
* Previous Unit Cost - `0.0000`
* Re-stock Unit Cost - `799.0000`
* Previous Quantity On-Hand - `0`
* RESTOCK\_QUANTITY\_TRANSLATOR - `475`

## Identify which records need to be deleted

### Step 2 - Document the Cost History line items and the Transactions&#x20;

Example:&#x20;

* Remove Cost History:
  * `670`
  * `671`
* Remove Transactions:
  * `47059`
  * `47122`

## Remove Cost History and Transaction line item records

### Step 3 - Go to tables "inventory\_transaction" and "inventory\_item\_unit\_costs"

* Delete Unit Cost records
* Delete Transaction records

## Correct Inventory Items

### Step 4 - Go to "inventory\_items" table

Update fields to roll back the **Unit Cost** and **Quantity On-Hand** from before the error

* Unit Cost - `$799.0000`
* Previous Unit Cost - `0.0000`
* Re-stock Unit Cost - `799.0000`
* Previous Quantity On-Hand - `0`
* RESTOCK\_QUANTITY\_TRANSLATOR - `475`

## Review Unit Cost and Inventory Item Details that all values are matching

### Step 5 - Review Inventory Item Details page to see if values have been reverted

<figure><img src="https://3087753818-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzNSSXajDFpzOv2IhIv%2Fuploads%2FI7BCQ4vOP8lF10tFjoEK%2Fimage.png?alt=media&#x26;token=4d1c094e-8461-4996-952f-312a270a0a3a" alt=""><figcaption></figcaption></figure>

## Test Restock form (but don't actually submit)

### Step 6 - Click "Restock", and add "1" quanity to see if the Unit Costs remains the same as the reverted Unit Cost

<figure><img src="https://3087753818-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzNSSXajDFpzOv2IhIv%2Fuploads%2F2INJ3PFvu4suvzeEjW44%2Fimage.png?alt=media&#x26;token=7c62bc4a-b4e7-4aa5-adf4-9116b8928b5d" alt=""><figcaption></figcaption></figure>

