summaryrefslogtreecommitdiff
path: root/doc/manual/LedgerSMB-manual.tex
blob: f8d7a2e56b244ed9b22c44e4d092b2028fea3101 (plain)
  1. %% LyX 1.4.2 created this file. For more info, see http://www.lyx.org/.
  2. %% Do not edit unless you really know what you are doing.
  3. \documentclass[english]{article}
  4. \usepackage[T1]{fontenc}
  5. \usepackage[latin1]{inputenc}
  6. \IfFileExists{url.sty}{\usepackage{url}}
  7.                       {\newcommand{\url}{\texttt}}
  8. \newcommand{\version}{1.2}
  9. \makeatletter
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
  11. \providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
  12. %% Bold symbol macro for standard LaTeX users
  13. \providecommand{\boldsymbol}[1]{\mbox{\boldmath $#1$}}
  14. %% Because html converters don't know tabularnewline
  15. \providecommand{\tabularnewline}{\\}
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
  17. \usepackage{metatron}
  18. \renewcommand{\abstractname}{Executive Summary}
  19. \newcommand{\mycustomer}[1][]{#1\space}
  20. \newcommand{\myproject}[1][]{#1\space}
  21. \title{Ledger-SMB Manual v. \version}
  22. \author{The LedgerSMB Core Team}
  23. \date{\today}
  24. \usepackage{babel}
  25. \makeatother
  26. \begin{document}
  27. \maketitle
  28. Copyright \copyright 2006 The LedgerSMB Core Team. Permission
  29. is granted to copy, distribute and/or modify this document under the
  30. terms of the GNU Free Documentation License, Version 1.2 or any later
  31. version published by the Free Software Foundation; with no Invariant
  32. Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of
  33. the license is included in the section entitled \char`\"{}GNU Free
  34. Documentation License\char`\"{} (Appendix \ref{fdl}).
  35. \tableofcontents{}
  36. \listoffigures
  37. \clearpage
  38. \part{Ledger-SMB and Business Processes}
  39. \section{Introduction to Ledger-SMB}
  40. \subsection{Why Ledger-SMB}
  41. \subsubsection{Advantages of Ledger-SMB}
  42. \begin{itemize}
  43. \item Flexibility and Central Management
  44. \item Accessibility over the Internet (for some users)
  45. \item Relatively open data format
  46. \item Integration with other tools
  47. \item Excellent accounting options for Linux users
  48. \item Open Source
  49. \item Flexible, open framework that can be extended or modified to fit
  50. your business.
  51. \item Security-conscious development community.
  52. \end{itemize}
  53. \subsubsection{Key Features}
  54. \begin{itemize}
  55. \item Accounts Receivable
  56. \begin{itemize}
  57. \item Track sales by customer
  58. \item Issue Invoices, Statements, Receipts, and more
  59. \item Do job costing and time entry for customer projects
  60. \item Manage sales orders and quotations
  61. \item Ship items from sales orders
  62. \end{itemize}
  63. \item Accounts Payable
  64. \begin{itemize}
  65. \item Track purchases and debts by vendor
  66. \item Issue RFQ's Purchase Orders, etc.
  67. \item Track items received from purchase orders
  68. \end{itemize}
  69. \item Budgeting
  70. \begin{itemize}
  71. \item Track expenditures and income across multiple departments
  72. \item Track all transactions across departments
  73. \end{itemize}
  74. \item Check Printing
  75. \begin{itemize}
  76. \item Customize template for any check form
  77. \end{itemize}
  78. \item General Ledger
  79. \item Inventory Management
  80. \begin{itemize}
  81. \item Track sales and orders of parts
  82. \item Track cost of goods sold using First In/First Out method
  83. \item List all parts below reorder point
  84. \item Track ordering requirements
  85. \item Track, ship, receive, and transfer parts to and from multiple warehouses
  86. \end{itemize}
  87. \item Localization
  88. \begin{itemize}
  89. \item Provide Localized Translations for Part Descriptions
  90. \item Provide Localized Templates for Invoices, Orders, Checks, and more
  91. \item Select language per customer, invoice, order, etc.
  92. \end{itemize}
  93. \item Manufacturing
  94. \begin{itemize}
  95. \item Track cost of goods sold for manufactured goods (assemblies)
  96. \item Create assemblies and stock assemblies, tracking materials on hand
  97. \end{itemize}
  98. \item Multi-company/Multiuser
  99. \begin{itemize}
  100. \item One isolated database per company
  101. \item Users can have localized systems independent of company data set
  102. \end{itemize}
  103. \item Point of Sale
  104. \begin{itemize}
  105. \item Run multiple cash registers against main Ledger-SMB installation
  106. \item Suitable for retail stores and more
  107. \item Credit card processing via TrustCommerce
  108. \item Supports some POS hardware out of the box including:
  109. \begin{itemize}
  110. \item Logic Controls PD3000 pole displays (serial or parallel)
  111. \item Basic text-based receipt printers
  112. \item Keyboard wedge barcode scanners
  113. \item Keyboard wedge magnetic card readers
  114. \item Printer-attached cash drawers
  115. \end{itemize}
  116. \end{itemize}
  117. \item Price Matrix
  118. \begin{itemize}
  119. \item Track different prices for vendors and customers across the board
  120. \item Provide discounts to groups of customers per item or across the board
  121. \item Store vendors' prices independent of the other last cost in the parts
  122. record
  123. \end{itemize}
  124. \item Reporting
  125. \begin{itemize}
  126. \item Supports all basic financial statements
  127. \item Easily display customer history, sales data, and additional information
  128. \item Open framework allows for ODBC connections to be used to generate
  129. reports using third party reporting tools.
  130. \end{itemize}
  131. \item Tax
  132. \begin{itemize}
  133. \item Supports Retail Sales Tax and Value Added Tax type systems
  134. \item Flexible framework allows one to customize reports to change the tax
  135. reporting framework to meet any local requirement.
  136. \end{itemize}
  137. \end{itemize}
  138. \subsection{Limitations of Ledger-SMB}
  139. \begin{itemize}
  140. \item No payroll module (Payroll must be done manually)
  141. \item Some integration limitations
  142. \item Further development/maintenance requires a knowledge of a relatively
  143. broad range of technologies
  144. \end{itemize}
  145. \subsection{System Requirements of Ledger-SMB}
  146. \begin{itemize}
  147. \item PostgreSQL
  148. \item A CGI-enabled Web Server (for example, Apache)
  149. \item Perl 5.8.x
  150. \item An operating system which supports the above software (usually Linux,
  151. though Windows, MacOS X, etc. do work)
  152. \item \LaTeX{}\ (optional) is required to create PDF or Postscript invoices
  153. \item The following CPAN modules:
  154. \begin{itemize}
  155. \item Data::Dumper
  156. \item Locale::Maketext
  157. \item Locale::Maketext::Lexicon
  158. \item MIME::Base64
  159. \item Digest::MD5
  160. \item HTML::Entities
  161. \item DBI
  162. \item DBD::Pg
  163. \item Math::BigFloat
  164. \item IO::File
  165. \item Encode
  166. \item Locale::Country
  167. \item Locale::Language
  168. \item Time::Local
  169. \item Cwd
  170. \item Config::Std
  171. \item MIME::Lite
  172. \end{itemize}
  173. \end{itemize}
  174. \section{User Account and Database Administration Basics}
  175. These functions are accessed via the admin.pl script in the
  176. installed directory of Ledger-SMB.
  177. \subsection{Companies and Datasets}
  178. Ledger-SMB stores its information in locale-specific data sets. When
  179. a dataset is created, it sets various defaults such as currency, a
  180. basic chart of accounts setup, and so forth. Note that the default
  181. setup is for Canada, where the author of the software resides.
  182. Datasets are stored as PostgreSQL databases. The application
  183. is designed with the idea that each dataset will represent exactly
  184. one company. If a customer is working with multiple companies, he/she
  185. must create a dataset to for each.
  186. When creating a dataset, the application asks for both a username and a
  187. superusername. If the superuser's information is not filled in, Ledger-SMB will
  188. attempt to populate an existing dataset, but if this information is filled in,
  189. the progam will log into the PostgreSQL cluster with the superusername and
  190. password, create the database, and attempt to add Plpgsql to it.
  191. \subsection{How to Create a User}
  192. Users are created by going to the admin.pl page and clicking on \char`\"{}Add
  193. User.\char`\"{} One then fills out the form and when it is saved,
  194. the user is created.
  195. \subsection{Permissions}
  196. The permissions system is not rigorously enforced within Ledger-SMB,
  197. in the sense that the permissions API is generally not used in the
  198. application itself. Instead permissions are used to enable/disable
  199. menu options. Setting an enforcement of such permissions would require
  200. some custom programming at the present time. Most organizations, however,
  201. find that the current system is adequate.
  202. The checkboxes which are marked enable menu entries. Those that are
  203. unchecked disable those entries on the menu.
  204. \subsection{User Account Types}
  205. \begin{itemize}
  206. \item User is a general user of the system
  207. \item Managers often are able to see a larger amount of data
  208. \item Administrators have full access to the system
  209. \end{itemize}
  210. \subsection{Other Features}
  211. \begin{itemize}
  212. \item Lock System allows one to lock users out of the system while maintenance
  213. is performed. This is only necessary during upgrades or maintenance
  214. which results in the RDBMS being offline.
  215. \item Change Admin Password changes the administrative password.
  216. \item Logout terminates the admin session.
  217. \end{itemize}
  218. \section{Chart of Accounts}
  219. The Chart of Accounts provides a basic overview of the logical structure
  220. of the accounting program. One can customize this chart to allow for
  221. tracking of different sorts of information.
  222. \subsection{Introduction to Double Entry Bookkeeping}
  223. In order to set up your chart of accounts in LedgerSMB you will need to
  224. understand a bit about double entry bookkeeping. This section provides a
  225. brief overview of the essential concepts. There is a list of references
  226. for further reading at the end.
  227. \subsubsection{Business Entity}
  228. You don't want to mix your personal expenses and income with that of the
  229. business or you will not be able to tell how much money it is making (if
  230. any). For the same reason you will want to keep track of how much money
  231. you put into and take out of the business so you will want to set up a
  232. completely seperate set of records for it and treat it almost as if it had
  233. a life of its own.
  234. \subsubsection{Double Entry}
  235. Examples:
  236. \begin{itemize}
  237. \item When you buy you pay money and receive goods.
  238. \item When you sell you get money and give goods.
  239. \item When you borrow you get money and give a promise to pay it back.
  240. \item When you lend you give money and get a promise to pay it back.
  241. \item When you sell on credit you give goods and get a promise to pay.
  242. \item When you buy on credit you give a promise to pay and get goods.
  243. \end{itemize}
  244. You need to record both sides of each transaction: thus double entry.
  245. Furthermore, you want to organize your entries, recording those having to
  246. do with money in one place, value of goods bought and sold in another,
  247. money owed in yet another, etc. Hence you create accounts, and record each
  248. half of each transaction in an appropriate account. Of course, you won't
  249. have to actually record the amount in more than one place yourself: the
  250. program takes care of that.
  251. \subsubsection{Accounts}
  252. \begin{description}
  253. \item[Assets] Valuable stuff the business owns such as money and
  254. goods available for sale
  255. \item[Liabilities] Debts owned by the business such as bank loans and unpaid
  256. bills
  257. \item[Equity or Capital] What would be left for the owner if all the assets were
  258. converted to money and all the liabilities paid off ("Share Capital" on the
  259. LedgerSMB default chart of accounts: not to be confused with "Capital Assets".)
  260. \item[Revenue] Income from business activity: increases Equity
  261. \item[Expense] The light bill, the cost of goods sold, etc: decreases Equity
  262. \end{description}
  263. All other accounts are subdivisions of these. The relationship between the
  264. top-level accounts is often stated in the form of the Accounting Equation
  265. (don't worry: you won't have to solve it):
  266. Assets = Liabilities + Equity + (Revenue - Expense)
  267. You won't actually use this equation while doing your bookkeeping, but it's
  268. a useful tool for understanding how the system works.
  269. \subsubsection{Debits and Credits}
  270. Traditional paper accounting systems used a two-column form in which all
  271. increases went in one column and all deceases in the other. For asset and
  272. expense accounts increases went in the left column and decreases in the
  273. right. For liability and capital accounts decreases went in the left
  274. column and increases in the right. Looking at the accounting equation we
  275. see that assets are on the left, so it is logical that asset increases
  276. would go on the left. Libilities, capital, and revenue are on the right so
  277. it is logical that their increase would go on the right. Expenses,
  278. however, are on the right, so why do their increases go on the left?
  279. Because expenses are subtracted from the right side of the equation and so
  280. expense increases decrease the right side of the equation.
  281. Entries in the left column of the traditional form are called debits, while
  282. entries on the right are called credits. Neither is "negative".
  283. \begin{itemize}
  284. \item Debits increase assets
  285. \item Debits increase expense
  286. \item Credits increase liabilities
  287. \item Credits increase capital
  288. \item Credits increase revenue
  289. \end{itemize}
  290. Examples:
  291. You go to the bank and make a deposit. The teller tells you that he is
  292. going to credit your account. This is correct: your account is money the
  293. bank owes you and so is a liability from their point of view. Your deposit
  294. increased this liability and so they will credit it. They will make an
  295. equal debit to their cash account. When you return you will debit your
  296. bank deposits account because you have increased that asset and credit cash
  297. on hand because you have decreased that one.
  298. \subsubsection{Accrual}
  299. You deliver some goods to a customer and give him the bill which, as
  300. agreed, he promises to pay within 90 days. You record the sale as
  301. completed, debiting the customer's account in Accounts Payable (an asset
  302. account) for the amount due. This is accrual. Later, when the payment
  303. comes, you credit his account and debit cash. You purchase some goods on
  304. credit, taking delivery and promising to pay within 90 days. You debit
  305. inventory (an asset account) and credit the supplier's account in Accounts
  306. Payable (a Liability account). This is also accrual. Later, when you pay
  307. the bill, you credit cash and debit the supplier's account. Accrual just
  308. means recognizing and recording transactions when they actually occur
  309. rather than waiting until cash changes hands.
  310. You won't have to think about most of this stuff while doing your
  311. bookkeeping with LedgerSMB, but understanding it will help you set up your
  312. accounts, handle unusual situations, and understand the reports. If you
  313. need to learn more about double entry bookkeeping see the following
  314. references or consult an accountant.
  315. \subsubsection{References}
  316. \url{http://www.accounting-and-bookkeeping-tips.com/learning-accounting/accounting-basics-credit.htm}\\
  317. Discussion of debits and credits as well as links to other accounting subjects.\\
  318. \noindent \url{http://www.computer-consulting.com/accttips.htm}\\
  319. Discussion of double entry bookkeeping.\\
  320. \noindent \url{http://www.minnesota.com/~tom/sql-ledger/howtos/}\\
  321. A short glossary, some links, and a FAQ (which makes the "credit=negative
  322. number" error). The FAQ focuses on SQL-Ledger, LedgerSMB's ancestor.\\
  323. \noindent \url{http://bitscafe.com/pub2/etp/sql-ledger-notes\#expenses}\\
  324. Some notes on using SQL-Ledger (LedgerSMB's ancestor).\\
  325. \noindent \url{http://en.wikipedia.org/wiki/List\_of\_accounting\_topics}\\
  326. Wikipedia articles on accounting.\\
  327. \noindent \url{http://www.bized.ac.uk/learn/accounting/financial/index.htm}\\
  328. Basic accounting tutorial.\\
  329. \noindent \url{http://www.asset-analysis.com/glossary/glo\_index.html}\\
  330. Financial dictionary and glossary.\\
  331. \noindent \url{http://www.geocities.com/chapleaucree/educational/FinanceHandbook.html}\\
  332. Financial glossary.\\
  333. \noindent \url{http://www.quickmba.com/accounting/fin/}\\
  334. Explanation of fundamentals of accounting, including good discussions
  335. of debits and credits and of double-entry.
  336. \subsection{General Guidelines on Numbering Accounts}
  337. In general, most drop-down boxes in Ledger-SMB order the accounts
  338. by account number. Therefore by setting appropriate account numbers,
  339. one can affect the default values.
  340. A second consideration is to try to keep things under each heading
  341. appropriate to that heading. Thus setting an account number for a
  342. bank loan account in the assets category is not generally advisable.
  343. \subsection{Adding/Modifying Accounts}
  344. These features are listed under System-\textgreater Chart of Accounts.
  345. One can list the accounts and click on the account number to modify
  346. them or click on the \char`\"{}add account\char`\"{} option to create
  347. new accounts.
  348. \begin{itemize}
  349. \item Headings are just broad categories and do not store values themselves,
  350. while accounts are used to store the transactional information.
  351. \item One cannot have an account that is a summary account (like AR)
  352. and also has another function.
  353. \item GIFI is mostly of interest to Canadian customers but it can be used
  354. to create reports of account hierarchies.
  355. \end{itemize}
  356. \subsection{Listing Account Balances and Transactions}
  357. One can list the account balances via the Reports-\textgreater Chart
  358. of Accounts report. Clicking on the account number will provide a
  359. ledger for that account.
  360. \section{Administration}
  361. This section covers other (non-Chart of Accounts) aspects to the
  362. setup of the Ledger-SMB accounting package. These are generally accessed
  363. in the System submenu.
  364. \subsection{Taxes, Defaults, and Preferences}
  365. \subsubsection{Adding A Sales Tax Account}
  366. Sales Tax is collected on behalf of a state or national government
  367. by the individual store. Thus a sales tax account is a liability--
  368. it represents money owed by the business to the government.
  369. To add a sales tax account, create an account in the Chart of Accounts
  370. as a liability account, check all of the \char`\"{}tax\char`\"{} checkboxes,
  371. and answer the following question as \char`\"{}yes:\char`\"{}
  372. \char`\"{}Include this account on the customer/vendor forms to flag
  373. customer/vendor as taxable?\char`\"{}
  374. Once this account is created, one can set the tax amount.
  375. \subsubsection{Setting a Sales Tax Amount}
  376. Go to System-\textgreater Defaults and the tax account will be listed
  377. near the bottom of the page. The rate can be set there.
  378. \subsubsection{Default Account Setup}
  379. These accounts are the default accounts for part creation and foreign
  380. exchange tracking.
  381. \subsubsection{Currency Setup}
  382. The US accounts list this as USD:CAD:EUR. One can add other currencies
  383. in here, such as IDR (Indonesian Rupiah), etc. Currencies are separated
  384. by colons.
  385. \subsubsection{Sequence Settings}
  386. These sequences are used to generate user identifiers for quotations,
  387. invoices, and the like. If an identifier is not added, the next number
  388. will be used.
  389. A common application is to set invoices, etc. to start at 1000 in
  390. order to hide the number of issued invoices from a customer.
  391. Leading zeros are preserved. Other special values which can be embedded using
  392. $<$?lsmb ?$>$ tags include:
  393. \begin{description}
  394. \item[DATE] expands to the current date
  395. \item[YYMMDD] expands to a six-digit version of the date. The components of
  396. this date can be re-arranged in any order, so MMDDYY, DDMMYY,
  397. or even just MMYY are all options.
  398. \item[NAME] expands to the name of the customer or vendor
  399. \item[BUSINESS] expands to the type of business assigned to the customer or
  400. ventor.
  401. \item[DESCRIPTION] expands to the description of the part. Valid only for parts.
  402. \item[ITEM] expands to the item field. Valid only for parts.
  403. \item[PARTSGROUP] expands to the partsgroup. Valid only for parts.
  404. \item[PHONE] expands to the telephoen number for customers and vendors.
  405. \end{description}
  406. \subsection{Audit Control}
  407. Auditability is a core concern of the architects of any accounting
  408. system. Such ensures that any modification to the accounting information
  409. leaves a trail which can be followed to determine the nature of the
  410. change. Audits can help ensure that the data in the accounting system
  411. is meaningful and accurate, and that no foul play (such as embezzlement)
  412. is occurring.
  413. \subsubsection{Explaining transaction reversal}
  414. In paper accounting systems, it was necessary to have a means to authoritatively
  415. track corrections of mistakes. The means by which this was done was
  416. known as \char`\"{}transaction reversal.\char`\"{}
  417. When a mistake would be made, one would then reverse the transaction
  418. and then enter it in correctly. For example, let us say that an office
  419. was renting space for \$300 per month. Let us say that they inadvertently
  420. entered it in as a \$200 expense.
  421. The original transaction would be:
  422. \begin{tabular}{l|r|r}
  423. Account &
  424. Debit &
  425. Credit \tabularnewline
  426. \hline
  427. 5760 Rent &
  428. \$200 &
  429. \tabularnewline
  430. 2100 Accounts Payable &
  431. &
  432. \$200\tabularnewline
  433. \end{tabular}
  434. The reversal would be:
  435. \begin{tabular}{l|r|r}
  436. Account &
  437. Debit &
  438. Credit \tabularnewline
  439. \hline
  440. 5760 Rent &
  441. &
  442. \$200\tabularnewline
  443. 2100 Accounts Payable &
  444. \$200 &
  445. \tabularnewline
  446. \end{tabular}
  447. This would be followed by re-entering the rent data with the correct
  448. numbers. This was meant to ensure that one did not erase data from
  449. the accounting books (and as such that erasing data would be a sign
  450. of foul play).
  451. Ledger-SMB has a capability to require such reversals if the business
  452. deems this to be necessary. When this option is enabled, existing
  453. transactions cannot be modified and one will need to post reversing
  454. transactions to void existing transactions before posting corrected
  455. ones.
  456. Most accountants prefer this means to other audit trails because it
  457. is well proven and understood by them.
  458. \subsubsection{Close books option}
  459. You cannot alter a transaction that was entered before the closing date.
  460. \subsubsection{Audit Trails}
  461. This option stores additional information in the database to help
  462. auditors trace individual transactions. The information stored, however,
  463. is limited and it is intended to be supplemental to other auditing
  464. facilities.
  465. The information added includes which table stored the record, which
  466. employee entered the information, which form was used, and what the
  467. action was. No direct financial information is included.
  468. \subsection{Departments}
  469. Departments are logical divisions of a business. They allow for budgets
  470. to be prepared for the individual department as well as the business
  471. as a whole. This allows larger businesses to use Ledger-SMB to meet
  472. their needs.
  473. \subsubsection{Cost v Profit Centers.}
  474. In general business units are divided into cost and profit centers.
  475. Cost centers are generally regarded as business units where the business
  476. expects to lose money and profit centers are where they expect to
  477. gain money. For example, the legal department in most companies is
  478. a cost center.
  479. One of the serious misunderstandings people run up against is that
  480. Ledger-SMB tends to more narrowly define cost and profit centers than
  481. most businesses do. In Ledger-SMB a cost center is any department
  482. of the business that does not issue AR transactions. Although many
  483. businesses may have cost centers (like technical support) where customer
  484. fees may subsidize the cost of providing the service, in Ledger-SMB,
  485. these are profit centers.
  486. Ledger-SMB will not allow cost centers to be associated with AR transactions.
  487. So if you want this functionality, you must create the department
  488. as a profit center.
  489. \subsection{Warehouses}
  490. Ledger-SMB has the ability to track inventory by warehouse. Inventory
  491. items can be moved between warehouses, and shipped from any warehouse
  492. where the item is in stock. We will explore this concept more later.
  493. \subsection{Languages}
  494. Languages allow for goods and services to be translated so that one
  495. can maintain offices in different countries and allow for different
  496. goods and service descriptions to be translated to different languages
  497. for localization purposes.
  498. \subsection{Types of Businesses}
  499. One can create types of businesses and then give them discounts across
  500. the board. For example, one might give a firm that uses one's services
  501. as a subcontractor a 10\% discount or more.
  502. \subsection{Misc.}
  503. \subsubsection{GIFI}
  504. GIFI is a requirement for Canadian customers. This feature allows
  505. one to link accounts with Canadian tax codes to simplify the reporting
  506. process. Some European countries now use a similar system.
  507. People that don't otherwise have a use for GIFI can use it to create reports
  508. which agregate accounts together.
  509. \subsubsection{SIC}
  510. Standard Industrial Classification is a way of tracking the type of
  511. business that a vendor or customer is in. For example, an accountant
  512. would have an SIC of 8721 while a graphic design firm would have an
  513. SIC of 7336. The classification is hierarchical so one could use this
  514. field for custom reporting and marketing purposes.
  515. \subsubsection{Overview of Template Editing}
  516. The templates for invoices, orders, and the like can be edited from
  517. within Ledger-SMB. The submenus within the System submenu such as
  518. HTML Templates, Text Templates and \LaTeX{} templates provide access
  519. to this functionality.
  520. \subsubsection{Year-end}
  521. Although the Year-end functionality in Ledger-SMB is very useful,
  522. it does not entirely make the process simple and painless. One must
  523. still manually enter adjustments prior to closing the books. The extent
  524. to which these adjustments are necessary for any given business is
  525. a matter best discussed with an accountant.
  526. The standard way books are normally closed at the end of the year
  527. is by moving all adjusted%
  528. \footnote{Adjustments would be entered via the General Ledger. The exact process
  529. is beyond the scope of this document, however.%
  530. } income and expenses to an equity account usually called \char`\"{}Retained
  531. Earnings.\char`\"{} Assets and liabilities are not moved. Equity drawing/dividend
  532. accounts are also moved, but the investment accounts are not. The
  533. reasoning behind this process is that one wants a permanent record
  534. of the amount invested in a business, but any dividends ought not
  535. to count against their recipients when new investors are brought on
  536. board.
  537. Ledger-SMB automatically moves all income and expense into the specified
  538. year-end/retained earnings account. It does not move the drawing account,
  539. and this must be done manually, nor does it automate the process of
  540. making adjustments.
  541. Contrary to its name, this function can close the books at any time,
  542. though this would likely be of limited use.
  543. \subsection{Options in the ledger-smb.conf}
  544. The ledger-smb.conf configures the software by assigning site-wide
  545. variables. Most of these should be left alone unless one knows what
  546. one is doing. However, on some systems some options might need to
  547. be changed, so all options are presented here for reference:
  548. \begin{description}
  549. \item[templates] is the directory where the templates are stored.
  550. \item[sendmail] is the command to use to send a message. It must read the
  551. email from standard input.
  552. \item[language] allows one to set the language for the login screen and
  553. admin page.
  554. \item[latex] tells Ledger-SMB whether \LaTeX{} is installed. \LaTeX{} is
  555. required for generating Postscript and PDF invoices and the like.
  556. \item[Environmental variables] can be set here too. One
  557. can add paths for searching for \LaTeX{}, etc.
  558. \item[printer] can be used to set a hash table of printers for the software.
  559. The primary example is\\
  560. \%printer = ( 'Default' =\textgreater 'lpr', 'Color' =\textgreater
  561. 'lpr -PEpson' ); \\%TODO check with Seneca on this
  562. However, this can use any program that can accept print documents
  563. (in Postscript) from standard input, so there are many more possibilities.
  564. \end{description}
  565. \section{Goods and Services}
  566. The Goods and Services module will focus on the definition of goods
  567. and services and the related accounting concepts.
  568. \subsection{Basic Terms}
  569. \begin{description}
  570. \item [{COGS}] is Cost of Goods Sold. When an item is sold, then the expense
  571. of its purchase is accrued as attached to the income of the sale.
  572. \item [{List}] Price is the recommended retail price.
  573. \item [{Markup}] is the percentage increase that is applied to the last
  574. cost to get the sell price.
  575. \item [{ROP}] is re-order point. Items with fewer in stock than this will
  576. show up on short reports.
  577. \item [{Sell}] Price is the price at which the item is sold.
  578. \end{description}
  579. \subsection{The Price Matrix}
  580. It is possible to set different prices for different groups of customers,
  581. or for different customers individually. Similarly, one can track
  582. different prices from different vendors along with the required lead
  583. time for an order.
  584. \subsection{Pricegroups}
  585. Pricegroups are used to help determine the discount a given customer
  586. may have.
  587. \subsection{Groups}
  588. Groups represent a way of categorizing POS items for a touchscreen
  589. environment. It is not fully functional yet, but is sufficient that
  590. with some stylesheet changes, it could be made to work.
  591. \subsection{Labor/Overhead}
  592. Labor/overhead is usually used for tracking manufacturing expenses.
  593. It is not directly billed to a customer. It is associated with an
  594. expense/Cost of Goods Sold (COGS) account.
  595. \subsection{Services}
  596. Services include any labor that is billed directly to the customer.
  597. It is associated with an expense/COGS account and an income account.
  598. Services can be associated with sales tax.
  599. \subsubsection{Shipping and Handling as a Service}
  600. One approach to dealing with shipping and handling is to add it as
  601. a service. Create a service called {}``Shipping and Handling'',
  602. with a sell price \$1 per unit, and a 0\% markup. Bill it as \$1 per
  603. unit. This allows one to add the exact amount of shipping and handling
  604. as necessary.
  605. \subsection{Parts}
  606. A part is any single item you might purchase and either might resell
  607. or use in manufacturing an assembly. It is linked to an expense/COGS
  608. account, an income account, and an inventory account. Parts can be
  609. associated with sales tax.
  610. \subsection{Assemblies and Manufacturing}
  611. Manufacturers order parts but they sell the products of their efforts.
  612. Ledger-SMB supports manufacturing using the concept of assemblies.
  613. An assembly is any product which is manufactured on site. It consists
  614. of a selection of parts, services, and/or labor and overhead. Assemblies
  615. are treated as parts in most other regards.
  616. However, one cannot order assemblies from vendors. One must instead
  617. order the components and stock them once they are manufactured.
  618. \subsubsection{Stocking Assemblies}
  619. One stocks assemblies in the Stock Assembly entry on the Goods and
  620. Services submenu. When an assembly is stocked the inventory is adjusted
  621. properly.
  622. The Check Inventory option will cause Ledger-SMB to refuse to stock
  623. an assembly if the inventory required to produce the assembly would
  624. drop the part below the reorder point.
  625. \subsection{Reporting}
  626. \subsubsection{All Items and Parts Reports}
  627. The All Items report provides a unified view of assemblies, parts, services,
  628. and labor for the company, while the Parts report confines it to parts.
  629. Types of reports are:
  630. \begin{description}
  631. \item [{Active}] lists all items not marked as obsolete.
  632. \item [{On}] Hand lists current inventory .
  633. \item [{Short}] Lists all items which are stocked below their ROP.
  634. \item [{Obsolete}] Lists all items which are marked as obsolete.
  635. \item [{Orphaned}] Lists all items which have never had a transaction associated
  636. with them.
  637. \end{description}
  638. One can also list these goods by invoice, order, or quotation.
  639. For best results, it is a good idea to enter some AR and AP data before
  640. running these reports.
  641. \subsubsection{Requirements}
  642. This report is designed to assist managers determine the quantities
  643. of goods to order and/or stock. It compares the quantity on hand with
  644. the activity in a given time frame and provides a list of goods which
  645. need to be ordered and the relevant quantity.
  646. \subsubsection{Services and Labor}
  647. This is similar to the Parts and All Items menu but only supports
  648. Active, Obsolete, and Orphaned reports.
  649. \subsubsection{Assemblies}
  650. This is similar to the Parts and All Items reports but it also provides
  651. an ability to list individual items in the assemblies as well.
  652. AP Invoices, Purchase Orders, and RFQ's are not available on this
  653. report.
  654. \subsubsection{Groups and Pricegroups}
  655. These reports provide a simple interface for locating groups and pricegroups.
  656. The report types are similar to what they are for services.
  657. \subsection{Translations}
  658. One can add translations so that they show up in the customer's native
  659. language in the issued invoice.
  660. To issue translations, one must have languages defined. One can then
  661. add translations to descriptions and part groups.
  662. \subsection{How Cost of Goods Sold is tracked}
  663. Cost of Goods Sold is tracked on a First-In, First-out (FIFO) basis.
  664. When a part is purchased, its cost is recorded in the database. The
  665. cost of the item is then added to the inventory asset account. When
  666. the good is sold, the cost of the item is moved to the cost of goods
  667. sold account.
  668. This means that one must actually provide invoices for all goods entered
  669. at their actual cost. If one enters in \$0 for the cost, the cost
  670. of goods sold will also be \$0 when the item is sold. We will cover
  671. this entire process in more depth after we cover the AP and AR units
  672. below.
  673. \section{AP}
  674. \subsection{Basic AP Concepts}
  675. The Accounts Payable module tracks all financial commitments that
  676. the company makes to other businesses. This includes rent, utilities,
  677. etc. as well as orders of goods and services.
  678. \subsection{Vendors}
  679. A vendor is any business that the company agrees to pay money to.
  680. One can enter vendor information under AP-\textgreater Vendors-\textgreater
  681. Add Vendor. The vendor list can be searched under AP-\textgreater
  682. Vendors-\textgreater Reports-\textgreater Search.
  683. Enter start and end-dates for each vendor. This will make searches
  684. and drop-down boxes faster when some vendors are no longer actively
  685. supporting your company.
  686. A few fields that need explanation are:
  687. \begin{description}
  688. \item [{BIC}] Bank Identifier Code is often the same as the S.W.I.F.T.
  689. code. This is a code for the bank a customer uses for automated money
  690. transfers.
  691. \item [{IBAN}] International Bank Account Number is related to the BIC
  692. and is used for cross-border automated money transfers.
  693. \item [{Terms}] is the number of days one has to pay the invoice.
  694. \item [{Vendor}] Number is automatically generated.
  695. \end{description}
  696. \subsection{AP Transactions}
  697. AP Transactions are generally used for items other than goods and
  698. services. Utilities, rent, travel expenses, etc. could be entered
  699. in as an AP transaction.
  700. If the item is paid partially or in full when the transaction is entered,
  701. one can add payments to the payment section.
  702. All other payments can and should be entered under cash payment (below).
  703. The PO Number and Order Number fields are generally used to track
  704. associations with purchase orders sent to vendors, etc. These fields
  705. can be helpful for adding misc. expenses to orders for reporting purposes.
  706. The department drop-down box appears when one has created one or more
  707. departments. A transaction is not required to be associated with a
  708. department, but one can use this feature for budget tracking.
  709. With AP Transactions, there is no option for internal notes. All notes
  710. will appear on any printed version of the transaction.
  711. Note: Printing a transaction does not post it. No data is committed
  712. until the invoice is posted.
  713. \subsection{AP Invoices}
  714. AP Invoices are used to enter in the receipt of goods and services.
  715. Goods and services are deemed entered into the inventory when they
  716. are invoiced.
  717. This screen is reasonably similar to the AP Transaction Screen, though
  718. the part entry section is a bit different.
  719. The AP Invoice section has a capacity to separate internal notes from
  720. notes printed on the invoice. Note, however, that since these are
  721. received invoices, it is rare that one needs this ability.
  722. Note that Ledger-SMB can search for partial part numbers or descriptions.
  723. Also if you have a group you can use this to select the part.
  724. To remove a line item from an invoice or order, delete the partnumber
  725. and click update.
  726. \subsubsection{Correcting an AP Invoice}
  727. If an invoice is entered improperly, the methods used to correct it
  728. will vary depending on whether transaction reversal is enforced or
  729. not. If transaction reversal is not enforced, one can simply correct
  730. the invoice or transaction and repost. Note, however, that this violates
  731. generally accepted accounting principles.
  732. If transaction reversal is in effect, one needs to create a duplicate
  733. invoice with exactly opposite values entered. If one part was listed as
  734. received, then one should enter a negative one for the quantity. Then one
  735. can enter the invoice number as the same as the old one. Add an R to the
  736. end to show that it is a reversing transaction. Once this is posted, one can
  737. enter the invoice correctly.
  738. \subsection{Cash payment And Check Printing}
  739. It is a bad idea to repost invoices/transactions just to enter a payment.
  740. The Cash-\textgreater Payment window allows one to enter payments against
  741. AP invoices or transactions.
  742. The printing capability can be used to print checks. The default template
  743. is NEBS 9085, though you can use 9082 as well (as Quickbooks does).
  744. The source field is used to store an identifying number of the source
  745. document, such as the check number. One must select the item to have
  746. it paid, and then enter the amount. One can then print a check.
  747. \subsubsection{Rapid Payment Entry Screen}
  748. One can also use the rapid payment entry screen to print multiple
  749. checks. However, this does not allow you to print the multiple checks
  750. to the screen as a separate document is created for each check. In
  751. this event, one must print directly to a printer as postscript.
  752. \subsection{Transaction/Invoice Reporting}
  753. \subsubsection{Transactions Report}
  754. This report is designed to help you locate AP transactions based on
  755. various criteria. One can search by vendor, invoice number, department,
  756. and the like. One can even search by the shipping method.
  757. The summary button will show what was placed where, while the details
  758. button will show all debits and credits associated with the transaction.
  759. To view the invoice, click on the invoice number. In the detail view,
  760. to view the account transactions as a whole, click on the account
  761. number.
  762. Open invoices are ones not fully paid off, while closed invoices
  763. are those that have been paid.
  764. \subsubsection{Outstanding Report}
  765. The outstanding report is designed to help you locate AP transactions
  766. that are not paid yet. The ID field is mostly useful for locating
  767. the specific database record if a duplicate invoice number exists.
  768. \subsubsection{AP Aging Report}
  769. This report can tell you how many invoices are past due and by how
  770. much.
  771. A summary report just shows vendors while a detail report shows individual
  772. invoices.
  773. \subsubsection{Tax Paid and Non-taxable Report}
  774. These reports have known issues. It is better to use the GL reports and filter
  775. accordingly.
  776. \subsection{Vendor Reporting}
  777. \subsubsection{Vendor Search}
  778. The Vendor Search screen can be used to locate vendors or AP transactions
  779. associated with those vendors.
  780. The basic types of reports are:
  781. \begin{description}
  782. \item [{All}] Lists all vendors
  783. \item [{Active}] Lists those vendors currently active
  784. \item [{Inactive}] Lists those vendors who are currently inactive. time
  785. frame.
  786. \item [{Orphaned}] Lists those vendors who do not have transactions associated
  787. with them. These vendors can be deleted.
  788. \end{description}
  789. One can include purchase orders, Requests for Quotations, AP invoices,
  790. and AP transactions on this report as well if they occur between the
  791. from and to dates.
  792. \subsubsection{Vendor History}
  793. This report can be used to obtain information about the past goods
  794. and services ordered or received from vendors. One can find quantities,
  795. partnumber, and sell prices on this report. This facility can be used
  796. to search RFQ's, Purchase Orders, and AP Invoices.
  797. \section{AR}
  798. \subsection{Customers}
  799. Customers are entered in using the AR-\textgreater Customers-\textgreater
  800. Add Customer menu.
  801. The salesperson is autopopulated with the current user who is logged
  802. in. Otherwise, it looks fairly similar to the Vendor input screen.
  803. Customers, like vendors can be assigned languages, but it is more
  804. important to do so because invoices will be printed and sent to them.
  805. The credit limit field can be used to assign an amount that one is
  806. willing to do for a customer on credit.
  807. \subsubsection{Customer Price Matrix}
  808. The price list button can be used to enter specific discounts to the
  809. customer, and groups of customers can be assigned a pricegroup for
  810. the purpose of offering specific discounts on specific parts to the
  811. customer. Such discounts can be temporary or permanent.
  812. \subsection{AR Transactions}
  813. AR Transactions are where one can add moneys owed the business by
  814. customers. One can associate these transactions with income accounts,
  815. and add payments if the item is paid when the invoice is issued.
  816. The PO number field is used to track the PO that the customer sent.
  817. This makes it easier to find items when a customer is asking for clarification
  818. on a bill, for example.
  819. \subsection{AR Invoices}
  820. AR Invoices are designed to provide for the delivery of goods and
  821. services to customers. One would normally issue these invoices at
  822. the time when the everything has been done that is necessary to get
  823. paid by the customer.
  824. As with AP invoices, one can search for matches to partial part numbers
  825. and descriptions, and enter initial payments at this screen.
  826. \subsection{Cash Receipt}
  827. The Cash-\textgreater Receipt screen allows you to accept prepayments
  828. from customers or pay single or multiple invoices after they have
  829. been posted. One can print a receipt, however the current templates
  830. seem to be based on check printing templates and so are unsuitable
  831. for this purpose. This presents a great opportunity for improvement.
  832. \subsubsection{Cash Receipts for multiple customers}
  833. The cash-\textgreater receipts screen allows you to accept payments
  834. on all open customer invoices of all customers at once. One could
  835. print (directly to a printer only) all receipts to be sent out if
  836. this was desired.
  837. \subsection{AR Transaction Reporting}
  838. The AR Outstanding report is almost identical to the AP Outstanding
  839. report and is not covered in any detail in this document.
  840. \subsubsection{AR Transactions Report}
  841. This is almost identical to the AP Transactions Report.
  842. If a customer's PO has been associated with this transaction, one
  843. can search under this field as well.
  844. \subsubsection{AR Aging Report}
  845. This report is almost identical to the AP Aging report, with the exception
  846. that one can print up statements for customer accounts that are overdue.
  847. One more application is to calculate interest based on balance owed
  848. so that these can be entered as AR transactions associated with the
  849. customer.
  850. \subsection{Customer Reporting}
  851. These reports are almost identical to the AP Vendor reports and are
  852. not discussed in these notes.
  853. \section{Projects}
  854. \subsection{Project Basics}
  855. A project is a logical collection of AR and AP transactions, orders,
  856. and the like that allow one to better manage specific service or product
  857. offerings. Ledger-SMB does not offer comprehensive project management
  858. capabilities, and projects are only used here as they relate to accounting.
  859. One can also add translated descriptions to the project names as well.
  860. \subsection{Timecards}
  861. Timecards allow one to track time entered on specific services. These
  862. can then be used to generate invoices for the time entered.
  863. The non-chargeable is the number of hours that are not billed on the
  864. invoice.
  865. One can then generate invoices based on this information.
  866. The project field is not optional.
  867. \subsection{Projects and Invoices}
  868. One can select the project id for line items of both AR and AP invoices.
  869. These will then be tracked against the project itself.
  870. \subsection{Reporting}
  871. \subsubsection{Timecard Reporting}
  872. The Timecard Report allows one to search for timecards associated
  873. with one or more projects. One can then use the total time in issuing
  874. invoices (this is not automated yet).
  875. \subsubsection{Project Transaction Reporting}
  876. The Standard or GIFI options can be used to create different reports
  877. (for example, for Canadian Tax reporting purposes).
  878. This report brings up a summary that looks sort of like a chart of
  879. accounts. Of one clicks on the account numbers, one can see the transactions
  880. associated with the project.
  881. \subsubsection{List of Projects}
  882. This provides a simple way of searching for projects to edit or modify.
  883. \subsection{Possibilities for Using Projects}
  884. \begin{itemize}
  885. \item One can use them similar to departments for tracking work done for
  886. a variety of customers.
  887. \item One can use them for customer-specific projects, such as this training.
  888. \end{itemize}
  889. \section{Quotations and Order Management}
  890. This unit will introduce the business processes that Ledger-SMB allows.
  891. These processes are designed to allow various types of businesses
  892. to manage their orders and allow for rudimentary customer relationship
  893. management processes to be built around this software. In this section,
  894. we will introduce the work flow options that many businesses may use
  895. in their day-to-day use of the software.
  896. \subsection{Sales Orders}
  897. Sales orders represent orders from customers that have not been delivered
  898. or shipped yet. These orders can be for work in the future, for
  899. back ordered products, or work in progress. A sales order can be generated
  900. form an AR invoice or from a quotation automatically.
  901. \subsection{Quotations}
  902. Quotations are offers made to a customer but to which the customer
  903. has not committed to the work. Quotations can be created from Sales
  904. orders or AR Invoice automatically.
  905. \subsection{Shipping}
  906. The Shipping module (Shipping-\textgreater Shipping) allows one to
  907. ship portions or entireties of existing sales orders, printing pick
  908. lists and packing slips.
  909. One can then generate invoices for those parts that were shipped.
  910. In general, one will be more likely to use these features if they
  911. have multiple warehouses that they ship from. More likely most customers
  912. will just generate invoices from orders.
  913. \subsection{AR Work Flow}
  914. \subsubsection{Service Example}
  915. A customer contacts your firm and asks for a quote on some services.
  916. Your company would create a quotation for the job and email it to
  917. the customer or print it and mail it. Once the customer agrees to
  918. pay, one creates a sales order from the quotation.
  919. When the work is completed, the sales order is converted into a sales
  920. invoice and this is presented to the customer as a bill.
  921. Note that in some cases, this procedure may be shortened. If the customer
  922. places an order without asking for a quotation and is offered a verbal
  923. quote, then one might merely prepare the sales order.
  924. %
  925. \begin{figure}[hbtp]
  926. \caption{Simple AR Service Invoice Workflow Example}
  927. \input{simple_ar_dataflow}
  928. \end{figure}
  929. \subsubsection{Single Warehouse Example}
  930. A customer contacts your firm and asks for a quotation for shipping
  931. a part. You would create the quotation and when you get confirmation,
  932. convert it to an order. Once the parts are in place you could go to
  933. shipping and ship the part.
  934. The billing department can then generate the invoice from the sales
  935. order based on what merchandise has been shipped and mail it to the
  936. customer.
  937. Note that this requires that you have the part in your inventory.
  938. %
  939. \begin{figure}[hbtp]
  940. \caption{AR Workflow with Shipping}
  941. \input{ar_workflow_ship}
  942. \end{figure}
  943. \subsubsection{Multiple Warehouse Example}
  944. A customer contacts your firm and asks for a quotation for a number
  945. of different parts. You would create a quotation and when you get
  946. confirmation, convert it to a sales order. When you go to ship the item,
  947. you would select the warehouse in the drop-down menu, and select the
  948. parts to ship. One would repeat with other warehouses until the entire
  949. order is shipped.
  950. Then the billing department would go to the sales order and generate
  951. the invoice. It would then be mailed to the customer.
  952. %
  953. \begin{figure}[hbtp]
  954. \caption{Complex AR Workflow with Shipping}
  955. \input{ar_workflow_complex}
  956. \end{figure}
  957. \subsection{Requests for Quotation (RFQ)}
  958. A request for quotation would be a formal document one might submit
  959. to a vendor to ask for a quote on a product or service they might
  960. offer. These can be generated from Purchase Orders or AP Invoices.
  961. \subsection{Purchase Orders}
  962. A purchase order is a confirmation that is issued to the vendor to
  963. order the product or service. Many businesses will require a purchase
  964. order with certain terms in order to begin work on a product. These
  965. can be generated from RFQ's or AP Invoices.
  966. \subsection{Receiving}
  967. The Shipping-\textgreater Receiving screen allows you to track the
  968. parts received from an existing purchase order. Like shipping, it
  969. does not post an invoice but tracks the received parts in the order.
  970. \subsection{AP Work Flow}
  971. \subsubsection{Bookkeeper entering the received items, order completed in full}
  972. Your company inquires about the price of a given good or service from
  973. another firm. You submit an RFQ to the vendor, and finding that the
  974. price is reasonable, you convert it to an order, adjust the price
  975. to what they have quoted, and save it. When the goods are delivered
  976. you convert the order into an AP invoice and post it.
  977. %
  978. \begin{figure}[hbtp]
  979. \caption{Simple AP Workflow}
  980. \input{simple_ap_workflow}
  981. \end{figure}
  982. \subsubsection{Bookkeeper entering received items, order completed in part}
  983. Your company inquires about the price of a given good or service from
  984. another firm, You submit an RFQ to the vendor, and finding that the
  985. price is acceptable, you convert it into an order, adjusting the price
  986. to what they have quoted, and save it. When some of the goods are
  987. received, you open up the purchase order, enter the number of parts
  988. received, convert that order into an invoice, and post it. Repeat
  989. until all parts are received.
  990. %
  991. \begin{figure}[hbtp]
  992. \caption{AP Workflow with Receiving}
  993. \input{ap_workflow_ship}
  994. \end{figure}
  995. \subsubsection{Receiving staff entering items}
  996. Your company inquires about the price of a given good or service from
  997. another firm, You submit an RFQ to the vendor, and finding that the
  998. price is acceptable, you convert it into an order, adjusting the price
  999. to what they have quoted, and save it. When some or all of the goods
  1000. are received, the receiving staff goes to Shipping-Receiving, locates
  1001. the purchase order, and fills in the number of items received.
  1002. The bookkeeper can then determine when all items have been received
  1003. and post the invoice at that time.
  1004. %
  1005. \begin{figure}[hbtp]
  1006. \caption{Complex AP Workflow}
  1007. \input{ap_workflow_complex}
  1008. \end{figure}
  1009. \subsection{Generation and Consolidation}
  1010. \subsubsection{Generation}
  1011. The Generation screen allows you to generate Purchase Orders based
  1012. on sales orders. One selects the sales orders one wants to use, and
  1013. clicks \char`\"{}Generate Purchase Orders.\char`\"{} Then one selects
  1014. clicks on the parts to order, adjusts the quantity if necessary, and
  1015. clicks \char`\"{}Select Vendor.\char`\"{} This process is repeated
  1016. for every vendor required. Then the Generate Orders button is clicked.
  1017. \subsubsection{Consolidation}
  1018. One can consolidate sales and/or purchase orders using this screen.
  1019. For the consolidation to work you must have more than one order associated
  1020. with the relevant customer or vendor.
  1021. \subsection{Reporting}
  1022. The reporting functionality in the order management is largely limited
  1023. to the ability to locate purchase orders, sales orders, RFQ's, and
  1024. quotations.
  1025. \subsection{Shipping Module: Transferring Inventory between Warehouses}
  1026. One can transfer inventory between warehouses if necessary by using
  1027. the Shipping-\textgreater Transfer Inventory screen.
  1028. \section{HR}
  1029. The HR module is currently limited to tracking employees for and their
  1030. start and end dates. It has very little other functionality. One could
  1031. build payroll systems that could integrate with it however.
  1032. \section{POS}
  1033. LedgerSMB 1.2 includes a number of components merged from Metatron Technology
  1034. Consulting's SL-POS. Although it is still not a perfect solution, it is greatly improved in both workflow and hardware support. It is suitable for retail
  1035. establishments at the moment.
  1036. \subsection{Sales Screen}
  1037. The sales screen looks very much like a normal invoice entry screen
  1038. with a few differences.
  1039. \begin{itemize}
  1040. \item The discount text field is not available, nor is the unit field..
  1041. \item The next part number is automatically focused when the data loads
  1042. for rapid data entry.
  1043. \item Hot keys for the buttons are Alt-U for update, Alt-P for print, Alt-O
  1044. for post, and Alt-R for print and post.
  1045. \item Part Groups appear at the bottom of the screen.
  1046. \item Alt-N moves the cursor to the next free payment line.
  1047. \end{itemize}
  1048. \subsection{Possibilities for Data Entry}
  1049. \begin{itemize}
  1050. \item Barcode scanners can be used to scan items in as they are being rung
  1051. in.
  1052. \item One could use touch screens, though this would ideally require some
  1053. custom stylesheets to make it efficient.
  1054. \end{itemize}
  1055. \subsection{Hardware Support}
  1056. As LedgerSMB is a web-based application, the web browser usually
  1057. does not allow the page to write to arbitrary files. Therefore hardware
  1058. support for pole displays, etc. is not readily possible from the application
  1059. itself. LedgerSMB gets around this limitation by using an additional set of
  1060. network sockets from the server to the client to control its hardware. This
  1061. naturally requires that other software is also running on the client.
  1062. Notes for specific types of hardware are as follows:
  1063. \begin{description}
  1064. \item [{Touch}] screens: The default stylesheet is not really usable from
  1065. a touchscreen as the items are often too small. One would need to
  1066. modify the stylesheets to ensure that the relevant items would be
  1067. reasonable. Setting down the resolution would also help.
  1068. \item [{Receipt}] Printers: ESC/POS printers generally work in text mode.
  1069. Control sequences can be embedded in the template as necessary.
  1070. \item [{Pole}] Displays: Generally supported. Only the Logic Controls PD3000 is
  1071. supported out of the box, but making this work for other models ought to be
  1072. trivial.
  1073. \item [{Cash}] Drawers: These should be attached to the printer. The control
  1074. codes is then specified in the pos.conf.pl so that the command is sent to the
  1075. printer when the open till button is pushed.
  1076. \item [{Barcode}] Scanners: Most customers use decoded barcode scanners
  1077. through a keyboard wedge interface. This allows them to scan items
  1078. as if they were typing them on the keyboard.
  1079. \end{description}
  1080. \subsection{Reports}
  1081. \subsubsection{Open Invoices}
  1082. The POS-\textgreater Open screen allows one to find any POS receipts
  1083. that are not entirely paid off.
  1084. \subsubsection{Receipts}
  1085. The POS-\textgreater Receipts screen allows one to bring up a basic
  1086. record of the POS terminals. It is not sufficient for closing the
  1087. till, however, though it may help for reconciliation.
  1088. The till column is the last component or octet of the terminal's IP
  1089. address. Therefore it is a good idea to try to avoid having IP addresses
  1090. where the last octet is the same.
  1091. All entries are grouped by date and source in this report.
  1092. \section{General Ledger}
  1093. \subsection{GL Basics}
  1094. The General Ledger is the heart of Ledger-SMB. Indeed, Ledger-SMB
  1095. is designed to be as close as possible to a software equivalent of
  1096. a paper-based accounting program (but with no difference between the
  1097. General Ledger and General Journal).
  1098. \subsubsection{Paper-based accounting systems and the GL}
  1099. In order to understand the principle of the General Ledger, one must
  1100. have a basic understanding of the general process of bookkeeping using
  1101. double-entry paper-based accounting systems.
  1102. Normally when a transaction would be recorded, it would first be recorded
  1103. in the \char`\"{}General Journal\char`\"{} which would contain detailed
  1104. information about the transaction, notes, etc. Then the entries from
  1105. the General Journal would be transcribed to the General Ledger, where
  1106. one could keep closer tabs on what was going on in each account.
  1107. In the general journal, all transactions are listed chronologically
  1108. with whatever commentary is deemed necessary, while in the general
  1109. ledger each account has its own page and transactions are recorded
  1110. in a simple and terse manner. The General Journal is the first place
  1111. the transaction is recorded and the General Ledger is the last.
  1112. At the end of the accounting period, the GL transactions would be
  1113. summarized into a trial balance and this would be used for creating
  1114. financial statements and closing the books at the end of the year.
  1115. \subsubsection{Double Entry Examples on Paper}
  1116. Let us say that John starts his business with an initial investment
  1117. of \$10,000.
  1118. This is recorded in the General Journal as follows (in this example,
  1119. suppose it is page 1):
  1120. \begin{tabular}{|l|l|l|r|r|}
  1121. \hline
  1122. Date &
  1123. Accounts and Explanation &
  1124. Ref &
  1125. DEBIT &
  1126. CREDIT \tabularnewline
  1127. \hline
  1128. March 1 &
  1129. Checking Account &
  1130. 1060 &
  1131. 10000.00 &
  1132. \tabularnewline
  1133. &
  1134. John Doe Capital &
  1135. 3011 &
  1136. &
  1137. 10000.00\tabularnewline
  1138. &
  1139. John Doe began a business &
  1140. &
  1141. &
  1142. \tabularnewline
  1143. &
  1144. with an investment of &
  1145. &
  1146. &
  1147. \tabularnewline
  1148. &
  1149. \$10000 &
  1150. &
  1151. &
  1152. \tabularnewline
  1153. \hline
  1154. \end{tabular}\medskip{}
  1155. This would then be transcribed into two pages of the General Ledger.
  1156. The first page might be the Checking Account page:\medskip{}
  1157. \begin{tabular}{|l|l|l|r|l|l|l|r|}
  1158. \hline
  1159. DATE &
  1160. EXPLANATION &
  1161. REF. &
  1162. DEBITS &
  1163. DATE &
  1164. EXPLANATION &
  1165. REF. &
  1166. CREDITS\tabularnewline
  1167. \hline
  1168. March 1 &
  1169. &
  1170. J1 &
  1171. 10000.00 &
  1172. &
  1173. &
  1174. &
  1175. \tabularnewline
  1176. \hline
  1177. \end{tabular}\medskip{}
  1178. On the John Doe Capital page, we would add a similar entry:\medskip{}
  1179. \begin{tabular}{|l|l|l|r|l|l|l|r|}
  1180. \hline
  1181. DATE &
  1182. EXPLANATION &
  1183. REF. &
  1184. DEBITS &
  1185. DATE &
  1186. EXPLANATION &
  1187. REF. &
  1188. CREDITS\tabularnewline
  1189. \hline
  1190. &
  1191. &
  1192. &
  1193. &
  1194. March 1 &
  1195. &
  1196. J1 &
  1197. 10000.00\tabularnewline
  1198. \hline
  1199. \end{tabular}\medskip{}
  1200. \subsubsection{The GL in Ledger-SMB}
  1201. The paper-based accounting procedure works well when one is stuck
  1202. with paper recording requirements but it has one serious deficiency---
  1203. all of this transcribing creates an opportunity for errors.
  1204. Relational databases relieve the need for such transcription as it
  1205. is possible to store everything physically in a way similar to the
  1206. way a General Journal is used in the paper-based systems and then
  1207. present the same information in ways which are more closely related
  1208. to the General Ledger book.
  1209. This is the exact way that the General Ledger is used in Ledger-SMB.
  1210. The actual data is entered and stored as if it was a general journal,
  1211. and then the data can be presented in any number of different ways.
  1212. All modules of Ledger-SMB that involve COA accounts store their data
  1213. in the General Ledger (it is a little more complex than this but this
  1214. is very close to the actual mechanism).
  1215. \subsection{Cash Transfer}
  1216. The simplest form of GL entry in Ledger-SMB is the Cash-\textgreater
  1217. Transfer screen. This screen shows two transaction lines, and fields
  1218. for reference, department, description, and notes.
  1219. The field descriptions are as follows:
  1220. \begin{description}
  1221. \item [{Reference}] refers to the source document for the transfer. One
  1222. can use transfer sheets, bank receipt numbers, etc for this field.
  1223. \item [{Description}] is optional but really should be filled in. It ought
  1224. to be a description of the transaction.
  1225. \item [{Notes}] provide supplemental information for the transaction.
  1226. \item [{FX}] indicates whether foreign exchange is a factor in this transaction.
  1227. \item [{Debit}] indicates money going \textbf{into} the asset account.
  1228. \item [{Credit}] indicates money coming \textbf{out} of the asset account.
  1229. \item [{Source}] is the source document for that portion of the transaction.
  1230. \item [{Memo}] lists additional information as necessary.
  1231. \item [{Project}] allows you to assign this line to a project.
  1232. \end{description}
  1233. The credit and debit options seem to be the opposite of what one would
  1234. think of concerning one's bank account. The reason is that your bank
  1235. statement is done from the bank's point of view. Your bank account balance
  1236. is an asset to you and therefor you show it as having a debit balance, but
  1237. to the bank it is money they owe you and so they show it as having a credit
  1238. balance.
  1239. Note that in this screen, when an item is updated, it will reduce
  1240. the number of lines to those already filled in plus an extra line
  1241. for the new line in the data entry.
  1242. \subsection{GL Transactions}
  1243. The GL Transaction screen (General Ledger-\textgreater Add Transaction)
  1244. is identical to the Cash Transfer screen with the exception that it
  1245. starts with nine lines instead of two. Otherwise, they are identical.
  1246. Again, one must be careful with debits and credits. Often it is easy
  1247. to get confused. It is generally worth while to go back to the principle
  1248. that one tracks them with regard to their impact on the equity accounts.
  1249. So expenses are credits because they debit the equity accounts, and
  1250. income is a debit because it credits the retained earning equity account.
  1251. \subsection{Payroll as a GL transaction}
  1252. Currently payroll must be done as a GL transaction. The attempts to
  1253. create a payroll system that would ship with SL have largely stalled.
  1254. Most customers running their businesses will have an idea of how to
  1255. do this.
  1256. %
  1257. \begin{figure}[hbtp]
  1258. \caption{Payroll as a GL Transaction (Purely fictitious numbers)}
  1259. \begin{tabular}{|l|r|r|}
  1260. \hline
  1261. Account &
  1262. Debit &
  1263. Credit \tabularnewline
  1264. 5101 Wages and Salaries &
  1265. 500 &
  1266. \tabularnewline
  1267. 2032 Accrued Wages &
  1268. &
  1269. 450 \tabularnewline
  1270. 2033 Fed. Income Tax wthd &
  1271. &
  1272. 30 \tabularnewline
  1273. 2034 State Inc. Tax. wthd &
  1274. &
  1275. 15 \tabularnewline
  1276. 2035 Social Security wthd &
  1277. &
  1278. 3 \tabularnewline
  1279. 2036 Medicare wthd &
  1280. &
  1281. 2 \tabularnewline
  1282. 2032 Accrued Wages &
  1283. 450 &
  1284. \tabularnewline
  1285. 1060 Checking Acct &
  1286. &
  1287. 450 \tabularnewline
  1288. \hline
  1289. \end{tabular}
  1290. \end{figure}
  1291. \subsection{Reconciliation}
  1292. To reconcile an account (say, when one would get a checking account
  1293. statement), one would go to cash/reconciliation, and check off the
  1294. items that have cleared. One can then attempt to determine where any
  1295. errors lie by comparing the total on the statement with the total
  1296. that SL generates.
  1297. This can be done for other accounts too, such as petty cash.%
  1298. \footnote{Petty cash denotes a drawer of cash that is used to pay small expenses.
  1299. When an expense is paid, it is recorded on a slip of paper that is
  1300. stored for reconciliation purposes.%
  1301. }
  1302. \subsection{Reports}
  1303. The most flexible report in Ledger-SMB is the GL report because it
  1304. has access to the entire set of financial transactions of a business.
  1305. Every invoice posted, payment made or received, etc. can be located
  1306. here.
  1307. The search criteria include:
  1308. \begin{description}
  1309. \item [{Reference}] is the invoice number, or other reference number associated
  1310. with the transaction.
  1311. \item [{Source}] is the field related to the source document number in
  1312. a payment or other transaction.%
  1313. \footnote{Source documents are things like receipts, canceled checks, etc. that
  1314. can be used to verify the existence and nature of a transaction.%
  1315. }
  1316. \item [{Memo}] relates to the memo field on a payment.
  1317. \item [{Department}] can be used to filter results by department.
  1318. \item [{Account}] Type can be used to filter results by type of account
  1319. (Asset, Liability, etc.)
  1320. \item [{Description}] can be used to filter by GL description or by
  1321. customer/vendor name.
  1322. \end{description}
  1323. The actual format of the report looks more like what one would expect
  1324. in a paper accounting system's general journal than a general ledger
  1325. per se. A presentation of the data that is more like the paper general
  1326. ledger is found in the Chart of Accounts report.
  1327. \subsubsection{GL as access to almost everything else}
  1328. The GL reports can be used to do all manner of things. One can determine,
  1329. for example, which AP invoice or transaction was paid with a certain
  1330. check number or which invoice by a specific customer was paid by a specific
  1331. check number.
  1332. \section{Recurring Transactions}
  1333. Any transaction or invoice may be repeated a number of times in regular
  1334. intervals. To schedule any GL, AR, or AP transaction or invoice, click
  1335. the schedule button.
  1336. In general the reference number should be left blank as this will
  1337. force Ledger-SMB to create a new invoice or transaction number for
  1338. each iteration. The rest of the options are self-explanatory. Note
  1339. that a blank number if iterations will result in no recurrences of
  1340. the transaction.
  1341. To process the recurring transactions, click on the Recurring Transactions
  1342. option on the main menu select the ones you want to process and click
  1343. \char`\"{}Process Transactions.\char`\"{}
  1344. \section{Financial Statements and Reports}
  1345. Financial statements and reports are a very important part of any
  1346. accounting system. Accountants and business people rely on these reports
  1347. to determine the financial soundness of the business and its prospects
  1348. for the next accounting period.
  1349. \subsection{Cash v. Accrual Basis}
  1350. Financial statements, such as the Income Statement and Balance Sheet
  1351. can be prepared either on a cash or accrual basis. In cash-basis accounting,
  1352. the income is deemed earned when the customer pays it, and the expenses
  1353. are deemed incurred when the business pays them.
  1354. There are a number of problems with cash-basis accounting from a business
  1355. point of view. The most serious is that one can misrepresent the wellbeing
  1356. of a business by paying a large expense after a deadline. Thus cash-basis
  1357. accounting does not allow one to accurately pair the income with the
  1358. related expense as these are recorded at different times. If one cannot
  1359. accurately pair the income with the related expense, then financial
  1360. statements cannot be guaranteed to tell one much of anything about
  1361. the well-being of the business.
  1362. In accrual basis accounting, income is considered earned when the
  1363. invoice is posted, and expenses are considered incurred at the time
  1364. when the goods or services are delivered to the business. This way,
  1365. one can pair the income made from the sale of a product with the expense
  1366. incurred in bringing that product to sale. This pairing allows for
  1367. greater confidence in business reporting.
  1368. \subsection{Viewing the Chart of Accounts and Transactions}
  1369. The Reports--\textgreater Chart of Accounts will provide the chart
  1370. of accounts along with current totals in each account.
  1371. If you click on an account number, you will get a screen that allows
  1372. you to filter out transactions in that account by various criteria.
  1373. One can also include AR/AP, and Subtotal in the report.
  1374. The report format is similar to that of a paper-based general ledger.
  1375. \subsection{Trial Balance}
  1376. \subsubsection{The Paper-based function of a Trial Balance}
  1377. In paper-based accounting systems, the accountant at the end of the
  1378. year would total up the debits and credits in every account and transfer
  1379. them onto another sheet called the trial balance. The accountant would
  1380. check to determine that the total debits and credits were equal and
  1381. would then transfer this information onto the financial statements.
  1382. It was called a trial balance because it was the main step at which
  1383. the error-detection capabilities of double-entry accounting systems
  1384. were used.
  1385. \subsubsection{Running the Trial Balance Report}
  1386. This report is located under Reports --\textgreater Trial Balance.
  1387. One can filter out items by date, accounting period, or department.
  1388. One can run the report by accounts or using GIFI classifications to
  1389. group accounts together.
  1390. From this report, you can click on the account number and see all
  1391. transactions on the trial balance as well as whether or not they have
  1392. been reconciled.
  1393. \subsubsection{What if the Trial Balance doesn't Balance?}
  1394. If the trial balance does not balance, get technical support immediately.
  1395. This usually means that transactions were not entered properly. Some
  1396. may have been out of balance, or some may have gone into non-existent
  1397. accounts (believe it or not, Ledger-SMB does not check this latter
  1398. issue).
  1399. \subsubsection{Trial Balance as a Summary of Account Activity}
  1400. The trial balance offers a glance at the total activity in every account.
  1401. It can provide a useful look at financial activity at a glance for
  1402. the entire business.
  1403. \subsubsection{Trial Balance as a Budget Planning Tool}
  1404. By filtering out departments, one can determine what a department
  1405. earned and spent during a given financial interval. This can be used
  1406. in preparing budgets for the next accounting period.
  1407. \subsection{Income Statement}
  1408. The Income Statement is another tool that can be used to assist with
  1409. budgetary planning as well as provide information on the financial
  1410. health of a business.
  1411. The report is run from Reports--\textgreater Income Statement. The
  1412. report preparation screen shows the following fields:
  1413. \begin{description}
  1414. \item [{Department}] allows you to run reports for individual departments.
  1415. This is useful for budgetary purposes.
  1416. \item [{Project}] allows you to run reports on individual projects. This
  1417. can show how profitable a given project was during a given time period.
  1418. \item [{From}] and To allow you to select arbitrary from and to dates.
  1419. \item [{Period}] allows you to specify a standard accounting period.
  1420. \item [{Compare to}] fields allow you to run a second report for comparison
  1421. purposes for a separate range of dates or accounting period.
  1422. \item [{Decimalplaces}] allows you to display numbers to a given precision.
  1423. \item [{Method}] allows you to select between accrual and cash basis reports.
  1424. \item [{Include}] in Report provides various options for reporting.
  1425. \item [{Accounts}] allows you to run GIFI reports instead of the standard
  1426. ones.
  1427. \end{description}
  1428. The report shows all income and expense accounts with activity during
  1429. the period when the report is run, the balances accrued during the
  1430. period, as well as the total income and expense at the bottom of each
  1431. section. The total expense is subtracted from the total income to
  1432. provide the net income during the period. If there is a loss, it appears
  1433. in parentheses.
  1434. \subsubsection{Uses of an Income Statement}
  1435. The income statement provides a basic snapshot of the overall ability
  1436. of the business to make money. It is one of the basic accounting statements
  1437. and is required, for example, on many SEC forms for publicly traded
  1438. firms.
  1439. Additionally, businessmen use the income statement to look at overall
  1440. trends in the ability of the business to make money. One can compare
  1441. a given month, quarter, or year with a year prior to look for trends
  1442. so that one can make adjustments in order to maximize profit.
  1443. Finally, these reports can be used to provide a look at each department's
  1444. performance and their ability to work within their budget. One can
  1445. compare a department or project's performance to a year prior and
  1446. look for patterns that can indicate problems or opportunities that
  1447. need to be addressed.
  1448. \subsection{Balance Sheet}
  1449. The balance sheet is the second major accounting statement supported
  1450. by Ledger-SMB. The balance sheet provides a snapshot of the current
  1451. financial health of the business by comparing assets, liabilities,
  1452. and equity.
  1453. In essence the balance sheet is a statement of the current state of
  1454. owner equity. Traditionally, it does not track changes in owner equity
  1455. in the same way the Statement of Owner Equity does.
  1456. The Balance Sheet report preparation screen is much simpler than the
  1457. Income Statement screen. Balance sheets don't apply to projects, but
  1458. they do apply to departments. Also, unlike an income statement, a
  1459. balance sheet is fixed for a specific date in time. Therefore one
  1460. does not need to select a period.
  1461. The fields in creating a balance sheet are:
  1462. \begin{description}
  1463. \item [{Department}] allows you to run separate balance sheets for each
  1464. department.
  1465. \item [{As}] at specifies the date. If blank this will be the current date.
  1466. \item [{Compare to}] specifies the date to compare the balance sheet to.
  1467. \item [{Decimalplaces}] specifies the number of decimal places to use.
  1468. \item [{Method}] selects between cash and accrual basis.
  1469. \item [{Include}] in report allows you to select supplemental information
  1470. on the report.
  1471. \item [{Accounts}] allows you to select between standard and GIFI reports.
  1472. \end{description}
  1473. The balance sheet lists all asset, liability, and equity accounts
  1474. with a balance. Each category has a total listed, and the total of
  1475. the equity and liability accounts is also listed.
  1476. The total assets should be equal to the sum of the totals of the liability
  1477. and equity accounts.
  1478. \subsection{What if the Balance Sheet doesn't balance?}
  1479. Get technical support immediately, This may indicate that out of balance
  1480. transactions were entered or that transactions did not post properly.
  1481. \subsection{No Statement of Owner Equity?}
  1482. The Statement of Owner Equity is the one accounting statement that
  1483. Ledger-SMB does not support. However, it can be simulated by running
  1484. a balance sheet at the end of the time frame in question and comparing
  1485. it to the beginning. One can check this against an income statement
  1486. for the period in question to verify its accuracy. The statement of
  1487. owner equity is not as commonly used now as it once was.
  1488. \section{The Template System}
  1489. Ledger-SMB allows most documents to be generated according to a template
  1490. system. This allows financial statements, invoices, orders, and the
  1491. like to be customized to meet the needs of most businesses. Company
  1492. logos can be inserted, the format can be radically altered, one can
  1493. print letters to be included with checks to vendors instead of the
  1494. checks themselves, and the like. In the end, there is very little
  1495. that cannot be accomplished regarding modification of these documents
  1496. with the template system.
  1497. One can define different templates for different languages, so that
  1498. a customer in Spain gets a different invoice than a customer in Canada.
  1499. \subsection{Text Templates}
  1500. The only template that uses a text-only format is the POS receipt.
  1501. This example provides the simplest way to understand the template
  1502. system.
  1503. The first two lines are:\\
  1504. \textless\%company align=center width=40\%\textgreater\\
  1505. \textless\%address align=center width=40\%\textgreater\\
  1506. The first line tells Ledger-SMB to print the company name as passed
  1507. to it via a variable, centered, with a page width of 40 characters.
  1508. The second line does the same thing with the address.
  1509. These variables are usually passed to the invoice using form fields
  1510. (hidden or otherwise) in the submitting web page. The printing script,
  1511. however, can disable some of these fields or add others via database
  1512. lookups and the like.
  1513. In all types of templates, variable substitution occurs between \textless\%
  1514. and \%\textgreater. One can optionally specify an alignment or a
  1515. width but these are really only useful in text templates.
  1516. \subsection{HTML Templates}
  1517. The following templates exist in HTML format:
  1518. \begin{itemize}
  1519. \item Income Statement
  1520. \item Balance Sheet
  1521. \item Invoice (AR)
  1522. \item AR Transaction
  1523. \item AP Transaction
  1524. \item Packing List
  1525. \item Pick List
  1526. \item Sales Order
  1527. \item Work Order
  1528. \item Purchase Order
  1529. \item Bin List
  1530. \item Statement
  1531. \item Quotation
  1532. \item RFQ
  1533. \item Time Card
  1534. \end{itemize}
  1535. These templates can be edited by an HTML editor. However, it is generally
  1536. recommended that one back up templates first. The reason is that some
  1537. HTML editors will fully re-parse the HTML and save it back without
  1538. what they see as invalid tags. Most editors, however, will save the
  1539. variable substitution tags because similar tags are also used by Microsoft's
  1540. active server pages.
  1541. Finally, some editors are known to mangle formatting, so many problems
  1542. can be avoided by ensuring that one has a backup of the templates,
  1543. especially if they have already been customized.
  1544. \subsection{\LaTeX{}\ Templates}
  1545. The following templates, by default, are available in \LaTeX{}\ :
  1546. \begin{itemize}
  1547. \item Invoice
  1548. \item AR Transaction
  1549. \item AP Transaction
  1550. \item Packing List
  1551. \item Pick List
  1552. \item Sales Order
  1553. \item Work Order
  1554. \item Purchase Order
  1555. \item Bin List
  1556. \item Statement
  1557. \item Check
  1558. \item Receipt
  1559. \item Quotation
  1560. \item RFQ
  1561. \item Time Card
  1562. \end{itemize}
  1563. \LaTeX{}\ templates allow one to generate PDF and postscript documents
  1564. and print directly to a postscript-enabled printer or print software
  1565. (like CUPS).
  1566. \LaTeX{}\ templates can be edited using a standard text editor (like
  1567. vim or emacs), or using a synchronous \LaTeX{}\ implementation such
  1568. as \LyX{}.
  1569. \subsubsection{What is \LaTeX{}\ ?}
  1570. \LaTeX{}\ (pronounced LAY-tech) is an extension on the \TeX{}\ typesetting
  1571. system. It largely consists of a set of macros that allow one to focus
  1572. on the structure of the document while letting the \TeX{}\ engine
  1573. do the heavy lifting in terms of determining the optimal formatting
  1574. for the page. \LaTeX{}\ is used in a large number of academic journals
  1575. (including those of the American Mathematics Association). It is available
  1576. at \url{http://www.tug.org} and is included in most Linux distributions.
  1577. Like HTML, \LaTeX{}\ uses plain text documents to store the formatting
  1578. information and then when the document is rendered, attempts to fit
  1579. it onto a page. \LaTeX{}\
  1580. supports the concept of stylesheets, allowing one to separate content
  1581. from format, and this feature is used in many higher-end applications,
  1582. like journal publication.
  1583. Unlike HTML, \LaTeX{}\ is a complete though simple programming language
  1584. that allows one to redefine internals of the system for formatting
  1585. purposes.
  1586. This document is written in \LaTeX{}.
  1587. \subsubsection{Using \LyX{} to Edit \LaTeX{}\ Templates}
  1588. \LyX{} is a synchronous \LaTeX{}\ editor that runs on Windows, UNIX/Linux,
  1589. and Mac OS X. It requires an installed \LaTeX{}-2e implementation
  1590. and can be obtained at \url{http://www.lyx.org}. Like the most common
  1591. \LaTeX{}\ implementations, it is open source and is included with most
  1592. Linux distributions.
  1593. \subsection{Customizing Logos}
  1594. \LaTeX{}\ requires different formats of logos depending on whether
  1595. the document is going to be generated as a PDF or as postscript. Postscript
  1596. requires an embedded postscript graphic, while PDF requires any type
  1597. of graphic other than embedded postscript. Usually one uses a PNG's
  1598. for PDF's, though GIF's could be used as well. The logo for a \LaTeX{}\ document
  1599. resides in the users directory.
  1600. HTML documents can have logos in many different formats. PNG's are
  1601. generally preferred for printing reasons. The image can be stored
  1602. anywhere and merely referenced in the HTML.
  1603. Note: Always test the an invoice with images to ensure that
  1604. the rest of the page format is not thrown off by it.
  1605. \subsection{How are They Stored in the Filesystem?}
  1606. The template directory (\char`\"{}templates\char`\"{} in the root
  1607. Ledger-SMB install directory) contains all the root templates used
  1608. by Ledger-SMB. These follow a naming convention of COAType-templatename.ext
  1609. where COAType is the type of dataset that was created when the user
  1610. was created, templatename is the name of the template, and ext is
  1611. either txt, html, or tex (for text, html, and \LaTeX{}\ respectively).
  1612. Inside this directory are one or more subdirectories where the relevant
  1613. templates have been copied as default language templates for the user.
  1614. Many users can use the same user directory (which bears the name of
  1615. the Ledger-SMB username). Within this directory are more subdirectories
  1616. for translated templates, one for each language created.
  1617. \subsection{Upgrade Issues}
  1618. When Ledger-SMB is upgraded, the templates are not replaced. This
  1619. is designed to prevent the upgrade script from overwriting changes
  1620. made during the course of customizing the templates.
  1621. Occasionally, however, the data model changes in a way which can cause
  1622. the templates to stop printing certain information. When information
  1623. that was showing up before an upgrade stops showing up, one can either
  1624. upgrade the templates by copying the source template over the existing
  1625. one, or one can edit the template to make the change.
  1626. \clearpage
  1627. \part{Technical Overview}
  1628. \section{Basic Architecture}
  1629. Ledger-SMB is a web-based Perl program that interfaces with PostgreSQL
  1630. using the relevant Perl modules. The code is well partitioned, and
  1631. the main operation modules are written in an object oriented way.
  1632. \subsection{The Software Stack}
  1633. %
  1634. \begin{figure}[hbtp]
  1635. \label{fig-sl-stack} \input{sl-stack.tex}
  1636. \caption{The Ledger-SMB software stack in a Typical Implementation}
  1637. \end{figure}
  1638. Ledger-SMB runs in a Perl interpreter. I do not currently know if
  1639. it is possible to run it with Perl2C or other language converters
  1640. to run in other environments. However, except for high-capacity environments,
  1641. Perl is a good language choice for this sort of program.
  1642. Ledger-SMB used to support DB2 and Oracle as well as PostgreSQL. However,
  1643. currently some of the functionality is implemented using PostgreSQL
  1644. user-defined functions. These would need to be ported to other database
  1645. managers in order to make the software work on these. It should not
  1646. be too hard, but the fact that it has not been done yet may mean that
  1647. there is no real demand for running the software under other RDBMS's.
  1648. One can substitute other web servers for Apache. Normally Ledger-SMB
  1649. is run as a CGI program but it may be possible to run it in the web
  1650. server process (note that this may not be entirely thread-safe).
  1651. The operating system can be any that supports a web server and Perl
  1652. (since PostgreSQL need not run on the same system). However, there
  1653. are a few issues running Ledger-SMB on Windows (most notably in trying
  1654. to get Postscript documents to print properly).
  1655. On the client side, any web-browser will work. Currently, the layout
  1656. is different for Lynx (which doesn't support frames), and the layout
  1657. is not really useful under eLinks (the replacement for Lynx which
  1658. does support frames). Some functionality requires Javascript to work
  1659. properly, though the application is usable without these features.
  1660. \subsection{Capacity Planning}
  1661. Some companies may ask how scalable Ledger-SMB is. In general, it
  1662. is assumed that few companies are going to have a need for a high-concurrency
  1663. accounting system. However, with all the features available in Ledger-SMB,
  1664. the staff that may have access to some of the application may be senior
  1665. enough to make the question worthwhile.
  1666. This question also becomes more important when companies might look
  1667. at integrating Ledger-SMB with a CRM solution, online store, or other
  1668. environment. This section looks at a number of the known issues and
  1669. their solutions.
  1670. \subsubsection{Scalability Strategies}
  1671. Ledger-SMB is a fairly standard web-based application. However,
  1672. sometimes the database schema changes during upgrades. In these cases,
  1673. it becomes impossible to use different versions of the software against
  1674. the same database version safely. Ledger-SMB checks the version of
  1675. the database and if the version is higher than the version of the
  1676. software that is running, will refuse to run.
  1677. Therefore although one strategy might be to run several front-end
  1678. web servers with Ledger-SMB, in reality this can be a bit of a problem.
  1679. One solution is to take half of the front-end servers off-line while
  1680. doing the initial upgrade, and then take the other offline to upgrade
  1681. when these are brought back online.
  1682. The database manager is less scalable in the sense that one cannot
  1683. just add more database servers and expect to carry on as normal. However,
  1684. aside from the known issues listed below, there are few performance
  1685. issues with it. If complex reports are necessary, these can be moved
  1686. to a replica database (perhaps using Slony-I).
  1687. If this solution is insufficient for database scalability, one might
  1688. be able to move staff who do not need real-time access to new entries
  1689. onto a PG-Pool/Slony-I cluster where new transactions are entered
  1690. on the master and other data is looked up on the replica. In certain
  1691. circumstances, one can also offload a number of other queries from
  1692. the master database in order to minimize the load. Ledger-SMB has
  1693. very few issues in the scalability of the application.
  1694. \subsubsection{Database Maintenance}
  1695. PostgreSQL uses a technique called Multi-version Concurrency Control
  1696. (MVCC) to provide a snapshot of the database at the beginning of a
  1697. statement or transaction (depending on the transaction isolation level).
  1698. When a row is updated, PostgreSQL leaves the old row in the database,
  1699. and inserts a new version of that row into the table. Over time, unless
  1700. those old rows are removed, performance can degrade as PostgreSQL
  1701. has to search through all the old versions of the row in order to
  1702. determine which one ought to be the current one.
  1703. Due to the way the SQL statements are executed in Ledger-SMB, most
  1704. inserts will also create a dead row.
  1705. A second problem occurs in that each transaction is given a transaction
  1706. id. These id's are numbered using 32-bit integers. If the transaction
  1707. id wraps around (prior to 8.1), data from transactions that appear
  1708. (due to the wraparound) to be in the future suddenly becomes inaccessible.
  1709. This problem was corrected in PostgreSQL 8.1, where the database will
  1710. refuse to accept new transactions if the transaction ID gets too close
  1711. to a wraparound. So while the problem is not as serious in 8.1, the
  1712. application merely becomes inaccessible rather than displaying apparent
  1713. data loss. Wraparound would occur after about a billion transactions
  1714. between all databases running on that instance of PostgreSQL.
  1715. Prior to 8.1, the main way to prevent both these problems was to run
  1716. a periodic vacuumdb command from cron (UNIX/Linux) or the task scheduler
  1717. (Windows). In 8.1 or later, autovacuum capabilities are part of the
  1718. back-end and can be configured with the database manager. See the
  1719. PostgreSQL documentation for treatment of these subjects.
  1720. In general, if performance appears to be slowly degrading, one should
  1721. try to run vacuumdb -z from the shell in order to attempt to reclaim
  1722. space and provide the planner with accurate information about the
  1723. size and composition of the tables. If this fails, then one can go
  1724. to other methods of determining the bottleneck and what to do about
  1725. it.
  1726. \subsubsection{Known issues}
  1727. The PostgreSQL planner assumes a minimum page size of ten pages for
  1728. a physically empty table. The reasoning behind this choice is that
  1729. a table could grow rapidly and one could end up with bad database
  1730. performance if the planner assumes a very small table.
  1731. However, if you end up with joins between a very large table with
  1732. millions of rows and a physically empty table, one can end up with
  1733. a very bad query plan. In this case, the planner will choose a nested
  1734. loop join and run through this loop for every row in the large table.
  1735. As a result, performance will suddenly drop once the large table becomes
  1736. too large to effectively do index scans of the join criteria on both
  1737. tables. This problem most often occurs when people have no warehouses,
  1738. departments, or projects defined and are running systems with a large
  1739. number of transactions (such as a point of sale environment).
  1740. Last time I saw this problem, the server would wait for thirty seconds
  1741. to display a new point of sale screen while the server CPU activity
  1742. would spike to 100\%.
  1743. One solution is to define one warehouse, department, and project,
  1744. and then run vacuumdb -z from the shell to force the planner to acknowledge
  1745. these tables as single-row tables. The other option is to go into
  1746. the source code and edit the database queries to omit unused tables.
  1747. \section{Customization Possibilities}
  1748. Ledger-SMB is designed to be customized relatively easily and rapidly.
  1749. In general, the source code is well written and compartmentalized.
  1750. This section covers the basic possibilities involving customization.
  1751. \subsection{Brief Guide to the Source Code}
  1752. Ledger-SMB is an application with over 34000 lines of code. While
  1753. it is not possible to cover the entire application here, a brief overview
  1754. of the source code is in order.
  1755. In the root of the install directory, one will find a setup.pl program,
  1756. a number of other .pl programs, and a number of directories. The setup.pl
  1757. program is used to update or install Ledger-SMB. The other .pl programs
  1758. provide a basic set of services for the framework (including authentication)
  1759. and then pass the work on to the data entry screen file in the bin
  1760. directory.
  1761. The bin directory contains another directory for each terminal type.
  1762. The main two offered are lynx and mozilla. Lynx would be used for
  1763. web browsers that do not support frames and is ideal for a text-mode
  1764. VGA terminal. Mozilla is the terminal type used for most other web
  1765. browsers. The perl files within these directories provides the user
  1766. interface of the software.
  1767. The css directory in the root install directory contains CSS documents
  1768. to provide various stylesheets one can select for changing various
  1769. aspects of the look and feel of the application.
  1770. The locale directory contains translation files that Ledger-SMB uses
  1771. to translate between different languages. One could add translations
  1772. to these files if necessary.
  1773. The SL directory is where the Perl modules reside that provide the
  1774. core business logic in Ledger-SMB. These modules provide functionality
  1775. such as form handling, email capabilities, and access to the database
  1776. through its at least partially object oriented API.
  1777. Finally, the sql directory provides the database schemas and upgrade
  1778. scripts.
  1779. \subsection{Data Entry Screens}
  1780. One can customize the data entry screens to optimize work flow, display
  1781. additional information, etc.
  1782. \subsubsection{Examples}
  1783. We set up hot keys for payment lines, automatically focused the keyboard
  1784. on the last partnumber field, removed separate print and post buttons
  1785. to ensure that invoices were always printed and posted together, and
  1786. removed the ability to print to the screen, and even the ability to
  1787. scan items in when an invoice was received (using a portable data
  1788. terminal) and import this data into Ledger-SMB. Finally we added the
  1789. ability to reconcile the till online in a paperless manner.
  1790. For another customer, we added the ability to print AR invoices in
  1791. plain text format and added templates (based on the POS sales template)
  1792. to do this.
  1793. \subsection{Extensions}
  1794. One can add functionality to the Perl modules in the SL directory
  1795. and often add missing functions easily.
  1796. \subsubsection{Examples}
  1797. For one customer, we added a module to take data from a portable data
  1798. terminal collected when inventory items were taken and use that to
  1799. add shrinkage and loss adjustments. We also extended the parts model
  1800. to add a check id flag (for alcohol sales) and added this flag to
  1801. the user interface.
  1802. For another customer, we added a complex invoice/packing slip tracking
  1803. system that allowed one to track all the printed documents associated
  1804. with an order or invoice.
  1805. \subsection{Templates}
  1806. As noted before templates can be modified or extended, though sometimes
  1807. this involves extending the user interface scripts. Most templates
  1808. are easy enough to modify.
  1809. \subsubsection{Examples}
  1810. For one customer we added text-only invoices for AR and AP transactions/Invoices
  1811. and an ability to use Javascript in them to automatically print them
  1812. on load.
  1813. \subsection{Reports}
  1814. The fact that all the data is available within the database manager
  1815. is a huge advantage of Ledger-SMB over Quickbooks and the like. The
  1816. rapid development of reports allows for one to easily develop reports
  1817. of any sort within Ledger-SMB.
  1818. \subsubsection{Examples}
  1819. For one customer, we developed a report of parts sold and received
  1820. during arbitrary time frames. The report allows one to go back and
  1821. look up the invoices involved.
  1822. \section{Integration Possibilities}
  1823. An open database system and programming API allows for many types
  1824. of integration. There are some challenges, but in the end, one can
  1825. integrate a large number of tools.
  1826. \subsection{Reporting Tools}
  1827. Any reporting tool which can access the PostgreSQL database can be
  1828. used with Ledger-SMB for custom reporting. These can include programs
  1829. like Microsoft Access and Excel (using the ODBC drivers), PgAccess
  1830. (A PostgreSQL front-end written in TCL/Tk with a similar feel to Access),
  1831. Rekall, Crystal Reports, OpenOffice and more.
  1832. \subsubsection{Examples}
  1833. We have created spreadsheets of the summaries of activity by day and
  1834. used the ODBC driver to import these into Excel. Excel can also read
  1835. HTML tables, so one can use PostgreSQL to create an HTML table of
  1836. the result and save it with a .xls extension so that Windows opens
  1837. it with Excel. These could then be served via the same web server
  1838. that serves Ledger-SMB.
  1839. \subsection{Line of Business Tools on PostgreSQL}
  1840. Various line of business tools have been written using PostgreSQL
  1841. in large part due to the fact that it is far more mature than MySQL
  1842. in areas relating to data integrity enforcement, transactional processing,
  1843. and the like. These tools can be integrated with Ledger-SMB in various
  1844. ways. One could integrate this program with the HERMES CRM framework,
  1845. for example.
  1846. \subsubsection{Known Issues}
  1847. Ledger-SMB uses a single 'id' sequence across many tables. At the
  1848. same time it is expected that these tables do not have identical id
  1849. values in their records as they are used as a sort of pseudo-foreign
  1850. key by the acc\_trans table which stores the financial transaction
  1851. information.
  1852. If the integration solution does not keep this in mind, it is possible
  1853. to create a situation where the account transactions are ambiguously
  1854. associated with a number of different types of financial transactions.
  1855. This would lead to a large number of problems.
  1856. \subsubsection{Strategies}
  1857. In general, it is advisable to run all such programs that benefit
  1858. from integration in the same database but under different schemas.
  1859. This allows PostgreSQL to become the main method of synchronizing
  1860. the data in real time. However, sometimes this can require dumping
  1861. the database, recreating the tables etc. in a different schema and
  1862. importing the data back into Ledger-SMB.
  1863. One possibility for this sort of integration is to use database triggers
  1864. to replicate the data between the applications in real-time. This
  1865. can avoid the main issue of duplicate id's. One issue that can occur
  1866. however relates to updates. If one updates a customer record in HERMES,
  1867. for example, how do we know which record to update in Ledger-SMB?
  1868. There are solutions to this problem but they do require some forethought.
  1869. A second possibility is to use views to allow one application to present
  1870. the data from the other as its own. This can be cleaner regarding
  1871. update issues, but it can also pose issues regarding duplicate id
  1872. fields.
  1873. \subsubsection{Examples}
  1874. Others have integrated L'ane POS and Ledger-SMB in order to make it
  1875. work better with touch screen devices. Still others have successfully
  1876. integrated Ledger-SMB and Interchange. In both cases, I believe that
  1877. triggers were used to perform the actual integration.
  1878. \subsection{Line of Business Tools on other RDBMS's}
  1879. Often there are requests to integrate Ledger-SMB with applications
  1880. like SugarCRM, OSCommerce, and other applications running on MySQL
  1881. or other database managers. This is a far more complex field and it
  1882. requires a great deal more effort than integrating applications within
  1883. the same database.
  1884. \subsubsection{Strategies}
  1885. Real-time integration is not always possible. MySQL does
  1886. not support the SQL extension SQL/MED (Management of External Data) that
  1887. supports non-MySQL data sources so it is not possible to replicate the
  1888. data in real-time. Therefore
  1889. one generally resorts to integrating the system using time-based updates.
  1890. Replication may be somewhat error-prone unless the database manager
  1891. supports triggers (first added to MySQL in 5.0) or other mechanisms
  1892. to ensure that all changed records can be detected and replicated.
  1893. In general, it is usually advisable to add two fields to the record--
  1894. one that shows the insert time and one that shows the last update.
  1895. Additionally, I would suggest adding additional information to the
  1896. Ledger-SMB tables so that you can track the source record from the
  1897. other application in the case of an update.
  1898. In general, one must write replication scripts that dump the information
  1899. from one and add it to the other. This must go both ways.
  1900. \subsubsection{Integration Products and Open Source Projects}
  1901. While many people write Perl scripts to accomplish the replication,
  1902. an open source project exists called DBI-Link. This package requires
  1903. PL/Perl to be installed in PostgreSQL, and it allows PostgreSQL to
  1904. present any data accessible via Perl's DBI framework as PostgreSQL
  1905. tables. DBI-Link can be used to allow PostgreSQL to pull the data
  1906. from MySQL or other database managers.
  1907. DBI-Link can simplify the replication process by reducing the operation
  1908. to a set of SQL queries.
  1909. \section{Customization Guide}
  1910. This section is meant to provide a programmer with an understanding
  1911. of the technologies enough information to get up to speed quickly
  1912. and minimize the time spent familiarizing themselves with the software.
  1913. Topics in this section are listed in order of complexity. As it appeals
  1914. to a narrower audience than previous discussions of this topic, it
  1915. is listed separately.
  1916. \subsection{General Information}
  1917. The main framework scripts (the ar.pl, ap.pl, etc. scripts found in
  1918. the root of the installation directory) handle such basic features
  1919. as instantiating the form object, ensuring that the user is logged
  1920. in, and the like. They then pass the execution off to the user interface
  1921. script (usually in the bin/mozilla directory).
  1922. Ledger-SMB in many ways may look sort of object oriented in its design,
  1923. but in reality, it is far more data-driven than object oriented. The
  1924. Form object is used largely as a global symbol table and also as a
  1925. collection of fundamental routines for things like database access.
  1926. It also breaks down the query string into sets of variables which
  1927. are stored in its attribute hash table.
  1928. In essence one can and often will store all sorts of data structures
  1929. in the primary Form object. These can include almost anything. It
  1930. is not uncommon to see lists of hashes stored as attributes to a Form
  1931. object.
  1932. \subsection{Customizing Templates}
  1933. Templates are used to generate printed checks, invoices, receipts,
  1934. and more in Ledger-SMB. Often the format of these items does not fit
  1935. a specific set of requirements and needs to be changed. This document
  1936. will not include \LaTeX{} or HTML instruction, but will include a
  1937. general introduction to editing templates. Also, this is not intended
  1938. to function as a complete reference.
  1939. Template instructions are contained in tags \textless\% and \%\textgreater.
  1940. The actual parsing is done by the parse\_template function in SL/Form.pm.
  1941. \subsubsection{Page Breaks in \LaTeX{}}
  1942. The first tag one will see with \LaTeX{}\ templates is \textless\%pagebreak
  1943. num1 num2 num3\%\textgreater
  1944. \begin{itemize}
  1945. \item num1 represents characters per line
  1946. \item num2 represents lines on first page
  1947. \item num3 represents lines on second page.
  1948. \end{itemize}
  1949. The pagebreak block is terminated by \textless\%end pagebreak\%\textgreater.
  1950. Any text within the pagebreak block is ignored by the template.
  1951. \subsubsection{Conditionals}
  1952. \begin{itemize}
  1953. \item \textless\%if not varname\%\textgreater tells the parser to
  1954. include the next block only if varname was posted by the submitting
  1955. form (or set via the form hash elsewhere in the scripts). The block
  1956. ends with \textless\%end varname\%\textgreater
  1957. \item \textless\%if varname\%\textgreater tells the parser to include the
  1958. block if varname was posted in the submitting form (or set via
  1959. the form hash elsewhere in the scripts). The block ends with \textless\%end
  1960. varname\%\textgreater
  1961. \item Lines conditionals are otherwise ignored by the parser.
  1962. \item Conditionals cannot be nested, but IF's can be nested inside loops.
  1963. \end{itemize}
  1964. \subsubsection{Loops}
  1965. \textless\%foreach varname\%\textgreater is used to iterate through
  1966. a list of vars set by the user interface system (usually one of the
  1967. files under bin/mozilla (or otherwise). The block is repeated for
  1968. each varname in a list. Block ends with \textless\%end varname\%\textgreater
  1969. \subsubsection{File Inclusion}
  1970. \begin{itemize}
  1971. \item Files may be included with the syntax \textless\%include template\_name\%\textgreater
  1972. where templatename is the name of the template within the current
  1973. template directory (usually templates/\$username/)
  1974. \item Cannot be used with conditionals
  1975. \item Filenames cannot use slashes (/) or .. due to directory transversal
  1976. considerations.
  1977. \item Files can force other files to be included, but the same file cannot
  1978. be included more than once.
  1979. \end{itemize}
  1980. \subsubsection{Cross-referencing and multiple passes of \LaTeX{}}
  1981. In \LaTeX{}\ cross-references require two passes with latex to resolve.
  1982. This is because the type is set page by page and the program really
  1983. doesn't know on which page a given reference will fall. This becomes
  1984. an even larger issue where floats are concerned as they can move between
  1985. pages for formatting reasons.
  1986. In rare cases, cross-references may point at incorrect pages even
  1987. with two passes (if the inclusion of the cross-reference data moves
  1988. the object to another page). In this case you will need to use three
  1989. passes of \LaTeX{}\ in order to have accurate references.
  1990. Ledger-SMB as of the time of this writing (2.6.8) only makes one pass
  1991. at the \LaTeX{}\ file. To force it to make more than one pass, open
  1992. Form.pm with your favorite text editor. Look for the line:
  1993. system(\char`\"{}latex --interaction=nonstopmode \$self-\textgreater$\lbrace$
  1994. tmpfile$\rbrace$\
  1995. \textgreater\ \$ self-\textgreater$\lbrace$ tmpfile$\rbrace$
  1996. .err\char`\"{});
  1997. Duplicate this line for two passes, or add two copies if you need
  1998. three passes.
  1999. \subsubsection{Variable Substitution}
  2000. The following format is used for variable substitution:
  2001. \begin{itemize}
  2002. \item \textless\%varname options\%\textgreater Options are one or more
  2003. (whitespace separated) of:
  2004. \begin{itemize}
  2005. \item align=left/right/center
  2006. \item width=chars where chars is the width in characters before wrapping
  2007. \item offset=chars where chars is the number of spaces to (depending on
  2008. alignment).
  2009. \end{itemize}
  2010. \end{itemize}
  2011. \subsection{Customizing Forms}
  2012. Data entry forms and other user interface pieces are in the bin directory.
  2013. In Ledger-SMB 1.0.0 and later, symlinks are not generally used.
  2014. Each module is identified with a two letter combination: ar, ap, cp,
  2015. etc. These combinations are generally explained in the comment headers
  2016. on each file.
  2017. Execution in these files begins with the function designated by the
  2018. form->$\lbrace$action$\rbrace$ variable. This variable is usually
  2019. derived from configuration parameters in the menu.ini or the name
  2020. of the button that was clicked on to submit the previous page. Due
  2021. to localization requirements, the following process is used to determine
  2022. the appropriate action taken:
  2023. The \$locale-\textgreater getsub routine is called. This routine
  2024. checks the locale package to determine if the value needs to be translated
  2025. back into an appropriate SL function. If not, the variable is lower-cased,
  2026. and all spaces are converted into underscores.
  2027. In general there is no substitute for reading the code to understand
  2028. how this can be customized and how one might go about doing this.
  2029. \subsection{Customizing Modules}
  2030. The Perl Modules (.pm files) in the LedgerSMB directory contain the
  2031. main business logic of the application including all database access.
  2032. Most of the modules are relatively easy to follow, but the code quality
  2033. leaves something to be desired. The API calls themselves are
  2034. likely to be replaced in the future, so work on documenting API calls is
  2035. now focused solely on those calls that are considered to be stable.
  2036. At the moment, the best place to request information on the API's is on
  2037. the Developmers' Email List (\mailto{ledger-smb-devel@lists.sourceforge.net}).
  2038. Many of these modules have a fair bit of dormant code in them which
  2039. was written for forthcoming features, such as payroll and bills of
  2040. materials.
  2041. One can add a new module through the normal means and connect it to
  2042. other existing modules.
  2043. \subsubsection{Database Access}
  2044. The \$form object provides two methods for accessing the database.
  2045. The \$form-\textgreater dbconnect(\%myconfig) method commits each
  2046. individual statement as its own transaction. The \$form-\textgreater
  2047. dbconnect\_noauto(\%myconfig) method requires a manual commit. Both
  2048. these functions are thin wrappers around the standard Perl DBI operations.
  2049. \subsection{CLI Examples}
  2050. Louis Moore contributed some SQL-Ledger CLI examples that still work for
  2051. LedgerSMB. You can find his page at \url{http://www.sql-ledger.org/cgi-bin/nav.pl?page=contrib/moore.html&title=Louis\%20B.\%20Moore}.
  2052. \clearpage
  2053. \part{Appendix}
  2054. \appendix
  2055. %dummy comment inserted by tex2lyx to ensure that this paragraph is not empty
  2056. \section{Where to Go for More Information}
  2057. There are a couple of relevant sources of information on Ledger-SMB
  2058. in particular.
  2059. The most important resources are the LedgerSMB web site
  2060. (\url{http://www.ledgersmb.org}) and the email lists found at our Sourceforge
  2061. site.
  2062. In addition, it is generally recommended that the main bookkeeper
  2063. of a company using Ledger-SMB work through at least one accounting
  2064. textbook. Which textbook is not as important as the fact that a textbook
  2065. is used.
  2066. \section{Quick Tips}
  2067. \subsection{Understanding Shipping Addresses and Carriers}
  2068. Each customer can have a default shipping address. This address is
  2069. displayed prominantly in the add new customer screen. To change the
  2070. shipping address for a single order, one can use the ship to button
  2071. at the bottom of the quote, order, or invoice screen.
  2072. The carrier can be noted in the Ship Via field. However, this is a
  2073. freeform field and is largely used as commentary (or instructions
  2074. for the shipping crew).
  2075. \subsection{Handling bad debts}
  2076. In the event that a customer's check bounces or a collection requirement
  2077. is made, one can flag the customer's account by setting the credit
  2078. limit to a negative number.
  2079. If a debt needs to be written off, one can either use the allowance
  2080. method (by writing it against the contra asset account of \char`\"{}Allowance
  2081. for Bad Debts\char`\"{} or using the direct writeoff method where
  2082. it is posted as an expense.
  2083. \section{Step by Steps for Vertical Markets}
  2084. \subsection{Common Installation Errors}
  2085. \begin{itemize}
  2086. \item Ledger-SMB is generally best installed in its own directory outside
  2087. of the wwwroot directory. While it is possible to install it inside
  2088. the wwwroot directory, the instructions and the faq don't cover the
  2089. common problems here.
  2090. \item When the chart of accounts (COA) is altered such that it is no longer
  2091. set up with appropriate items, you can make it impossible to define
  2092. goods and services properly. In general, until you are familiar with
  2093. the software, it is best to rename and add accounts rather than deleting
  2094. them.
  2095. \end{itemize}
  2096. \subsection{Retail With Light Manufacturing}
  2097. For purposes of this example we will use a business that assembles
  2098. computers and sells them on a retail store.
  2099. \begin{enumerate}
  2100. \item Install Ledger-SMB.
  2101. \item Set preferences, and customize chart of accounts.
  2102. \begin{enumerate}
  2103. \item Before customizing the COA it is suggested that you consult an accountant.
  2104. \end{enumerate}
  2105. \item Define Goods, Labor, and Services as raw parts ordered from the vendors.
  2106. \begin{itemize}
  2107. \item These are located under the goods and services menu node.
  2108. \end{itemize}
  2109. \item Define assemblies.
  2110. \begin{itemize}
  2111. \item These are also located under goods and services.
  2112. \item Component goods and services must be defined prior to creating assembly.
  2113. \end{itemize}
  2114. \item Enter an AP Invoice to populate inventory with proper raw materials.
  2115. \begin{itemize}
  2116. \item One must generally add a generic vendor first. The vendor is added
  2117. under AP-\textgreater Vendors-\textgreater Add Vendor.
  2118. \end{itemize}
  2119. \item To pay an AP invoice like a check, go to cash-$>$payment. Fill out
  2120. approrpiate fields and click print.
  2121. \begin{itemize}
  2122. \item Note that one should select an invoice and enter in the payment amount
  2123. in the appropriate line of the invoice list. If you add amounts to
  2124. the master amount list, you will find that they are added to the amount
  2125. paid on the invoice as a prepayment.
  2126. \item The source field is the check number.
  2127. \end{itemize}
  2128. \item Stock assemblies
  2129. \item One can use AR Invoices or the POS interface to sell goods and services.
  2130. \begin{itemize}
  2131. \item Sales Invoice
  2132. \begin{itemize}
  2133. \item Can be generated from orders or quotations
  2134. \item Cannot include labor/overhead except as part of an assembly
  2135. \item One can make the mistake of printing the invoice and forgetting to
  2136. post it. In this event, the invoice does not officially exist in the
  2137. accounting system.
  2138. \item For new customers, you must add the customer first (under AR-\textgreater
  2139. Customers-\textgreater Add Customer.
  2140. \end{itemize}
  2141. \item POS Interface
  2142. \begin{itemize}
  2143. \item Cannot include labor/overhead except as part of an assembly
  2144. \item Printing without posting is often even easier in the POS because of
  2145. the rapid workflow. Yet it is just as severe a problem.
  2146. \end{itemize}
  2147. \item Ecommerce and Mail Order Operations
  2148. \begin{itemize}
  2149. \item See the shipping workflow documentation above.
  2150. \end{itemize}
  2151. \item Customers are set up by going to AR-\textgreater Customers-\textgreater
  2152. Add Customer (or the equivalent localized translation). The appropriate
  2153. fields are filled out and the buttons are used at the bottom to save
  2154. the record and optionally use it to create an invoice, etc.
  2155. \begin{itemize}
  2156. \item Saving a customer returns to the customer screen. After the appropriate
  2157. invoice, transaction, etc. is entered and posted, Ledger-SMB will
  2158. return to the add customer screen.
  2159. \end{itemize}
  2160. \end{itemize}
  2161. \item One can use the requirements report to help determine what parts need
  2162. to be ordered though one cannot generate PO's directly from this report.
  2163. \end{enumerate}
  2164. Note, the needs of Ledger-SMB are mostly useful for light manufacturing
  2165. operations (assembling computers, for example). More manufacturing
  2166. capabilities are expected to be released in the next version.
  2167. A custom assembly is a bit difficult to make. One must add the assembly
  2168. prior to invoice (this is not true of goods and services). If the
  2169. assembly is based on a different assembly but may cost more (due to
  2170. non-standard parts) you can load the old assembly using Goods and
  2171. Services-\textgreater Reports-\textgreater Assemblies and then make
  2172. necessary changes (including to the SKU/Partnumber) and save it as
  2173. new.
  2174. Then one can add it to the invoice.
  2175. \section{Glossary}
  2176. \begin{description}
  2177. \item [{BIC}] Bank Identifier Code is often the same as the S.W.I.F.T.
  2178. code. This is a code for the bank a customer uses for automated money
  2179. transfers.
  2180. \item [{COGS}] is Cost of Goods Sold. When an item is sold, then the expense
  2181. of its purchase is accrued as attached to the income of the sale.
  2182. It is tracked as COGS.
  2183. \item [{Credit}] : A logical transactional unit in double entry accounting.
  2184. It is the opposite of a debit. Credits affect different account types
  2185. as follows:
  2186. \begin{description}
  2187. \item [{Equity}] : Credits are added to the account when money is invested
  2188. in the business.
  2189. \item [{Asset}] : Credits are added when money is deducted from an asset
  2190. account.
  2191. \item [{Liability}] : Credits are added when money is owed to the business
  2192. account.
  2193. \item [{Income}] : Credits are added when income is earned.
  2194. \item [{Expense}] : Credits are used to apply adjustments at the end of
  2195. accounting periods to indicate that not all the expense for an AP
  2196. transaction has been fully accrued.
  2197. \end{description}
  2198. \item [{Debit}] : A logical transactional unit in double entry accounting
  2199. systems. It is the opposite of a credit. Debits affect different account
  2200. types as follows:
  2201. \begin{description}
  2202. \item [{Equity}] : Debits are added when money is paid to business owners.
  2203. \item [{Asset}] : Debits are added when money is added to an account.
  2204. \item [{Liability}] : Debits are added when money that is owed is paid
  2205. off.
  2206. \item [{Income}] : Debits are used to temporarily adjust income to defer
  2207. unearned income to the next accounting period.
  2208. \item [{Expense}] : Debits are added as expenses are incurred.
  2209. \end{description}
  2210. \item [{IBAN}] International Bank Account Number is related to the BIC
  2211. and is used for cross-border automated money transfers.
  2212. \item [{List}] Price is the recommended retail price.
  2213. \item [{Markup}] is the percentage increase that is applied to the last
  2214. cost to get the sell price.
  2215. \item [{ROP}] Re-order point. Items with fewer in stock than this will
  2216. show up on short reports.
  2217. \item [{Sell}] Price is the price at which the item is sold.
  2218. \item [{SKU}] Stock Keeping Unit: a number designating a specific product.
  2219. \item [{Source}] Document : a paper document that can be used as evidence
  2220. that a transaction occurred. Source documents can include canceled
  2221. checks, receipts, credit card statements and the like.
  2222. \item [{Terms}] is the number of days one has to pay the invoice. Most
  2223. businesses abbreviate the terms as Net n where n is the number of
  2224. days. For example, Net 30 means the customer has 30 days to pay the
  2225. net due on an invoice before it is late and incurs late fees. Sometimes
  2226. you will see 2 10 net 30 or similar. This means 2\% discount if paid within
  2227. 10 days but due within 30 days in any case.
  2228. \end{description}
  2229. \input{fdl.tex}
  2230. \end{document}