From 16274cae5c3ab6914cabeac133543eeac9208db3 Mon Sep 17 00:00:00 2001 From: Yamel Senih Date: Sun, 21 Nov 2021 14:13:13 -0430 Subject: [PATCH] Add validation for document status of shipments --- .classpath | 1 + .../spin/grpc/service/PointOfSalesServiceImplementation.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.classpath b/.classpath index 40c14ffe9..23f835fa1 100644 --- a/.classpath +++ b/.classpath @@ -30,5 +30,6 @@ + diff --git a/src/main/java/org/spin/grpc/service/PointOfSalesServiceImplementation.java b/src/main/java/org/spin/grpc/service/PointOfSalesServiceImplementation.java index d4da7621b..ecf894b58 100644 --- a/src/main/java/org/spin/grpc/service/PointOfSalesServiceImplementation.java +++ b/src/main/java/org/spin/grpc/service/PointOfSalesServiceImplementation.java @@ -1931,6 +1931,9 @@ private Shipment.Builder processShipment(ProcessShipmentRequest request) { Trx.run(transactionName -> { int shipmentId = RecordUtil.getIdFromUuid(I_M_InOut.Table_Name, request.getShipmentUuid(), transactionName); MInOut shipment = new MInOut(Env.getCtx(), shipmentId, transactionName); + if(shipment.isProcessed()) { + throw new AdempiereException("@M_InOut_ID@ @Processed@"); + } if (!shipment.processIt(request.getDocumentAction())) { log.warning("@ProcessFailed@ :" + shipment.getProcessMsg()); throw new AdempiereException("@ProcessFailed@ :" + shipment.getProcessMsg());