fix the bug of Tracking Number Available Qty
fix the bug of Tracking Number Available Qty ( stock moves => move lines => Tracking Number)
This commit is contained in:
@@ -47,8 +47,8 @@ public class TrackingNumberManagementRepository extends TrackingNumberRepository
|
||||
|
||||
if (stockLocation != null) {
|
||||
BigDecimal availableQty =
|
||||
stockLocationLineService.getAvailableQty(
|
||||
stockLocation, trackingNumber.getProduct());
|
||||
stockLocationLineService.getTrackingNumberAvailableQty(
|
||||
stockLocation, trackingNumber);
|
||||
|
||||
json.put("$availableQty", availableQty);
|
||||
}
|
||||
|
||||
@@ -246,4 +246,15 @@ public interface StockLocationLineService {
|
||||
* @param stockMoveLine the move line responsible for the WAP change.
|
||||
*/
|
||||
void updateWap(StockLocationLine stockLocationLine, BigDecimal wap, StockMoveLine stockMoveLine);
|
||||
|
||||
|
||||
/**
|
||||
* Allow to get the available qty of product for a given Tracking Number.
|
||||
*
|
||||
* @param stockLocation
|
||||
* @param trackingNumber
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getTrackingNumberAvailableQty(
|
||||
StockLocation stockLocation, TrackingNumber trackingNumber);
|
||||
}
|
||||
|
||||
@@ -741,4 +741,18 @@ public class StockLocationLineServiceImpl implements StockLocationLineService {
|
||||
stockLocationLine.getUnit(),
|
||||
stockMoveLine));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTrackingNumberAvailableQty(
|
||||
StockLocation stockLocation, TrackingNumber trackingNumber) {
|
||||
StockLocationLine detailStockLocationLine =
|
||||
getDetailLocationLine(stockLocation, trackingNumber.getProduct(), trackingNumber);
|
||||
|
||||
BigDecimal availableQty = BigDecimal.ZERO;
|
||||
|
||||
if (detailStockLocationLine != null) {
|
||||
availableQty = detailStockLocationLine.getCurrentQty();
|
||||
}
|
||||
return availableQty;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user