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,9 +47,9 @@ public class TrackingNumberManagementRepository extends TrackingNumberRepository
|
|||||||
|
|
||||||
if (stockLocation != null) {
|
if (stockLocation != null) {
|
||||||
BigDecimal availableQty =
|
BigDecimal availableQty =
|
||||||
stockLocationLineService.getAvailableQty(
|
stockLocationLineService.getTrackingNumberAvailableQty(
|
||||||
stockLocation, trackingNumber.getProduct());
|
stockLocation, trackingNumber);
|
||||||
|
|
||||||
json.put("$availableQty", availableQty);
|
json.put("$availableQty", availableQty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,4 +246,15 @@ public interface StockLocationLineService {
|
|||||||
* @param stockMoveLine the move line responsible for the WAP change.
|
* @param stockMoveLine the move line responsible for the WAP change.
|
||||||
*/
|
*/
|
||||||
void updateWap(StockLocationLine stockLocationLine, BigDecimal wap, StockMoveLine stockMoveLine);
|
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(),
|
stockLocationLine.getUnit(),
|
||||||
stockMoveLine));
|
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