diff --git a/base/src/org/compiere/process/InOutGenerate.java b/base/src/org/compiere/process/InOutGenerate.java index cf4ed3fb77..f88862e21f 100644 --- a/base/src/org/compiere/process/InOutGenerate.java +++ b/base/src/org/compiere/process/InOutGenerate.java @@ -47,6 +47,8 @@ public class InOutGenerate extends SvrProcess private String p_docAction = DocAction.ACTION_Complete; /** Consolidate */ private boolean p_ConsolidateDocument = true; + /** Shipment Date */ + private Timestamp p_DateShipped = null; /** The current Shipment */ private MInOut m_shipment = null; @@ -96,13 +98,18 @@ public class InOutGenerate extends SvrProcess p_ConsolidateDocument = "Y".equals(para[i].getParameter()); else if (name.equals("DocAction")) p_docAction = (String)para[i].getParameter(); + else if (name.equals("MovementDate")) + p_DateShipped = (Timestamp)para[i].getParameter(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); - // Login Date - m_movementDate = Env.getContextAsDate(getCtx(), "#Date"); - if (m_movementDate == null) - m_movementDate = new Timestamp(System.currentTimeMillis()); + // juddm - added ability to specify a shipment date from Generate Shipments + if (p_DateShipped == null) { + m_movementDate = Env.getContextAsDate(getCtx(), "#Date"); + if (m_movementDate == null) + m_movementDate = new Timestamp(System.currentTimeMillis()); + } else + m_movementDate = p_DateShipped; // DocAction check if (!DocAction.ACTION_Complete.equals(p_docAction)) p_docAction = DocAction.ACTION_Prepare; diff --git a/migration/320-trunk/002_add_feature_1714090.sql b/migration/320-trunk/002_add_feature_1714090.sql new file mode 100644 index 0000000000..0400210caa --- /dev/null +++ b/migration/320-trunk/002_add_feature_1714090.sql @@ -0,0 +1,20 @@ +-- Feature Request +-- juddm - add the ability to specific a shipment date (instead of current date) to the shipment generation process +-- http://sourceforge.net/tracker/index.php?func=detail&aid=1714090&group_id=176962&atid=879335 + +INSERT INTO AD_PROCESS_PARA (ad_process_para_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, + name, description, help, ad_process_id, seqno, ad_reference_id, ad_reference_value_id, ad_val_rule_id, columnname, iscentrallymaintained, + fieldlength, ismandatory, isrange, defaultvalue, defaultvalue2, vformat, valuemin, valuemax, ad_element_id, entitytype ) + VALUES (50019, 0, 0, 'Y', TO_DATE('2007-03-03','YYYY-MM-DD'), 100, TO_DATE('2007-03-03','YYYY-MM-DD'), 100, + 'Shipment Date', 'Date printed on shipment', 'The Shipment Date indicates the date printed on the shipment.', 118, 15, 15,null,null, 'MovementDate', 'Y', + 0, 'Y', 'N', '@#Date@', '','','','', 1037, 'D'); + +COMMIT; + +UPDATE AD_SEQUENCE + SET currentnextsys = (SELECT MAX (ad_process_para_id) + 1 + FROM AD_PROCESS_PARA + WHERE ad_process_para_id < 1000000) + WHERE NAME = 'AD_Process_Para'; + +COMMIT; \ No newline at end of file diff --git a/migration/320-trunk/postgresql/002_add_feature_1714090.sql b/migration/320-trunk/postgresql/002_add_feature_1714090.sql new file mode 100644 index 0000000000..2c251f954d --- /dev/null +++ b/migration/320-trunk/postgresql/002_add_feature_1714090.sql @@ -0,0 +1,20 @@ +-- Feature Request +-- juddm - add the ability to specific a shipment date (instead of current date) to the shipment generation process +-- http://sourceforge.net/tracker/index.php?func=detail&aid=1714090&group_id=176962&atid=879335 + +INSERT INTO AD_PROCESS_PARA (ad_process_para_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, + name, description, help, ad_process_id, seqno, ad_reference_id, ad_reference_value_id, ad_val_rule_id, columnname, iscentrallymaintained, + fieldlength, ismandatory, isrange, defaultvalue, defaultvalue2, vformat, valuemin, valuemax, ad_element_id, entitytype ) + VALUES (50019, 0, 0, 'Y', TO_TIMESTAMP('2007-03-03','YYYY-MM-DD'), 100, TO_TIMESTAMP('2007-03-03','YYYY-MM-DD'), 100, + 'Shipment Date', 'Date printed on shipment', 'The Shipment Date indicates the date printed on the shipment.', 118, 15, 15,null,null, 'MovementDate', 'Y', + 0, 'Y', 'N', '@#Date@', '','','','', 1037, 'D'); + +COMMIT; + +UPDATE AD_SEQUENCE + SET currentnextsys = (SELECT MAX (ad_process_para_id) + 1 + FROM AD_PROCESS_PARA + WHERE ad_process_para_id < 1000000) + WHERE NAME = 'AD_Process_Para'; + +COMMIT; \ No newline at end of file