Getting Started with PHP and webERP Development


With the source code available it is possible to make webERP do pretty much anything you want... BUT you need to understand the program scripts that make up webERP.

All these scripts use the PHP programming language... a tutorial on PHP programming is outside the scope of the webERP documentation but there is extensive information available and many online tutorials:

webERP is written with nice simple PHP - as simple as possible so I could understand it ... it is therefore not a bad program to learn some PHP with. Having read a couple of the articles above - there is no substitute for diving in. PHP is very flexible but webERP scripts try to follow a series of conventions as rigorously as possible - see Coding Style Guide and Project Goals

Description of the function of each of the webERP Scripts This will always be out of date.... there is a table in the database called naturally enough scripts - that describes the function of each script and is kept up to date.

I would strongly recommend using an editor with syntax highlighting - this changes the colour and bolds keywords of the programming code so you can see what words are variables and what words are PHP functions etc as they are displayed in a different colour. I use Context Editor in windows there are probably better ones - but this is a free download and is small and fast - working on the same principles as webERP.... in linux I use geany or KATE - K Advanced Text Editor which comes with every distribution of linux. There are other Integrated Development Environments IDEs but I am a purist and these simple tools I have recommended suffice.

Of course accounting applications are database applications and an understanding of the data structure is also required to make sense of the code .... the code does use english names for variables and data throughout and error messages are in the code where you'd expect them to be so you can figure out the code quite easily. There is a start on a document that describes the database tables and there is a database diagram showing the relationships between tables for your reference on this wiki.


Getting to Know Your Way Around the Scripts

webERP uses a few common include files throughout that must be understood:
includes/ConnectDB.inc - database abstraction
includes/session.inc - initiation of session and security checking
includes/header.inc - page headings and quick menu links
includes/footer.inc - page footer
includes/DateFunctions.inc - Date functions (included in session.inc)
includes/MiscFunctions.inc - Functions for printing messages prnMsg
includes/PDFStarter.inc - PDF report generation
includes/SQL_CommonFunctions.inc - common functions that retrieve database info or update the database eg GetNextTransNo
and config.php which is included by includes/session.inc and is separate from session.inc only because it requires user editing to enter the database user and password.
Most scripts use all the first 6.
Transactional scripts also use an includes/DefineXXXXXXClass.php script.
PDF reporting scripts generally have an includes/PDFXXXXXXXPageHeader.inc script for the report page titles.
Apart from these files above, most scripts are otherwise self contained so that a knowledge of these includes and the main script should be all that's needed to be confident in modifying the script.

More Help Getting to Grips with webERP code


The manual describes the foundations for all scripts to give you a starting point to understanding the code. There are other resources under the Development section of this Wiki that help you understand which scripts use which tables and what each script does etc...

Valid XHTML :: Valid CSS: :: Powered by WikkaWikiGet webERP Accounting & Business Management at SourceForge.net. Fast, secure and Free Open Source software downloads