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