Planta de Liq. Generales de la UNC

De Wiki
Revisión del 13:46 31 ene 2012 de Mwilson (Discusión | contribuciones) (Botón "Procesar" (btnProcesar))

Saltar a: navegación, buscar

FORMULARIO

Planta.PNG


Planta2.PNG

INFORME

CÓDIGO

Programa "prg_fec_permanencia.prg"

Botón "Ejecutar" (Command1)

  set excl on
  public planta, depend,busca,buscadh03,base,basedh03,buscadh05,basedh05 
  public fechaL ,fecha
  store " " to planta
  store 0 to depend
  
  base = "pla"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)
  busca =vm_bases+ "pla"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)+".dbf"
  buscadh05 =vm_bases+ "dh05"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)+".dbf"
  basedh05 = "dh05"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)
  buscadh03 =vm_bases+ "dh03"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)+".dbf"
  basedh03 = "dh03"+padl(alltrim(thisform.text1.value),2,"0")+right(alltrim(str(thisform.text2.value)),2)
  
  
  
  if empty(thisform.text1.value ) = .f. 
    if empty(thisform.text2.value ) = .f. 
  *---------dh05-------------------
  if FILE('&buscadh05') = .t.
     if not used ('dh05')
       sele sele(1)
       *use &basedh05 alias dh05
       use &buscadh05 alias dh05
     else
       sele dh05
     endif 
       planta = "S"
   else
       wait windows "No existe inf de cargos del mes ingresado"
       planta = "N"
   endif  
  
  *---------dh03-------------------
  
  if FILE('&buscadh03') = .t.
     if !used ('dh03')
       sele sele(1)
       *use &basedh03 alias dh03
       use &buscadh03 alias dh03
     else
       sele dh03
     endif 
       planta = "S"
   else
       wait windows "No existe inf de cargos del mes ingresado"
       planta = "N"
   endif  
  
  
  *-------planta--------------------------------------------------------------
   if FILE('&busca') = .t.
     if !used ('dh21')
       sele sele(1)
       *use &base alias dh21
       use &busca alias dh21
     else
       sele dh21
     endif 
       planta = "S"
   else
       wait windows "No existe inf de planta del mes ingresado"
       planta = "N"
   endif  
  
   else
      wait windows "debe ingresar año" nowait
   endif
      else
      wait windows "debe ingresar mes" nowait
  
  endif  
  
  planta = "S"
  
  
  if planta = "S"
            
      fecha = ('{^' + alltrim(str(thisform.text2.value))+ '/' + padl(alltrim(thisform.text1.value),2,"0") +'/01}')
    if  inlist(val(alltrim(thisform.text1.value)) ,1,3,5,7,8,10,12) 
      *fechaL = alltrim(str(thisform.text2.value))+ '-' + padl(alltrim(thisform.text1.value),2,"0") +'-31'
       fechaL = ('{^' + alltrim(str(thisform.text2.value))+ '/' + padl(alltrim(thisform.text1.value),2,"0") +'/31}')
    endif
    if  inlist(val(alltrim(thisform.text1.value)),4,6,9,11) 
      *fechaL = alltrim(str(thisform.text2.value))+ '-' + padl(alltrim(thisform.text1.value),2,"0") +'-30'
      fechaL = ('{^' + alltrim(str(thisform.text2.value))+ '/' + padl(alltrim(thisform.text1.value),2,"0") +'/30}') 
    endif
    if val(alltrim(thisform.text1.value)) = 2 AND  thisform.text2.value % 4=0
      *año 2004 bisiesto febrero trae 29
      fechaL = ('{^' + alltrim(str(thisform.text2.value))+ '/' + padl(alltrim(thisform.text1.value),2,"0") +'/29}')
    endif
    if val(alltrim(thisform.text1.value)) = 2 AND  thisform.text2.value %4 <>0
      fechaL = ('{^' + alltrim(str(thisform.text2.value))+ '/' + padl(alltrim(thisform.text1.value),2,"0") +'/28}')
    endif
      do vm_programas+"planta.prg"
   
  endif
  thisform.command3.enabled = .t.
       thisform.pageframe1.page1.optiongroup4.option1.enabled = .t.
       thisform.pageframe1.page1.optiongroup4.option2.enabled = .t.
       thisform.pageframe1.page1.optiongroup4.option3.enabled = .t.
       thisform.pageframe1.page1.optiongroup1.option1.enabled = .t.
       thisform.pageframe1.page1.optiongroup1.option2.enabled = .t.
       thisform.pageframe1.page2.optiongroup2.option1.enabled = .t.
       thisform.pageframe1.page2.optiongroup2.option2.enabled = .t.
       thisform.pageframe1.page2.optgroupreno.optrenova.enabled = .t.
       thisform.pageframe1.page2.optgroupreno.opincapa.enabled = .t.
       thisform.command1.enabled = .f.
  *store "2003-06-30" to fechaL &&fecha para licencias s/g
  *store {^2003/06/01} to fecha   &&fecha para cargos vigentes

Botón "Cancelar" (btnCancelar)

  THISFORM.Release

Botón "Ayuda"(btnAyuda)

Combo "Año" (cmbAnio)

Combo "Mes" (cmbMes)

MANUAL DEL USUARIO

Procedimiento de Uso