PARAMETERS lLocal


SET TALK off
SET STATUS BAR OFF
SET SYSMENU off
SET DELETED on
SET CONFIRM OFF
SET NOTIFY off
SET SAFETY off
SET CENTURY ON
SET DATE TO DMY

*** Clases para el manejo de Web
SET PATH TO ".\classes" ADDITIVE
SET PROCEDURE TO wwHTTP ADDITIVE   
SET PROCEDURE TO wwAPI ADDITIVE
SET PROCEDURE TO wwFTP ADDITIVE
SET PROCEDURE TO wwUtils ADDITIVE

*SET CLASSLIB TO json\boleteria\boleteria ADDITIVE 

*SET PATH TO ".\json\boleteria" ADDITIVE

SET PATH TO ".\json\" ADDITIVE


*SET PROCEDURE TO json/qdfoxJSON ADDITIVE
*JSONStart()


WAIT WINDOW "Cargando Ghost..." nowait

Local lcDefaultPath
lcDefaultPath = Sys(5)+Sys(2003)
Set Path To (Addbs(lcDefaultPath)+"Images") Additive
Set Default To (lcDefaultPath)

_screen.Visible = .T.
_screen.Caption = 'Ghost@v4'

_screen.Icon = 'images/ico/ghost_flat.ICO'
_screen.AutoCenter = .t.
_screen.Closable = .t.
_screen.Height = 550
_screen.Width = 900
_screen.ControlBox = .T.
_SCREEn.BorderStyle = 2
_screen.AutoCenter= .T.
_screen.Show



*DO app.prg WITH cBdd, .t.

DO app.prg WITH '', .t.

DO json\json_cliente.prg WITH !EMPTY(llocal)

DO json\js.prg

oJson.initMon()

*!*	IF !FILE(oApp.cFileTestDllSqlite)
*!*	  	STRTOFILE('',oApp.cFileTestDllSqlite)
*!*	  	declare integer DLLSelfRegister in [Vb6stkit.DLL] string lpDllName
*!*		DLLSelfRegister([NewObjectsPack1.dll])
*!*		DLLSelfRegister([SQLITE3COMUTF8.dll])
*!*	ENDIF

PUBLIC db   as "newObjectsPack1.sqlite.dbutf8"
PUBLIC pd   as "newObjectsPack1.sqlite.dbutf8"



db = CreateObject("newObjects.sqlite3.dbutf8")
db.NoErrorMode = .T.

pd = CreateObject("newObjects.sqlite3.dbutf8")
pd.NoErrorMode = .T.


IF pd.Open(oJson.cBddNamePd) THEN 
	cCmdBddPd = crear_bdd_pd_sql()
	oJson.sqlite (pd,cCmdBddPd)
ENDIF
pd.execute('ALTER TABLE pedidodet ADD noteunidad varchar(20) DEFAULT ""')
pd.Close()



_screen.Caption = 'Ghost@V4 - '+oApp.cbEnterprise

*WAIT WINDOW '22'
DO FORM v5main WITH 'v4'

Read Events


_SCREEN.WindowState = 2
CLEAR ALL
CLOSE ALL
SET SYSMENU TO defa
On Shutdown
   Clear Events
   If _vfp.StartMode > 0
      Quit
   Endif

_screen.ControlBox= .T.