Merge pull request #25 from myrle-krantz/develop

Moving accounts.csv and ledgers.csv to new default-setup project.
diff --git a/build.gradle b/build.gradle
index b472bcb..1a799a1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -34,6 +34,7 @@
         frameworklang           : '0.1.0-BUILD-SNAPSHOT',
         frameworktest           : '0.1.0-BUILD-SNAPSHOT',
         frameworkanubis         : '0.1.0-BUILD-SNAPSHOT',
+        defaultsetup            : '0.1.0-BUILD-SNAPSHOT',
         validator               : '5.3.0.Final'
 ]
 
@@ -88,6 +89,7 @@
             [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
             [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
             [group: 'io.mifos', name: 'service-starter', version: versions.frameworkservicestarter],
+            [group: 'io.mifos.default-setup', name: 'accounting', version: versions.defaultsetup],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
             [group: 'org.eclipse.aether', name: 'aether-api', version: '1.1.0'],
             [group: 'org.eclipse.aether', name: 'aether-spi', version: '1.1.0'],
diff --git a/scripts/Unix/initial-setup.sh b/scripts/Unix/initial-setup.sh
index 89a630c..2a66e0c 100755
--- a/scripts/Unix/initial-setup.sh
+++ b/scripts/Unix/initial-setup.sh
@@ -264,6 +264,16 @@
 
 cd ..
 
+# REM initialize default-setup
+git clone 'https://github.com/'$githubAccount'/default-setup.git'
+cd default-setup
+git remote add upstream https://github.com/mifosio/default-setup.git
+git checkout develop
+chmod +x gradlew
+./gradlew publishToMavenLocal
+
+cd ..
+
 # REM initialize demo-server
 git clone 'https://github.com/'$githubAccount'/demo-server.git'
 cd demo-server
diff --git a/scripts/Unix/pull-all.sh b/scripts/Unix/pull-all.sh
index ed9618b..888884e 100644
--- a/scripts/Unix/pull-all.sh
+++ b/scripts/Unix/pull-all.sh
@@ -228,13 +228,22 @@
 git push origin develop 
 cd ..
 
+# REM pull default-setup
+cd default-setup
+git checkout develop
+git pull upstream develop
+chmod +x gradlew
+./gradlew publishToMavenLocal
+git push origin develop 
+cd ..
+
 # REM pull demo-server
 cd demo-server
 git checkout develop
 git pull upstream develop
 chmod +x gradlew
 ./gradlew publishToMavenLocal
-git push origin develop 
+git push origin develop
 cd ..
 
 # REM pull test-provisioner-identity-organization
diff --git a/scripts/windows/initial-setup.bat b/scripts/windows/initial-setup.bat
index 7928ce4..3d1c727 100644
--- a/scripts/windows/initial-setup.bat
+++ b/scripts/windows/initial-setup.bat
@@ -242,6 +242,15 @@
 TIMEOUT /T 5
 cd ..
 
+REM initialze default-setup
+git clone https://github.com/%githubAccount%/default-setup.git
+cd default-setup
+git remote add upstream https://github.com/mifosio/default-setup.git
+git checkout develop
+CALL gradlew publishToMavenLocal
+TIMEOUT /T 5
+cd ..
+
 REM initialze demo-server
 git clone https://github.com/%githubAccount%/demo-server.git
 cd demo-server
diff --git a/scripts/windows/pull-all.bat b/scripts/windows/pull-all.bat
index 6403aa1..d6475a5 100644
--- a/scripts/windows/pull-all.bat
+++ b/scripts/windows/pull-all.bat
@@ -226,6 +226,15 @@
 TIMEOUT /T 5
 cd ..
 
+REM pull default-setup
+cd default-setup
+git checkout develop
+git pull upstream develop
+CALL gradlew publishToMavenLocal
+git push origin develop
+TIMEOUT /T 5
+cd ..
+
 REM pull demo-server
 cd demo-server
 git checkout develop
diff --git a/src/main/java/io/mifos/dev/ServiceRunner.java b/src/main/java/io/mifos/dev/ServiceRunner.java
index 70cec52..a370d65 100644
--- a/src/main/java/io/mifos/dev/ServiceRunner.java
+++ b/src/main/java/io/mifos/dev/ServiceRunner.java
@@ -411,15 +411,13 @@
 
     try (final AutoUserContext ignored = new AutoUserContext(userWithPassword.getIdentifier(), authentication.getAccessToken())) {
       final LedgerImporter ledgerImporter = new LedgerImporter(ledgerManager.api(), logger);
-      final ClassPathResource ledgersResource = new ClassPathResource("ledgers.csv");
-      final URL ledgersUri = ledgersResource.getURL();
-      ledgerImporter.importCSV(ledgersUri);
+      final URL ledgersUrl = ClassLoader.getSystemResource("standardChartOfAccounts/ledgers.csv");
+      ledgerImporter.importCSV(ledgersUrl);
       Assert.assertTrue(this.eventRecorder.wait(POST_LEDGER, LOAN_INCOME_LEDGER));
 
       final AccountImporter accountImporter = new AccountImporter(ledgerManager.api(), logger);
-      final ClassPathResource accountsResource = new ClassPathResource("accounts.csv");
-      final URL accountsUri = accountsResource.getURL();
-      accountImporter.importCSV(accountsUri);
+      final URL accountsUrl = ClassLoader.getSystemResource("standardChartOfAccounts/accounts.csv");
+      accountImporter.importCSV(accountsUrl);
       Assert.assertTrue(this.eventRecorder.wait(POST_ACCOUNT, "9330"));
 
       identityManager.api().logout();
diff --git a/src/main/resources/accounts.csv b/src/main/resources/accounts.csv
deleted file mode 100644
index d2ac4bd..0000000
--- a/src/main/resources/accounts.csv
+++ /dev/null
@@ -1,79 +0,0 @@
-parentIdentifier,identifier,name
-1100,1101,"Interest on Business Loans"
-1100,1102,"Interest on Agriculture Loans"
-1100,1103,"Interest on Consumer Loans"
-1100,1104,"Interest on Savings Secured"
-1100,1105,"Interest on Other Member Loans"
-1100,1120,"Interest on Lines of Credit"
-1100,1121,"Interest on Credit Cards"
-1100,1140,"Interest on Real Estate Loans"
-1100,1190,"Interest Refunds"
-1200,1210,"Income from Government Investments"
-1200,1220,"Income from Govenment Agency Securities"
-1200,1230,"Income from Savings/Deposits/Certificates"
-1200,1290,"Income from Other Investments"
-1300,1310,"Loan Origination Fees"
-1300,1311,"Loan Late Payment Fee"
-1300,1320,"Loan Refinance Fee"
-1300,1390,"Other Loan Fee"
-2800,2820,"Collection Expenses"
-2800,2830,"Recording Fees—Chattel Lien Insurance"
-2800,2840,"Credit Reports"
-2800,2850,"Refunds—Real Estate Service Charges"
-2800,2860,"Credit Card Program Expenses"
-2800,2870,"Service Fees on Loans Purchased"
-2800,2890,"Other Loan Servicing Expenses"
-3000,3010,"Provision for Loan Losses—Consumer Loans"
-3000,3020,"Provision for Loan Losses—Lines of Credit"
-3000,3030,"Provision for Loan Losses—Real Estate Loans"
-3000,3040,"Provision for Loan Losses—Other Loans"
-3000,3090,"Other Provision for Losses"
-3100,3110,"Saving Insurance"
-3100,3120,"Life Savings Insurance"
-3100,3130,"Borrowers' Insurance"
-3100,3190,"Other Members' Insurance"
-3800,3801,"Share Dividend"
-3800,3810,"Regular Saving Interest"
-3800,3820,"Checking Interest"
-3800,3830,"Club Account Interest"
-3800,3840,"Saving Certificate Interest"
-3800,3890,"Other Interest Expense"
-7000,7011,"Commercial Loans"
-7000,7012,"Agriculture Loans"
-7000,7013,"Consumer Loans"
-7000,7014,"Other Member Loans"
-7000,7015,"Home Equity Loans"
-7000,7021,"Lines of Credit to Members—Credit Cards"
-7000,7022,"Lines of Credit—Cash Advances in Process"
-7000,7023,"Net Origination Fees (Costs)—Lines of Credit"
-7000,7024,"Net Commitment Fees (Costs)—Lines of Credit"
-7000,7031,"Net Origination Fees (Costs)"
-7000,7070,"Loans—Collateral in Process of Liquidation"
-7300,7310,"Bank account one"
-7300,7311,"Bank account two"
-7300,7312,"Petty Cash"
-7300,7351,"Vault Cash"
-7300,7352,"Teller One"
-7300,7353,"Teller Two"
-7300,7353,"Teller Three"
-7800,7810,"Accrued Interest on Loans"
-7800,7820,"Accrued Income on Investments"
-7800,7830,"Accrued Credit Card Income"
-7800,7890,"Other Accrued Income"
-8200,8201,"Dividends Payable on Shares"
-8200,8202,"Interest Payable on Savings"
-8200,8203,"Interest Payable on Club Accounts"
-8200,8207,"Interest Payable on Other Accounts"
-8400,8410,"VAT Taxes payable"
-8400,8420,"Withholding taxes payable"
-8400,8490,"Other Taxes Payable"
-8500,8540,"Accrued Dividends Payable"
-8500,8550,"Accrued Interest Payable"
-8500,8590,"Other Accrued Expenses"
-9000,9010,"Share Account"
-9000,9020,"Savings"
-9000,9030,"Club Accounts"
-9000,9040,"Other Savings"
-9300,9310,"Regular Reserves"
-9300,9320,"Special Reserve for Losses"
-9300,9330,"Other Reserves"
\ No newline at end of file
diff --git a/src/main/resources/ledgers.csv b/src/main/resources/ledgers.csv
deleted file mode 100644
index ec641d7..0000000
--- a/src/main/resources/ledgers.csv
+++ /dev/null
@@ -1,53 +0,0 @@
-parentIdentifier,identifier,description,type,show
-,1000,"Income",REVENUE,true
-1000,1100,"Income from Loans",REVENUE,true
-1000,1200,"Investment Income",REVENUE,true
-1000,1300,"Fees and Charges",REVENUE,true
-1000,1400,"Gain (Loss) on Sale of Loans",REVENUE,true
-1000,1500,"Miscellaneouse Income",REVENUE,true
-1000,1600,"Service Income on Loans",REVENUE,true
-1000,1700,"Trading Profits & Losses",REVENUE,true
-,2000,"Expenses",EXPENSE,true
-2000,2100,"Employee Compensation",EXPENSE,true
-2000,2200,"Employee Benefits",EXPENSE,true
-2000,2300,"Travel and Conference Expenses",EXPENSE,true
-2000,2400,"Association Dues",EXPENSE,true
-2000,2500,"Office Occupancy Expenses",EXPENSE,true
-2000,2600,"Office Operations Expenses",EXPENSE,true
-2000,2700,"Educational and Promotional Expenses",EXPENSE,true
-2000,2800,"Loan Servicing Expenses",EXPENSE,true
-2000,2900,"Professional and Outside Services",EXPENSE,true
-2000,3000,"Provision for Loan Losses",EXPENSE,true
-2000,3100,"Member Insurance",EXPENSE,true
-2000,3220,"Federal Operating Fee",EXPENSE,true
-2000,3300,"Cash Over and Short",EXPENSE,true
-2000,3400,"Interest on Borrowed Money",EXPENSE,true
-2000,3550,"Annual Meeting Expenses",EXPENSE,true
-2000,3700,"Miscellaneous Operating Expenses",EXPENSE,true
-2000,3800,"Interest (Dividend) Expense",EXPENSE,true
-,7000,"Assets",ASSET,true
-7000,7010,"Loans to Members",ASSET,true
-7000,7020,"Lines of Credit to Members",ASSET,true
-7000,7030,"Real Estate Loans",ASSET,true
-7000,7100,"Other Loans",ASSET,true
-7000,7200,"Other Receivables",ASSET,true
-7000,7300,"Cash Accounts",ASSET,true
-7000,7350,"Change Fund",ASSET,true
-7000,7400,"Investments",ASSET,true
-7000,7420,"Federal Agency Securities",ASSET,true
-7000,7500,"Investments—Investment Allowance",ASSET,true
-7000,7600,"Prepaid Expenses and Deferred Charges",ASSET,true
-7000,7700,"Fixed Assets",ASSET,true
-7000,7800,"Accrued Income",ASSET,true
-7000,7900,"Other Assets",ASSET,true
-,8000,"Accounts Payable",LIABILITY,true
-8000,8100,"Accounts Payable",LIABILITY,true
-8000,8200,"Interest Payable",LIABILITY,true
-8000,8400,"Taxes Payable",LIABILITY,true
-8000,8500,"Accrued Expenses",LIABILITY,true
-,9000,"Equity",EQUITY,true
-9000,9100,"Member Savings",EQUITY,true
-9000,9300,"Reserves",EQUITY,true
-9000,9400,"Undivided Earnings",EQUITY,true
-9000,9550,"Donated Equity",EQUITY,true
-9000,9560,"Net Income (Loss)",EQUITY,true
\ No newline at end of file