DOS accounting system to TWeb

User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

DOS accounting system to TWeb

Post by Otto »

Hello,
today I started converting my DOS accounting system to TWeb.
I also had a WINDOWS accounting but this was not accepted by the power users.
Therefore I try to copy the screens from the DOS program.
From time to time I will post here about the progress.

Best regards and a nice weekend to all
Otto
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello,
I changed the start menu and canceled description. For expert mode - and accounting is done by experts - this is not necessary.
Regards
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: DOS accounting system to TWeb

Post by Silvio.Falconi »

do you're using DBF ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello,
the new web APP is SQL.
The old desktop DOS accounting had DBF support only.

As a first step to convert my DOS program to a web program I wrote an upload program which exports the dbf files to SQL. Uploading and creating the new tables is handled from Fivewin.

Best regards
Otto

Image

Code: Select all


function f_konto()
   local aFibu := {}
   local cTable := "konto"
   local oRs
   local aCols :=  { { "KTONR", "C", 9, 0 },;
      { "KURZ", "C", 7, 0 },;
      { "NAME", "C", 25, 0 },;
      { "BRANCH", "C", 20, 0 },;
      { "STRA", "C", 25, 0 },;
      { "PLZ", "C", 9, 0 },;
      { "ORT", "C", 9, 0 },;
      { "SAMMEL", "C", 2, 0 },;
      { "MWSTSATZ", "N", 2, 0 },;
      { "STEUER", "C", 1, 0 },;
      { "FW_CODE", "C", 2, 0 },;
      { "KASSA", "C", 3, 0 },;
      { "SKONTO", "C", 4, 0 },;
      { "ZIEL", "C", 3, 0 },;
      { "BA_BLZ", "C", 5, 0 },;
      { "BA_KTO", "C", 13, 0 },;
      { "BA_BEZ", "C", 15, 0 },;
      { "MKZ", "C", 1, 0 },;
      { "VZ", "C", 1, 0 },;
      { "KONTOART", "C", 1, 0 },;
      { "SAMMELZEIC", "N", 1, 0 },;
      { "FIL", "C", 1, 0 },;
      { "SALDO", "N", 14, 2 },;
      { "BUDGET", "N", 14, 2 },;
      { "VERGLEICH", "N", 14, 2 },;
      { "GL1", "C", 10, 0 },;
      { "GL2", "C", 10, 0 },;
      { "GL3", "C", 10, 0 },;
      { "GL4", "C", 10, 0 } }
   LOCAL cDBF := "c:\TWeb\fibu dbf files\konto.DBF"
   *----------------------------------------------------------
   
   use( cDBF ) new ALIAS TMPDBF
   oCn   := maria_Connect( "???.???.???.???", "fibu", "root", "password" )
   IF oCn == nil
      ? "Connect fail"
      RETURN NIL
   ENDIF

   IF oCn:TableExists( cTable )
      oCn:DropTable( cTable )
   ENDIF

   IF oCn:CreateTable( cTable, aCols, .T., "utf8" )
      ? cTable + " Created"
      do while .not. eof()
         AADD(aFibu, { field->KTONR,field->KURZ,field->NAME,field->BRANCH,field->STRA,field->PLZ,field->ORT,field->SAMMEL,field->MWSTSATZ,field->STEUER,field->FW_CODE,field->KASSA,field->SKONTO,field->ZIEL,field->BA_BLZ,field->BA_KTO,field->BA_BEZ,field->MKZ,field->VZ,field->KONTOART,field->SAMMELZEIC,field->FIL,field->SALDO,field->BUDGET,field->VERGLEICH,field->GL1,field->GL2,field->GL3,field->GL4 } )

         SKIP
      enddo

      oCn:Insert( cTable, ;
         "KTONR,KURZ,NAME,BRANCH,STRA,PLZ,ORT,SAMMEL,MWSTSATZ,STEUER,FW_CODE,KASSA,SKONTO,ZIEL,BA_BLZ,BA_KTO,BA_BEZ,MKZ,VZ,KONTOART,SAMMELZEIC,FIL,SALDO,BUDGET,VERGLEICH,GL1,GL2,GL3,GL4", aFibu )
      oRs   := oCn:RowSet( cTable )
      XBROWSER oRs SETUP oBrw:nRowHeight := 30
      oRs:Close()
   ELSE
      ? "Failed to create " + cTable
   ENDIF

   oCn:Close()
   select TMPDBF
   close
return nil
//-----------------------------------
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: DOS accounting system to TWeb

Post by Jack »

Hi Otto,
Great job .
1) Is it possible to use TWEB with MS SQL database ?
2) Could we say that TWEB is a php code generator ?

Thanks ,

Philippe
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: DOS accounting system to TWeb

Post by Marc Venken »

Otto wrote:Hello,
the new web APP is SQL.
The old desktop DOS accounting had DBF support only.

As a first step to convert my DOS program to a web program I wrote an upload program which exports the dbf files to SQL. Uploading and creating the new tables is handled from Fivewin.

Best regards
Otto

Image

Code: Select all


function f_konto()
   local aFibu := {}
   local cTable := "konto"
   local oRs
   local aCols :=  { { "KTONR", "C", 9, 0 },;
      { "KURZ", "C", 7, 0 },;
      { "NAME", "C", 25, 0 },;
      { "BRANCH", "C", 20, 0 },;
      { "STRA", "C", 25, 0 },;
      { "PLZ", "C", 9, 0 },;
      { "ORT", "C", 9, 0 },;
      { "SAMMEL", "C", 2, 0 },;
      { "MWSTSATZ", "N", 2, 0 },;
      { "STEUER", "C", 1, 0 },;
      { "FW_CODE", "C", 2, 0 },;
      { "KASSA", "C", 3, 0 },;
      { "SKONTO", "C", 4, 0 },;
      { "ZIEL", "C", 3, 0 },;
      { "BA_BLZ", "C", 5, 0 },;
      { "BA_KTO", "C", 13, 0 },;
      { "BA_BEZ", "C", 15, 0 },;
      { "MKZ", "C", 1, 0 },;
      { "VZ", "C", 1, 0 },;
      { "KONTOART", "C", 1, 0 },;
      { "SAMMELZEIC", "N", 1, 0 },;
      { "FIL", "C", 1, 0 },;
      { "SALDO", "N", 14, 2 },;
      { "BUDGET", "N", 14, 2 },;
      { "VERGLEICH", "N", 14, 2 },;
      { "GL1", "C", 10, 0 },;
      { "GL2", "C", 10, 0 },;
      { "GL3", "C", 10, 0 },;
      { "GL4", "C", 10, 0 } }
   LOCAL cDBF := "c:\TWeb\fibu dbf files\konto.DBF"
   *----------------------------------------------------------
   
   use( cDBF ) new ALIAS TMPDBF
   oCn   := maria_Connect( "???.???.???.???", "fibu", "root", "password" )
   IF oCn == nil
      ? "Connect fail"
      RETURN NIL
   ENDIF

   IF oCn:TableExists( cTable )
      oCn:DropTable( cTable )
   ENDIF

   IF oCn:CreateTable( cTable, aCols, .T., "utf8" )
      ? cTable + " Created"
      do while .not. eof()
         AADD(aFibu, { field->KTONR,field->KURZ,field->NAME,field->BRANCH,field->STRA,field->PLZ,field->ORT,field->SAMMEL,field->MWSTSATZ,field->STEUER,field->FW_CODE,field->KASSA,field->SKONTO,field->ZIEL,field->BA_BLZ,field->BA_KTO,field->BA_BEZ,field->MKZ,field->VZ,field->KONTOART,field->SAMMELZEIC,field->FIL,field->SALDO,field->BUDGET,field->VERGLEICH,field->GL1,field->GL2,field->GL3,field->GL4 } )

         SKIP
      enddo

      oCn:Insert( cTable, ;
         "KTONR,KURZ,NAME,BRANCH,STRA,PLZ,ORT,SAMMEL,MWSTSATZ,STEUER,FW_CODE,KASSA,SKONTO,ZIEL,BA_BLZ,BA_KTO,BA_BEZ,MKZ,VZ,KONTOART,SAMMELZEIC,FIL,SALDO,BUDGET,VERGLEICH,GL1,GL2,GL3,GL4", aFibu )
      oRs   := oCn:RowSet( cTable )
      XBROWSER oRs SETUP oBrw:nRowHeight := 30
      oRs:Close()
   ELSE
      ? "Failed to create " + cTable
   ENDIF

   oCn:Close()
   select TMPDBF
   close
return nil
//-----------------------------------
 
There are functions to convert dbf to sql ? Is it not easier to use ?
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: DOS accounting system to TWeb

Post by Silvio.Falconi »

I not remember good now But I founded the possibility to use also dbf with a Web System not was tweb
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello Philippe,

I do not know if it is working with MS SQL. But I think as an advice if you work with FIVEWIN MySQL - as nearly all of us are using it - is the best option if you need community help too.
TWeb is php code a framework.

The creator of TWeb Carles says:
“I am a son of Harbor and FWH. Tweb was born with the same philosophy of work.
Obviously Windows will exist many years. Obviously Internet is here and we have to take advantage of it.”


Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Silvio,
for me SQL is perfect.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello Marc,
The code I posted converts dbf file to SQL and creates SQL tables and uploads the data to the server.
I think this can’t be easier.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello,
we will start the reprogramming of our accounting software with the reporting part.
We are currently reaching certain limits with the DOS software in the DOSBOX printing the reports.
-------------------------------------------------------------------------------------------------------------------
Therefore we upload a current data status with the posted source code before we execute report queries to the sever.

We did some tests.
The upload for a small company with the data of one year takes about 10 - 12 sec.

Kind regards
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello,

now the first basic grid from TWeb.
Image

Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Massimo Linossi
Posts: 474
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: DOS accounting system to TWeb

Post by Massimo Linossi »

Hi Otto.
Can we see a little piece of code for making the grid above ?
Thanks a lot
Massimo
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: DOS accounting system to TWeb

Post by Marc Venken »

Otto wrote:Hello Marc,
The code I posted converts dbf file to SQL and creates SQL tables and uploads the data to the server.
I think this can’t be easier.
Best regards
Otto
From post of Mr. Rao

This opens the dbf file, creates a table with the same structure and copies the data. By default, it creates the table with the same name as the dbf. If we want a different table name, we can give that as the second paramter.

Example:

Code: Select all

oCn:ImportFromDBF( "c:\fwh\samples\customer.dbf" )
 
http://forums.fivetechsupport.com/viewt ... 8&start=15
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: DOS accounting system to TWeb

Post by Otto »

Hello Massimo,

Please read this post:

http://forums.fivetechsupport.com/viewt ... =6&t=35444

I took test_grid_update.php from the Tweb.examples.

\tweb.examples\test_grid_update.php

The only thing I did was to change the SERVERNAME and ceredentials and the table.
Then I changed inside the code the fieldnames to my names.

@Mark, thank you for the info. I will try the function tomorrow.

Best regards
Otto

Code: Select all


<?php 
include ( 'config.php' );
include( TWEB_PATH . "core.php" );
include( TWEB_PATH . "core.grid.php" );

$oWeb = new TWeb( 'Test TGrid - Updated' );
    
$oWeb->Activate();

    $oWnd = new TWindow();
    
        $o = new TBar( $oWnd, 'mybtnbar' );
            $o->AddButton( null, 'Load' , 'TGrid_Load()'    , 'images/db.png' );
            $o->AddButton( null, 'Save' , 'TGrid_Save()'    , 'images/save.png' );
            
        $o = new TGrid( $oWnd, 'mygrid', 60, 10 );
            $o->lSingle = false;
            $o->cTitle  = 'Customer';
            $o->SetRight( 10 );
            $o->SetBottom( 40 );            
            $o->lForceFitColumns = true;            
        
            //$oCol = $o->AddCol( 'id'     , 'Id'        , 100 );        
            $oCol = $o->AddCol( 'KTONR'  , 'KTONR'     , 100, 'C' );        
            $oCol = $o->AddCol( 'NAME'   , 'Name'      , 100, 'C');        
            $oCol = $o->AddCol( 'SALDO'  , 'Saldo'     , 100, 'C');                                         
        
    $oWnd->Activate();
    
$oWeb->End()    
?>

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply