POS Directory Structure
From the project root, POS is found in the directory pos/is4c-nf. The pos directory is leftover from an old idea of having multiple point of sale interfaces that were all compatible with the underlying database structure. The is4c-nf name stands for "no frames" because the original IS4C involved several pages in a frameset.
Under pos/is4c-nf you will find:
- ajax-callbacks which contains request handlers for AJAX calls. It's one of the only sections of POS that is not currently object oriented. Request handlers typically accept data via both POST and GET interchangeably and return a JSON encoded response.
- css contains CSS files for POS
- graphics contains image files for POS. The most notable one is is4c.gif which is used as the background for POS. This file should be a symlink to minimize overwriting other peoples' logos via git.
- gui-class-lib contains a handful of base classes used for drawing POS pages.
- gui-modules contains the default set of pages for POS. Each of these inherits from one of the base classes in gui-class-lib. The "main" page of POS is named pos2.php for weird historical reasons.
install contains the scripts for installing POS' databases and managing configuration.
- install/data contains sample data in CSV or a psuedo-SQL format.
lib is the deepest directory. It contains two fairly different things. One is library classes collecting common functionality that may be called from various places. These classes contain nothing but static methods. They're only implemented as classes for organizational purposes. The second thing lib contains is base classes for hookable, modular functionality. In many cases there are also a default set of modules.
- lib/adminlogin contains classes that interact with the admin login page. These classes control what the login page says and what happens if a correct password is entered or the operation is aborted.
- lib/FooterBoxes contains classes that draw FooterBoxes. These are the five fields along the bottom of the screen.
- lib/Kickers contains classes that control when the cash drawer opens.
- lib/LocalStorage contains classes that read and write state information. These are not necessarily replaceable modules but there hasn't ever been a need for that.
lib/models contains model classes representing POS' tables and views.
- lib/models/op contains models for the operational database (default "opdata")
- lib/models/trans contains models for the transaction database (default "translog")
- lib/PrinterHandlers contains classes that format receipt text for compatibility with different printer devices.
lib/ReceiptBuilding contains a whole bunch of modules related to generating receipt text.
- lib/ReceiptBuilding/custMessages contains member-specific messages attached to the footer of the receipt.
- lib/ReceiptBuilding/Messages contains generic messages attached to the footer of the receipt.
- lib/ReceiptBuilding/ReceiptDataFetch contains classes that fetch transaction records from the database. This is the first step of itemized receipt generation.
- lib/ReceiptBuilding/ReceiptFilter contains classes that determine which transaction records should be included. This is the second step of itemized receipt generation.
- lib/ReceiptBuilding/ReceiptFormat contains classes that transform a transaction record into a printable string. This is the fifth and final step of itemized receipt generation.
- lib/ReceiptBuilding/ReceiptSort contains classes that sort transaction records into the printing order. This is the third step of itemized receipt generation.
- lib/ReceiptBuilding/ReceiptTag contain classes that map each transaction record to an appropriate formatting class. This is the fourth step of itemized receipt generation.
- lib/ReceiptBuilding/TenderReports contain classes for drawing different style tender reports.
lib/Scanning contains classes related to items' settings and behavior.
- lib/Scanning/DiscountTypes contain classes that calculate sale pricing. These correspond directly to settings for the "discounttype" column in the products table.
- lib/Scanning/PriceMethods contain classes that calculate complex pricing. These correspond directly to settings for the "pricemethod" column in the products table. Price method differs from discount type in that price method largely deals with group pricing (e.g., buy one get one).
- lib/Scanning/SpecialDepts contains classes that attach special functionality to departments. These generally apply to both individual items and open rings.
- lib/Scanning/SpecialUPCs contain classes that handle UPCs which do not exist in the products table.
- lib/Scanning/VariableWeightReWrites contain class related to variable weight/price barcodes with UPC prefix "2" and mapping the variable barcodes back to logical items.
- lib/Search/Products contains classes that perform product searches.
- lib/Tenders contain classes that control the behavior of a tender when added to the transaction.
- lib/TotalActions contain classes that "run" each time the transaction is totaled. These may add items to the transaction or check for conditions that merit an error/warning.
- locale contains gettext language files. Internationalization is a very, very long-term project.
- log contains POS' error logs. PHP issues are logged in php-errors.log; SQL issues are logged in queries.log.
parser-class-lib contains classes used in POS' input processing.
- parser-class-lib/preparse contains PreParser classes. These are executed in the first stage of input processing.
- parser-class-lib/parse contains Parser classes. These are executed in the second stage of input processing.
- plugins contains optional functionality. Each plugin is a separate directory under plugins. The directory structure within the plugin may be whatever the author prefers.
scale-drivers contains code for interacting with low-level hardware
scale-drivers/drivers contains different driver implementations. None of the current drivers are written in PHP. These run as an entirely separate process from the webserver.
- scale-drivers/drivers/NewMagellan is the "default" driver package and contains the most up-to-date driver files for both scannerscale and integrated PIN pad.
- scale-drivers/php-wrappers contains PHP classes responsible for communication between the webserver and the driver process.
- scale-drivers/drivers contains different driver implementations. None of the current drivers are written in PHP. These run as an entirely separate process from the webserver.
- test contains a handful of debugging scripts. None of these are executed during normal POS operations.
- unit-tests contains PHPUnit-based unit tests for POS.