Estimado Antonio, Gracias por tu pronta respuesta, he realizado lo que me dijiste y sigue haciendolo a la tercera vez que abro la seguna mdichild, yo defino los font al comienzo de cada funcion de cada ventana sera esto ? te adjunto el araanque de la segunda mdi
Code: Select all
FUNCTION pro_ctas(ncta)
LOCAL nH, a_cli, a_cli2, ax[4], a_tcta, a_tct2, a_tct3, oFldx
LOCAL oBcta , oBct2, oBchq, a_pag[11,2], nAt, oSlen
LOCAL oFont, oFch2, oFexa
DEFAULT ncta:=1
IF oWcta != Nil
oWcta:END()
oWcta:=Nil
ENDIF
*----DEFINIR CLIENTE------------------*
IF ncta=1
a_cl:=bus_prv("1")
IF a_cl[1]
ncta:=a_cl[2]
ELSE
RETURN(.T.)
ENDIF
ENDIF
*-------------------------------------*
cursorwait()
*--DEFINIR a_pag RESUMEN -----------------*
a_pag[1 ,1]:=oemtoansi("Cr‚dito:")
a_pag[2 ,1]:="Comprobantes en Cta.Cte.:"
a_pag[3 ,1]:="Cheques en Cartera:"
a_pag[4 ,1]:="Disponible:"
a_pag[5 ,1]:=""
a_pag[6 ,1]:="Descuento en Vtas:"
a_pag[7 ,1]:="Lista de Precios"
a_pag[8 ,1]:="Vendedor:"
a_pag[9 ,1]:=oemtoansi("D¡a de Visita:")
a_pag[10,1]:=oemtoansi("D¡as de Cr‚dito:")
a_pag[11,1]:=oemtoansi("Cr‚dito Limitado:")
FOR i=1 TO 11
a_pag[i,2]:=0
NEXT i
*-----------------------------------------*
*-- DEFINIR SIMBOLO-----------------------*
aX[1] :=LoadBitMap(GetResources(),"B_ALTA")
aX[2] :=LoadBitMap(GetResources(),"C_PAL")
aX[3] :=LoadBitMap(GetResources(),"B_BAJA")
aX[4] :=LoadBitMap(GetResources(),"B_MEDI")
*-----------------------------------------*
*-- BUSCAR CLIENTE -------------*
a_cli :=bus_prvr(STR(ncta,7,0))
*-------------------------------*
MSGRUN(" ABRIENDO CUENTA CORRIENTE.... ","ESPERE!!",;
{|| oBchq :=abrir_dbf("GR2_500"),a_tct3:=ref_cta3(a_cli,oBchq,2) ,oBchq :=a_tct3[2],;
oBct2 :=abrir_dbf("GR2_511"),a_tct2:=ref_cta2(a_cli[2],oBct2,2),oBct2 :=a_tct2[2],;
oBcta :=abrir_dbf("GR2_511"),a_tcta:=ref_ctac(a_cli[2],oBcta,2),oBcta :=a_tcta[4],;
ref_cta4(a_pag,a_cli,a_tcta,a_tct2,a_tct3,2) })
adias :={"Lunes","Martes",OEMTOANSI("Mi‚rcoles"),"Jueves","Viernes"}
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -8
DEFINE FONT oFch2 NAME "Ms Sans Serif" SIZE 0, -8 BOLD
DEFINE FONT oFexa NAME "Terminal" SIZE 0,-11 PITCHFAMILY 49
oFont:nCount++
oFch2:nCount++
oFexa:nCount++
DEFINE WINDOW oWcta MDIChild OF oWnd ;
TITLE "Cuenta Corriente de Proveedores "+oBcta
DEFINE BUTTONBAR oBar 3DLOOK BUTTONSIZE 28,57 OF oWcta
DEFINE BUTTON oBot1 RESOURCE "B_EXEL" ;
OF oBar ;
ACTION cta_exel(oBcta,oBrct,oBct2,oBrc2,oBchq,oBrc3,a_pag,oBrc4,oWcta,oSlen,oFldx) ;
NOBORDER ;
TOOLTIP "Transferir Actual a Excel"
DEFINE BUTTON oBot1 RESOURCE "B_PRI" ;
OF oBar ;
ACTION cta_impr(oBcta,oBrct,oBct2,oBrc2,oBchq,oBrc3,a_pag,oBrc4,oWcta,oSlen,oFldx,2);
NOBORDER ;
TOOLTIP "Imprimir Actual"
DEFINE BUTTON oBot1 ;
OF oBar ;
RESOURCE "B_CLI" ;
ACTION (a_cli2:=bus_prv(STR(a_cli[2],7,0)),;
IF(a_cli2[1],;
MSGRUN(" ABRIENDO CUENTA CORRIENTE... ","ESPERE!!" ,;
{|| (a_cli:=a_cli2,;
a_tcta:=ref_ctac(a_cli[2],oBcta,2),;
oBcta:=a_tcta[4],;
a_tct2:=ref_cta2(a_cli[2],oBct2,2),;
oBct2 :=a_tct2[2],;
a_tct3:=ref_cta3(a_cli,oBchq,2),;
oBchq:=a_tct3[2],;
ref_cta4(a_pag,a_cli,a_tcta,a_tct2,a_tct3,2),;
oBrct:aFooters :={,,,"Totales",,;
TRANSFORM(a_tcta[2],"@E ##,###,###.##"),;
TRANSFORM(a_tcta[3],"@E ##,###,###.##"),;
TRANSFORM(a_tcta[1],"@E ##,###,###.##") } ,;
oBrc2:aFooters :={,,,"Totales",,,,,;
TRANSFORM(a_tct2[1],"@E ##,###,###.##") },;
oBrc3:aFooters :={,,,,"Total",;
TRANSFORM(a_tct3[1],"@E ##,###,###.##") },;
oWcta:UPDATE(),oSlen:REFRESH()) }) ,)) ;
NOBORDER ;
TOOLTIP "Seleccionar otro Proveedor"
@ .05,18 SAY oSlen PROMPT lee_cl(a_cli) ;
SIZE 700,52 ;
COLOR CLR_BLUE,CLR_FONDO ;
FONT oFont ;
UPDATE ;
OF oBar
@ 1,1 FOLDER oFldx ;
OF oWcta ;
FONT oFont ;
ITEMS "Mayor de Cuenta Corriente","Cbtes Adeudados/No Conciliados",;
"Cheques en Cartera",oemtoansi("Res£men de Cta.Cte.")
*------- MAYOR DE CUENTAS -------------------*
@ 0,0 LISTBOX oBrct ;
FIELDS AX[esta_cta(oBcta)] ,;
DTOC((oBcta)->CTA_FVTO) ,;
for_fec((oBcta)->CTA_FECH),;
(oBcta)->VTA_COMP ,;
(oBcta)->CTA_CUOT ,;
TRANSFORM((oBcta)->CTA_DEBE,"@EZ ##,###,###.##") ,;
TRANSFORM((oBcta)->CTA_HABE,"@EZ ##,###,###.##") ,;
TRANSFORM((oBcta)->CTA_SALD,"@EZ ##,###,###.##") ,;
" ",;
TRANSFORM((oBcta)->CTA_PAGA,"@EZ ##,###,###.##") ,;
cta_tpaga(oBcta) ,;
(oBcta)->OPE_OPER ;
HEADERS "E" ,;
"Vencimiento",;
oemtoansi("Emisi¢n"),;
"Concepto" ,;
"Cuota" ,;
"Debe" ,;
"Haber" ,;
"Saldo" ,;
" " ,;
"Pagado" ,;
"Sldo.Compte.",;
"Operador" ;
SIZES 15,70,70,130,45,75,75,100,4,75,75,200 ;
ALIAS (oBcta)->(ALIAS()) ;
FONT oFont ;
UPDATE ;
OF oFldx:adialogs[1]
oBrct:bFont := {| nRow,nCol, nStyleLine| IF( nCol=8 .AND. (nStyleline=0 .OR. nStyleline=3 .OR. nStyleLine=2),;
oFch2:Hfont,NIL) }
oBrct:bLDblClick := { | nRow, nCol, nFlags | com_vcon((oBcta)->VTA_COMP,a_cli[2]) }
oBrct:bBkColor := {| nRow,nCol, nStyleLine| esta_ctac(nRow,nStyleline,oBrct) }
oBrct:ajustify := {2,.F.,.F.,.F.,2,.T.,.T.,.T.,.T.,.T.,.T.,.F.}
oBrct:nclrbackhead := RGB(0,200,255)
oBrct:nclrforehead := RGB(0,0,1)
oBrct:nclrNFback := RGB(127,127,127)
oBrct:nlineHeight := 15
oBrct:nHeaderHeight:= 15
oBrct:nclrbackfocus:= RGB(200,100,50)
oBrct:lAdjLastCol :=.F.
oBrct:lDrawFooters :=.T.
oBrct:aFooters :={,,,"Totales",,;
TRANSFORM(a_tcta[2],"@E ##,###,###.##"),;
TRANSFORM(a_tcta[3],"@E ##,###,###.##"),;
TRANSFORM(a_tcta[1],"@E ##,###,###.##") }
*-------ADEUDADOS---------------------------*
@ 0,0 LISTBOX oBrc2 ;
FIELDS AX[esta_cta(oBct2)] ,;
DTOC((oBct2)->CTA_FVTO) ,;
for_fec((oBct2)->CTA_FECH),;
(oBct2)->VTA_COMP ,;
(oBct2)->CTA_CUOT ,;
TRANSFORM((oBct2)->CTA_DEBE,"@EZ ##,###,###.##") ,;
TRANSFORM((oBct2)->CTA_HABE,"@EZ ##,###,###.##") ,;
TRANSFORM((oBct2)->CTA_PAGA,"@EZ ##,###,###.##") ,;
cta_tpaga(oBct2) ,;
(oBct2)->OPE_OPER ;
HEADERS "E" ,;
"Vencimiento",;
oemtoansi("Emisi¢n"),;
"Concepto" ,;
"Cuota" ,;
"Debe" ,;
"Haber" ,;
"Pagado" ,;
"Sldo.Compte.",;
"Operador" ;
SIZES 15,75,75,150,50,85,85,85,110,200 ;
ALIAS (oBct2)->(ALIAS()) ;
FONT oFont ;
UPDATE ;
OF oFldx:adialogs[2]
oBrc2:bFont := {| nRow,nCol, nStyleLine| IF( nCol=9 .AND. (nStyleline=0 .OR. nStyleline=3 .OR. nStyleLine=2),;
oFch2:Hfont,NIL) }
oBrc2:bLDblClick := { | nRow, nCol, nFlags | com_vcon((oBct2)->VTA_COMP,a_cli[2]) }
oBrc2:bBkColor := {| nRow,nCol, nStyleLine| esta_ctac(nRow,nStyleline,oBrc2) }
oBrc2:ajustify := {2,.F.,.F.,.F.,2,.T.,.T.,.T.,.T.,.F.}
oBrc2:nclrbackhead := RGB(0,200,255)
oBrc2:nclrforehead := RGB(0,0,1)
oBrc2:nclrNFback := RGB(127,127,127)
oBrc2:nlineHeight := 15
oBrc2:nHeaderHeight:= 15
oBrc2:nclrbackfocus:= RGB(200,100,50)
oBrc2:lAdjLastCol :=.F.
oBrc2:lDrawFooters :=.T.
oBrc2:aFooters :={,,,"Totales",,,,,;
TRANSFORM(a_tct2[1],"@E ##,###,###.##") }
*-------CHEQUES EN CARTERA---------------------------*
@ 0,0 LISTBOX oBrc3 ;
FIELDS for_fec((oBchq)->CHQ_FVTO),;
for_fec((oBchq)->CHQ_FECH),;
(oBchq)->CHQ_BANK ,;
(oBchq)->CHQ_SUCU ,;
(oBchq)->CHQ_NUME ,;
TRANSFORM((oBchq)->CHQ_TOTA,"@EZ ##,###,###.##") ,;
(oBchq)->VTA_COMP ,;
(oBchq)->CHQ_CLIE ,;
(oBchq)->OPE_OPER ;
HEADERS "Fecha Cobro" ,;
oemtoansi("Emisi¢n"),;
oemtoansi("Banco") ,;
"Sucursal" ,;
oemtoansi("N£mero") ,;
"Monto" ,;
"Comprobante" ,;
"Cliente" ,;
"Operador" ;
SIZES 70,70,165,165,165,95,150,200,200 ;
ALIAS (oBChq)->(ALIAS()) ;
FONT oFont ;
UPDATE ;
OF oFldx:adialogs[3]
oBrc3:bFont := {| nRow,nCol, nStyleLine| IF( nCol=6 .AND. (nStyleline=0 .OR. nStyleline=3 .OR. nStyleLine=2),oFch2:Hfont,NIL) }
oBrc3:ajustify := {.F.,.F.,.F.,.f.,.f.,.T.,.f.,.f.,.F.}
oBrc3:nclrbackhead := RGB(0,200,255)
oBrc3:nclrforehead := RGB(0,0,1)
oBrc3:nclrNFback := RGB(127,127,127)
oBrc3:nlineHeight := 15
oBrc3:nHeaderHeight:= 15
oBrc3:nclrbackfocus:= RGB(200,100,50)
oBrc3:lAdjLastCol :=.F.
oBrc3:lDrawFooters :=.T.
oBrc3:aFooters :={,,,,"Total",;
TRANSFORM(a_tct3[1],"@E ##,###,###.##") }
*--- FOLDER 4 - RESUMEN DE CUENTA
@ 0,0 LISTBOX oBrc4 FIELDS "" ;
HEADER "Detalle" ,;
"Totales" ;
SIZES 250,180 ;
UPDATE ;
OF oFldx:aDialogs[4]
oBrc4:bFont := {| nRow,nCol, nStyleLine| IF( oBrc4:nAt=4 .AND. (nStyleline=0 .OR. nStyleline=3 .OR. nStyleLine=2),oFch2:Hfont,NIL) }
oBrc4:bBkColor := {| nRow,nCol, nStyleLine| IF( oBrc4:nAt=4 .AND. nCol=2 .AND. (nStyleline=0 .OR. nStyleline=3 .OR. nStyleLine=2),IF(AT("-",a_pag[oBrc4:nAt,2])>0,RGB(255,0,0),RGB(0,255,0)),NIL) }
oBrc4:bLine:= {|nAt| nAt:= oBrc4:nAt, { a_pag[nAt,1],a_pag[nAt,2] } }
oBrc4:aJustify := { .F.,.T. }
oBrc4:SetArray( a_pag )
oBrc4:lAdjLastCol := .f.
oBrc4:nLineStyle := 4
oBrc4:nlineHeight := 17
oBrc4:nHeaderHeight:= 17
oBrc4:nclrbackhead := RGB(0,200,255)
oBrc4:nclrforehead := RGB(0,0,1)
oBrc4:nclrNFback := RGB(127,127,127)
oBrc4:nclrbackfocus:= RGB(200,100,50)
oWcta:bGotFocus :={|| oBrct:SetFocus() }
oWcta:SetControl(oBrct)
oWcta:Gotop()
ACTIVATE WINDOW oWcta ;
MAXIMIZED ;
ON RESIZE FoldRes4( oWcta, oFldx, oBrct, oBrc2, oBrc3, oBrc4 ) ;
VALID (oWcta:=Nil,;
cerrar_dbf(oBcta),;
cerrar_dbf(oBct2),;
cerrar_dbf(oBchq),.T.)
RETURN(.T.)