#include "fivewin.ch"
static oCn
//----------------------------------------------------------------------------//
function main
if ( oCn := FW_DemoDB() ) == nil
return nil
endif
oCn:lShowErrors := .t.
CreateTables()
return nil
//----------------------------------------------------------------------------//
function CreateTables()
local n, i, aDet := {}
oCn:DropTable( "t_menu" )
if !oCn:TableExists( "t_menu" )
oCn:CreateTable( "t_menu", { ;
{ "menu_id" , 'N', 14, 0, "PRI" }, ;
{ "menu_name" , 'C', 50, 0 },;
{ "parent_menu_id", 'N', 14, 0 } } )
oCn:Insert( "t_menu", "menu_id,menu_name,parent_menu_id", ;
{ { 1, "Master" , nil }, ;
{ 2, "Transaction" , nil }, ;
{ 3, "Accounts" , 1 }, ;
{ 4, "Items" , 1 }, ;
{ 5, "Others" , 1 }, ;
{ 6, "Tax" , 5 }, ;
{ 7, "Category" , 5 }, ;
{ 8, "Voucher" , 2 }, ;
{ 9, "Quick Entry", 8 }, ;
{ 10, "Multple Entry", 8 }, ;
{ 11, "Inventory" , 2 }, ;
{ 12, "Sales" , 11 }, ;
{ 13, "Purchase" , 11 }, ;
{ 14, "Returns" , 11 }, ;
{ 15, "Sales Return" , 14 }, ;
{ 16, "Purchase Return" , 14 }, ;
{ 17, "Credit Note" , 11 }, ;
{ 18, "Debit Note" , 11 } } )
endif
xbrowser oCn:rowset( "t_menu" ) TITLE "MASTER TABLE"
return nil
//----------------------------------------------------------------------------//