definir le prix achat auto pour les sorties de stock / sophal interne

This commit is contained in:
walid seghier
2022-07-21 15:46:38 +01:00
parent ae214d14ac
commit 1e15cb6346

View File

@@ -801,7 +801,11 @@ public class StockMoveLineServiceImpl implements StockMoveLineService {
BigDecimal unitPriceUntaxed = BigDecimal.ZERO;
if (stockMoveLine.getProduct() != null && stockMove != null) {
if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING) {
unitPriceUntaxed = stockMoveLine.getProduct().getSalePrice();
if(stockMoveLine.getProduct().getSellable() == true){
unitPriceUntaxed = stockMoveLine.getProduct().getSalePrice();
}else{
unitPriceUntaxed = stockMoveLine.getProduct().getPurchasePrice();
}
} else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING) {
unitPriceUntaxed = stockMoveLine.getProduct().getPurchasePrice();
} else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INTERNAL