Explanation for used database tables in Kave 2000
=================================================

Missing:
 - Rolls.db
 - Orderln : Roll

All database tables are Paradox 7.0 tables.

This program uses following database tables:

================================================================================
Color.db
    Table to control available colors and their codes
================================================================================

       Code*    Color   Back            Text
-------------------------------------------------
1	RR00	Steel	13220024	0
2	RR31	Black	0	        16777215
3	RR32	Blue	16711680	65535
4	RR33	Brown	5196450	        65535
5	RR34	Green   65280	        0
6	RR35	Red	255	        0
7	RR36	White	16777215	0
8	RR37	Yellow	65535	        0
9	RR38	Pink	12615935	0
10	RR39	Orange	33023           0
--------------------------------------------------

Code*   A10 - code for the color
Color   A10 - name for the color
Back    I   - RGB for background color (the visible color)
Text    I   - RGB for text color (not to loose black text to black bkgnd)

================================================================================
Customer.db
    Table to control customers and their contact information
================================================================================

 CustomerNr Name     Street               Zip   City         Phone1    Phone2
--------------------------------------------------------------------------------
1    3	Leivon Shk         	          42070	LEIVONMKI   112233    112234
2    4	Kave Oy	     Matinmentie 34 B 7  40270	Palokka	     014-3781  338
3    5	Sintech Oy   Kelokuja 20	  40100	Jyvskyl    014-675   121
--------------------------------------------------------------------------------

CustomerNr*  I    - customer number
Name         A20  - customer name
Street       A20  - street address
Zip          A10  - zip code
City         A20  - city address
Phone1       A20  - phone number for contact 1
Phone2       A20  - phone number for contact 2

================================================================================
3)  lastcode.db
    Table to control last used color codes for each material
    (mainly used in selecting materials for not to loose selected
     color when looking other material)
================================================================================

        Nr    LastCode
-----------------------
1		RR32
2	1	RR00
3	2	RR00
4	3	RR32
5	4	RR34
6	5	RR32
-----------------------

Nr*        A10 - Matrial number
LastCode   A10 - last selected color code for material

================================================================================
MatColor.db
    Table to control what colors are available for selected material
================================================================================

        Nr      ColorCode
----------------------
1	1	RR00
2	2	RR00
3	3	RR32
6	3	RR38
7	4	RR00
8	4	RR31
9	4	RR32
11	4	RR35
12	4	RR39
13	5	RR32
----------------------

Nr*           A10 - material code
ColorCode*    A10 - color code for that material

================================================================================
Material.db
    Table to control what colors are available for selected material
================================================================================

        Nr    Material  Thickness Weigth
--------------------------------------
1	1	Sin	0.5	3 200
2	2	Sin	0.6	3 400
3	3	PVC	0.5	2 700
4	4	Sil	0.5	2 500
5	5	Sil	0.6	2 800
--------------------------------------

Nr*         A10 - material code
Material    A15 - name for the material
Thickness   N   - thickness of the material
Weigth      N   - ewight of the material g/m2

================================================================================
Orderln.db
    Table to control ordered lines
================================================================================

     OrderNr   Nr     Material Color   Len      Qty   Done      UserNic
----------------------------------------------------------------------------
1	1	1	1	0	  500	5	0	Vesa
2	1	2	1	0	2 000	1	1	Vesa
3	1	3	3	8	2 000	3	1	Vesa
4	1	4	1	0	3 400	2	0	Vesa
5	1	5	1	0	4 500	3	3
6	1	6	1	0	1 230	3
7	2	3	3	4	4 250	4	1	Vesa
8	3	1	1	0	1 000	3	3
9	3	2	3	3	2 000	4	4
10	3	3	4	4	2 100	2	2
11	4	1	3	8	1 200	6	3
12	5	1	1	0	1 200	3	4
----------------------------------------------------------------------------

OrderNr*      I   - order number for the line
Nr*           S   - liner number from that order
Len           N   - length of the sheet
Qty           N   - how many sheets to do
Done          N   - how many sheet is done
UserNic       A10 - who did the order


================================================================================
Ordernr.db
    Table to control orders
================================================================================

        MachineNr                        Material RollNr      ToCoG Total_m
  OrderNr CustomerNr OrderDate DeliveryDate   Color      S SortOrder    UserNic
--------------------------------------------------------------------------------
1	1   1   5 12.10.1996  2.11.1996	             112   0  0         Jukka
2	2   1	4 17.10.1996  1.11.1996	   1   RR00        1  1         Teuvo
3	3   1	5 12. 9.1996  4.11.1996                  x 0  2
4	4   1	5  2.11.1996  5.11.1996			                Vesa
5	5   1	3 12.11.1996 14.12.1996
6	6   3	3 13.11.1996 15.11.1996
--------------------------------------------------------------------------------

OrderNr*       I   - order number
MachineNr      A10 - machine number
CustomerNr     I   - customer number
OrderDate      D   - date the order was signed up
DeliveryDate   D   - date when the order should be out
Material       A10 - material code (no need if roll code)
Color          A10 - color code    ( -" -               )
RollNr         A10 - roll code
S              A1  - special = there is many different material in the order
ToCoG          S   - to center of gravity (0=no, 1=yes)
SortOrder      S   - driving order (0=line order,1=long bottom, 2=short bottom)
Total_m        N   - total amount of the order in m
UserNic        A10 - user code

================================================================================
Machine.db
    Table to control machines
================================================================================

     MachineNr  Name            Width   BWidth
-----------------------------------------------
1	1	Super Tile	1 100	1 250
2	3	High Tile	1 000	1 250
-----------------------------------------------

MachineNr*     A10 - machine number
Name           A20 - name of the machine
Width          N   - netto wdith of the machine
BWidth         N   - brutto width of the machine

================================================================================
Users.db
    Table to control people working in the factory
================================================================================

        Nr      Name                 Nick name  Passwd
--------------------------------------------------------
1	1	Vesa Lappalainen	Vesa	1 234
2	2	Timo Lappalainen	Tipi	3 333
3	3	Jukka Sintonen	        Jukka	3 456
4	4	Jukka Virtanen	        Hyrr	1 111
5	5	Teijo Hyl	        Teijo	2 222
--------------------------------------------------------

================================================================================
OrdMat.db
    Table to control Order-Material relations.
    If all order lines have the same material, it's stored in
    OrderNr.db, otherwise here
================================================================================

OrderNr Nr Material Color RollNr Qty
--------------------------------------------------------


--------------------------------------------------------
OrderNr*      I   - order number for the line
Nr*           S   - liner number from that order
Material*     A10 - material code for the line  (look material db)
Color*        A10 - color code for the line (look color.db)
RollNr*       A10 - rollnumber for that line
Qty           N   - how many sheets to do with these setting, blank=all


================================================================================
Rolls.db
    Table to control roll usage
================================================================================

RollNr Material Color Capacity RollLeft InDate LastUsedDate
-------------------------------------------------------------

-------------------------------------------------------------

RollNr*       A10 - rollnumber
Material      A10 - material code for the roll
Color         A10 - color code for the roll
Capacity      N   - how many meters originally in the roll
RollLeft      N   - how many metrs left in the roll
InDate        D   - when the roll came in
LastUsedDate  D   - when was the roll last used


================================================================================
rorderln.db
    Table for ready made orderlines
================================================================================

DTime*       A18 - date+time when done
+                - all fielad from orderln

================================================================================
rorder.db
    Table for ready made orders
================================================================================
DTime*       A18 - date+time when done
+                - all fielad from order

================================================================================
rsheet.db
    Table for every cut
================================================================================
DTime*       A18 - date+time when done
OrderNr*      I   - order number for the line
Nr*           S   - liner number from that order
Len           N   - length we should get
Cut           N   - lenght when cut
Brutto        N   - length with pressing counted
Material      A10 - material code for the line  (look material db)
Color         A10 - color code for the line (look color.db)
RollNr*       A10 - rollnumber
UserNic       A10 - who did the order

================================================================================
rOrdMat.db
    Table to control Order-Material relations.
    If all order lines have the same material, it's stored in
    OrderNr.db, otherwise here
================================================================================

OrderNr Nr Material Color RollNr Qty
--------------------------------------------------------


--------------------------------------------------------
OrderNr*      I   - order number for the line
Nr*           S   - liner number from that order
Material*     A10 - material code for the line  (look material db)
Color*        A10 - color code for the line (look color.db)
RollNr*       A10 - rollnumber for that line
Qty           N   - how many sheets to do with these setting, blank=all


