New forms

You can easily build your own data entry forms and reports and integrate seamlessly into sql-ledger. We provide sample code on this page which makes it much easier for you. The code contains comments which will help you to adapt it for your own tables.

1. Screen Shots

Here are screen shots from sampleform.pl installed and running.

2. Installation

This sample form is minimal Perl code required to build and integrate a new data entry form into sql-ledger. This sample form allows you to add, change, delete and search data in the given database table.

Steps to install the sample form:

1. Download the sampleform.perl and rename it to sampleform.pl

2. Create the new table in your dataset by running this sql statement through phppgadmin, pgadmin or psql.

CREATE TABLE production (
	id		INTEGER DEFAULT NEXTVAL('id'),
	reference	TEXT,
	transdate	DATE DEFAULT current_date,
	parts_id	INTEGER,
	description	TEXT,
	qty		FLOAT,
	cost		FLOAT,
	notes		TEXT,
	employee_id	INTEGER
);

3. Copy this script to your ../sql-ledger/bin/mozilla/ folder.

4. Create a gateway script in ../sql-ledger/ folder by copying any existing gateway script. For example; cp gl.pl sampleform.pl

5. Edit your custom_menu.ini and add the following lines:

[Sample Form]

[Sample Form--Add]
module=sampleform.pl
action=add

[Sample Form--Reports]
module=sampleform.pl
action=search

6. Optionally run perl locale.pl in your language folder if you are not using the default English language.

You are done.

3. Tips to build forms on your own data tables.

  1. There should be a column with auto-generated values in your database table. It should be named id. Some thing like id INTEGER DEFAULT NEXTVAL('id') in your table definition will accomplish this.
  2. You can copy/rename sampleform.pl (form1.pl, form2.pl, assets.pl etc.) to create any number of forms.

We can also build a custom form for you with all sql-ledger features and integration. For details send email to sales@ledger123.com.

 
new_forms.txt · Last modified: 2010/05/06 12:05 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki