details: /erp/devel/pi/rev/7f0cf3635e6c
changeset: 11612:7f0cf3635e6c
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Mon Apr 11 17:40:40 2011 +0200
summary: Fixes issue 0015789: There is no way to back to General Ledger Report
Now, when going to the detail of a general ledger report record it opens a new
tab with the selected entry, making it possible the navigation in 3.0
details: /erp/devel/pi/rev/b750b36d757e
changeset: 11613:b750b36d757e
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Thu Apr 14 15:11:11 2011 +0200
summary: Fixes issue 0016811: The callout calculates wrong the Net Unit Price
when Discount % is 100
It has been modified the format of the price when invoking GetOffersPrice() to
use an standard format and not a cientific format
diffstat:
src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java | 23 +-
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html | 22 ++-
src/org/openbravo/erputils/ComputeTranslatedNameActionHandler.java | 79
++++++++++
3 files changed, 113 insertions(+), 11 deletions(-)
diffs (180 lines):
diff -r 4ff40eabc82e -r b750b36d757e
src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Fri Apr 15
11:20:46 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Thu Apr 14
15:11:11 2011 +0200
@@ -156,14 +156,17 @@
dataOrder[0].dateordered, dataOrder[0].cBpartnerId, strProduct,
priceStd.toString(),
strQty, dataOrder[0].mPricelistId, dataOrder[0].id));
if (expectedPriceActual.scale() > PricePrecision)
- expectedPriceActual = expectedPriceActual.setScale(PricePrecision,
BigDecimal.ROUND_HALF_UP);
+ expectedPriceActual = expectedPriceActual.setScale(PricePrecision,
+ BigDecimal.ROUND_HALF_UP);
- // To avoid rounding issues if the expected priceActual is equals to
the current priceActual.
+ // To avoid rounding issues if the expected priceActual is equals to
the current
+ // priceActual.
// Do not do anything.
if (!priceActual.equals(expectedPriceActual)) {
priceStd = new BigDecimal(SLOrderProductData.getOffersStdPrice(this,
- dataOrder[0].cBpartnerId,
expectedPriceActual.toString().replace("\"", ""), strProduct,
- dataOrder[0].dateordered, strQty, dataOrder[0].mPricelistId,
dataOrder[0].id));
+ dataOrder[0].cBpartnerId,
expectedPriceActual.toString().replace("\"", ""),
+ strProduct, dataOrder[0].dateordered, strQty,
dataOrder[0].mPricelistId,
+ dataOrder[0].id));
}
// priceList
resultado.append("new Array(\"inppricestd\", " + priceStd.toString() +
"),");
@@ -242,8 +245,8 @@
priceStd = priceList.subtract(priceList.multiply(discount).divide(new
BigDecimal("100"),
12, BigDecimal.ROUND_HALF_EVEN));
priceActual = new BigDecimal(SLOrderProductData.getOffersPrice(this,
- dataOrder[0].dateordered, dataOrder[0].cBpartnerId, strProduct,
priceStd.toString(),
- strQty, dataOrder[0].mPricelistId, dataOrder[0].id));
+ dataOrder[0].dateordered, dataOrder[0].cBpartnerId, strProduct,
+ priceStd.toPlainString(), strQty, dataOrder[0].mPricelistId,
dataOrder[0].id));
if (priceStd.scale() > PricePrecision)
priceStd = priceStd.setScale(PricePrecision,
BigDecimal.ROUND_HALF_UP);
if (priceActual.scale() > PricePrecision)
@@ -262,8 +265,8 @@
resultStock = stockNoAttribute.subtract(qtyOrdered);
if (stockSecurity.compareTo(resultStock) > 0) {
resultado.append("new Array('MESSAGE', \""
- + FormatUtilities.replaceJS(Utility.messageBD(this,
"StockLimit", vars
- .getLanguage())) + "\"),");
+ + FormatUtilities.replaceJS(Utility.messageBD(this,
"StockLimit",
+ vars.getLanguage())) + "\"),");
}
} else {
if (!strAttribute.equals("") && strAttribute != null) {
@@ -273,8 +276,8 @@
resultStock = stockAttribute.subtract(qtyOrdered);
if (stockSecurity.compareTo(resultStock) > 0) {
resultado.append("new Array('MESSAGE', \""
- + FormatUtilities.replaceJS(Utility.messageBD(this,
"StockLimit", vars
- .getLanguage())) + "\"),");
+ + FormatUtilities.replaceJS(Utility.messageBD(this,
"StockLimit",
+ vars.getLanguage())) + "\"),");
}
}
}
diff -r 4ff40eabc82e -r b750b36d757e
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html Fri Apr
15 11:20:46 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html Thu Apr
14 15:11:11 2011 +0200
@@ -128,6 +128,26 @@
function onResizeDo(){
resizeArea();
}
+
+ function openGeneralLedgerJournal(recordid) {
+
+ var myframe = getFrame('LayoutMDI') || top.opener;
+ if (myframe) {
+
myframe.OB.RemoteCallManager.call('org.openbravo.erputils.ComputeTranslatedNameActionHandler',
{}, {'processId': '800000'},
+ function(response, data, request){
+
myframe.OB.Layout.ViewManager.openView('OBClassicWindow', {
+ command: 'DIRECT2',
+ icon:
'[SKINIMG]../../org.openbravo.client.application/images/application-menu/iconReport.png',
+ id: '800000',
+ obManualURL:
'/ad_reports/ReportGeneralLedgerJournal.html?inpFactAcctGroupId=' + recordid,
+ processId: '800000',
+ tabTitle: data.processTitle,
+ type: 'report',
+ viewId: 'OBClassicWindow'
+ });
+ });
+ }
+ }
</script>
@@ -812,7 +832,7 @@
<div id="sectionDetail">
<tr class="DataGrid_Body_Row DataGrid_Body_Row_yy"
id="funcEvenOddRow1xx">
<td width="10%" class="DataGrid_Body_Cell">
- <a href="#"
onclick="submitCommandFormParameter('DIRECT2',
document.frmMain.inpFactAcctGroupId, 'xx', false, document.frmMain,
'ReportGeneralLedgerJournal.html', '_self', false, true);return false;"
onmouseover="window.status='General Ledger';return true;"
onmouseout="window.status='';return true;" class="LabelLink" id="fieldId"><span
id="fieldDateacct">xx22/04/2010</span>
+ <a href="#"
onclick="openGeneralLedgerJournal('xx');return false;"
onmouseover="window.status='General Ledger';return true;"
onmouseout="window.status='';return true;" class="LabelLink" id="fieldId"><span
id="fieldDateacct">xx22/04/2010</span>
</a>
</td>
<!--input type="hidden" id="fieldTotalacctdr"
value=""/>
diff -r 4ff40eabc82e -r b750b36d757e
src/org/openbravo/erputils/ComputeTranslatedNameActionHandler.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erputils/ComputeTranslatedNameActionHandler.java
Thu Apr 14 15:11:11 2011 +0200
@@ -0,0 +1,79 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.1 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erputils;
+
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.client.kernel.StaticResourceComponent;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+
+/**
+ * Computes information to open a classic window for a record in the new
layout.
+ *
+ * @author mtaal, aro
+ * @see StaticResourceComponent
+ */
+@ApplicationScoped
+public class ComputeTranslatedNameActionHandler extends BaseActionHandler {
+
+ protected JSONObject execute(Map<String, Object> parameters, String data) {
+
+ final String processId = removeFragment((String)
parameters.get("processId"));
+
+ try {
+ OBContext.setAdminMode();
+
+ final org.openbravo.model.ad.ui.Process process =
OBDal.getInstance().get(
+ org.openbravo.model.ad.ui.Process.class, processId);
+
+ final String userLanguageId =
OBContext.getOBContext().getLanguage().getId();
+
+ String title = process.getName();
+ for (org.openbravo.model.ad.ui.ProcessTrl processtrl :
process.getADProcessTrlList()) {
+ final String trlLanguageId = (String)
DalUtil.getId(processtrl.getLanguage());
+ if (trlLanguageId.equals(userLanguageId)) {
+ title = processtrl.getName();
+ }
+ }
+
+ final JSONObject json = new JSONObject();
+ json.put("processId", processId);
+ json.put("processTitle", title);
+ return json;
+
+ } catch (Exception e) {
+ throw new OBException(e);
+ } finally {
+ OBContext.restorePreviousMode();
+ }
+ }
+
+ // solve the case that sometimes the fragment is added to the tabId or the
record id
+ private String removeFragment(String value) {
+
+ return (value == null || !value.contains("#")) ? value :
value.substring(0, value.indexOf("#"));
+ }
+}
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits