Ledger.pm
This module will start with the ledger summary screen as the display. It will have links to other ledger specific actions as well.
These are standard forms that a page in the accounting application will use: mainForm, menuForm, optionsForm
The main frameset should title the document with the Ledger Name. Each screen should title its document with the screen name.
Will use the HTMLObject::Normal and HTMLObject::ReadCookie modules
Commands:
display - ledger summary screen
closeOut
reOpen
ledgerFrame - creates the frameset. If a windowName is given, it will register that wndow name with the portal.
ledgerMenu
editLedger
createLedger
saveLedger
deleteLedger
Details:
display - ledger summary screen
Will use DB::Main.pm to replace reports.pm methods - some routines will need to be added, etc.
getLedgerCode(ledgerDB)
doesSystemBalance(fromDate, toDate)
findInvalidEntries(fromDate, toDate)
getAccountBalances(@cashAccounts, date)
getAccountTypeNames(@accountTypeNums)
getAccountTypeBalances(@accountTypeNums, date)
getAccountsOfType(type, ledgerCode)
getLastTransactionDate(account, ledgerCode)
A commify routine will be required
editLedger/createLedger - The Edit/Create Ledger screen will be one method editCreateLedger and based upon the command (edit or create) will set the defaults to correct items, etc. Then submits to saveLedger.
This code will add a whole year (potentially called the "fake fiscal year") before the year provided to start the books of the accounting system. This "fake fiscal year" will act exactly as any other year except that specific routines (including inserting Buy investment transactions and entering Initial Balances) will be coded to check for the smallest fiscal year in the known years table. This "fake fiscal year" will be closed out immediately during the process of creating a new ledger.
ledgerFrame: When a ledger window is opened, a frameset will be created by the Ledger module. From the main menu screen, clicking the open button will use javascript to open a new window with random name and submit to
index.cgi?app=XIWA
&state=Main
&command=LedgerFrame
&ledgerCode=
&ledgerName=
&windowName={randomValue}
[ &topURL=""&bottomURL="" ]
This submission will
register the window name with the portal
output the frameset with the optional URLs or the defaults screens LedgerMenu and LedgerSummary.
The top frame will be named after the window name i.e. {random}Menu. It will generally have a navigation menu and other static elements. The bottom frame, {random}Data, will generally be the working area for the user.
ledgerMenu - displays the dropdown menu, help button, and other common formatting options, as well as Close icon (BIG X on top right) and New checkbox.
When the user wants to open a new LedgerFrame from the current LedgerFrame: click the new checkbox and choose from the drop down menu where to go. Otherwise choosing the menu item submits to the bottom frame.
We should have a "GET" link that can be clicked quickly to open a new window to the summary screen. It could be middle clicked to open in a new window. That would be tricky because it would not have a random name...
Links
Fiscal Year Open/Close
Ledger Configuration (Accounts, SubAccounts, etc.)
New Transaction link
Federal Deposit link
Power & Quick Search links
Evenutally this will be user defineable(Build your own start page!)
Initial Balances InitialBalances.pm only available before first close-outs
import data: QIFImport.pm only available before first close-outs
Other screens
Create New Ledger Configuration screen
Edit Ledger Configuration screen
Delete Ledger Confirmation screen
import data: QIFImport.pm
when data is imported it is assumed that this data is for the beginning of using the system and the working year should be set to the earliest year in order to import
Ledger Procedures
ReOpen year
year must be in known years tb and be closed.
take ending balances out of acct_bal_tb for that year
Close Out
Check for company type
Present user options based on type:
Types 0, 2, 4
Ask user "Which equity account should be used for income summary calculations?"
"Note: Income summary is Revenues minus Expenses minus Dividends Declared/Paid."
User should pick an Equity account (type 7) from drop down.
Simply use that account for result.
Type 1
Ask user "Which equity accounts (partner equity) should be used for income summary calculations?"
"Note: Income summary is Revenues minus Expenses minus Dividends Declared/Paid."
"Retained Earnings results will be divided equally among the partners (accounts)."
User should pick at least two Equity accounts (type 7) from multi-select.
Divide the income summary result by the number of accounts picked and update each.
Type 3
Ask user "Which equity accounts (shareholder equity) should be used for income summary calculations?"
"Note: Income summary is Revenues minus Expenses minus Dividends Declared/Paid."
"Retained Earnings results will be divided among the shareholders (accounts)."
User should pick at least two Equity accounts (type 7) from multi-select.
Next screen should ask:
"How much percentage goes to each shareholder?"
The accounts should be listed with edit fields. All should be filled in with numbers greater than 0, less than 100. All added together should equal 100.
Divide the results among shareholder accounts. Ask the user what to do with leftovers fractional cents. 100.00 / 3 = 33.33 *3 + .01
+income summary - implemented using stored procedures and SQL
sum all accts beginning with 4 from last close out to this one
all beginning with 5 from last close out to this one
all dividends out from last close out to this one
sum of 4 minus sum of 5 minus Dividends Out
Add this number to user specified Equity Acct balance and update the records in bal_tb
+check to make sure the next fiscal year is not already known
+calculate if needed qtr dates and enter them into working year. And known years tb.
When year report is run the correct activity will show because only bal_tb was affected.
HTML output all jumbled up and no real cookie support
The 4 actions were not methodized, just a big if-then-else block
Used reports.pm as the library of database independant access methods to get lists of accounts, etc.
Display Ledger Summary screen
Create New Ledger
Edit Ledger Options
Delete Ledger confirmation screen
Copyright (c) 2002 Xperience, Inc.
Permission is granted to
copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.1; A copy of the license is
available at http://www.gnu.org/licenses/licenses.html#FDL.
Updated: $Id: Ledger.html,v 1.8 2002/05/14 21:11:59 pattieja Exp $