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