-
Notifications
You must be signed in to change notification settings - Fork 6
/
Comun.prg
4676 lines (3208 loc) · 127 KB
/
Comun.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "FiveWin.Ch"
#include "Factu.ch"
#include "Empresa.ch"
#include "hbxml.ch"
#include "Xbrowse.ch"
#include "hbwin.ch"
#include "HdoCommon.ch"
#include "hbthread.ch"
#include "gif.ch"
#include "RichEdi5.ch"
#include "colores.ch"
#include "Constant.ch"
#include "hdo.ch"
#include "hdomysql.ch"
#define CS_DBLCLKS 8
#define NUMERO_TARIFAS 6
#command CTEXT TO VAR <v> => #pragma __cstream|<v>:=%s
#define DT_TOP 0
#define DT_LEFT 0
#define DT_CENTER 1
#define DT_RIGHT 2
#define DT_VCENTER 4
#define DT_BOTTOM 8
#define DT_WORDBREAK 16
#define DT_SINGLELINE 32
#define DT_CALCRECT 1024
#define GWL_STYLE (-16)
#define LWA_ALPHA 0x00000002
memvar nId
static oPnel1
static oWnd
static oWndBar
static oDlgProgress
static oMsgUser
static oMsgDelegacion
static oMsgCaja
static oMsgSesion
static oMsgProgress
static cCodigoEmpresaEnUso
static cCodigoDelegacionEnUso
static aEmpresa
static aDelegacion
static cCodEmp := ""
static aMnuNext := {}
static aMnuPrev := {}
static aDlgEmp := {}
static hVariables := {=>}
static nError := 0
static lDemoMode := .t.
static nHndCaj
static nHndReport
static aEmpresasGrupo := {}
static cDefPicIn
static cDefPicOut
static lAds := .f.
static lAIS := .f.
static lCdx := .f.
static cAdsIp := ""
static cAdsPort := ""
static cAdsData := ""
static nAdsServer := 7
static cAdsFile := "Gestool.Add"
static appParamsMain := ""
static appParamsSecond := ""
static appParamsThird := ""
static cCodigoAgente := ""
static dSysDate
static cEmpUsr := ""
static cPatGrp := ""
static cPatCli := ""
static cPatArt := ""
static cPatPrv := ""
static cPatAlm := ""
static cPatEmp := ""
static cPatScriptEmp := ""
static cPatTmp := ""
static cPathPC := ""
static cNombrePc := ""
static cBmpVersion
static cNameVersion
static cTypeVersion := ""
static lStandard
static lProfesional
static lOsCommerce
static oMsgAlmacen
static cUsrTik
static oFastReport
static hMapaAjuste := { "#,#0" => { "Round" => 1, "Incrementa" => 0.00, "Decrementa" => 0.00, "Ceros" => .t. } ,;
"#,#5" => { "Round" => 1, "Incrementa" => 0.05, "Decrementa" => -0.05, "Ceros" => .f. } ,;
"#,#9" => { "Round" => 1, "Incrementa" => 0.09, "Decrementa" => -0.01, "Ceros" => .f. } ,;
"#,10" => { "Round" => 0, "Incrementa" => 0.10, "Decrementa" => -0.90, "Ceros" => .f. } ,;
"#,20" => { "Round" => 0, "Incrementa" => 0.20, "Decrementa" => -0.80, "Ceros" => .f. } ,;
"#,50" => { "Round" => 0, "Incrementa" => 0.50, "Decrementa" => -0.50, "Ceros" => .f. } ,;
"#,90" => { "Round" => 0, "Incrementa" => 0.90, "Decrementa" => -0.10, "Ceros" => .f. } ,;
"#,95" => { "Round" => 0, "Incrementa" => 0.95, "Decrementa" => -0.05, "Ceros" => .f. } ,;
"#,99" => { "Round" => 0, "Incrementa" => 0.99, "Decrementa" => -0.01, "Ceros" => .f. } ,;
"#,00" => { "Round" => 0, "Incrementa" => 1.00, "Decrementa" => -9.00, "Ceros" => .t. } ,;
"1,00" => { "Round" => -1, "Incrementa" => 11.00, "Decrementa" => -19.00, "Ceros" => .f. } ,;
"5,00" => { "Round" => -1, "Incrementa" => 15.00, "Decrementa" => -15.00, "Ceros" => .f. } ,;
"9,00" => { "Round" => -1, "Incrementa" => 19.00, "Decrementa" => -19.00, "Ceros" => .f. } ,;
"10,00" => { "Round" => -2, "Incrementa" => 110.00, "Decrementa" => 110.00, "Ceros" => .f. } ,;
"20,00" => { "Round" => -2, "Incrementa" => 120.00, "Decrementa" => 120.00, "Ceros" => .f. } ,;
"50,00" => { "Round" => -2, "Incrementa" => 150.00, "Decrementa" => 150.00, "Ceros" => .f. } ,;
"100,00" => { "Round" => -3, "Incrementa" => 200.00, "Decrementa" => 200.00, "Ceros" => .f. } }
#define FW_BOLD 700
#define ID_YES 6
#define ID_NO 7
static oWndMain, oRTF, oFont
static lBold, lItalic, lUnderline, lLink, lSuper, lSub
static lNumber, lBullet, lUpp, lProtect
static oFnt
static lRich20
static oBarR
//----------------------------------------------------------------------------//
FUNCTION oWnd() ; RETURN oWnd
//---------------------------------------------------------------------------//
FUNCTION oWndBar() ; RETURN oWndBar
//---------------------------------------------------------------------------//
FUNCTION CreateMainSQLWindow()
LoggedTest()
// Carga o no la imagen de fondo--------------------------------------------
DEFINE WINDOW oWnd ;
FROM 0, 0 TO 26, 82;
TITLE __GSTROTOR__ + " " + __GSTVERSION__ + " " + cTypeVersion() + " : " + Company():Codigo() + " - " + Company():Nombre() ;
MDI ;
COLORS Rgb( 0, 0, 0 ), Rgb( 231, 234, 238 ) ;
ICON getIconApp() ;
MENU ( BuildMenu() )
oWndBar := CreateMainSQLAcceso( oWnd )
oWndBar:CreateButtonBar( oWnd )
// Set the bar messages-----------------------------------------------------
oWnd:Cargo := appParamsMain()
// Mensajes-----------------------------------------------------------------
oWnd:oMsgBar := TMsgBar():New( oWnd, __GSTCOPYRIGHT__ + Space(2) + cNameVersion(), .f., .f., .f., .f., Rgb( 0,0,0 ), Rgb( 255,255,255 ), oFontLittleTitle(), .f. )
oWnd:oMsgBar:lPaint3L := .f.
oDlgProgress := TMsgItem():New( oWnd:oMsgBar, "", 100, , , , .t. )
oWnd:oMsgBar:oDate := TMsgItem():New( oWnd:oMsgBar, Dtoc( GetSysDate() ), oWnd:oMsgBar:GetWidth( dtoc( getsysdate() ) ) + 12,,,, .t., { || SelSysDate() } )
oWnd:oMsgBar:oDate:lTimer := .t.
oWnd:oMsgBar:oDate:bMsg := {|| GetSysDate() }
oWnd:oMsgBar:checkTimer()
oMsgUser := TMsgItem():New( oWnd:oMsgBar, "Usuario : " + rtrim( Auth():Nombre() ), 200,,,, .t. )
oMsgDelegacion := TMsgItem():New( oWnd:oMsgBar, "Delegación : " + rtrim( Application():codigoDelegacion() ), 200,,,, .t., {|| EnviromentController():Activate() } )
oMsgCaja := TMsgItem():New( oWnd:oMsgBar, "Caja : " + rtrim( Box():Nombre() ), 200,,,, .t., {|| EnviromentController():Activate() } )
oMsgAlmacen := TMsgItem():New( oWnd:oMsgBar, "Almacén : " + rtrim( Application():codigoAlmacen() ), 200,,,, .t., {|| EnviromentController():Activate() } )
oMsgSesion := TMsgItem():New( oWnd:oMsgBar, "Sesión : " + alltrim( str( Session():Numero() ) ) , 100,,,, .t., {|| EnviromentController():Activate() } )
// Abrimos la ventana-------------------------------------------------------
ACTIVATE WINDOW oWnd ;
MAXIMIZED ;
ON PAINT ( WndPaint( hDC, oWnd ) );
ON RESIZE ( WndResize( oWnd ) );
ON INIT ( EnviromentController():New():isShow() );
VALID ( EndApp() )
SysRefresh()
RETURN nil
//-----------------------------------------------------------------------------//
FUNCTION BuildMenu()
local oMenu
MENU oMenu
ENDMENU
RETURN ( oMenu )
//---------------------------------------------------------------------------//
PROCEDURE loggedTest()
// AlbaranesVentasController():runGenerateFacturaVentas()*/
RETURN
//----------------------------------------------------------------------------//
FUNCTION WndResize( oWnd )
local oBlock
local oError
if empty( oWnd )
RETURN ( nil )
end if
oBlock := ErrorBlock( {| oError | ApoloBreak( oError ) } )
BEGIN SEQUENCE
aeval( oWnd:oWndClient:aWnd, {|o| oWnd:oWndClient:ChildMaximize( o ) } )
if !empty( oWndBar )
oWndBar:CreateLogo()
end if
RECOVER
END SEQUENCE
ErrorBlock( oBlock )
RETURN nil
//-----------------------------------------------------------------------------//
FUNCTION oMsgProgress()
if empty( oMsgProgress ) .and. !empty( oWnd() )
oMsgProgress := TProgress():New( 3, oDlgProgress:nLeft() - 2 , oWnd():oMsgBar, 0, , , .t., .f., oDlgProgress:nWidth - 2, 16 )
end if
RETURN ( oMsgProgress )
//--------------------------------------------------------------------------//
FUNCTION EndProgress()
oMsgProgress:End()
oMsgProgress := nil
RETURN ( nil )
//--------------------------------------------------------------------------//
FUNCTION Titulo( cTxt )
RETURN ( if( oWnd() != nil, oWnd():cTitle( cTxt ), "" ) )
//--------------------------------------------------------------------------//
FUNCTION oMsgSesion() ; RETURN ( oMsgSesion )
//--------------------------------------------------------------------------//
FUNCTION oMsgText( cText )
DEFAULT cText := __GSTCOPYRIGHT__ + Space(2) + cNameVersion()
if empty( oWnd() )
RETURN nil
end if
if _isData( oWnd(), "oMsgBar" ) .and. ( oWnd():oMsgBar != nil )
oWnd():oMsgBar:SetMsg( cText )
end if
RETURN ( nil )
//--------------------------------------------------------------------------//
STATIC FUNCTION EndApp()
local oDlg
local oBrush
local oBtnOk
local lFinish
local oBtnCancel
local oBmpVersion
SysRefresh()
if !empty( oWnd() )
oWnd():CloseAll()
end if
SysRefresh()
DEFINE BRUSH oBrush COLOR Rgb( 255, 255, 255 ) // FILE ( cBmpVersion() )
DEFINE DIALOG oDlg RESOURCE "EndApp" BRUSH oBrush
REDEFINE BITMAP oBmpVersion ;
RESOURCE cBmpVersion() ;
ID 600 ;
OF oDlg
oBtnOk := ApoloBtnFlat():Redefine( IDOK, {|| oDlg:end( IDOK ) }, oDlg, , .f., , , , .f., CLR_BLACK, CLR_OKBUTTON, .f., .f. )
oBtnCancel := ApoloBtnFlat():Redefine( IDCANCEL, {|| oDlg:end() }, oDlg, , .f., , , , .f., CLR_BLACK, CLR_WHITE, .f., .f. )
oDlg:bKeyDown := {| nKey | if( nKey == VK_F5, oDlg:end( IDOK ), ) }
ACTIVATE DIALOG oDlg CENTER
if !empty( oBrush )
oBrush:End()
end if
if !empty( oBmpVersion )
oBmpVersion:End()
end if
lFinish := !empty( oDlg ) .and. ( oDlg:nResult == IDOK )
if ( lFinish )
FinishAplication()
end if
RETURN ( lFinish )
//-----------------------------------------------------------------------------//
//
//Procesos de comprobaciones iniciales y lectura de archivos .INI, cuando existan
//
FUNCTION ControlAplicacion()
local oDlg
local oBmpPerpetua
local oBmpSaas
local oBmpDemo
local oSayDemo
local oSerialHD
local nSerialHD
local oSerialUSR
local nSerialUSR
local oLicencia
local nlicencia
local oSayPerpetua
local oSayAlquiler
local cSayAlquiler
if lControlAcceso()
RETURN .t.
end if
nSerialHD := Abs( nSerialHD() )
nSerialUSR := 0
nlicencia := 1
oSayPerpetua := Array( 2 )
oSayAlquiler := Array( 8 )
cSayAlquiler := Array( 8 )
DEFINE DIALOG oDlg RESOURCE "GetSerialNo" TITLE "Sistema de protección"
REDEFINE BITMAP oBmpPerpetua ;
RESOURCE "gc_certificate_32" ;
TRANSPARENT ;
ID 500;
OF oDlg
REDEFINE BITMAP oBmpSaas ;
RESOURCE "gc_piggy_bank_32" ;
TRANSPARENT ;
ID 510;
OF oDlg
REDEFINE BITMAP oBmpDemo ;
RESOURCE "gc_lock2_32" ;
TRANSPARENT ;
ID 520;
OF oDlg
/*
Licencia perpetua-----------------------------------------------------------
*/
REDEFINE RADIO oLicencia ;
VAR nLicencia ;
ID 100, 200, 300 ;
ON CHANGE ( ChangeLicenciaMode( nLicencia, oSerialHd, oSerialUsr, oSayPerpetua, oSayAlquiler, oSayDemo ) ) ;
OF oDlg
REDEFINE SAY oSerialHD ;
PROMPT nSerialHD ;
ID 110 ;
OF oDlg
REDEFINE SAY oSayPerpetua[1] ID 111 OF oDlg
REDEFINE GET oSerialUsr ;
VAR nSerialUSR ;
ID 120 ;
IDSAY 121 ;
PICTURE "99999999999999" ;
OF oDlg
REDEFINE SAY oSayPerpetua[2] ID 130 OF oDlg
/*
Licencia Alquiler-----------------------------------------------------------
*/
REDEFINE GET oSayAlquiler[1] ;
VAR cSayAlquiler[1] ;
ID 210 ;
IDSAY 211 ;
OF oDlg
REDEFINE GET oSayAlquiler[2] ;
VAR cSayAlquiler[2] ;
ID 220 ;
IDSAY 221 ;
OF oDlg
REDEFINE GET oSayAlquiler[3] ;
VAR cSayAlquiler[3] ;
ID 230 ;
IDSAY 231 ;
OF oDlg
REDEFINE GET oSayAlquiler[4] ;
VAR cSayAlquiler[4] ;
ID 240 ;
IDSAY 241 ;
OF oDlg
REDEFINE GET oSayAlquiler[5] ;
VAR cSayAlquiler[5] ;
ID 250 ;
IDSAY 251 ;
OF oDlg
REDEFINE GET oSayAlquiler[6] ;
VAR cSayAlquiler[6] ;
ID 260 ;
IDSAY 261 ;
OF oDlg
REDEFINE GET oSayAlquiler[7] ;
VAR cSayAlquiler[7] ;
ID 270 ;
IDSAY 271 ;
OF oDlg
REDEFINE GET oSayAlquiler[8] ;
VAR cSayAlquiler[8] ;
ID 280 ;
OF oDlg
/*
Licencia demo---------------------------------------------------------------
*/
REDEFINE SAY oSayDemo ID 310 OF oDlg
with object ( TWebBtn():Redefine( 400,,,,, {|| goWeb( __GSTWEB__ ) }, oDlg,,,,, "LEFT",,,,, Rgb( 0, 0, 255 ), Rgb( 0, 0, 255 ),,,, "Ir a la página web de " + __GSTFACTORY__ ) )
:SetTransparent()
:SetText( __GSTWEB__ )
end with
REDEFINE BUTTON ;
ID IDOK ;
OF oDlg ;
ACTION ( ExitDialog( oDlg, nLicencia, nSerialHD, nSerialUSR, oSerialUsr, oSayAlquiler, cSayAlquiler ) )
oDlg:bStart := {|| ChangeLicenciaMode( nLicencia, oSerialHd, oSerialUsr, oSayPerpetua, oSayAlquiler, oSayDemo ) }
ACTIVATE DIALOG oDlg CENTER
oBmpPerpetua:end()
oBmpSaas:end()
oBmpDemo:end()
RETURN .t.
//---------------------------------------------------------------------------//
FUNCTION ExitDialog( oDlg, nLicencia, nSerialHD, nSerialUSR, oSerialUsr, oSayAlquiler, cSayAlquiler )
local n
local nSerialCRC
local aSerialCRC := {}
local cFileIni := FullCurDir() + "2Ktorce.Num"
do case
case nLicencia == 1
if lCheckPerpetuoMode( nSerialUSR )
MsgInfo( "Programa registrado con éxito" )
oDlg:End( IDOK )
else
MsgStop( "Número invalido" )
oSerialUsr:SetFocus()
end if
case nLicencia == 2
if empty( cSayAlquiler[1] )
MsgStop( "El campo N.I.F./ C.I.F. no puede estar vacío" )
oSayAlquiler[1]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[2] )
MsgStop( "El campo nombre no puede estar vacío" )
oSayAlquiler[2]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[3] )
MsgStop( "El campo domicilio no puede estar vacío" )
oSayAlquiler[3]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[4] )
MsgStop( "El campo población no puede estar vacío" )
oSayAlquiler[4]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[5] )
MsgStop( "El campo código postal no puede estar vacío" )
oSayAlquiler[5]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[6] )
MsgStop( "El campo email no puede estar vacío" )
oSayAlquiler[6]:SetFocus()
RETURN .f.
end if
if !lValidMail( cSayAlquiler[6] )
MsgStop( "El campo email no es valido" )
oSayAlquiler[6]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[7] )
MsgStop( "El campo teléfono no puede estar vacío" )
oSayAlquiler[7]:SetFocus()
RETURN .f.
end if
if empty( cSayAlquiler[8] )
MsgStop( "El campo provincia no puede estar vacío" )
oSayAlquiler[8]:SetFocus()
RETURN .f.
end if
CursorWait()
lEnviarCorreoWatchdog( cSayAlquiler, oDlg )
lEnviarCorreoCliente( cSayAlquiler, oDlg )
oDlg:End( IDOK )
CursorWE()
case nLicencia == 3
cTypeVersion( "[VERSIÓN DEMO]" )
oDlg:End( IDOK )
end case
RETURN ( .t. )
//---------------------------------------------------------------------------//
FUNCTION ChangeLicenciaMode( nLicencia, oSerialHd, oSerialUsr, oSayPerpetua, oSayAlquiler, oSayDemo )
do case
case nLicencia == 1
oSerialHd:Show()
oSerialUsr:Show()
aEval( oSayPerpetua, { |o| o:Show() } )
aEval( oSayAlquiler, { |o| o:Hide() } )
oSayDemo:Hide()
case nLicencia == 2
oSerialHd:Hide()
oSerialUsr:Hide()
aEval( oSayPerpetua, { |o| o:Hide() } )
aEval( oSayAlquiler, { |o| o:Show() } )
oSayDemo:Hide()
case nLicencia == 3
oSerialHd:Hide()
oSerialUsr:Hide()
aEval( oSayPerpetua, { |o| o:Hide() } )
aEval( oSayAlquiler, { |o| o:Hide() } )
oSayDemo:Show()
end case
RETURN .t.
//---------------------------------------------------------------------------//
FUNCTION About()
local oDlg
local oTree
local oBrush
local oImgLst
DEFINE BRUSH oBrush FILE ( cBmpVersion() )
DEFINE DIALOG oDlg RESOURCE "About" BRUSH oBrush TITLE "Acerca de " + __GSTROTOR__ + Space( 1 ) + __GSTVERSION__
oImgLst := TImageList():New( 24, 24 )
oImgLst:Add( TBitmap():Define( "gc_businessman_24", , oDlg ) )
oImgLst:Add( TBitmap():Define( "gc_businessman2_24", , oDlg ) )
oImgLst:Add( TBitmap():Define( "gc_dude4_24", , oDlg ) )
oImgLst:Add( TBitmap():Define( "gc_mail2_24", , oDlg ) )
oImgLst:Add( TBitmap():Define( "gc_user_telephone_24", , oDlg ) )
oImgLst:Add( TBitmap():Define( "gc_mail_earth_24", , oDlg ) )
oTree := TTreeView():Redefine( 100, oDlg )
oTree:SetColor( Rgb( 0, 0, 0 ), Rgb( 255, 255, 255 ) )
REDEFINE SAY ID 200 COLOR Rgb( 0, 0, 0 ), Rgb( 255, 255, 255 ) OF oDlg
REDEFINE BUTTON ID IDCANCEL OF oDlg ACTION ( oDlg:end() )
ACTIVATE DIALOG oDlg ;
ON INIT ( oTree:SetImageList( oImgLst ),;
oTree:Add( "Manuel Calero Solís", 0 ),;
oTree:Add( "Antonio Ebrero Burgos", 1 ),;
oTree:Add( "Dario Cruz Mauro", 2 ),;
oTree:Add( "C. Ronda de legionarios, 58", 3 ),;
oTree:Add( "21700 - La Palma del Condado - Huelva",3 ),;
oTree:Add( "902 930 252", 4 ),;
oTree:Add( "mcalero@gestool.es", 5 ),;
oTree:Add( "aebrero@gestool.es", 5 ),;
oTree:Add( "dario@gestool.es", 5 ) ) ;
CENTER
oBrush:End()
RETURN nil
//---------------------------------------------------------------------------//
FUNCTION RunAsistenciaRemota()
local nHnd
if File( FullCurDir() + "Client\Client.Exe" )
nHnd := WinExec( FullCurDir() + "Client\Client.Exe" , 1 )
if !( nHnd > 21 .or. nHnd < 0 )
MsgStop( "Error en la ejecución de la asistencia remota" )
end if
else
goWeb( __GSTWEB__ + "/Client.exe" )
end if
RETURN nil
//---------------------------------------------------------------------------//
FUNCTION lEnviarCorreoWatchdog( cSay, oDlg )
RETURN ( .t. )
//---------------------------------------------------------------------------//
FUNCTION lEnviarCorreoCliente( cSay, oDlg )
RETURN ( .t. )
//---------------------------------------------------------------------------//
// Remember to use 'exit' procedures to asure that resources are
// freed on a possible application error
Static FUNCTION FinishAplication() // Static FUNCTION
CursorWait()
// Cerramos las auditorias--------------------------------------------------
stopServices()
// Cerramos el Activex------------------------------------------------------
closeWebBrowser()
// Limpiamos los recursos estaticos-----------------------------------------
TAcceso():End()
TBandera():Destroy()
freeResources()
cursorWE()
/* winExec( "notepad checkres.txt" ) */
RETURN nil
//---------------------------------------------------------------------------//
Static FUNCTION addMenu( oMenu, oTree )
local n
local cPrompt
local oItem
for n = 1 to len( oMenu:aItems )
cPrompt := oMenu:aItems[ n ]:cPrompt
if ValType( oMenu:aItems[ n ]:bAction ) == "O"
oItem := oTree:add( strtran( cPrompt, "&", "" ) )
addMenu( oMenu:aItems[ n ]:bAction, oItem )
else
if !empty( cPrompt )
oItem := oTree:add( strtran( cPrompt, "&", "" ) )
end if
endif
next
RETURN .t.
//----------------------------------------------------------------------------//
static FUNCTION nLeft( oMsgBar )
local n
local nLen := Len( oMsgBar:aItems )
local nPos := oMsgBar:nRight - 3
if nLen > 0
for n := 1 to nLen
nPos -= ( oMsgBar:aItems[ n ]:nWidth + 4 )
next
end if
RETURN nPos
//------------------------------------------------------------------------------------------------------------------------------
STATIC PROCEDURE GoToWeb()
WinExec( "Start " + __GSTWEB__, 0 )
RETURN
//---------------------------------------------------------------------------//
STATIC FUNCTION WndPaint( hDC, oWnd )
local oBlock
oBlock := ErrorBlock( {| oError | ApoloBreak( oError ) } )
BEGIN SEQUENCE
if !empty( oWnd ) .and. !empty( oWnd:oWndClient )
if len( oWnd:oWndClient:aWnd ) > 0
aTail( oWnd:oWndClient:aWnd ):SetFocus()
end if
end if
RECOVER
END SEQUENCE
ErrorBlock( oBlock )
RETURN nil
//---------------------------------------------------------------------------//
FUNCTION cNbrUsr( cNbr )
if cNbr != nil .and. oMsgUser != nil
oMsgUser:SetText( "Usuario : " + RTrim( cNbr ) )
end if
RETURN cNbr
//---------------------------------------------------------------------------//
FUNCTION setCajaMessageBar( cCaja )
if !empty( cCaja ) .and. oMsgCaja != nil
oMsgCaja:SetText( "Caja : " + rtrim( cCaja ) )
end if
RETURN ( cCaja )
//---------------------------------------------------------------------------//
FUNCTION setSesionMessageBar( nNumero )
if !empty( nNumero ) .and. oMsgCaja != nil
oMsgSesion:SetText( "Sesión : " + alltrim( str( nNumero ) ) )
end if
RETURN ( nNumero )
//---------------------------------------------------------------------------//
FUNCTION setAlmacenMessageBar( cAlmacen )
if cAlmacen != nil .and. oMsgAlmacen != nil
oMsgAlmacen:SetText( "Almacén : " + rtrim( cAlmacen ) )
end if
RETURN ( cAlmacen )
//---------------------------------------------------------------------------//
FUNCTION setDelegacionMessageBar( cDelegacion )
if cDelegacion != nil .and. oMsgDelegacion != nil
oMsgDelegacion:SetText( "Delegación : " + rtrim( cDelegacion ) )
end if
RETURN ( cDelegacion )
//---------------------------------------------------------------------------//
FUNCTION EnableAcceso()
RETURN ( nil ) // if( !empty( oWndBar ), oWndBar:Enable(), ) )
//---------------------------------------------------------------------------//
FUNCTION DisableAcceso()
RETURN ( nil ) // if( !empty( oWndBar ), oWndBar:Disable(), ) )
//---------------------------------------------------------------------------//
FUNCTION CreateMainSQLAcceso()
local oAcceso
local oGrupo
local oItem
local oItemArchivo
local oItemCompras
local oItemAlmacen
local oItemProduccion
local oItemExpediente
local oItemVentas
local oItemTpv
local oItemHerramientas
local oItemAyudas
local oItemReporting
local oItemSQL
oAcceso := TAcceso():New()
oItemArchivo := oAcceso:Add()
oItemArchivo:cPrompt := 'ARCHIVOS'
oItemArchivo:cBmp := "gc_folder_open_16"
oItemArchivo:cBmpBig := "gc_folder_open_32"
oItemArchivo:lShow := .t.
oGrupo := TGrupoAcceso()
oGrupo:nBigItems := 1
oGrupo:cPrompt := 'Inicio'
oGrupo:cLittleBitmap := "gc_clock_16"
oGrupo:cBigBitmap := "gc_clock_32"
oItem := oItemArchivo:Add()
oItem:oGroup := oGrupo
oItem:cPrompt := 'Sesiones'
oItem:cMessage := 'Sesiones'
oItem:bAction := {||SesionesController():New():ActivateNavigatorView() }
oItem:cId := "sesiones"
oItem:cBmp := "gc_clock_16"
oItem:cBmpBig := "gc_clock_32"
oItem:lShow := .f.
oGrupo := TGrupoAcceso()
oGrupo:nBigItems := 1
oGrupo:cPrompt := 'Empresa'
oGrupo:cLittleBitmap := "gc_factory_16"
oGrupo:cBigBitmap := "gc_factory_32"
/*oItem := oItemArchivo:Add()
oItem:oGroup := oGrupo
oItem:cPrompt := 'Empresa'
oItem:cMessage := 'Empresas'
oItem:bAction := {|| EmpresasController():New():ActivateNavigatorView() }
oItem:cId := "empresa"
oItem:cBmp := "gc_factory_16"
oItem:cBmpBig := "gc_factory_32"
oItem:lShow := .f.*/
// Articulos----------------------------------------------------------------
oGrupo := TGrupoAcceso()
oGrupo:nBigItems := 3
oGrupo:nLittleItems := 3
oGrupo:cPrompt := 'Artículos'
oGrupo:cLittleBitmap := "gc_object_cube_16"
oGrupo:cBigBitmap := "gc_object_cube_32"
oItem := oItemArchivo:Add()
oItem:oGroup := oGrupo
oItem:cPrompt := 'Familia de articulos'
oItem:cMessage := 'Familia de articulos'
oItem:bAction := {|| ArticulosFamiliasController():New():ActivateNavigatorView() }
oItem:cId := "familias_articulos"
oItem:cBmp := "gc_cubes_16"
oItem:cBmpBig := "gc_cubes_32"
oItem:lShow := .f.
oItem := oItemArchivo:Add()
oItem:oGroup := oGrupo
oItem:cPrompt := 'Artículos'
oItem:cMessage := 'Artículos'
oItem:bAction := {|| ArticulosController():New():ActivateNavigatorView() }
oItem:cId := "articulos"
oItem:cBmp := "gc_object_cube_16"
oItem:cBmpBig := "gc_object_cube_32"
oItem:lShow := .t.
oItem := oItemArchivo:Add()
oItem:oGroup := oGrupo
oItem:cPrompt := 'Categorias de artículo'
oItem:cMessage := 'Categorias de artículo'
oItem:bAction := {|| ArticulosCategoriasController():New():ActivateNavigatorView() }
oItem:cId := "categorias"
oItem:cBmp := "gc_photographic_filters_16"
oItem:cBmpBig := "gc_photographic_filters_32"
oItem:lShow := .f.