gracias PABLO DE ARGENTINA
Publicado por ALBERTO JUAN FRANCISCO (404 intervenciones) el 13/07/2009 07:22:45
MUCHAS GRACIAS PABLO POR TUS LINKS, DESPUES DE MUCHAS HORAS DE QUEMARME LA CABEZA LOGRE SACAR EL CALCULO DE HORAS ENTRE DOS FECHAS Y PONIENDO UN INTERVALO DE XX HORAS, DEJO EL CODIGO PARA ALGUNOS DE LOS FORISTAS QUE LES INTERESE
BOTON GRABAR TURNOS
SET HOURS TO 24 PARA QUE GRABE 13 HS 16 HS 20 HS ETC
WAIT WIND "Grabando Turnos , espere por Favor ......" nowait
primeradia=thisform.text1.value CAMPO DATETIME()
d=str(day(primeradia))
m=str(month(primeradia))
a=str(year(primeradia))
hor=substr(TTOC(primeradia,2),1,5) ACA SACO SOLO LA HORA DEL CAMPO DATETIME()
final=alltrim (d)+ "/" + alltrim (m)+ "/" +alltrim(a)
final= CTOD(final) ACA SACO SOLO LA FECHA DEL CAMPO DATETIME()
dato2=final
dato1=hor
fechafinal=final+thisform.text4.value ESTA EL LA FECHA FINAL DEL CALCULO
thisform.text4.value ES DURANTE CUANTOS DIAS SUMO LAS HORAS
nuevafecha=thisform.text1.value
do while .t.
if dato2 > fechafinal
exit
endif
select tareas
set order to 1
go bottom
xnro=tareas.nro
set order to 2
append blank
rlock()
repla nro with xnro+1
repla hora with dato1
repla fecha with dato2
repla dia with diass[dow(dato2)]
repla codigo with thisform.codigo1.value
repla tarea with thisform.combo1.value
repla lugar with thisform.lugar1.value
* repla cliente with thisform.cliente1.value
* repla domicilio with thisform.domicilio1.value
* repla telefono with thisform.telefono1.value
repla notas with thisform.notas1.value
* repla precio with thisform.precio1.value*
* repla paciente with thisform.paciente1.value
* repla pedigree with thisform.text1.value
* if thisform.check1.value=1
* repla abono with .t.
* else
* repla abono with .f.
* endif
flush
unlock all
nuevafecha=nuevafecha+(3600*val(thisform.text2.value)) ACA SUMO LAS HORAS
thisform.calcular
enddo
messagebox("Turnos Grabados Exitosamente !!","Veter 1.5")
THISFORM.RElease
************************
thisform.calcular
d=str(day(nuevafecha))
m=str(month(nuevafecha))
a=str(year(nuevafecha))
final3=alltrim (d)+ "/" + alltrim (m)+ "/" +alltrim(a)
final3= CTOD(final3)
dato2=final3
dato1=substr(TTOC(nuevafecha,2),1,5)
VUELVO A SACAR LA FECHA Y HORA
*************************
SALUDOS Y ESPERO LES SIRVA A ALGUIEN ESTE CODIGO VALIOSO JEJE
BOTON GRABAR TURNOS
SET HOURS TO 24 PARA QUE GRABE 13 HS 16 HS 20 HS ETC
WAIT WIND "Grabando Turnos , espere por Favor ......" nowait
primeradia=thisform.text1.value CAMPO DATETIME()
d=str(day(primeradia))
m=str(month(primeradia))
a=str(year(primeradia))
hor=substr(TTOC(primeradia,2),1,5) ACA SACO SOLO LA HORA DEL CAMPO DATETIME()
final=alltrim (d)+ "/" + alltrim (m)+ "/" +alltrim(a)
final= CTOD(final) ACA SACO SOLO LA FECHA DEL CAMPO DATETIME()
dato2=final
dato1=hor
fechafinal=final+thisform.text4.value ESTA EL LA FECHA FINAL DEL CALCULO
thisform.text4.value ES DURANTE CUANTOS DIAS SUMO LAS HORAS
nuevafecha=thisform.text1.value
do while .t.
if dato2 > fechafinal
exit
endif
select tareas
set order to 1
go bottom
xnro=tareas.nro
set order to 2
append blank
rlock()
repla nro with xnro+1
repla hora with dato1
repla fecha with dato2
repla dia with diass[dow(dato2)]
repla codigo with thisform.codigo1.value
repla tarea with thisform.combo1.value
repla lugar with thisform.lugar1.value
* repla cliente with thisform.cliente1.value
* repla domicilio with thisform.domicilio1.value
* repla telefono with thisform.telefono1.value
repla notas with thisform.notas1.value
* repla precio with thisform.precio1.value*
* repla paciente with thisform.paciente1.value
* repla pedigree with thisform.text1.value
* if thisform.check1.value=1
* repla abono with .t.
* else
* repla abono with .f.
* endif
flush
unlock all
nuevafecha=nuevafecha+(3600*val(thisform.text2.value)) ACA SUMO LAS HORAS
thisform.calcular
enddo
messagebox("Turnos Grabados Exitosamente !!","Veter 1.5")
THISFORM.RElease
************************
thisform.calcular
d=str(day(nuevafecha))
m=str(month(nuevafecha))
a=str(year(nuevafecha))
final3=alltrim (d)+ "/" + alltrim (m)+ "/" +alltrim(a)
final3= CTOD(final3)
dato2=final3
dato1=substr(TTOC(nuevafecha,2),1,5)
VUELVO A SACAR LA FECHA Y HORA
*************************
SALUDOS Y ESPERO LES SIRVA A ALGUIEN ESTE CODIGO VALIOSO JEJE
Valora esta pregunta
0