hg merge release-1.0c (forward-porting)

This commit is contained in:
Carlos Ruiz 2013-09-30 10:18:29 -05:00
commit 06d81d69ab
11 changed files with 108 additions and 23 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -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
;

View File

@ -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
;

View File

@ -17,8 +17,10 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.MAllocationLine; import org.compiere.model.MAllocationLine;
import org.compiere.model.MPayment;
import org.compiere.util.DB; import org.compiere.util.DB;
/** /**
@ -154,4 +156,16 @@ public class DocLine_Allocation extends DocLine
{ {
return m_C_Charge_ID; 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 } // DocLine_Allocation

View File

@ -709,7 +709,7 @@ public final class FactLine extends X_Fact_Acct
Timestamp convDate = getDateAcct(); Timestamp convDate = getDateAcct();
if ( m_doc instanceof Doc_BankStatement ) if ( m_doc instanceof Doc_BankStatement || m_doc instanceof Doc_AllocationHdr )
convDate = m_docLine.getDateConv(); convDate = m_docLine.getDateConv();

View File

@ -200,19 +200,22 @@ public class MPackage extends X_M_Package
setIsSaturdayDelivery(shipper.isSaturdayDelivery()); setIsSaturdayDelivery(shipper.isSaturdayDelivery());
setTrackingInfo(shipper.getTrackingURL()); setTrackingInfo(shipper.getTrackingURL());
String shipperAccount = null; if (shipment.getFreightCharges() != 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()); String shipperAccount = null;
dutiesShipperAccount = ShippingUtil.getSenderDutiesShipperAccount(shipper.getM_Shipper_ID(), shipper.getAD_Org_ID()); 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 } // MPackage
protected boolean beforeSave(boolean newRecord) protected boolean beforeSave(boolean newRecord)

View File

@ -42,7 +42,7 @@ 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 PDF_FONT_DIR = "PDF_FONT_DIR";
public final static String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS"; public final static String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS";
@ -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 ZK_MAX_UPLOAD_SIZE = "ZK_MAX_UPLOAD_SIZE";
public static final String CALENDAR_ALTERNATE_TIMEZONE = "CALENDAR_ALTERNATE_TIMEZONE"; 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_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 ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
public static final String TAX_SAVE_REQUEST_RESPONSE_LOG = "TAX_SAVE_REQUEST_RESPONSE_LOG"; public static final String TAX_SAVE_REQUEST_RESPONSE_LOG = "TAX_SAVE_REQUEST_RESPONSE_LOG";

View File

@ -19,6 +19,8 @@ import java.util.List;
import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.Window; 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.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
@ -35,7 +37,8 @@ public class LabelAppletWindow extends Window implements EventListener<Event>
/** /**
* *
*/ */
private static final long serialVersionUID = -8980224912104404397L; private static final long serialVersionUID = -592770994381511142L;
private final static CLogger log = CLogger.getCLogger(LabelAppletWindow.class);
public LabelAppletWindow(List<byte[]> list) public LabelAppletWindow(List<byte[]> list)
{ {
@ -57,7 +60,23 @@ public class LabelAppletWindow extends Window implements EventListener<Event>
{ {
try 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); fos = new FileOutputStream(tempFile);
applet.setParam("file_" + i, tempFile.getAbsolutePath()); applet.setParam("file_" + i, tempFile.getAbsolutePath());
fos.write(list.get(i)); fos.write(list.get(i));

View File

@ -28,7 +28,7 @@
<c:forEach items='${info.advertisements}' var='ad'> <c:forEach items='${info.advertisements}' var='ad'>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<a href="http://www.adempiere.com/wstore/click?<c:out value='${ad.clickTargetURL}'/>" target="_blank"> <a href="http://www.idempiere.com/wstore/click?<c:out value='${ad.clickTargetURL}'/>" target="_blank">
<img src="<c:out value='${ad.imageURL}'/>" alt="<c:out value='${ad.name}'/>" border="0" align="left"></a> <img src="<c:out value='${ad.imageURL}'/>" alt="<c:out value='${ad.name}'/>" border="0" align="left"></a>
<img src="<c:out value='${ad.webParam2}'/>" alt="<c:out value='${ad.webParam1}'/>" border="0" align="right"> <img src="<c:out value='${ad.webParam2}'/>" alt="<c:out value='${ad.webParam1}'/>" border="0" align="right">
&nbsp; <b><c:out value='${ad.description}'/></b> &nbsp; <b><c:out value='${ad.description}'/></b>

View File

@ -190,10 +190,10 @@ public class LoginServlet extends HttpServlet
// Web User // Web User
WebUser wu = WebUser.get(request); WebUser wu = WebUser.get(request);
// Handover Loginprodcess to general WebLogin Handler // Handover Loginprocess to general WebLogin Handler
// Frst set the URL from our current situation // First set the URL from our current situation
thisLogin.setForward (url); thisLogin.setForward (url);
// Also handover adressConfirm // Also handover addressConfirm
thisLogin.setAddressConfirm (addressConfirm); thisLogin.setAddressConfirm (addressConfirm);
// Since Mode Usage is not consequent we will try to figure it out. // Since Mode Usage is not consequent we will try to figure it out.
if (WebUtil.getParameter(request, "Mode")==null) if (WebUtil.getParameter(request, "Mode")==null)
@ -210,8 +210,12 @@ public class LoginServlet extends HttpServlet
if (!url.startsWith("/")) if (!url.startsWith("/"))
url = "/" + url; url = "/" + url;
if (log.isLoggable(Level.INFO)) log.info("doPost - Forward to " + url); if (log.isLoggable(Level.INFO)) log.info("doPost - Forward to " + url);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); if (url.startsWith("/orderServlet")) {
dispatcher.forward(request, response); response.sendRedirect(url.substring(1));
} else {
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response);
}
} // doPost } // doPost
} // LoginServlet } // LoginServlet