diff --git a/migration/i1.0c-release/oracle/201309301851_IDEMPIERE-569.sql b/migration/i1.0c-release/oracle/201309301851_IDEMPIERE-569.sql new file mode 100644 index 0000000000..dced747572 --- /dev/null +++ b/migration/i1.0c-release/oracle/201309301851_IDEMPIERE-569.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Sep 30, 2013 6:48:37 PM SGT +-- IDEMPIERE-569 Ticket #1001758: Improve shipping configuration to support external services +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2013-09-30 18:48:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=444 +; + +-- Sep 30, 2013 6:48:42 PM SGT +-- IDEMPIERE-569 Ticket #1001758: Improve shipping configuration to support external services +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2013-09-30 18:48:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=319 +; + +SELECT register_migration_script('201309301851_IDEMPIERE-569.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i1.0c-release/oracle/201309301915_IDEMPIERE-1083.sql b/migration/i1.0c-release/oracle/201309301915_IDEMPIERE-1083.sql new file mode 100644 index 0000000000..fdb5694ad7 --- /dev/null +++ b/migration/i1.0c-release/oracle/201309301915_IDEMPIERE-1083.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Sep 30, 2013 7:12:21 PM SGT +-- IDEMPIERE-1083 Print shipping label applet is not working +INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,AD_SysConfig_UU,Created,Updated,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200036,'S',' ','3d792b55-0ca5-467c-b666-c642103efb28',TO_DATE('2013-09-30 19:12:20','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-09-30 19:12:20','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'ZK_PRINT_SHIPPING_LABEL_SHARED_TEMP_FOLDER',0,'D') +; + +SELECT register_migration_script('201309301915_IDEMPIERE-1083.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i1.0c-release/postgresql/201309301851_IDEMPIERE-569.sql b/migration/i1.0c-release/postgresql/201309301851_IDEMPIERE-569.sql new file mode 100644 index 0000000000..a7ef3ab7d3 --- /dev/null +++ b/migration/i1.0c-release/postgresql/201309301851_IDEMPIERE-569.sql @@ -0,0 +1,12 @@ +-- Sep 30, 2013 6:48:37 PM SGT +-- IDEMPIERE-569 Ticket #1001758: Improve shipping configuration to support external services +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2013-09-30 18:48:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=444 +; + +-- Sep 30, 2013 6:48:42 PM SGT +-- IDEMPIERE-569 Ticket #1001758: Improve shipping configuration to support external services +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2013-09-30 18:48:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=319 +; + +SELECT register_migration_script('201309301851_IDEMPIERE-569.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i1.0c-release/postgresql/201309301915_IDEMPIERE-1083.sql b/migration/i1.0c-release/postgresql/201309301915_IDEMPIERE-1083.sql new file mode 100644 index 0000000000..403d4f1fad --- /dev/null +++ b/migration/i1.0c-release/postgresql/201309301915_IDEMPIERE-1083.sql @@ -0,0 +1,7 @@ +-- Sep 30, 2013 7:12:21 PM SGT +-- IDEMPIERE-1083 Print shipping label applet is not working +INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,AD_SysConfig_UU,Created,Updated,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200036,'S',' ','3d792b55-0ca5-467c-b666-c642103efb28',TO_TIMESTAMP('2013-09-30 19:12:20','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-09-30 19:12:20','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'ZK_PRINT_SHIPPING_LABEL_SHARED_TEMP_FOLDER',0,'D') +; + +SELECT register_migration_script('201309301915_IDEMPIERE-1083.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java index e511d6fc0e..d61a4b5082 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java @@ -17,8 +17,10 @@ package org.compiere.acct; import java.math.BigDecimal; +import java.sql.Timestamp; import org.compiere.model.MAllocationLine; +import org.compiere.model.MPayment; import org.compiere.util.DB; /** @@ -154,4 +156,16 @@ public class DocLine_Allocation extends DocLine { return m_C_Charge_ID; } + + @Override + public Timestamp getDateConv() + { + if (getC_Payment_ID() > 0) + { + MPayment payment = new MPayment(p_po.getCtx(), getC_Payment_ID(), p_po.get_TrxName()); + return payment.getDateAcct(); // use payment date + } + return super.getDateConv(); + } + } // DocLine_Allocation diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 04c0f8be4c..a836c02a04 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -709,7 +709,7 @@ public final class FactLine extends X_Fact_Acct Timestamp convDate = getDateAcct(); - if ( m_doc instanceof Doc_BankStatement ) + if ( m_doc instanceof Doc_BankStatement || m_doc instanceof Doc_AllocationHdr ) convDate = m_docLine.getDateConv(); diff --git a/org.adempiere.base/src/org/compiere/model/MPackage.java b/org.adempiere.base/src/org/compiere/model/MPackage.java index 2e769b9483..49b072d470 100644 --- a/org.adempiere.base/src/org/compiere/model/MPackage.java +++ b/org.adempiere.base/src/org/compiere/model/MPackage.java @@ -200,19 +200,22 @@ public class MPackage extends X_M_Package setIsSaturdayDelivery(shipper.isSaturdayDelivery()); setTrackingInfo(shipper.getTrackingURL()); - String shipperAccount = null; - String dutiesShipperAccount = null; - if (shipment.getFreightCharges().equals(MInOut.FREIGHTCHARGES_Prepaid) || shipment.getFreightCharges().equals(MInOut.FREIGHTCHARGES_PrepaidAndBill)) + if (shipment.getFreightCharges() != null) { - shipperAccount = ShippingUtil.getSenderShipperAccount(shipper.getM_Shipper_ID(), shipper.getAD_Org_ID()); - dutiesShipperAccount = ShippingUtil.getSenderDutiesShipperAccount(shipper.getM_Shipper_ID(), shipper.getAD_Org_ID()); + String shipperAccount = null; + String dutiesShipperAccount = null; + if (shipment.getFreightCharges().equals(MInOut.FREIGHTCHARGES_Prepaid) || shipment.getFreightCharges().equals(MInOut.FREIGHTCHARGES_PrepaidAndBill)) + { + shipperAccount = ShippingUtil.getSenderShipperAccount(shipper.getM_Shipper_ID(), shipper.getAD_Org_ID()); + dutiesShipperAccount = ShippingUtil.getSenderDutiesShipperAccount(shipper.getM_Shipper_ID(), shipper.getAD_Org_ID()); + } + else + shipperAccount = shipment.getShipperAccount(); + if (shipperAccount != null) + setShipperAccount(shipperAccount); + if (dutiesShipperAccount != null) + setDutiesShipperAccount(dutiesShipperAccount); } - else - shipperAccount = shipment.getShipperAccount(); - if (shipperAccount != null) - setShipperAccount(shipperAccount); - if (dutiesShipperAccount != null) - setDutiesShipperAccount(dutiesShipperAccount); } // MPackage protected boolean beforeSave(boolean newRecord) diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 817545778b..4f8e85875f 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -42,8 +42,8 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = 8880509641924823121L; - + private static final long serialVersionUID = -8929067871181338266L; + public final static String PDF_FONT_DIR = "PDF_FONT_DIR"; public final static String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS"; public static final String ZK_DESKTOP_CLASS = "ZK_DESKTOP_CLASS"; @@ -118,6 +118,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String ZK_MAX_UPLOAD_SIZE = "ZK_MAX_UPLOAD_SIZE"; public static final String CALENDAR_ALTERNATE_TIMEZONE = "CALENDAR_ALTERNATE_TIMEZONE"; public static final String ZK_REPORT_JASPER_OUTPUT_TYPE = "ZK_REPORT_JASPER_OUTPUT_TYPE"; + public static final String ZK_PRINT_SHIPPING_LABEL_SHARED_TEMP_FOLDER = "ZK_PRINT_SHIPPING_LABEL_SHARED_TEMP_FOLDER"; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String TAX_SAVE_REQUEST_RESPONSE_LOG = "TAX_SAVE_REQUEST_RESPONSE_LOG"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java index 0983da88e5..9fba9147a4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java @@ -19,6 +19,8 @@ import java.util.List; import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; +import org.compiere.model.MSysConfig; +import org.compiere.util.CLogger; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; @@ -31,11 +33,12 @@ import org.zkoss.zul.Div; * */ public class LabelAppletWindow extends Window implements EventListener -{ +{ /** * */ - private static final long serialVersionUID = -8980224912104404397L; + private static final long serialVersionUID = -592770994381511142L; + private final static CLogger log = CLogger.getCLogger(LabelAppletWindow.class); public LabelAppletWindow(List list) { @@ -57,7 +60,23 @@ public class LabelAppletWindow extends Window implements EventListener { try { - tempFile = File.createTempFile("lblapp", Long.toString(System.nanoTime())); + File directory = null; + String tempFolder = MSysConfig.getValue(MSysConfig.ZK_PRINT_SHIPPING_LABEL_SHARED_TEMP_FOLDER, null); + if (tempFolder != null && tempFolder.trim().length() > 0) + { + directory = new File(tempFolder.trim()); + if (!directory.exists()) + { + log.severe("Directory doesn't exists " + tempFolder); + directory = null; + } + else if (!directory.canWrite()) + { + log.severe("Directory cannot write " + tempFolder); + directory = null; + } + } + tempFile = File.createTempFile("lblapp", Long.toString(System.nanoTime()), directory); fos = new FileOutputStream(tempFile); applet.setParam("file_" + i, tempFile.getAbsolutePath()); fos.write(list.get(i)); diff --git a/org.adempiere.webstore.resource/advertisements.jsp b/org.adempiere.webstore.resource/advertisements.jsp index 43d3935477..13a42bbaf4 100644 --- a/org.adempiere.webstore.resource/advertisements.jsp +++ b/org.adempiere.webstore.resource/advertisements.jsp @@ -28,7 +28,7 @@ - + <c:out value='${ad.name}'/> <c:out value='${ad.webParam1}'/>   diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java index 7700d9d0fa..4277c9db77 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java @@ -190,10 +190,10 @@ public class LoginServlet extends HttpServlet // Web User WebUser wu = WebUser.get(request); - // Handover Loginprodcess to general WebLogin Handler - // Frst set the URL from our current situation + // Handover Loginprocess to general WebLogin Handler + // First set the URL from our current situation thisLogin.setForward (url); - // Also handover adressConfirm + // Also handover addressConfirm thisLogin.setAddressConfirm (addressConfirm); // Since Mode Usage is not consequent we will try to figure it out. if (WebUtil.getParameter(request, "Mode")==null) @@ -210,8 +210,12 @@ public class LoginServlet extends HttpServlet if (!url.startsWith("/")) url = "/" + url; if (log.isLoggable(Level.INFO)) log.info("doPost - Forward to " + url); - RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); - dispatcher.forward(request, response); + if (url.startsWith("/orderServlet")) { + response.sendRedirect(url.substring(1)); + } else { + RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); + dispatcher.forward(request, response); + } } // doPost } // LoginServlet