Add external location handling to stock movement processes

This commit is contained in:
2026-09-08 13:17:01 +05:30
parent 7e362be304
commit 2053b61965
5 changed files with 9 additions and 2 deletions
@@ -104,6 +104,8 @@ public class PurchaseReturnService(
FK_ItemId = line.FK_ItemId,
FromLocationId = warehouseId,
FromLocationType = LocationType.Warehouse,
ToLocationId = StockService.ExternalLocationId,
ToLocationType = LocationType.External,
Quantity = line.Quantity,
Type = MovementType.PurchaseReturn,
ReasonCode = request.Reason,
@@ -120,6 +120,8 @@ public class ReturnService(
await stockRepo.AddMovementAsync(new StockMovement
{
FK_ItemId = line.FK_ItemId,
FromLocationId = StockService.ExternalLocationId,
FromLocationType = LocationType.External,
ToLocationId = vehicleId,
ToLocationType = LocationType.Vehicle,
Quantity = line.Quantity,
+2 -1
View File
@@ -298,7 +298,8 @@ public class RideService(
b.LocationId,
b.LocationType,
b.Quantity,
b.UpdatedAt)).ToList()));
b.UpdatedAt,
ride.Vehicle?.NumberPlate ?? string.Empty)).ToList()));
}
var openOrders = await rideRepo.GetActiveOrdersByRouteIdAsync(strandedRide.FK_RouteId);
@@ -251,6 +251,8 @@ public class SaleService(
FK_ItemId = item.FK_ItemId,
FromLocationId = vehicleId.Value,
FromLocationType = LocationType.Vehicle,
ToLocationId = StockService.ExternalLocationId,
ToLocationType = LocationType.External,
Quantity = item.QuantityFulfilled,
Type = MovementType.Sale,
ReferenceId = order.Id