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