IDEMPIERE-4035 OrderLineCreateShipment missing translation

This commit is contained in:
sjeffen 2019-08-25 13:42:40 +02:00
parent 171a0c67ba
commit 2fcf9759b4
3 changed files with 63 additions and 6 deletions

View File

@ -0,0 +1,29 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- CPH::ERP Comments:
-- 25. aug. 2019 13.25.17 CEST
-- 25. aug. 2019 13.26.44 CEST
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','No OrderLine',0,0,'Y',TO_DATE('2019-08-25 13:26:43','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-25 13:26:43','YYYY-MM-DD HH24:MI:SS'),100,200539,'No OrderLine','C','f5eb2dcc-2a77-4442-86c1-d41bbb79fc75')
;
-- 25. aug. 2019 13.31.12 CEST
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','Order line not found',0,0,'Y',TO_DATE('2019-08-25 13:31:11','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-25 13:31:11','YYYY-MM-DD HH24:MI:SS'),100,200543,'Order line not found','C','493c2571-38ec-4e81-8fc3-b837035a4287')
;
-- 25. aug. 2019 13.35.38 CEST
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','Order not completed',0,0,'Y',TO_DATE('2019-08-25 13:35:38','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-25 13:35:38','YYYY-MM-DD HH24:MI:SS'),100,200544,'Order not completed','C','a7a7c7cd-4bc5-439a-bfc7-534ca5b4b51e')
;
-- 25. aug. 2019 13.38.23 CEST
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','Ordered quantity already shipped',0,0,'Y',TO_DATE('2019-08-25 13:38:23','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-25 13:38:23','YYYY-MM-DD HH24:MI:SS'),100,200545,'Ordered quantity already shipped','C','dd045eef-f1b1-41e3-bc43-c17be39cdeb8')
;
-- 25. aug. 2019 13.38.51 CEST
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','Cannot save shipment header',0,0,'Y',TO_DATE('2019-08-25 13:38:50','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-25 13:38:50','YYYY-MM-DD HH24:MI:SS'),100,200546,'Cannot save shipment header','C','65847324-2c57-4cb6-8e2c-91ddffd4969b')
;
SELECT register_migration_script('201908271211_IDEMPIERE-4035.sql') FROM dual
;

View File

@ -0,0 +1,27 @@
-- CPH::ERP Comments:
-- 25. aug. 2019 13.25.17 CEST
-- 25. aug. 2019 13.26.44 CEST
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','No OrderLine',0,0,'Y',TO_TIMESTAMP('2019-08-25 13:26:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-25 13:26:43','YYYY-MM-DD HH24:MI:SS'),100,200539,'No OrderLine','C','f5eb2dcc-2a77-4442-86c1-d41bbb79fc75')
;
-- 25. aug. 2019 13.31.12 CEST
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','Order line not found',0,0,'Y',TO_TIMESTAMP('2019-08-25 13:31:11','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-25 13:31:11','YYYY-MM-DD HH24:MI:SS'),100,200543,'Order line not found','C','493c2571-38ec-4e81-8fc3-b837035a4287')
;
-- 25. aug. 2019 13.35.38 CEST
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','Order not completed',0,0,'Y',TO_TIMESTAMP('2019-08-25 13:35:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-25 13:35:38','YYYY-MM-DD HH24:MI:SS'),100,200544,'Order not completed','C','a7a7c7cd-4bc5-439a-bfc7-534ca5b4b51e')
;
-- 25. aug. 2019 13.38.23 CEST
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','Ordered quantity already shipped',0,0,'Y',TO_TIMESTAMP('2019-08-25 13:38:23','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-25 13:38:23','YYYY-MM-DD HH24:MI:SS'),100,200545,'Ordered quantity already shipped','C','dd045eef-f1b1-41e3-bc43-c17be39cdeb8')
;
-- 25. aug. 2019 13.38.51 CEST
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','Cannot save shipment header',0,0,'Y',TO_TIMESTAMP('2019-08-25 13:38:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-25 13:38:50','YYYY-MM-DD HH24:MI:SS'),100,200546,'Cannot save shipment header','C','65847324-2c57-4cb6-8e2c-91ddffd4969b')
;
SELECT register_migration_script('201908271211_IDEMPIERE-4035.sql') FROM dual
;

View File

@ -25,6 +25,7 @@ import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
/**
* Create (Generate) Invoice from Shipment
@ -72,17 +73,17 @@ public class OrderLineCreateShipment 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(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(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(getCtx(), "Order not completed"));
if ( (line.getQtyOrdered().subtract(line.getQtyDelivered())).compareTo(Env.ZERO) <= 0 )
return "Ordered quantity already shipped";
return Msg.getMsg(getCtx(), "Ordered quantity already shipped");
int C_DocTypeShipment_ID = DB.getSQLValue(get_TrxName(),
"SELECT C_DocTypeShipment_ID FROM C_DocType WHERE C_DocType_ID=?",
@ -92,7 +93,7 @@ public class OrderLineCreateShipment extends SvrProcess
shipment.setM_Warehouse_ID(line.getM_Warehouse_ID());
shipment.setMovementDate(line.getDatePromised());
if (!shipment.save())
throw new IllegalArgumentException("Cannot save shipment header");
throw new IllegalArgumentException(Msg.getMsg(getCtx(), "Cannot save shipment header"));
MInOutLine sline = new MInOutLine( shipment );
@ -103,7 +104,7 @@ public class OrderLineCreateShipment extends SvrProcess
sline.setQty(line.getQtyReserved());
sline.setM_Warehouse_ID(line.getM_Warehouse_ID());
if (!sline.save())
throw new IllegalArgumentException("Cannot save Shipment Line");
throw new IllegalArgumentException(Msg.getMsg(getCtx(), "Cannot save Shipment Line"));
return shipment.getDocumentNo();
} // OrderLineCreateShipment