details: https://code.openbravo.com/erp/devel/main/rev/7479233658b2 changeset: 21057:7479233658b2 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Sep 04 11:43:03 2013 +0200 summary: fixes issue 24651: Wrong Balance Sheet is obtained when previous year is not closed
details: https://code.openbravo.com/erp/devel/main/rev/7ba7f93cbe0f changeset: 21058:7ba7f93cbe0f user: Gorka Ion Damián <gorkaion.damian <at> openbravo.com> date: Tue Sep 03 18:09:38 2013 +0200 summary: Fixed issue 24681.Add new selector including generic products. details: https://code.openbravo.com/erp/devel/main/rev/be93dc37ad27 changeset: 21059:be93dc37ad27 user: Gorka Ion Damián <gorkaion.damian <at> openbravo.com> date: Tue Sep 03 19:09:50 2013 +0200 summary: Related to issue 24681.Fix db consistency issue.Run synchronize terminology. diffstat: src-db/database/sourcedata/AD_COLUMN.xml | 4 +- src-db/database/sourcedata/AD_REFERENCE.xml | 13 + src-db/database/sourcedata/OBUISEL_SELECTOR.xml | 16 + src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml | 89 ++ src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java | 338 +++++---- 5 files changed, 313 insertions(+), 147 deletions(-) diffs (truncated from 587 to 300 lines): diff -r 58951728ad3a -r be93dc37ad27 src-db/database/sourcedata/AD_COLUMN.xml --- a/src-db/database/sourcedata/AD_COLUMN.xml Mon Sep 02 18:00:32 2013 +0200 +++ b/src-db/database/sourcedata/AD_COLUMN.xml Tue Sep 03 19:09:50 2013 +0200 @@ -27789,8 +27789,8 @@ <!--2064--> <HELP><![CDATA[Identifies an item which is either purchased or sold in this organization.]]></HELP> <!--2064--> <COLUMNNAME><![CDATA[M_Product_ID]]></COLUMNNAME> <!--2064--> <AD_TABLE_ID><![CDATA[251]]></AD_TABLE_ID> -<!--2064--> <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID> -<!--2064--> <AD_REFERENCE_VALUE_ID><![CDATA[800011]]></AD_REFERENCE_VALUE_ID> +<!--2064--> <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID> +<!--2064--> <AD_REFERENCE_VALUE_ID><![CDATA[D65D16C78404437AAB008E8040715D2F]]></AD_REFERENCE_VALUE_ID> <!--2064--> <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH> <!--2064--> <ISKEY><![CDATA[N]]></ISKEY> <!--2064--> <ISPARENT><![CDATA[Y]]></ISPARENT> diff -r 58951728ad3a -r be93dc37ad27 src-db/database/sourcedata/AD_REFERENCE.xml --- a/src-db/database/sourcedata/AD_REFERENCE.xml Mon Sep 02 18:00:32 2013 +0200 +++ b/src-db/database/sourcedata/AD_REFERENCE.xml Tue Sep 03 19:09:50 2013 +0200 @@ -5880,6 +5880,19 @@ <!--D61E6D984E214F99B10DE56395ED692B--> <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED> <!--D61E6D984E214F99B10DE56395ED692B--></AD_REFERENCE> +<!--D65D16C78404437AAB008E8040715D2F--><AD_REFERENCE> +<!--D65D16C78404437AAB008E8040715D2F--> <AD_REFERENCE_ID><![CDATA[D65D16C78404437AAB008E8040715D2F]]></AD_REFERENCE_ID> +<!--D65D16C78404437AAB008E8040715D2F--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--D65D16C78404437AAB008E8040715D2F--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--D65D16C78404437AAB008E8040715D2F--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--D65D16C78404437AAB008E8040715D2F--> <NAME><![CDATA[All Products Simple Selector]]></NAME> +<!--D65D16C78404437AAB008E8040715D2F--> <HELP><![CDATA[Simple selector that shows all products, including those checked as Generic.]]></HELP> +<!--D65D16C78404437AAB008E8040715D2F--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--D65D16C78404437AAB008E8040715D2F--> <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE> +<!--D65D16C78404437AAB008E8040715D2F--> <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID> +<!--D65D16C78404437AAB008E8040715D2F--> <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED> +<!--D65D16C78404437AAB008E8040715D2F--></AD_REFERENCE> + <!--D6C4E62C3EB040989001DA16B3925DC8--><AD_REFERENCE> <!--D6C4E62C3EB040989001DA16B3925DC8--> <AD_REFERENCE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_ID> <!--D6C4E62C3EB040989001DA16B3925DC8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff -r 58951728ad3a -r be93dc37ad27 src-db/database/sourcedata/OBUISEL_SELECTOR.xml --- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml Mon Sep 02 18:00:32 2013 +0200 +++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml Tue Sep 03 19:09:50 2013 +0200 @@ -68,6 +68,22 @@ <!--1E14C66616444E0DA8D5C5321EC9F61B--> <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY> <!--1E14C66616444E0DA8D5C5321EC9F61B--></OBUISEL_SELECTOR> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--><OBUISEL_SELECTOR> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <OBUISEL_SELECTOR_ID><![CDATA[1F051395F1CC4A40ADFE5C440EBCAA7F]]></OBUISEL_SELECTOR_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <NAME><![CDATA[Product]]></NAME> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_REFERENCE_ID><![CDATA[D65D16C78404437AAB008E8040715D2F]]></AD_REFERENCE_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <AD_COLUMN_ID><![CDATA[1402]]></AD_COLUMN_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--> <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY> +<!--1F051395F1CC4A40ADFE5C440EBCAA7F--></OBUISEL_SELECTOR> + <!--1F1889DC41AD41D596A046091B4EFA81--><OBUISEL_SELECTOR> <!--1F1889DC41AD41D596A046091B4EFA81--> <OBUISEL_SELECTOR_ID><![CDATA[1F1889DC41AD41D596A046091B4EFA81]]></OBUISEL_SELECTOR_ID> <!--1F1889DC41AD41D596A046091B4EFA81--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff -r 58951728ad3a -r be93dc37ad27 src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml --- a/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml Mon Sep 02 18:00:32 2013 +0200 +++ b/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml Tue Sep 03 19:09:50 2013 +0200 @@ -235,6 +235,28 @@ <!--1E2A8D7793C64421814CAD979FFBB1FB--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> <!--1E2A8D7793C64421814CAD979FFBB1FB--></OBUISEL_SELECTOR_FIELD> +<!--1F1EC6A3DC45452DB5C029FD89420C13--><OBUISEL_SELECTOR_FIELD> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[1F1EC6A3DC45452DB5C029FD89420C13]]></OBUISEL_SELECTOR_FIELD_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <OBUISEL_SELECTOR_ID><![CDATA[1F051395F1CC4A40ADFE5C440EBCAA7F]]></OBUISEL_SELECTOR_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <AD_COLUMN_ID><![CDATA[2012]]></AD_COLUMN_ID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <NAME><![CDATA[Product Category]]></NAME> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <DESCRIPTION><![CDATA[A classification of items based on similar characteristics or attributes.]]></DESCRIPTION> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <HELP><![CDATA[Identifies the category which this product belongs to. Product categories are used for pricing.]]></HELP> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <PROPERTY><![CDATA[productCategory]]></PROPERTY> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <SORT><![CDATA[Y]]></SORT> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <FILTER><![CDATA[Y]]></FILTER> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <SHOWINGRID><![CDATA[Y]]></SHOWINGRID> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <SORTNO><![CDATA[30]]></SORTNO> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD> +<!--1F1EC6A3DC45452DB5C029FD89420C13--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> +<!--1F1EC6A3DC45452DB5C029FD89420C13--></OBUISEL_SELECTOR_FIELD> + <!--1FFD5B1F3D7248DCAFA8225E92D17606--><OBUISEL_SELECTOR_FIELD> <!--1FFD5B1F3D7248DCAFA8225E92D17606--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[1FFD5B1F3D7248DCAFA8225E92D17606]]></OBUISEL_SELECTOR_FIELD_ID> <!--1FFD5B1F3D7248DCAFA8225E92D17606--> <OBUISEL_SELECTOR_ID><![CDATA[4C8BC3E8E56441F4B8C98C684A0C9212]]></OBUISEL_SELECTOR_ID> @@ -500,6 +522,28 @@ <!--3AC833E6798F459F82EA1E8D80DE79BE--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> <!--3AC833E6798F459F82EA1E8D80DE79BE--></OBUISEL_SELECTOR_FIELD> +<!--3C35BB29BB2249DD916FFAAA32BD7021--><OBUISEL_SELECTOR_FIELD> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[3C35BB29BB2249DD916FFAAA32BD7021]]></OBUISEL_SELECTOR_FIELD_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <OBUISEL_SELECTOR_ID><![CDATA[1F051395F1CC4A40ADFE5C440EBCAA7F]]></OBUISEL_SELECTOR_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <AD_COLUMN_ID><![CDATA[1410]]></AD_COLUMN_ID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <NAME><![CDATA[Name]]></NAME> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <DESCRIPTION><![CDATA[A non-unique identifier for a record/document often used as a search tool.]]></DESCRIPTION> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <HELP><![CDATA[A more descriptive identifier (that does need to be unique) of a record/document that is used as a default search option along with the search key (that is unique and mostly shorter). It is up to 60 characters in length.]]></HELP> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <PROPERTY><![CDATA[name]]></PROPERTY> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <SORT><![CDATA[Y]]></SORT> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <FILTER><![CDATA[Y]]></FILTER> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <SHOWINGRID><![CDATA[Y]]></SHOWINGRID> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <SORTNO><![CDATA[20]]></SORTNO> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD> +<!--3C35BB29BB2249DD916FFAAA32BD7021--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> +<!--3C35BB29BB2249DD916FFAAA32BD7021--></OBUISEL_SELECTOR_FIELD> + <!--3C4C59A1AB77437A959F10D42D32FDE7--><OBUISEL_SELECTOR_FIELD> <!--3C4C59A1AB77437A959F10D42D32FDE7--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[3C4C59A1AB77437A959F10D42D32FDE7]]></OBUISEL_SELECTOR_FIELD_ID> <!--3C4C59A1AB77437A959F10D42D32FDE7--> <OBUISEL_SELECTOR_ID><![CDATA[F132874BE0954A9B8C1301BE20704730]]></OBUISEL_SELECTOR_ID> @@ -1055,6 +1099,30 @@ <!--65AE411567384A8D916F78C0597E40E4--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> <!--65AE411567384A8D916F78C0597E40E4--></OBUISEL_SELECTOR_FIELD> +<!--66838C3228C94AE695DB3D294CFDCDC8--><OBUISEL_SELECTOR_FIELD> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[66838C3228C94AE695DB3D294CFDCDC8]]></OBUISEL_SELECTOR_FIELD_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <OBUISEL_SELECTOR_ID><![CDATA[1F051395F1CC4A40ADFE5C440EBCAA7F]]></OBUISEL_SELECTOR_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <AD_COLUMN_ID><![CDATA[2011]]></AD_COLUMN_ID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <NAME><![CDATA[Search Key]]></NAME> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <DESCRIPTION><![CDATA[A fast method for finding a particular record.]]></DESCRIPTION> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <HELP><![CDATA[A search key allows for a fast method of finding a particular record. If you leave the search key empty, the system automatically creates a numeric number originating from a document sequence defined in the "Document Sequence" window. The sequence naming convention follows a rule "DocumentNo_TableName", where TableName is the actual name of the database table (e.g. C_Order). + +Usually, company's internal identifiers for various records (products, customers, etc) are stored here.]]></HELP> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <PROPERTY><![CDATA[searchKey]]></PROPERTY> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <SORT><![CDATA[Y]]></SORT> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <FILTER><![CDATA[Y]]></FILTER> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <SHOWINGRID><![CDATA[Y]]></SHOWINGRID> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <SORTNO><![CDATA[10]]></SORTNO> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD> +<!--66838C3228C94AE695DB3D294CFDCDC8--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> +<!--66838C3228C94AE695DB3D294CFDCDC8--></OBUISEL_SELECTOR_FIELD> + <!--681AD87159544997B999B254DD4F97EC--><OBUISEL_SELECTOR_FIELD> <!--681AD87159544997B999B254DD4F97EC--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[681AD87159544997B999B254DD4F97EC]]></OBUISEL_SELECTOR_FIELD_ID> <!--681AD87159544997B999B254DD4F97EC--> <OBUISEL_SELECTOR_ID><![CDATA[EB3C41F0973A4EDA91E475833792A6D4]]></OBUISEL_SELECTOR_ID> @@ -1513,6 +1581,27 @@ <!--94298E76C86A439A935D7D84E7DF1C3E--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> <!--94298E76C86A439A935D7D84E7DF1C3E--></OBUISEL_SELECTOR_FIELD> +<!--943A10BE2F494F768A8DC4BC44B5B092--><OBUISEL_SELECTOR_FIELD> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[943A10BE2F494F768A8DC4BC44B5B092]]></OBUISEL_SELECTOR_FIELD_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <OBUISEL_SELECTOR_ID><![CDATA[1F051395F1CC4A40ADFE5C440EBCAA7F]]></OBUISEL_SELECTOR_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <AD_COLUMN_ID><![CDATA[D7192114A6A5B6B7E040007F01001270]]></AD_COLUMN_ID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <NAME><![CDATA[Is Generic]]></NAME> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <HELP><![CDATA[Identifies a generic product. A generic product cannot be purchased or sold.]]></HELP> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <PROPERTY><![CDATA[isGeneric]]></PROPERTY> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <SORT><![CDATA[Y]]></SORT> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <FILTER><![CDATA[Y]]></FILTER> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <SHOWINGRID><![CDATA[Y]]></SHOWINGRID> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <SORTNO><![CDATA[40]]></SORTNO> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD> +<!--943A10BE2F494F768A8DC4BC44B5B092--> <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST> +<!--943A10BE2F494F768A8DC4BC44B5B092--></OBUISEL_SELECTOR_FIELD> + <!--9658A4E18959420F927BC4A1B26D0931--><OBUISEL_SELECTOR_FIELD> <!--9658A4E18959420F927BC4A1B26D0931--> <OBUISEL_SELECTOR_FIELD_ID><![CDATA[9658A4E18959420F927BC4A1B26D0931]]></OBUISEL_SELECTOR_FIELD_ID> <!--9658A4E18959420F927BC4A1B26D0931--> <OBUISEL_SELECTOR_ID><![CDATA[D47A3616483E46C18A09794B9B276B37]]></OBUISEL_SELECTOR_ID> diff -r 58951728ad3a -r be93dc37ad27 src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java --- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java Mon Sep 02 18:00:32 2013 +0200 +++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java Tue Sep 03 19:09:50 2013 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2001-2011 Openbravo SLU + * All portions are Copyright (C) 2001-2013 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -21,15 +21,23 @@ import java.io.IOException; import java.io.PrintWriter; import java.math.BigDecimal; -import java.util.Vector; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.criterion.Restrictions; import org.openbravo.base.secureApp.HttpSecureAppServlet; import org.openbravo.base.secureApp.VariablesSecureApp; import org.openbravo.dal.core.OBContext; +import org.openbravo.dal.service.OBCriteria; +import org.openbravo.dal.service.OBDal; import org.openbravo.erpCommon.businessUtility.AccountTree; import org.openbravo.erpCommon.businessUtility.AccountTreeData; import org.openbravo.erpCommon.businessUtility.AccountingSchemaMiscData; @@ -39,10 +47,15 @@ import org.openbravo.erpCommon.utility.DateTimeData; import org.openbravo.erpCommon.utility.LeftTabsBar; import org.openbravo.erpCommon.utility.NavigationBar; +import org.openbravo.erpCommon.utility.OBDateUtils; import org.openbravo.erpCommon.utility.OBError; import org.openbravo.erpCommon.utility.ToolBar; import org.openbravo.erpCommon.utility.Utility; import org.openbravo.erpCommon.utility.WindowTreeData; +import org.openbravo.model.common.enterprise.Organization; +import org.openbravo.model.financialmgmt.accounting.OrganizationClosing; +import org.openbravo.model.financialmgmt.calendar.Calendar; +import org.openbravo.model.financialmgmt.calendar.Year; import org.openbravo.xmlEngine.XmlDocument; public class GeneralAccountingReports extends HttpSecureAppServlet { @@ -112,7 +125,7 @@ } private void printPagePDF(HttpServletRequest request, HttpServletResponse response, - VariablesSecureApp vars, String strAgno, String strAgnoRef, String strDateFrom, + VariablesSecureApp vars, String strYearId, String strYearRefId, String strDateFrom, String strDateTo, String strDateFromRef, String strDateToRef, String strAsDateTo, String strAsDateToRef, String strElementValue, String strConImporte, String strOrg, String strLevel, String strConCodigo, String strcAcctSchemaId, String strPageNo) @@ -155,133 +168,128 @@ String TreeID = ""; if (dataTree != null && dataTree.length != 0) TreeID = dataTree[0].id; + OBContext.setAdminMode(false); + try { + // For each year, the initial and closing date is obtained + Year year = OBDal.getInstance().get(Year.class, strYearId); + Year yearRef = OBDal.getInstance().get(Year.class, strYearRefId); + HashMap<String, Date> startingEndingDate = getStartingEndingDate(year); + HashMap<String, Date> startingEndingDateRef = getStartingEndingDate(yearRef); + // Years to be included as no closing is present + String strYearsToClose = ""; + String strYearsToCloseRef = ""; - // For each year, the initial and closing date is obtained - GeneralAccountingReportsData[] startEndYear = GeneralAccountingReportsData.startEndYear(this, - vars.getClient(), "'" + strAgno + "'"); - GeneralAccountingReportsData[] startEndYearRef = GeneralAccountingReportsData.startEndYear( - this, vars.getClient(), "'" + strAgnoRef + "'"); - String strYear = "'" + startEndYear[0].name + "'"; - String strYearRef = "'" + startEndYearRef[0].name + "'"; - String strYearsToClose = ""; - String strYearsToCloseRef = ""; - - Vector<Object> vec = new Vector<Object>(); - // Relation of open and closed years is obtained - GeneralAccountingReportsData[] closedYears = GeneralAccountingReportsData - .checkFiscalYearsGenLed(this, vars.getClient(), strcAcctSchemaId); - GeneralAccountingReportsData[] previousYears = GeneralAccountingReportsData.previousYear( - this, vars.getClient()); - if (strCalculateOpening.equals("Y")) { - strCalculateOpening = "N"; - strDateTo = strAsDateTo; - strDateToRef = strAsDateToRef; - strDateFrom = ""; - strDateFromRef = ""; - fulfillYearsToClose(vec, startEndYear[0].name, closedYears, previousYears); - // If there is some year to close, will be appended to the year to show in report when - // calculating amounts, through strYearsToClose and strYearsToCloseRef variables - if (vec.size() > 0) { - for (int i = 0; i < vec.size(); i++) { - strCalculateOpening = "Y"; // If we finally calculate the opening variable takes "Y" - strYearsToClose = strYearsToClose + ",'" + vec.elementAt(i) + "'"; + if (strCalculateOpening.equals("Y")) { + strCalculateOpening = "N"; + strDateTo = strAsDateTo; + strDateToRef = strAsDateToRef; + strDateFrom = ""; + strDateFromRef = ""; + strYearsToClose = getYearsToClose(startingEndingDate.get("startingDate"), strOrg, + year.getCalendar()); + if (strYearsToClose.length() > 0) { + strCalculateOpening = "Y"; + strYearsToClose = "," + strYearsToClose; ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits