Attached Files | JournalEntriesReport.diff [^] (29,244 bytes) 2014-09-17 09:17 [Show Content] [Hide Content]diff --git a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html
@@ -90,6 +90,25 @@
}
function onloadFunctions() {
+ keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', false, 'frmMain', 'inpcElementValueIdFrom', 'inpElementValueIdFrom_DES', document.frmMain.inpElementValueIdFrom_DES.value, 'inpcAcctSchemaId', document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", "inpElementValueIdFrom_DES", "null");
+ keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', false, 'frmMain', 'inpcElementValueIdTo', 'inpElementValueIdTo_DES', document.frmMain.inpElementValueIdTo_DES.value, 'inpcAcctSchemaId', document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", "inpElementValueIdTo_DES", "null");
+}
+
+function validate() {
+ var frm = document.frmMain;
+ var evFrom = frm.inpcElementValueIdFrom.value;
+ var evTo = frm.inpcElementValueIdTo.value;
+
+if (frm.inpcAcctSchemaId.value == null || frm.inpcAcctSchemaId.value == ""){
+ setWindowElementFocus(frm.inpcAcctSchemaId);
+ showJSMessage(7);
+ return false;
+ } else if ((evFrom != null && evFrom != "" && (evTo == null || evTo == ""))
+ || (evTo != null && evTo != "" && (evFrom == null || evFrom == ""))) {
+ showJSMessage(27);
+ return false;
+ }
+ return true;
}
function displayAdvancedFilters(){
@@ -463,6 +482,52 @@
</select></td>
</tr>
<tr>
+ <td class="TitleCell"><span class="LabelText">From Account</span></td>
+ <td class="TextBox_btn_ContentCell" colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0" summary="" style="padding-top: 0px;">
+ <tr>
+ <td class="TextBox_ContentCell">
+ <input type="hidden" name="inpcElementValueIdFrom" id="paramElementvalueIdFrom" value=""></input>
+ <input class="dojoValidateValid TextBox_btn_TwoCells_width" type="text" name="inpElementValueIdFrom_DES" id="inpElementValueIdFrom_DES" maxlength="20" value=""></input>
+ </td>
+ <td class="FieldButton_ContentCell">
+ <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Account'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" onclick="openSearch(null, null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', false, 'frmMain', 'inpcElementValueIdFrom', 'inpElementValueIdFrom_DES', document.frmMain.inpElementValueIdFrom_DES.value, 'inpcAcctSchemaId', document.frmMain.inpcAcctSchemaId.value);return false;">
+ <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Search';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+ <tr>
+ <td class="FieldButton_bg">
+ <img alt="Account" class="FieldButton_Icon FieldButton_Icon_Account" title="Account" src="../../../../../web/images/blank.gif" border="0"></img>
+ </td>
+ </tr>
+ </table>
+ </a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="TitleCell"><span class="LabelText">To Account</span></td>
+ <td class="TextBox_btn_ContentCell" colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0" summary="" style="padding-top: 0px;">
+ <tr>
+ <td class="TextBox_ContentCell">
+ <input type="hidden" name="inpcElementValueIdTo" id="paramElementvalueIdTo" value=""></input>
+ <input class="dojoValidateValid TextBox_btn_TwoCells_width" type="text" name="inpElementValueIdTo_DES" id="inpElementValueIdTo_DES" maxlength="20" value=""></input>
+ </td>
+ <td class="FieldButton_ContentCell">
+ <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Account'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" onclick="openSearch(null, null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', false, 'frmMain', 'inpcElementValueIdTo', 'inpElementValueIdTo_DES', document.frmMain.inpElementValueIdTo_DES.value, 'inpcAcctSchemaId', document.frmMain.inpcAcctSchemaId.value);return false;">
+ <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Search';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+ <tr>
+ <td class="FieldButton_bg">
+ <img alt="Account" class="FieldButton_Icon FieldButton_Icon_Account" title="Account" src="../../../../../web/images/blank.gif" border="0"></img>
+ </td>
+ </tr>
+ </table>
+ </a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
<td colspan="6">
<table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
<tbody>
@@ -542,7 +607,7 @@
<button type="button"
id="buttonHTML"
class="ButtonLink"
- onclick="submitCommandForm('FIND', false, frmMain, 'ReportGeneralLedgerJournal.html', '_self');return false;"
+ onclick="submitCommandForm('FIND', true, frmMain, 'ReportGeneralLedgerJournal.html', '_self');return false;"
onfocus="buttonEvent('onfocus', this); window.status='View Results in a New Window'; return true;"
onblur="buttonEvent('onblur', this);"
onkeyup="buttonEvent('onkeyup', this);"
diff --git a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
@@ -127,9 +127,26 @@
"ReportGeneralLedgerJournal|EntryNo", "1");
String strShowDescription = vars.getGlobalVariable("inpShowDescription",
"ReportGeneralLedgerJournal|ShowDescription", "");
+ String strcelementvaluefrom = vars.getGlobalVariable("inpcElementValueIdFrom",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDFROM", "");
+ String strcelementvalueto = vars.getGlobalVariable("inpcElementValueIdTo",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDTO", "");
+ String strcelementvaluefromdes = "", strcelementvaluetodes = "";
+ if (!strcelementvaluefrom.equals(""))
+ strcelementvaluefromdes = ReportGeneralLedgerData.selectSubaccountDescription(this,
+ strcelementvaluefrom);
+ if (!strcelementvalueto.equals(""))
+ strcelementvaluetodes = ReportGeneralLedgerData.selectSubaccountDescription(this,
+ strcelementvalueto);
+ strcelementvaluefromdes = (strcelementvaluefromdes.equals("null")) ? ""
+ : strcelementvaluefromdes;
+ strcelementvaluetodes = (strcelementvaluetodes.equals("null")) ? "" : strcelementvaluetodes;
+ vars.setSessionValue("inpElementValueIdFrom_DES", strcelementvaluefromdes);
+ vars.setSessionValue("inpElementValueIdTo_DES", strcelementvaluetodes);
printPageDataSheet(response, vars, strDateFrom, strDateTo, strDocument, strOrg, strTable,
strRecord, "", strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening, strPageNo,
- strEntryNo, strShowDescription, strShowRegular, strShowDivideUp, "", "");
+ strEntryNo, strShowDescription, strShowRegular, strShowDivideUp, "", "",
+ strcelementvaluefrom, strcelementvalueto, strcelementvaluefromdes, strcelementvaluetodes);
} else if (vars.commandIn("DIRECT")) {
String strTable = vars.getGlobalVariable("inpTable", "ReportGeneralLedgerJournal|Table");
String strRecord = vars.getGlobalVariable("inpRecord", "ReportGeneralLedgerJournal|Record");
@@ -156,14 +173,14 @@
setHistoryCommand(request, "DIRECT");
vars.setSessionValue("ReportGeneralLedgerJournal.initRecordNumber", "0");
printPageDataSheet(response, vars, "", "", "", "", strTable, strRecord, "", strcAcctSchemaId,
- "", "", "", "1", "1", "", "Y", "", schemas, strPosted);
+ "", "", "", "1", "1", "", "Y", "", schemas, strPosted, "", "", "", "");
} else if (vars.commandIn("DIRECT2")) {
String strFactAcctGroupId = vars.getGlobalVariable("inpFactAcctGroupId",
"ReportGeneralLedgerJournal|FactAcctGroupId");
setHistoryCommand(request, "DIRECT2");
vars.setSessionValue("ReportGeneralLedgerJournal.initRecordNumber", "0");
printPageDataSheet(response, vars, "", "", "", "", "", "", strFactAcctGroupId, "", "", "",
- "", "1", "1", "", "Y", "", "", "");
+ "", "1", "1", "", "Y", "", "", "", "", "", "", "");
} else if (vars.commandIn("FIND")) {
String strcAcctSchemaId = vars.getRequestGlobalVariable("inpcAcctSchemaId",
"ReportGeneralLedger|cAcctSchemaId");
@@ -224,9 +241,23 @@
"ReportGeneralLedgerJournal|ShowDescription");
if (strShowDescription == null || "".equals(strShowDescription))
vars.setSessionValue("ReportGeneralLedgerJournal|ShowDescription", "N");
+ String strcelementvaluefrom = vars.getRequestGlobalVariable("inpcElementValueIdFrom",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDFROM");
+ String strcelementvalueto = vars.getRequestGlobalVariable("inpcElementValueIdTo",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDTO");
+ String strcelementvaluefromdes = "", strcelementvaluetodes = "";
+ if (!strcelementvaluefrom.equals(""))
+ strcelementvaluefromdes = ReportGeneralLedgerData.selectSubaccountDescription(this,
+ strcelementvaluefrom);
+ if (!strcelementvalueto.equals(""))
+ strcelementvaluetodes = ReportGeneralLedgerData.selectSubaccountDescription(this,
+ strcelementvalueto);
+ vars.setSessionValue("inpElementValueIdFrom_DES", strcelementvaluefromdes);
+ vars.setSessionValue("inpElementValueIdTo_DES", strcelementvaluetodes);
printPageDataSheet(response, vars, strDateFrom, strDateTo, strDocument, strOrg, "", "", "",
strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening, strPageNo, strEntryNo,
- strShowDescription, strShowRegular, strShowDivideUp, "", "");
+ strShowDescription, strShowRegular, strShowDivideUp, "", "", strcelementvaluefrom,
+ strcelementvalueto, strcelementvaluefromdes, strcelementvaluetodes);
} else if (vars.commandIn("PDF", "XLS")) {
if (log4j.isDebugEnabled())
log4j.debug("PDF");
@@ -306,10 +337,14 @@
}
// vars.setSessionValue("ReportGeneralLedgerJournal.initRecordNumber", "0");
setHistoryCommand(request, "DEFAULT");
+ String strcelementvaluefrom = vars.getRequestGlobalVariable("inpcElementValueIdFrom",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDFROM");
+ String strcelementvalueto = vars.getRequestGlobalVariable("inpcElementValueIdTo",
+ "ReportGeneralLedgerJournal|C_ElementValue_IDTO");
printPagePDF(response, vars, strDateFrom, strDateTo, strDocument, strOrg, strTable,
strRecord, strFactAcctGroupId, strcAcctSchemaId, strShowClosing, strShowReg,
strShowOpening, strPageNo, strEntryNo, "Y".equals(strShowDescription) ? "Y" : "",
- strShowRegular, strShowDivideUp);
+ strShowRegular, strShowDivideUp, strcelementvaluefrom, strcelementvalueto);
} else if (vars.commandIn("PREVIOUS_RELATION")) {
String strInitRecord = vars.getSessionValue("ReportGeneralLedgerJournal.initRecordNumber");
String strPreviousRecordRange = vars.getSessionValue(PREVIOUS_RANGE);
@@ -373,7 +408,12 @@
String strRecord, String strFactAcctGroupId, String strcAcctSchemaId, String strShowClosing,
String strShowReg, String strShowOpening, String strPageNo, String strEntryNo,
String strShowDescription, String strShowRegular, String strShowDivideUp, String accShemas,
- String strPosted) throws IOException, ServletException {
+ String strPosted, String strcelementvaluefrom, String strcelementvalueto,
+ String strcelementvaluefromdes, String strcelementvaluetodes) throws IOException,
+ ServletException {
+ String strAllaccounts = "Y";
+ if (strcelementvaluefrom != null && !strcelementvaluefrom.equals(""))
+ strAllaccounts = "N";
String strRecordRange = Utility.getContext(this, vars, "#RecordRange",
"ReportGeneralLedgerJournal");
int intRecordRangePredefined = (strRecordRange.equals("") ? 0 : Integer
@@ -407,7 +447,8 @@
Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"),
strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), strDocument,
- strcAcctSchemaId, strOrgFamily, strCheck);
+ strcAcctSchemaId, strOrgFamily, strCheck, strAllaccounts, strcelementvaluefrom,
+ strcelementvalueto);
String strInitAcctEntries = vars.getSessionValue(PREVIOUS_ACCTENTRIES);
int acctEntries = (strInitAcctEntries.equals("") ? 0 : Integer.parseInt(strInitAcctEntries
.split(",")[0]));
@@ -462,14 +503,15 @@
Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"),
strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), strDocument,
- strcAcctSchemaId, strOrgFamily, strCheck, vars.getLanguage(), initRecordNumber,
- intRecordRangeUsed);
+ strcAcctSchemaId, strOrgFamily, strCheck, strAllaccounts, strcelementvaluefrom,
+ strcelementvalueto, vars.getLanguage(), initRecordNumber, intRecordRangeUsed);
if (data != null && data.length > 0)
strPosition = ReportGeneralLedgerJournalData.selectCount(this,
Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"),
strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), strDocument,
- strcAcctSchemaId, strOrgFamily, strCheck, data[0].dateacct, data[0].identifier);
+ strcAcctSchemaId, strOrgFamily, strCheck, strAllaccounts, strcelementvaluefrom,
+ strcelementvalueto, data[0].dateacct, data[0].identifier);
} else {
data = ReportGeneralLedgerJournalData.selectDirect(this,
Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
@@ -619,6 +661,10 @@
xmlDocument.setParameter("showDivideUp", ("".equals(strShowDivideUp)) ? "N" : strShowDivideUp);
xmlDocument.setParameter("showDescription", ("".equals(strShowDescription)) ? "N"
: strShowDescription);
+ xmlDocument.setParameter("paramElementvalueIdTo", strcelementvalueto);
+ xmlDocument.setParameter("paramElementvalueIdFrom", strcelementvaluefrom);
+ xmlDocument.setParameter("inpElementValueIdTo_DES", strcelementvaluetodes);
+ xmlDocument.setParameter("inpElementValueIdFrom_DES", strcelementvaluefromdes);
xmlDocument.setData("structure1", data);
out.println(xmlDocument.print());
@@ -640,11 +686,14 @@
String strDateFrom, String strDateTo, String strDocument, String strOrg, String strTable,
String strRecord, String strFactAcctGroupId, String strcAcctSchemaId, String strShowClosing,
String strShowReg, String strShowOpening, String strPageNo, String strEntryNo,
- String strShowDescription, String strShowRegular, String strShowDivideUp) throws IOException,
- ServletException {
+ String strShowDescription, String strShowRegular, String strShowDivideUp,
+ String strcelementvaluefrom, String strcelementvalueto) throws IOException, ServletException {
ReportGeneralLedgerJournalData[] data = null;
+ String strAllaccounts = "Y";
+ if (strcelementvaluefrom != null && !strcelementvaluefrom.equals(""))
+ strAllaccounts = "N";
String strTreeOrg = TreeData.getTreeOrg(this, vars.getClient());
String strOrgFamily = getFamily(strTreeOrg, strOrg);
if (!strFactAcctGroupId.equals("")) {
@@ -660,7 +709,8 @@
: "'N'", Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"), Utility
.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"), strDateFrom,
DateTimeData.nDaysAfter(this, strDateTo, "1"), strDocument, strcAcctSchemaId,
- strOrgFamily, strCheck, vars.getLanguage());
+ strOrgFamily, strCheck, strAllaccounts, strcelementvaluefrom, strcelementvalueto, vars
+ .getLanguage());
} else
data = ReportGeneralLedgerJournalData.selectDirect(this,
Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
diff --git a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml
@@ -56,6 +56,10 @@
<PARAMETER id="paramShowDivideUp" name="showDivideUp" boolean="checked" withId="fieldCheck"/>
<PARAMETER id="paramShowDescription" name="showDescription" boolean="checked" withId="fieldCheck"/>
<PARAMETER id="paramDocument" name="document"/>
+ <PARAMETER id="paramElementvalueIdTo" name="paramElementvalueIdTo" attribute="value"/>
+ <PARAMETER id="paramElementvalueIdFrom" name="paramElementvalueIdFrom" attribute="value"/>
+ <PARAMETER id="inpElementValueIdTo_DES" name="inpElementValueIdTo_DES" attribute="value"/>
+ <PARAMETER id="inpElementValueIdFrom_DES" name="inpElementValueIdFrom_DES" attribute="value"/>
<PARAMETER id="jsDisablePreviousNext" name="jsDisablePreviousNext" default=""/>
diff --git a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
@@ -43,6 +43,19 @@
AND f.AD_ORG_ID IN('2')
AND F.FactAcctType IN ('C','N','O','R','D')
AND f.C_ACCTSCHEMA_ID = SC.C_ACCTSCHEMA_ID
+ AND (?='Y' OR F.FACT_ACCT_GROUP_ID IN (
+ SELECT FACT_ACCT_GROUP_ID FROM FACT_ACCT WHERE ACCOUNT_ID IN (
+ SELECT c_elementvalue_id as name
+ FROM C_ELEMENTVALUE
+ WHERE value >= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and value <= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and c_elementvalue.ELEMENTLEVEL = 'S')
+ AND AD_CLIENT_ID IN ('3')
+ AND AD_ORG_ID IN ('3')
+ AND 3=3
+ AND AD_ORG_ID IN('4')
+ AND FactAcctType IN ('C','N','O','R','D')
+ ))
GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F.ACCTDESCRIPTION, CASE WHEN 'Y' = 'Y' THEN TO_CHAR(F.DESCRIPTION) ELSE TO_CHAR('') END, F.ACCTVALUE, F.DOCBASETYPE, F.RECORD_ID,
F.FACT_ACCT_GROUP_ID, F.ACCOUNT_ID,F.FACTACCTTYPE,
(CASE F.AMTACCTDR WHEN 0 THEN (CASE SIGN(F.AMTACCTCR) WHEN -1 THEN 1 ELSE 2 END) ELSE (CASE SIGN(F.AMTACCTDR) WHEN -1 THEN 3 ELSE 4 END) END), F.AD_CLIENT_ID
@@ -59,12 +72,23 @@
<Parameter name="docbasetype" optional="true" after="AND 1=1"><![CDATA[ AND f.DOCBASETYPE = ?]]></Parameter>
<Parameter name="acctschema" optional="true" after="AND 1=1"><![CDATA[ AND f.C_ACCTSCHEMA_ID = ?]]></Parameter>
<Parameter name="orgFamily" type="replace" optional="true" after="AND f.AD_ORG_ID IN(" text="'2'"/>
- <Parameter name="checks" type="replace" optional="true" after="AND F.FactAcctType IN (" text="'C','N','O','R','D'"/>
+ <Parameter name="checks" type="replace" optional="true" after="AND F.FactAcctType IN (" text="'C','N','O','R','D'"/>
+ <Parameter name="allaccounts"/>
+ <Parameter name="accountFrom"/>
+ <Parameter name="accountTo"/>
+ <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'3'"/>
+ <Parameter name="adUserOrg" type="replace" optional="true" after="AND AD_ORG_ID IN (" text="'3'"/>
+ <Parameter name="parDateFrom" optional="true" after="AND 3=3"><![CDATA[ AND dateacct >= TO_DATE(?)]]></Parameter>
+ <Parameter name="parDateTo" optional="true" after="AND 3=3"><![CDATA[ AND dateacct < TO_DATE(?)]]></Parameter>
+ <Parameter name="docbasetype" optional="true" after="AND 3=3"><![CDATA[ AND DOCBASETYPE = ?]]></Parameter>
+ <Parameter name="acctschema" optional="true" after="AND 3=3"><![CDATA[ AND C_ACCTSCHEMA_ID = ?]]></Parameter>
+ <Parameter name="orgFamily" type="replace" optional="true" after="AND AD_ORG_ID IN(" text="'4'"/>
+ <Parameter name="checks" type="replace" optional="true" after="AND FactAcctType IN (" text="'C','N','O','R','D'"/>
<Parameter name="descriptionGrouping" type="replace" optional="true" after="F.ACCTDESCRIPTION, CASE WHEN " text="'Y'"/>
+ <Parameter name="paramLanguage"></Parameter>
<!--Parameter name="closing" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'C'"/>
<Parameter name="regularization" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'R'"/>
<Parameter name="opening" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'O'"/-->
- <Parameter name="paramLanguage"></Parameter>
</SqlMethod>
<SqlMethod name="selectCountGroupedLines" type="preparedStatement" return="multiple">
<SqlMethodComment></SqlMethodComment>
@@ -86,6 +110,19 @@
AND f.AD_ORG_ID IN('2')
AND F.FactAcctType IN ('C','N','O','R','D')
AND f.C_ACCTSCHEMA_ID = SC.C_ACCTSCHEMA_ID
+ AND (?='Y' OR F.FACT_ACCT_GROUP_ID IN (
+ SELECT FACT_ACCT_GROUP_ID FROM FACT_ACCT WHERE ACCOUNT_ID IN (
+ SELECT c_elementvalue_id as name
+ FROM C_ELEMENTVALUE
+ WHERE value >= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and value <= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and c_elementvalue.ELEMENTLEVEL = 'S')
+ AND AD_CLIENT_ID IN ('3')
+ AND AD_ORG_ID IN ('3')
+ AND 3=3
+ AND AD_ORG_ID IN('4')
+ AND FactAcctType IN ('C','N','O','R','D')
+ ))
GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F.ACCTDESCRIPTION, F.ACCTVALUE, F.DOCBASETYPE, F.RECORD_ID,
F.FACT_ACCT_GROUP_ID, F.ACCOUNT_ID,
(CASE F.AMTACCTDR WHEN 0 THEN (CASE SIGN(F.AMTACCTCR) WHEN -1 THEN 1 ELSE 2 END) ELSE (CASE SIGN(F.AMTACCTDR) WHEN -1 THEN 3 ELSE 4 END) END)) AA
@@ -103,6 +140,17 @@
<Parameter name="acctschema" optional="true" after="AND 1=1"><![CDATA[ AND f.C_ACCTSCHEMA_ID = ?]]></Parameter>
<Parameter name="orgFamily" type="replace" optional="true" after="AND f.AD_ORG_ID IN(" text="'2'"/>
<Parameter name="checks" type="replace" optional="true" after="AND F.FactAcctType IN (" text="'C','N','O','R','D'"/>
+ <Parameter name="allaccounts"/>
+ <Parameter name="accountFrom"/>
+ <Parameter name="accountTo"/>
+ <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'3'"/>
+ <Parameter name="adUserOrg" type="replace" optional="true" after="AND AD_ORG_ID IN (" text="'3'"/>
+ <Parameter name="parDateFrom" optional="true" after="AND 3=3"><![CDATA[ AND dateacct >= TO_DATE(?)]]></Parameter>
+ <Parameter name="parDateTo" optional="true" after="AND 3=3"><![CDATA[ AND dateacct < TO_DATE(?)]]></Parameter>
+ <Parameter name="docbasetype" optional="true" after="AND 3=3"><![CDATA[ AND DOCBASETYPE = ?]]></Parameter>
+ <Parameter name="acctschema" optional="true" after="AND 3=3"><![CDATA[ AND C_ACCTSCHEMA_ID = ?]]></Parameter>
+ <Parameter name="orgFamily" type="replace" optional="true" after="AND AD_ORG_ID IN(" text="'4'"/>
+ <Parameter name="checks" type="replace" optional="true" after="AND FactAcctType IN (" text="'C','N','O','R','D'"/>
<!--Parameter name="closing" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'C'"/>
<Parameter name="regularization" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'R'"/>
<Parameter name="opening" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'O'"/-->
@@ -127,6 +175,19 @@
AND (CASE (SELECT MAX(ISSOTRX) FROM C_DOCTYPE D
WHERE D.DOCBASETYPE = F.DOCBASETYPE) WHEN 'N' THEN COALESCE(T.PO_WINDOW_ID, T.AD_WINDOW_ID) ELSE T.AD_WINDOW_ID END) = (CASE TO_CHAR(F.DOCBASETYPE)
WHEN 'FAT' THEN '94EAA455D2644E04AB25D93BE5157B6D' ELSE W.AD_WINDOW_ID END)
+ AND (?='Y' OR F.FACT_ACCT_GROUP_ID IN (
+ SELECT FACT_ACCT_GROUP_ID FROM FACT_ACCT WHERE ACCOUNT_ID IN (
+ SELECT c_elementvalue_id as name
+ FROM C_ELEMENTVALUE
+ WHERE value >= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and value <= ( select value from c_elementvalue where c_elementvalue_id = ?)
+ and c_elementvalue.ELEMENTLEVEL = 'S')
+ AND AD_CLIENT_ID IN ('3')
+ AND AD_ORG_ID IN ('3')
+ AND 3=3
+ AND AD_ORG_ID IN('4')
+ AND FactAcctType IN ('C','N','O','R','D')
+ ))
GROUP BY F.DATEACCT, F.FACT_ACCT_GROUP_ID) AA
WHERE (DATEACCT< TO_DATE(?) OR (DATEACCT=TO_DATE(?) AND FACT_ACCT_GROUP_ID < ?))
]]></Sql>
@@ -138,8 +199,19 @@
<Parameter name="acctschema" optional="true" after="AND 1=1"><![CDATA[ AND f.C_ACCTSCHEMA_ID = ?]]></Parameter>
<Parameter name="orgFamily" type="replace" optional="true" after="AND f.AD_ORG_ID IN(" text="'2'"/>
<Parameter name="checks" type="replace" optional="true" after="AND F.FactAcctType IN (" text="'C','N','O','R','D'"/>
+ <Parameter name="allaccounts"/>
+ <Parameter name="accountFrom"/>
+ <Parameter name="accountTo"/>
+ <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'3'"/>
+ <Parameter name="adUserOrg" type="replace" optional="true" after="AND AD_ORG_ID IN (" text="'3'"/>
+ <Parameter name="parDateFrom" optional="true" after="AND 3=3"><![CDATA[ AND dateacct >= TO_DATE(?)]]></Parameter>
+ <Parameter name="parDateTo" optional="true" after="AND 3=3"><![CDATA[ AND dateacct < TO_DATE(?)]]></Parameter>
+ <Parameter name="docbasetype" optional="true" after="AND 3=3"><![CDATA[ AND DOCBASETYPE = ?]]></Parameter>
+ <Parameter name="acctschema" optional="true" after="AND 3=3"><![CDATA[ AND C_ACCTSCHEMA_ID = ?]]></Parameter>
+ <Parameter name="orgFamily" type="replace" optional="true" after="AND AD_ORG_ID IN(" text="'4'"/>
+ <Parameter name="checks" type="replace" optional="true" after="AND FactAcctType IN (" text="'C','N','O','R','D'"/>
<Parameter name="dateAcct"/>
- <Parameter name="dateAcct"/>
+ <Parameter name="dateAcct"/>
<Parameter name="factAcctGroupId"/>
<!--Parameter name="closing" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'C'"/>
<Parameter name="regularization" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'R'"/>
|