by caducca » Thu Oct 26, 2017 12:08 am
Gracias Jose Luis y CmSoft por contestar, aquí les pongo el código fuente así como el error que arroja.
Pero lo llamativo es que cuando ejecuto el Sistema en un Servidor que tiene instalado Windows Server pero ejecutando un solo usuario arroja el problema, no es que estén usando varios operadores el Sistema. Estamos en etapa de prueba. Cuando lo ejecuto en mi equipo que tengo instalado Windows Seven y el MySql lo instale con el paquete XAMPP no arroja error.
Y por lo que veo el error es que quiere cargar de nuevo el primer registro.
PROCEDURE DetaCobranza2(lAppend,vTipo1)
Public oMatObj:=ARRAY(14), oImpoCta
lSave:=.F.
If lAppend
oQryCob:GetBlankRow(.F.)
Else
oQryCob:GetRow()
EndIf
DEFINE DIALOG CobraDlg RESOURCE "CARGAREME"
REDEFINE GET oMatObj[1] VAR oQryClien:Codigo ID 99 OF CobraDlg ;
BITMAP "./BmpN/Buscar.BMP" ACTION BusClien(.T.,1) VALID BusClien(.F.,1,oQryClien:Codigo)
REDEFINE SAY oMatObj[2] VAR oQryClien:nomcom ID 100 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont20
REDEFINE SAY oVCodCob VAR vNInterno ID 101 OF CobraDlg
REDEFINE GET oQryCob:cred_nro ID 103 OF CobraDlg
REDEFINE GET oQryCob:Fecha_en ID 102 OF CobraDlg
REDEFINE GET oQryCob:Saldo ID 4002 OF CobraDlg PICTURE "$9,999,999.99"
REDEFINE GET oQryCob:Cuo_Ade ID 105 OF CobraDlg PICTURE "999" VALID CalImpo()
REDEFINE GET oImpoCta VAR oQryCob:Imp_Cuo ID 104 OF CobraDlg PICTURE "$999,999.99"
REDEFINE GET oMes VAR vMes ID 107 OF CobraDlg VALID(vMes >=1 .and. vMes <=12) ;
PICTURE "99"
REDEFINE GET oAno VAR vAno ID 108 OF CobraDlg VALID(vAno >1900) ;
PICTURE "9999"
REDEFINE GET oMatObj[14] VAR oQryCob:Interes ID 109 OF CobraDlg PICTURE "999.99"
REDEFINE DBCOMBO oEstado VAR oQryCob:C_Estado ID 122 OF CobraDlg ;
ALIAS oQryEsta ITEMFIELD "codigo" LISTFIELD "descrip"
REDEFINE DBCOMBO oVende VAR oQryCob:codi_vende ID 4004 OF CobraDlg ;
ALIAS oQryVende ITEMFIELD "codigo_V" LISTFIELD "nombre_V" ;
ON CHANGE oVende:Refresh() ;
UPDATE
REDEFINE GET oQryCob:Autos ID 115 OF CobraDlg PICTURE '@!'
REDEFINE GET oMatObj[3] VAR nCSoli ID 116 OF CobraDlg ;
BITMAP "./BmpN/Buscar.BMP" ACTION If(BusDeu(2),(nCSoli:=oQryDeu:codigo,oMatObj[3]:Refresh()),Nada()) ; // (1,.T.,nCSoli,.T.) ;
VALID BusDeu2(1,nCSoli) PICTURE "99999" // 1,.F.,nCSoli,.T.) PICTURE "99999"
REDEFINE GET oMatObj[4] VAR nCGa1 ID 118 OF CobraDlg ;
BITMAP "./BmpN/Buscar.BMP" ACTION If(BusDeu(2),(nCGa1:=oQryDeu:codigo,oMatObj[4]:Refresh()),Nada()) ; // (2,.T.,nCGa1,.T.) ;
VALID BusDeu2(2,nCGa1) PICTURE "99999" // (2,.F.,nCGa1,.T.) PICTURE "99999"
REDEFINE GET oMatObj[5] VAR nCGa2 ID 120 OF CobraDlg ;
BITMAP "./BmpN/Buscar.BMP" ACTION If(BusDeu(2),(nCGa2:=oQryDeu:codigo,oMatObj[5]:Refresh()),Nada()) ; // (3,.T.,nCGa2,.T.) ;
VALID BusDeu2(3,nCGa2) PICTURE "99999" // (3,.F.,nCGa2,.T.) PICTURE "99999"
REDEFINE SAY oMatObj[6] VAR cNSoli ID 130 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE SAY oMatObj[7] VAR cNGa1 ID 131 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE SAY oMatObj[8] VAR cNGa2 ID 132 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE SAY oMatObj[9] VAR nDSoli ID 117 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE SAY oMatObj[10] VAR nDGa1 ID 119 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE SAY oMatObj[11] VAR nDGa2 ID 121 OF CobraDlg ;
COLOR CLR_NROJO FONT oFont12
REDEFINE BTNBMP oBtnAcep ID 250 OF CobraDlg MESSAGE "Graba la Cobranza..." ;
FILE "./BmpN/Grabar_24.PNG" PROMPT "Grabar" LEFT ;
TOOLTIP "Grabar Crédito" ;
ACTION (lSave:=.T., CobraDlg:End());
NOBOX
REDEFINE BTNBMP oBtnAcep ID 240 OF CobraDlg MESSAGE "Cancela el Movimiento..." ;
FILE "./BmpN/Cancelar.PNG" PROMPT "Cancelar" LEFT ;
TOOLTIP "Cancela Movimiento" ;
ACTION CobraDlg:End();
NOBOX
ACTIVATE DIALOG CobraDlg
If lSave
If lAppend
oQryCob:Clien :=oQryClien:Codigo
oQryCob:CodiDeu :=nCSoli
oQryCob:CodiGa1 :=nCGa1
oQryCob:CodiGa2 :=nCGa2
oQryCob:Cant_Cuo :=oQryCob:Cuo_Ade
oQryCob:Fecha_At :=ctod("10/"+str(vMes,2)+"/"+substr(str(vAno,4),3,2))
oQryCob:FechaCar :=Date()
oQryCob:tRemesa :=1
oQryCob:tipo_movi:=1
oQryCob:ulti_movi:=ctod("10/"+str(vMes,2)+"/"+substr(str(vAno,4),3,2))
oQryCob:Usuario_cre :=vUsuario
nSalcuo := oQryCob:Sal_Cuo
nTCuotas :=oQryCob:Cuo_Ade
nImpoCuo :=oQryCob:Imp_Cuo
nPorInte :=oQryCob:Interes
oQryCob:lAppend := .T.
oQryCob:Save()
oQryCob:Refresh()
vNInterno :=oServer:GetAutoIncrement("cobranza")-1
cuo :=1
While cuo <= nTCuotas
oQryCta:GetBlankRow(.F.)
oQryCta:CodCob :=vNInterno
oQryCta:Mes :=vMes
oQryCta:Ano :=vAno
oQryCta:NroCta :=vCta1
oQryCta:Capital :=nImpoCuo
oQryCta:Porc_Int :=nPorInte
oQryCta:Save()
oQryCta:Refresh()
vMes+=1
If vMes > 12
vMes=1
vAno+=1
EndIf
cuo+=1
vCta1 +=1
Enddo
oQryMovU:GetBlankRow(.F.)
oQryMovU:NroCredito :=vNInterno
oQryMovU:Fecha :=Date()
oQryMovU:NomUsuario :=vUsuario
oQryMovU:Detalle :="CARGA DE REMESA"
oQryMovU:Save()
oQryMovU:Refresh()
Else
oQryCob:Clien :=oQryClien:Codigo
oQryCob:CodiDeu :=nCSoli
oQryCob:CodiGa1 :=nCGa1
oQryCob:CodiGa2 :=nCGa2
oQryCob:Cant_Cuo :=oQryCob:Cuo_Ade
oQryCob:Fecha_At :=ctod("10/"+str(vMes,2)+"/"+substr(str(vAno,4),3,2))
oQryCob:FechaCar :=Date()
oQryCob:tipo_movi:=1
oQryCob:ulti_movi:=ctod("10/"+str(vMes,2)+"/"+substr(str(vAno,4),3,2))
oQryCob:tRemesa :=1
nSalcuo :=oQryCob:Sal_Cuo
nTCuotas :=oQryCob:Cuo_Ade
nImpoCuo :=oQryCob:Imp_Cuo
nPorInte :=oQryCob:Interes
oQryCob:Save()
oQryCob:Refresh()
vNInterno :=oQryCob:cod_est
oDBCta:SetWhere("codcob= "+ClipValue2SQL(vNInterno))
oDBCta:Refresh()
oDBCta:GoTop()
While !oDBCta:Eof()
oDBCta:GetRow()
oDBCta:Delete()
oDBCta:Refresh()
oDBCta:Skip()
Enddo
cuo :=1
While cuo <= oQryCob:Cuo_Ade
oQryCta:GetBlankRow(.F.)
oQryCta:CodCob :=vNInterno
oQryCta:Mes :=vMes
oQryCta:Ano :=vAno
oQryCta:NroCta :=vCta1
oQryCta:Capital :=nImpoCuo
oQryCta:Porc_Int :=nPorInte
oQryCta:Save()
oQryCta:Refresh()
vMes+=1
If vMes > 12
vMes=1
vAno+=1
EndIf
cuo+=1
vCta1 +=1
Enddo
oQryMovU:GetBlankRow(.F.)
oQryMovU:NroCredito :=vNInterno
oQryMovU:Fecha :=Date()
oQryMovU:NomUsuario :=vUsuario
oQryMovU:Detalle :="MODIFICACION DE REMESA"
oQryMovU:Save()
oQryMovU:Refresh()
EndIf
EndIf
Return
//-------------------------------------------------------------------------//
El error es:
Application
===========
Path and name: D:\Creditos\Estudio.Exe (32 bits)
Size: 1,436,160 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20161218)
FiveWin version: FWHX 17.03
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 1 mins 52 secs
Error occurred at: 24/10/2017, 20:19:11
Error description: Error MYSQL/1062 Duplicate entry '297' for key 'PRIMARY'
Stack Calls
===========
Called from: .\source\prg\tdolpsrv.prg => DOLPHIN_DEFERROR( 2822 )
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:CHECKERROR( 793 )
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:SQLQUERY( 2039 )
Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:SAVE( 1456 )
Called from: D:\Programs\ESTUDI~1\PRG\deudor.prg => EDITDEU( 333 )
Called from: D:\Programs\ESTUDI~1\PRG\deudor.prg => (b)BUSDEU( 395 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 665 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 901 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1848 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: D:\Programs\ESTUDI~1\PRG\deudor.prg => BUSDEU( 414 )
Called from: D:\Programs\ESTUDI~1\PRG\cobranzas.prg => (b)DETACOBRANZA2( 417 )
Called from: .\source\classes\TGET.PRG => (b)TGET:CREATEBUTTON( 628 )
Called from: .\source\classes\BUTTON.PRG => TBUTTONBMP:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1685 )
Called from: .\source\classes\BUTTONB.PRG => TBUTTONBMP:HANDLEEVENT( 253 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\WINDOW.PRG => TGET:COMMAND( 1088 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT( 767 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: D:\Programs\ESTUDI~1\PRG\cobranzas.prg => DETACOBRANZA2( 452 )
Called from: D:\Programs\ESTUDI~1\PRG\cobranzas.prg => CARGACOBRA( 69 )
Called from: D:\Programs\ESTUDI~1\PRG\estuinicial.prg => (b)MAIN( 183 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 717 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 917 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1036 )
Called from: D:\Programs\ESTUDI~1\PRG\estuinicial.prg => MAIN( 304 )
System
======
CPU type: Intel(R) Pentium(R) CPU G2010 @ 2.80GHz 2793 Mhz
Hardware memory: 4061 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 4
1 ,
2 , C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855
3 GDI+ Window, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23894_none_5c0be957a00992
4 Licencia gratuita (solo uso no comercial), D:\Creditos\Estudio.Exe
Variables in use
================
Procedure Type Value
==========================
DOLPHIN_DEFERROR
Param 1: O Class: TDOLPHINSRV
Param 2: N 1062
Param 3: L .F.
Param 4: C ""
Local 1: C ""
Local 2: O Class: ERROR
TDOLPHINSRV:CHECKERROR
Local 1: N 1062
Local 2: U
Local 3: O Class: TDOLPHINSRV
Local 4: L .F.
TDOLPHINSRV:SQLQUERY
Param 1: C "INSERT INTO deudor SET codigo=297,nombres='SUAREZ CLAUDIA MONICA',tipodoc=NULL,nrodoc=23976231,t_cuit=NULL,n_cuit=NULL,direc='TORRE 22 2º PISO DPTO 243',barrio=NULL,locali='SGO.',trabaja='BANCO',ocupa='EMPLEADA BANCARIA',ult_act=NULL,fec_con=NULL,telefono='3854768328',obser='COMPRA DE VEHICULO MOBI EASY',abisa=NULL,notifica=0,lugar=0,tipo=NULL,provi='SGO. DEL ESTERO',codpos='4200',codbarr='038',email=NULL,conyuge=NULL,esta_civil='1',fecha_naci=NULL"
Local 1: O Class: TDOLPHINSRV
Local 2: N 452
Local 3: N 1
TDOLPHINQRY:SAVE
Local 1: O Class: TDOLPHINQRY
Local 2: C "deudor"
Local 3: U
Local 4: C "INSERT INTO deudor SET codigo=297,nombres='SUAREZ CLAUDIA MONICA',tipodoc=NULL,nrodoc=23976231,t_cuit=NULL,n_cuit=NULL,direc='TORRE 22 2º PISO DPTO 243',barrio=NULL,locali='SGO.',trabaja='BANCO',ocupa='EMPLEADA BANCARIA',ult_act=NULL,fec_con=NULL,telefono='3854768328',obser='COMPRA DE VEHICULO MOBI EASY',abisa=NULL,notifica=0,lugar=0,tipo=NULL,provi='SGO. DEL ESTERO',codpos='4200',codbarr='038',email=NULL,conyuge=NULL,esta_civil='1',fecha_naci=NULL"
Local 5: D / /
Local 6: U
Local 7: U
Local 8: L .T.
Local 9: L .F.
Local 10: U
EDITDEU
Param 1: L .T.
Local 1: N 0
Local 2: L .T.
Local 3: O Class: TSAY
Local 4: O Class: TGET
Local 5: O Class: TGET
Local 6: O Class: TGET
Local 7: O Class: TGET
(b)BUSDEU
Param 1: O Class: TBTNBMP
TBTNBMP:CLICK
Local 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
Param 1: N 17
Param 2: N 7
Param 3: O Class: TBTNBMP
Local 1: U
Local 2: L .T.
Local 3: N 0
TCONTROL:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1114119
Local 1: O Class: TBTNBMP
Local 2: U
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1114119
Local 1: O Class: TBTNBMP
_FWH
Param 1: N 1114119
Param 2: N 514
Param 3: N 0
Param 4: N 1114119
Param 5: N 82
Local 1: O Class: TBTNBMP
DIALOGBOX
Param 1: N 4194304
Param 2: C "Listado2"
Param 3: N 590712
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: O Class: TDIALOG
Local 2: N 590712
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
BUSDEU
Param 1: N 2
(b)DETACOBRANZA2
Param 1: O Class: TGET
(b)TGET:CREATEBUTTON
Param 1: O Class: TBUTTONBMP
TBUTTONBMP:CLICK
Local 1: O Class: TBUTTONBMP
TBUTTON:HANDLEEVENT
Param 1: N 2048
Param 2: N 0
Param 3: N 0
Local 1: O Class: TBUTTONBMP
Local 2: U
TBUTTONBMP:HANDLEEVENT
Param 1: N 2048
Param 2: N 0
Param 3: N 0
Local 1: O Class: TBUTTONBMP
Local 2: U
_FWH
Param 1: N 0
Param 2: N 2048
Param 3: N 0
Param 4: N 0
Param 5: N 59
Local 1: O Class: TBUTTONBMP
SENDMESSAGE
Param 1: N 197660
Param 2: N 2048
Param 3: N 0
Param 4: N 0
TGET:COMMAND
Param 1: N 139
Param 2: N 197660
Local 1: O Class: TGET
Local 2: N 0
Local 3: N 139
Local 4: N 197660
Local 5: U
TWINDOW:HANDLEEVENT
Param 1: N 273
Param 2: N 139
Param 3: N 197660
TCONTROL:HANDLEEVENT
Param 1: N 273
Param 2: N 139
Param 3: N 197660
Local 1: O Class: TGET
Local 2: U
TGET:HANDLEEVENT
Param 1: N 273
Param 2: N 139
Param 3: N 197660
Local 1: O Class: TGET
Local 2: U
Local 3: U
Local 4: U
_FWH
Param 1: N 197660
Param 2: N 273
Param 3: N 139
Param 4: N 197660
Param 5: N 58
Local 1: O Class: TGET
DIALOGBOX
Param 1: N 4194304
Param 2: C "CARGAREME"
Param 3: N 1245760
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: O Class: TDIALOG
Local 2: N 1245760
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
DETACOBRANZA2
Param 1: L .T.
Param 2: N 3
CARGACOBRA
Param 1: N 3
(b)MAIN
Param 1: O Class: TRBTN
TRBTN:CLICK
Local 1: O Class: TRBTN
TRBTN:LBUTTONUP
Param 1: N 14
Param 2: N 31
Param 3: O Class: TRBTN
Local 1: U
Local 2: L .T.
Local 3: L .T.
TCONTROL:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 917535
Local 1: O Class: TRBTN
Local 2: U
TRBTN:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 917535
Local 1: O Class: TRBTN
_FWH
Param 1: N 917535
Param 2: N 514
Param 3: N 0
Param 4: N 917535
Param 5: N 17
Local 1: O Class: TRBTN
WINRUN
Param 1: N 1245760
TMDIFRAME:ACTIVATE
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: B {|| ... }
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: U
Param 18: U
Param 19: U
Param 20: L .F.
Local 1: O Class: TMDIFRAME
Local 2: U
Local 3: U
MAIN
Param 1: C "L"
Local 1: O Class: TRBGROUP
Local 2: A Len: 6
Local 3: A Len: 6
Local 4: A Len: 6
Local 5: A Len: 6
Local 6: A Len: 6
Local 7: A Len: 6
Local 8: A Len: 7
Local 9: O Class: TRBTN
Local 10: O Class: TRBTN
Local 11: O Class: TRBTN
Local 12: O Class: TQUICKACCESS
Local 13: U
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 HBOBJECT
5 TDOLPHINSRV
6 TDOLPHINQRY
7 TFONT
8 TMENU
9 TREG32
10 TMENUITEM
11 TWINDOW
12 TMDIFRAME
13 TBRUSH
14 TMDICLIENT
15 TCONTROL
16 TRIBBONBAR
17 TRPANEL
18 TRBGROUP
19 TRBTN
20 TQUICKACCESS
21 TMSGBAR
22 TRECT
23 TMSGITEM
24 TTIMER
25 TDIALOG
26 TGET
27 GET
28 TCLIPGET
29 TCHECKBOX
30 TBTNBMP
31 TSAY
32 TCOMBOBOX
33 TDBCOMBO
34 TBUTTON
35 TBUTTONBMP
36 TBITMAP
37 TIMAGE
38 TRADMENU
39 TRADIO
40 TXBROWSE
41 TXBRWCOLUMN
42 TSCROLLBAR
43 TSTRUCT
Memory Analysis
===============
473 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
Gracias