0% found this document useful (0 votes)
14 views1 page

Stock Movement Calculation Guide

The document outlines the StockMove process for a product identified by product_id. It describes two cases: Case 1 for stock moving from a warehouse, which updates the balance by subtracting the quantity, and Case 2 for stock moving to a warehouse, which updates the balance by adding the quantity. Each case retrieves the current balance from the StockMove table before and after the transaction.

Uploaded by

Toanh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Stock Movement Calculation Guide

The document outlines the StockMove process for a product identified by product_id. It describes two cases: Case 1 for stock moving from a warehouse, which updates the balance by subtracting the quantity, and Case 2 for stock moving to a warehouse, which updates the balance by adding the quantity. Each case retrieves the current balance from the StockMove table before and after the transaction.

Uploaded by

Toanh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

@Wh = VH001

Phát sinh StockMove: product_id


Case1: From_stock = @wh
Active: Balance = select top 1 balance from where StockMove where
productid = productID
Done: Balance = (select top 1 balance from where StockMove where
productid = productID) - QTY
Case2: To_Stock = @wh
Active: Balance = select top 1 balance from where StockMove where
productid = productID
Done: Balance = (select top 1 balance from where StockMove where
productid = productID) + QTY

You might also like