The order of the script files is important. I have them in the following order, although it's not the only possibility:
Main, AssetTracker, Error, Validation, WriteReports, ProcessLedger, UpdateAssetPrices, AssetApi, Asset, AssetRecord, LedgerRecord, InflationRecord, Wallet, FiatAccount, AssetAccount, Lot, ClosedLot, IncomeLot, SheetHelper, AssetsSheet, LedgerSheet, FiatAccountsSheet, OpenReport, ClosedReport, IncomeReport, ChartsDataSheet, OpenSummaryReport, ClosedSummeryReport, IncomeSummaryReport, DonnationsSummaryReport, WalletsReport, InvestmentDataSheet, InvestmentReport, SettingsDialog