under construction

Object Data Examples

Example invoice

well known invoice

Invoices are well known. Everybody gets invoices; many companies and independents write invoices. This is only an easy example to explain the master detail form; so some necessary fields for an invoice are missing. The data is stored in 2 tables:

  • Invoice-Head: k8documents
  • Positions: k8documentitems

Datadefinition 3 defines this invoice. The file for this example is: object_invoice_form.php. The steps to create this form are the following:

create the tables

Create the tables with: mysql/object_invoice.sql

html templates for the form

For the main fields I use jsonform. For the child records I need 2 html snippets:

  • container snippet
  • record snippet

the container snippet kitsamples/object_invoice_container.html:

the recordset snippet kitsamples/object_invoice_record.html:

the datadefinition

Special settings in the datadefinition:

In the "masterdata/_datadefintion.php the html is loaded into the datadefintion:

css file for items elements

The main fields are formatted with bootstrap. The CSS cares for this:

  • min height for container
  • headline and footline
  • flexbox for the items table
  • input fields like bootstrap with smaller padding
  • position for sum

object_invoice.css, pls declare it in the head

js file for calculation

object_invoice.js
In each line the total of quantity and price has to be calculated. The Sum of quantity and price has to be displayed in the document foot.
Here for the javascritpt file: object_invoice.js is created. insert article

Example customer

customer object

this is the table structure:

  • er_customer
    • er_employee
    • er_deliveryaddress

create the tables

Create the tables with: mysql/object_area.sql

datadefinition

datadefID=20

kitsamples/object_customer.json

html snippet for the container

kitsamples/object_customer_container.html

html snippet for the arrays

kitsamples/object_customer_employee_record.html

kitsamples/object_customer_da_record.html

CSS

Formatting for the arrays (css/object_areas.css):

Example areas

nested object: areas

the area objext consist of 4 tables:

  • TPprojects
  • TPareas
  • TPsurfaces
  • TPpoints

create the tables

Create the tables with: mysql/object_area.sql

datadefinition

datadefID=10

object_area.json

the json configuration:

html snippet for the container

the following html snippets are necessary:

  • object_area_container.html
  • object_area_record.html
  • object_area_surface_record.html
  • object_area_point_record.html

kitsamples/object_area_container.html

html snippet for the arrays

kitsamples/object_area_record.html

kitsamples/object_area_surface_record.html

kitsamples/object_area_point_record.html

css file for items elements

Formatting for the arrays (css/object_areas.css):