details: /erp/devel/int/rev/9c19ffe1d394
changeset: 6631:9c19ffe1d394
user: Sathiyan Sivaprakasam <sathiyan.sivaprakasam <at> openbravo.com>
date: Mon Mar 08 11:00:07 2010 +0530
summary: Not Tax Deductable and Is Tax Deductable should not be true at the
same time.
details: /erp/devel/int/rev/ea3c2d1c6e7d
changeset: 6632:ea3c2d1c6e7d
user: Balamurugan Ramadoss <balamurugan.ramadoss <at> openbravo.com>
date: Mon Mar 08 15:48:23 2010 +0530
summary: Fixes Issue 12017: Error in Payment Report.
diffstat:
src-db/database/model/triggers/AD_ORGINFO_TRG.xml |
2 +-
src-db/database/model/triggers/C_TAX_TRG.xml |
8 +
src-db/database/sourcedata/AD_MESSAGE.xml |
11 +
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html |
14 +-
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.java |
71 ++++++---
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.jrxml |
12 +-
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.xml |
36 ++--
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_BankAcc.jrxml |
14 +-
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_NoBP.jrxml |
12 +-
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_NoBP_BankAcc.jrxml |
14 +-
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql |
25 ++-
11 files changed, 148 insertions(+), 71 deletions(-)
diffs (truncated from 666 to 300 lines):
diff -r 63711bc0dda0 -r ea3c2d1c6e7d
src-db/database/model/triggers/AD_ORGINFO_TRG.xml
--- a/src-db/database/model/triggers/AD_ORGINFO_TRG.xml Sat Mar 06 12:55:36
2010 +0530
+++ b/src-db/database/model/triggers/AD_ORGINFO_TRG.xml Mon Mar 08 15:48:23
2010 +0530
@@ -17,7 +17,7 @@
* parts created by ComPiere are Copyright (C) ComPiere, Inc.;
* All Rights Reserved.
* Contributor(s): Openbravo SL
- * Contributions are Copyright (C) 2001-2010 Openbravo, S.L.
+ * Contributions are Copyright (C) 2010 Openbravo, S.L.
*
* Specifically, this derivative work is based upon the following Compiere
* file and version.
diff -r 63711bc0dda0 -r ea3c2d1c6e7d
src-db/database/model/triggers/C_TAX_TRG.xml
--- a/src-db/database/model/triggers/C_TAX_TRG.xml Sat Mar 06 12:55:36
2010 +0530
+++ b/src-db/database/model/triggers/C_TAX_TRG.xml Mon Mar 08 15:48:23
2010 +0530
@@ -45,6 +45,10 @@
IF(INSERTING) THEN
+ --isTaxUndeductable and isTaxDeductable should not be true at the same
time.
+ IF(:NEW.ISTAXUNDEDUCTABLE = 'Y' AND :NEW.ISTAXDEDUCTABLE='Y') THEN
+ RAISE_APPLICATION_ERROR(-20000,
'@InvalidCombinationOfTaxDeductableFlag@') ;
+ END IF;
-- Tax Account Defaults
FOR Cur_Defaults IN
(
@@ -128,6 +132,10 @@
END IF;
-- Inserting
IF(UPDATING) THEN
+ --isTaxUndeductable and isTaxDeductable should not be true at the same
time.
+ IF(:NEW.ISTAXUNDEDUCTABLE = 'Y' AND :NEW.ISTAXDEDUCTABLE='Y') THEN
+ RAISE_APPLICATION_ERROR(-20000,
'@InvalidCombinationOfTaxDeductableFlag@') ;
+ END IF;
UPDATE C_TAX_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
WHERE C_TAX_ID = :new.C_TAX_ID;
IF((COALESCE(:old.TaxIndicator, '.') <> COALESCE(:NEW.TaxIndicator, '.')
diff -r 63711bc0dda0 -r ea3c2d1c6e7d src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Sat Mar 06 12:55:36 2010 +0530
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Mon Mar 08 15:48:23 2010 +0530
@@ -31072,6 +31072,17 @@
<!--68082E2D67E94A7E8FB1416A7FCEBC47-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--68082E2D67E94A7E8FB1416A7FCEBC47--></AD_MESSAGE>
+<!--684157E8D36E455DA27AB1C1C4987403--><AD_MESSAGE>
+<!--684157E8D36E455DA27AB1C1C4987403-->
<AD_MESSAGE_ID><![CDATA[684157E8D36E455DA27AB1C1C4987403]]></AD_MESSAGE_ID>
+<!--684157E8D36E455DA27AB1C1C4987403-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--684157E8D36E455DA27AB1C1C4987403--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--684157E8D36E455DA27AB1C1C4987403--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--684157E8D36E455DA27AB1C1C4987403-->
<VALUE><![CDATA[InvalidCombinationOfTaxDeductableFlag]]></VALUE>
+<!--684157E8D36E455DA27AB1C1C4987403--> <MSGTEXT><![CDATA[Not Tax Deductable
and Is Tax Deductable should not be true at the same time.]]></MSGTEXT>
+<!--684157E8D36E455DA27AB1C1C4987403--> <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--684157E8D36E455DA27AB1C1C4987403-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--684157E8D36E455DA27AB1C1C4987403--></AD_MESSAGE>
+
<!--69155DDA0CA84861A828892DB4DC2E7C--><AD_MESSAGE>
<!--69155DDA0CA84861A828892DB4DC2E7C-->
<AD_MESSAGE_ID><![CDATA[69155DDA0CA84861A828892DB4DC2E7C]]></AD_MESSAGE_ID>
<!--69155DDA0CA84861A828892DB4DC2E7C-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 63711bc0dda0 -r ea3c2d1c6e7d
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html Sat Mar
06 12:55:36 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html Mon Mar
08 15:48:23 2010 +0530
@@ -58,6 +58,11 @@
keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null,
null, '../info/BusinessPartner.html', null, false, 'frmMain', 'inpcBpartnerId',
'inpBpartnerId_DES', inputValue(document.frmMain.inpBpartnerId_DES),
'inpIDValue', inputValue(document.frmMain.inpcBpartnerId), 'Command', 'KEY');",
"inpBpartnerId_DES", "null");
}
function validate(){
+ if (frmMain.inpCurrencyId.value == null || frmMain.inpCurrencyId.value ==
"") {
+ setWindowElementFocus(frmMain.inpCurrencyId);
+ showJSMessage(7);
+ return false;
+ }
markCheckedAllElements(document.frmMain.inpcBPartnerId_IN);
return true;
}
@@ -463,9 +468,12 @@
<td class="TitleCell"><span class="LabelText">Payable</span></td>
<td class="Radio_Check_ContentCell"><span
class="Radio_container_NOT_Focused"><input type="radio" name="inpReceipt"
value="N" checked="" id="paramPayable"></input></span>
</td>
- <td class="TitleCell"></td>
- <td class="ContentCell">
- </td>
+ <td class="TitleCell"><span
class="LabelText">Currency</span></td>
+ <td class="Combo_ContentCell">
+ <select name="inpCurrencyId" id="inpCurrencyId"
class="ComboKey Combo_OneCell_width" required="true">
+ <option value=""><div
id="reportC_Currency_ID"></div></option>
+ </select>
+ </td>
</tr>
<tr>
<td colspan="6">
diff -r 63711bc0dda0 -r ea3c2d1c6e7d
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.java Sat Mar
06 12:55:36 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.java Mon Mar
08 15:48:23 2010 +0530
@@ -84,6 +84,8 @@
String strPaymentRule = vars.getGlobalVariable("inpCPaymentRuleId",
"ReportDebtPayment|PaymentRule", "");
String strSettle = vars.getGlobalVariable("inpSettle",
"ReportDebtPayment|Settle", "");
+ String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId",
+ "ReportDebtPayment|currency");
String strConciliate = vars.getGlobalVariable("inpConciliate",
"ReportDebtPayment|Conciliate", "");
String strStatus = vars.getGlobalVariable("inpStatus",
"ReportDebtPayment|Status", "");
@@ -103,7 +105,7 @@
String strGroupBA = vars.getRequestGlobalVariable("inpGroupBA",
"ReportDebtPayment|Group");
printPageDataSheet(response, vars, strcBpartnerId, strDateFrom,
strDateTo, strCal1, strCal2,
strPaymentRule, strSettle, strConciliate, strReceipt, strPending,
strcbankaccount,
- strStatus, strGroup, strGroupBA);
+ strStatus, strGroup, strGroupBA, strCurrencyId);
} else if (vars.commandIn("FIND")) {
String strcbankaccount =
vars.getRequestGlobalVariable("inpcBankAccountId",
"ReportDebtPayment|C_Bankaccount_ID");
@@ -125,6 +127,8 @@
String strPending = vars.getRequestGlobalVariable("inpPending",
"ReportDebtPayment|Pending");
String strGroup = vars.getRequestGlobalVariable("inpGroup",
"ReportDebtPayment|Group");
String strStatus = vars.getRequestGlobalVariable("inpStatus",
"ReportDebtPayment|Status");
+ String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId",
+ "ReportDebtPayment|currency");
// String strReceipt = vars.getRequestGlobalVariable("inpReceipt",
// "ReportDebtPayment|Receipt");
String strReceipt = vars.getStringParameter("inpReceipt").equals("") ?
"N" : vars
@@ -136,7 +140,7 @@
String strGroupBA = vars.getRequestGlobalVariable("inpGroupBA",
"ReportDebtPayment|Group");
printPageDataSheet(response, vars, strcBpartnerId, strDateFrom,
strDateTo, strCal1, strCal2,
strPaymentRule, strSettle, strConciliate, strReceipt, strPending,
strcbankaccount,
- strStatus, strGroup, strGroupBA);
+ strStatus, strGroup, strGroupBA, strCurrencyId);
} else if (vars.commandIn("PRINT_PDF")) {
String strcbankaccount =
vars.getRequestGlobalVariable("inpcBankAccountId",
"ReportDebtPayment|C_Bankaccount_ID");
@@ -158,6 +162,8 @@
String strGroup = vars.getRequestGlobalVariable("inpGroup",
"ReportDebtPayment|Group");
String strGroupBA = vars.getRequestGlobalVariable("inpGroupBA",
"ReportDebtPayment|Group");
String strStatus = vars.getRequestGlobalVariable("inpStatus",
"ReportDebtPayment|Status");
+ String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId",
+ "ReportDebtPayment|currency");
// String strReceipt = vars.getRequestGlobalVariable("inpReceipt",
// "ReportDebtPayment|Receipt");
String strReceipt = vars.getStringParameter("inpReceipt").equals("") ?
"N" : vars
@@ -167,7 +173,7 @@
setHistoryCommand(request, "DIRECT");
printPageDataPdf(response, vars, strcBpartnerId, strDateFrom, strDateTo,
strCal1, strCal2,
strPaymentRule, strSettle, strConciliate, strReceipt, strPending,
strcbankaccount,
- strStatus, strGroup, strGroupBA);
+ strStatus, strGroup, strGroupBA, strCurrencyId);
} else
pageError(response);
}
@@ -176,7 +182,8 @@
String strC_BPartner_ID, String strDateFrom, String strDateTo, String
strCal1,
String strCalc2, String strPaymentRule, String strSettle, String
strConciliate,
String strReceipt, String strPending, String strcbankaccount, String
strStatus,
- String strGroup, String strGroupBA) throws IOException, ServletException
{
+ String strGroup, String strGroupBA, String cCurrencyConv) throws
IOException,
+ ServletException {
String strAux = "";
if (log4j.isDebugEnabled())
log4j.debug("strGroup = " + strGroup);
@@ -203,11 +210,11 @@
ReportDebtPaymentData[] data = null;
String strReportName = null;
if (!strGroup.equals("")) {
- data = ReportDebtPaymentData.select(this, vars.getLanguage(),
Utility.getContext(this, vars,
- "#User_Client", "ReportDebtPayment"), Utility.getContext(this, vars,
- "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom, DateTimeData
- .nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule, strReceipt,
- strStatus, strAux, strcbankaccount, "BPARTNER, BANKACC");
+ data = ReportDebtPaymentData.select(this, cCurrencyConv,
vars.getLanguage(), Utility
+ .getContext(this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(this,
+ vars, "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom,
+ DateTimeData.nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule,
+ strReceipt, strStatus, strAux, strcbankaccount, "BPARTNER, BANKACC");
if (!strGroupBA.equals("")) {
strReportName =
"@basedesign@/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_BankAcc.jrxml";
} else {
@@ -215,11 +222,11 @@
}
} else {
- data = ReportDebtPaymentData.selectNoBpartner(this, vars.getLanguage(),
Utility.getContext(
- this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(this, vars,
- "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom, DateTimeData
- .nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule, strReceipt,
- strStatus, strAux, strcbankaccount, "BANKACC, BPARTNER");
+ data = ReportDebtPaymentData.selectNoBpartner(this, cCurrencyConv,
vars.getLanguage(),
+ Utility.getContext(this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(
+ this, vars, "#AccessibleOrgTree", "ReportDebtPayment"),
strC_BPartner_ID,
+ strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), strCal1,
strCalc2,
+ strPaymentRule, strReceipt, strStatus, strAux, strcbankaccount,
"BANKACC, BPARTNER");
if (!strGroupBA.equals("")) {
strReportName =
"@basedesign@/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_NoBP_BankAcc.jrxml";
} else {
@@ -236,7 +243,8 @@
String strC_BPartner_ID, String strDateFrom, String strDateTo, String
strCal1,
String strCalc2, String strPaymentRule, String strSettle, String
strConciliate,
String strReceipt, String strPending, String strcbankaccount, String
strStatus,
- String strGroup, String strGroupBA) throws IOException, ServletException
{
+ String strGroup, String strGroupBA, String cCurrencyConv) throws
IOException,
+ ServletException {
if (log4j.isDebugEnabled())
log4j.debug("Output: dataSheet");
response.setContentType("text/html; charset=UTF-8");
@@ -269,17 +277,17 @@
XmlDocument xmlDocument;
ReportDebtPaymentData[] data = null;
if (!strGroup.equals(""))
- data = ReportDebtPaymentData.select(this, vars.getLanguage(),
Utility.getContext(this, vars,
- "#User_Client", "ReportDebtPayment"), Utility.getContext(this, vars,
- "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom, DateTimeData
- .nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule, strReceipt,
- strStatus, strAux, strcbankaccount, "BPARTNER, BANKACC");
+ data = ReportDebtPaymentData.select(this, cCurrencyConv,
vars.getLanguage(), Utility
+ .getContext(this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(this,
+ vars, "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom,
+ DateTimeData.nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule,
+ strReceipt, strStatus, strAux, strcbankaccount, "BPARTNER, BANKACC");
else
- data = ReportDebtPaymentData.selectNoBpartner(this, vars.getLanguage(),
Utility.getContext(
- this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(this, vars,
- "#AccessibleOrgTree", "ReportDebtPayment"), strC_BPartner_ID,
strDateFrom, DateTimeData
- .nDaysAfter(this, strDateTo, "1"), strCal1, strCalc2,
strPaymentRule, strReceipt,
- strStatus, strAux, strcbankaccount, "BANKACC, BPARTNER");
+ data = ReportDebtPaymentData.selectNoBpartner(this, cCurrencyConv,
vars.getLanguage(),
+ Utility.getContext(this, vars, "#User_Client", "ReportDebtPayment"),
Utility.getContext(
+ this, vars, "#AccessibleOrgTree", "ReportDebtPayment"),
strC_BPartner_ID,
+ strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), strCal1,
strCalc2,
+ strPaymentRule, strReceipt, strStatus, strAux, strcbankaccount,
"BANKACC, BPARTNER");
if (data == null || data.length == 0) {
data = ReportDebtPaymentData.set();
discard[0] = "sectionBpartner";
@@ -428,6 +436,19 @@
} catch (Exception ex) {
throw new ServletException(ex);
}
+
+ xmlDocument.setParameter("ccurrencyid", cCurrencyConv);
+ try {
+ ComboTableData comboTableData = new ComboTableData(vars, this,
"TABLEDIR", "C_Currency_ID",
+ "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
"ReportDebtPayment"),
+ Utility.getContext(this, vars, "#User_Client", "ReportDebtPayment"),
0);
+ Utility.fillSQLParameters(this, vars, null, comboTableData,
"ReportDebtPayment",
+ cCurrencyConv);
+ xmlDocument.setData("reportC_Currency_ID", "liststructure",
comboTableData.select(false));
+ comboTableData = null;
+ } catch (Exception ex) {
+ throw new ServletException(ex);
+ }
if (!strGroup.equals("") && !strGroupBA.equals("")) {
xmlDocument.setData("structure4", data);
} else if (!strGroupBA.equals("")) {
diff -r 63711bc0dda0 -r ea3c2d1c6e7d
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.jrxml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.jrxml Sat Mar
06 12:55:36 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.jrxml Mon Mar
08 15:48:23 2010 +0530
@@ -190,10 +190,12 @@
<field name="DESCRIPTION" class="java.lang.String"/>
<field name="AMOUNT" class="java.math.BigDecimal"/>
+ <field name="CONVAMOUNT" class="java.math.BigDecimal"/>
<field name="INVOICE" class="java.lang.String"/>
<field name="BPARTNER" class="java.lang.String"/>
<field name="DATEPLANNED" class="java.lang.String"/>
<field name="CURRENCY" class="java.lang.String"/>
+ <field name="CONVISOSYM" class="java.lang.String"/>
<field name="PAYMENTRULE" class="java.lang.String"/>
<field name="DEBTGENERATE" class="java.lang.String"/>
<field name="ISPAID" class="java.lang.String"/>
@@ -203,16 +205,16 @@
<field name="ACCOUNTSTR" class="java.lang.String"/>
<variable name="SUM_AMOUNT_1" class="java.math.BigDecimal"
resetType="Report" calculation="Sum">
- <variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+
<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
</variable>
<variable name="SUM_AMOUNT_2" class="java.math.BigDecimal"
resetType="Report" incrementType="Report" calculation="Sum">
- <variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+
<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
</variable>
<variable name="SUM_SUM_AMOUNT_1_1" class="java.math.BigDecimal"
resetType="Report" calculation="Sum">
<variableExpression><![CDATA[$V{SUM_AMOUNT_1}]]></variableExpression>
</variable>
<variable name="SUM_AMOUNT_3" class="java.math.BigDecimal"
resetType="Report" calculation="Sum">
- <variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+
<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
</variable>
<group name="bp" >
@@ -557,7 +559,7 @@
<textElement textAlignment="Right"
verticalAlignment="Middle">
<font fontName="Bitstream Vera
Sans" size="4"/>
</textElement>
- <textFieldExpression
class="java.lang.String"><![CDATA[($F{AMOUNT}!=null)?$P{NUMBERFORMAT}.format($F{AMOUNT}):new
String(" ")]]></textFieldExpression>
+ <textFieldExpression
class="java.lang.String"><![CDATA[($F{CONVAMOUNT}!=null)?$P{NUMBERFORMAT}.format($F{CONVAMOUNT}):new
String(" ")]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false"
pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"
hyperlinkTarget="Self" >
<reportElement
@@ -570,7 +572,7 @@
<textElement textAlignment="Left"
verticalAlignment="Middle">
<font fontName="Bitstream Vera
Sans" size="4"/>
</textElement>
- <textFieldExpression
class="java.lang.String"><![CDATA[$F{CURRENCY}]]></textFieldExpression>
+ <textFieldExpression
class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
</textField>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits