Applied fix from trunk for revision: 1530273 
===

A pretty important refactoring of some GL data and code that fixes a series of long standing gaps, errors and design issues affecting account balances and the closure of fiscal periods (some of them introduced by me when I initially wrote the first version of these business logics; at that time I didn't have a clear and deep enough understanding of these accounting rules sigh…).
This new version is cleaner (less code, less redundancy of information), correct and it also resolves some pretty relevant issues (including some db deadlock errors) affecting performance in instances with medium/high number of GL postings.
Here is a list of changes introduced in this commit:
* removed the postedBalance field from GlAccount and GlAccountOrganization: this was a wrong design; the field in GlAccount was not used by the applications; the field in GlAccountOrganization was used but not consistently
* added openingBalance field to GlAccountHistory: now this entity has full information about an account in a financial period after the period closed (opening and ending balance, posted debits and credits); now the endingBalance is computed correctly both for Debits and Credits accounts
* updated demo data for the data model changes mentioned above
* the business logic to compute the account balances is now implemented in a service (computeGlAccountBalanceForTimePeriod) and reused consistently
* removed several FIXME/TODO comments now that the new code addresses the related gaps and issues
* removed some old, incorrect or no more used artifacts: getGlAcctgOrgWithPostedBalanceSplit (service), getNetBalance (utily methods)
* refactored the TrialBalanceReport and GlAccountTrialBalance reports and related pdf versions: the new versions have cleaner code and show the correct balances both for debits and credits
* fixed a series of Groovy compilation issues due to missing imports



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release13.07@1530274 13f79535-47bb-0310-9956-ffa450edef68