Stock Adjustment (+) / (-) Via WDC

Stock Adjustment (+) and Stock Adjustment (-) are two separate WDC operations used to adjust stock quantities through barcode scanning. Both operations follow the same user flow, but they serve different business purposes: (+) is used to increase stock and (-) is used to decrease stock.

1. Overview

These operations are used when stock needs to be corrected through an inventory adjustment process. The warehouse user scans the adjustment document in WDC, scans the products that need to be adjusted, confirms the scanned result from the Summary page, and then the back-office user loads those scanned records into the Stock Adjustment document using Import from WDC.

Business usage:

  • Stock Adjustment (+) is used when stock must be added to the system.
  • Stock Adjustment (-) is used when stock must be reduced from the system.
Code behavior: Both operations are validated as draft stock adjustment documents in WDC, and both use Import from WDC to create adjustment lines in the document. The system decides whether the imported quantity should be positive or negative based on the selected operation type.

2. Step-by-Step Process

Step 1: Open WDC and Select the Required Adjustment Operation

Go to WDC → Operations and choose one of the following:

  • Stock Adjustment (+)
  • Stock Adjustment (-)

The user should select the operation based on whether stock needs to be increased or reduced.

[Attach Image Here] WDC Operations Screen - Stock Adjustment (+) / (-)
WDC Operations Screen - Stock Adjustment (+) / (-)

Step 2: Scan or Search the Adjustment Document

The user scans the Stock Adjustment document number using barcode scanning or enters it manually.

Based on the current code, WDC checks:

  • The document must exist.
  • The document must be in Draft state.
  • The document type must be Adjustment.
  • The document must belong to the correct Warehouse.
  • The document must have a valid Warehouse assigned.
Important: If the document has no warehouse assigned, WDC blocks the process and shows an error message.
[Attach Image Here] Scan / Search Stock Adjustment Document
Scan / Search Stock Adjustment Document

Step 3: Review the WDC Scanning Screen

After the document is validated, WDC opens the scanning screen and shows:

  • Document Number
  • Warehouse Name
  • Default Location
  • Set Quantity section

The user can increase, decrease, or manually edit the scan quantity before scanning products.

[Attach Image Here] Stock Adjustment Scanning Screen
Stock Adjustment Scanning Screen

Step 4: Scan the Products

The warehouse user scans the products that need to be adjusted. Each successful scan creates a wdc.transaction.lines record in Draft state.

During scanning, WDC can also handle:

  • Lot selection for lot-tracked products
  • Serial entry for serial-tracked products
  • Location change if a bin or location barcode is scanned
  • Quantity adjustment using the set quantity feature

If the product requires tracking, WDC asks the user to complete the required Lot or Serial details before the line is accepted.

[Attach Image Here] Scan Product for Stock Adjustment
Scan Product for Stock Adjustment

Step 5: Review the Summary Page

Once the user finishes scanning, the Summary page is opened to review the scanned products.

The summary usually shows:

  • Product
  • Lot / Serial where applicable
  • Quantity
  • Scanned By
  • Scanned Date and Time

The user can review the lines before final confirmation.

[Attach Image Here] Stock Adjustment Summary Page
Stock Adjustment Summary Page

Step 6: Confirm the WDC Transaction

On the Summary page, the user clicks Confirm.

Based on the stock WDC flow, the confirmation changes the related wdc.transaction.lines from Draft to Ready To Process.

Code behavior: The WDC summary confirmation does not immediately create adjustment lines in the document. It first moves the scanned WDC lines to Ready To Process.
[Attach Image Here] Confirm Scanned Stock Adjustment Lines
Confirm Scanned Stock Adjustment Lines

Step 7: Open the Stock Adjustment Document in Back Office

The back-office user opens the same Stock Adjustment document. If WDC scanned lines are available in Ready To Process state, the document shows a message indicating that WDC transactions are available for this document.

From this message area, the user can open:

  • WDC Lines – to review the scanned records
  • Import from WDC – to load the lines into the adjustment document
[Attach Image Here] Stock Adjustment Form with WDC Lines Available
Stock Adjustment Form with WDC Lines Available

Step 8: Click Import from WDC

The user clicks Import from WDC to load the scanned WDC lines into the adjustment document.

Based on the current code, the import wizard:

  • Loads only WDC lines that are in Ready To Process state
  • Aggregates scanned lines by Product, Warehouse, Lot, and UoM
  • Creates adjustment lines inside the stock adjustment document
  • Marks the imported WDC lines as Processed
Important: Import from WDC is available only while the stock adjustment document is not in Done state.
[Attach Image Here] Import from WDC Wizard for Stock Adjustment
Import from WDC Wizard for Stock Adjustment

Step 9: Understand How the System Applies (+) and (-)

During import, the system decides how the quantity should be inserted into the adjustment line:

  • For Stock Adjustment (+), the scanned quantity is imported as a positive quantity.
  • For Stock Adjustment (-), the scanned quantity is imported as a negative quantity.

This is handled automatically by the code during the import process, so the user does not need to manually enter a plus or minus sign.

Actual code logic: if the operation type is stock_adj_decrease, the imported quantity is forced to a negative value. Otherwise, the quantity is imported as entered.
[Attach Image Here] Imported Adjustment Lines for (+) and (-)
Imported Adjustment Lines for (+) and (-)

Step 10: Review and Post the Adjustment Document

After importing the lines, the back-office user reviews the adjustment lines and then proceeds with the normal adjustment posting process.

[Attach Image Here] Final Stock Adjustment Document Ready to Post
Final Stock Adjustment Document Ready to Post

3. What the Code Actually Does

Document validation in WDC

  • Checks that the document exists.
  • Checks that it is in Draft state.
  • Checks that it belongs to the current company.
  • Checks that the document type is Adjustment.
  • Checks that a warehouse is assigned.

Product scanning in WDC

  • Each scanned product becomes a wdc.transaction.lines entry.
  • The line stores product, quantity, lot, location, warehouse, document number, scanned user, and scan time.
  • Tracked products require lot or serial completion before the line is accepted.

Confirmation from summary

  • WDC lines move from Draft to Ready To Process.
  • The stock adjustment document then detects those lines through the has_wdc_trans flag.

Import logic

  • The import wizard fetches only Ready To Process adjustment WDC lines for the document.
  • It groups lines before inserting them into the adjustment document.
  • For Stock Adjustment (-), quantity is converted to negative during import.
  • After import, the WDC lines are marked Processed.

4. Important Notes

  • Use Stock Adjustment (+) only when stock needs to be increased.
  • Use Stock Adjustment (-) only when stock needs to be reduced.
  • The correct sign is handled automatically during import, based on the selected operation.
  • The document must remain in Draft until WDC lines are imported.
  • Users can review the scanned records at any time through the WDC Lines link in the adjustment form.

5. Business Benefits

Stock Adjustment via WDC helps the business:

  • Reduce manual data entry in stock adjustment journals
  • Improve accuracy during stock correction
  • Allow warehouse users to capture adjustments directly from the floor
  • Support lot and serial controlled products in adjustment workflows
  • Speed up adjustment preparation before final posting
Summary: Stock Adjustment (+) and Stock Adjustment (-) use the same WDC process: scan the document, scan the products, confirm from the summary page, then use Import from WDC in the stock adjustment form. The only functional difference is whether the imported quantity increases or decreases stock.