Skip to content

Commit

Permalink
Add validation for document status of shipments
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Nov 21, 2021
1 parent 5c07e7a commit 16274ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/Fiscal-Printer"/>
<classpathentry combineaccessrules="false" kind="src" path="/Fiscal-Printer-API"/>
<classpathentry combineaccessrules="false" kind="src" path="/CST-STD"/>
<classpathentry combineaccessrules="false" kind="src" path="/Material-Management-Improvements"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 16274ca

Please sign in to comment.