FEAT[BE] :implement proportional distribution with rounding for stock allocation in transfer laying approval process

This commit is contained in:
aguhh18
2026-02-03 08:06:52 +07:00
parent 58ae03a090
commit 9a328ae1e4
2 changed files with 55 additions and 31 deletions
@@ -520,6 +520,7 @@ func (s deliveryOrdersService) consumeDeliveryStock(ctx context.Context, tx *gor
CreatedBy: actorID,
Notes: fmt.Sprintf("FIFO consume (%.2f)", result.UsageQuantity),
}
stockLogs, err := s.StockLogRepo.GetByProductWarehouse(ctx, marketingProduct.ProductWarehouseId, 1)
if err != nil {
return fiber.NewError(fiber.StatusInternalServerError, "Failed to get stock logs")