IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShi… (#1211)

* IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10

* IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10

* IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated! #resolve #fixversion 10
This commit is contained in:
Layda Salas 2022-03-04 02:52:28 +01:00 committed by GitHub
parent 063788242c
commit 60fb790b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 7 deletions

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated!
SELECT register_migration_script('202203020949_IDEMPIERE-2081.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 2, 2022, 9:49:04 AM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Production has already been created: {0}',0,0,'Y',TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,200732,'ProductionHasAlreadyBeenCreated','D','273dde9a-5130-46d0-9d98-25c241597035')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-2081 Class OrderLineCreateProduction and OrderLineCreateShipment exception messages are not translated!
SELECT register_migration_script('202203020949_IDEMPIERE-2081.sql') FROM dual;
-- Mar 2, 2022, 9:49:04 AM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Production has already been created: {0}',0,0,'Y',TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-02 09:49:04','YYYY-MM-DD HH24:MI:SS'),100,200732,'ProductionHasAlreadyBeenCreated','D','273dde9a-5130-46d0-9d98-25c241597035')
;

View File

@ -79,22 +79,21 @@ public class OrderLineCreateProduction extends SvrProcess
{
if (log.isLoggable(Level.INFO)) log.info("C_OrderLine_ID=" + p_C_OrderLine_ID );
if (p_C_OrderLine_ID == 0)
throw new IllegalArgumentException("No OrderLine");
throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "No OrderLine"));
//
MOrderLine line = new MOrderLine (getCtx(), p_C_OrderLine_ID, get_TrxName());
if (line.get_ID() == 0)
throw new IllegalArgumentException("Order line not found");
throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "Order line not found"));
MOrder order = new MOrder (getCtx(), line.getC_Order_ID(), get_TrxName());
if (!MOrder.DOCSTATUS_Completed.equals(order.getDocStatus()))
throw new IllegalArgumentException("Order not completed");
throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "Order not completed"));
MDocType doc = new MDocType(getCtx(), order.getC_DocType_ID(), get_TrxName());
if ( (line.getQtyOrdered().subtract(line.getQtyDelivered())).compareTo(Env.ZERO) <= 0 )
{
if (!doc.getDocSubTypeSO().equals("ON")) //Consignment and stock orders both have subtype of ON
{
return "Ordered quantity already shipped";
return Msg.getMsg(Env.getCtx(), "Ordered quantity already shipped");
}
}
@ -109,7 +108,8 @@ public class OrderLineCreateProduction extends SvrProcess
p_C_OrderLine_ID);
if (docNo != null)
{
throw new IllegalArgumentException("Production has already been created: " + docNo);
throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "ProductionHasAlreadyBeenCreated", new String[] {docNo}));
}
}