DEFINITION OF XBROWSE
- Code: Select all Expand view
oBrw:=TxBrowse():New( oDlgPpal )
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:nStretchCol := STRETCHCOL_LAST
:lColDividerComplete := .t.
:lAllowColSwapping := .f.
:lAllowColHiding := .f.
:nHeaderHeight := 20
:l2007 := .t.
:lFooter := .t.
:lRecordSelector := .t.
:lFastEdit := .t.
:bLDblClick := {|| tildafactu( oDbfFACTU, oBrw ) } // DOBLE CLICK
END WITH
//COMIENZAN LAS COLUMNAS
*** COL.1
oCol := oBrw:AddCol()
oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:fecha, SPACE(10) ) }
oCol:cHeader := "Fecha"
oCol:nWidth := 70
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_CENTER
*** COL.2
oCol := oBrw:AddCol()
oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:factura, SPACE(10) ) }
oCol:cHeader := "No.FACT."
oCol:nWidth := 80
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_CENTER
*** COL.3
oCol := oBrw:AddCol()
oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:control, SPACE(10) ) }
oCol:cHeader := "No.CTRL"
oCol:nWidth := 80
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_CENTER
oCol:nEditType := EDIT_GET
oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN .or. ;
nKey == VK_DOWN ,;
( oDbfFACTU:control := xVal ,;
oDbfFACTU:SAVE() ), ) }
*** COL.4
oCol := oBrw:AddCol()
oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:nombre, SPACE(250) ) }
oCol:cHeader := "NOMBRE O RAZON SOCIAL DEL CLIENTE"
oCol:nWidth := 250
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_LEFT
*** COL.5
oCol := oBrw:AddCol()
oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:rif, SPACE(10) ) }
oCol:cHeader := "RIF"
oCol:cFooter := "TOTALES --->"
oCol:nFootStrAlign := AL_RIGHT
oCol:nWidth := 80
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_LEFT
*** COL.6 - MTO.BASE
oCol := oBrw:AddCol()
oCol:bEditValue := {|| oDbfFACTU:subtotal }
oCol:cEditPicture := "@E 999,999,999.99"
oCol:cHeader := "MTO.BASE"
oCol:nWidth := 70
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_RIGHT
oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
oCol:nEditType := EDIT_GET
oCol:lTotal := .t. // PARA TOTALIZAR
oCol:nTotal := 0 // PARA TOTALIZAR
oCol:nFooterType := AGGR_SUM // PARA TOTALIZAR
oCol:nFootStrAlign := AL_RIGHT // PARA TOTALIZAR
*** COL.7 - MTO.IVA
oCol := oBrw:AddCol()
oCol:bEditValue := {|| oDbfFACTU:total-oDbfFACTU:subtotal }
oCol:cEditPicture := "@E 999,999,999.99"
oCol:cHeader := "MTO.IVA"
oCol:nWidth := 70
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_RIGHT
oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
oCol:nEditType := EDIT_GET
oCol:lTotal := .t.
oCol:nTotal := 0
oCol:nFooterType := AGGR_SUM
oCol:nFootStrAlign := AL_RIGHT
*** COL.8 - MTO.NETO
oCol := oBrw:AddCol()
oCol:bEditValue := {|| oDbfFACTU:total }
oCol:cEditPicture := "@E 999,999,999.99"
oCol:cHeader := "MTO.NETO"
oCol:nWidth := 70
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_RIGHT
oCol:nEditType := EDIT_GET
oCol:lTotal := .t.
oCol:nTotal := 0
oCol:nFooterType := AGGR_SUM
oCol:nFootStrAlign := AL_RIGHT
oCol:bOnChange := { || oBrw:MakeTotals() ,;
oBrw:RefreshFooters() } // ACT.TOT.EN LOS FOOTERS(13/01/2013)
oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN ,;
( oDbfFACTU:total := xVal ,; // MTO.NETO
oDbfFACTU:subtotal := oDbfFACTU:total/1.12 ,; // MTO.BRUTO
oDbfFACTU:mtoiva := oDbfFACTU:total - oDbfFACTU:subtotal ,; // MTO.IVA
oDbfFACTU:SAVE() ), ) }
*** COL.9 - MARCA(check)
oCol := oBrw:AddCol()
oCol:cHeader := "Sel"
oCol:bEditValue := {|| IIF( LastRec() == 0, .f. ,;
oDbfFACTU:marca ) }
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_CENTER
oCol:nWidth := 20
oCol:cToolTip := "Doble Click/ENTER/ESPACIO para marcar/descargar."
oCol:SetCheck()
* oCol:SetCheck( { "OK16", .t. } )
//
oBrw:SetoDbf( oDbfFACTU )
oBrw:CreateFromResource( 100 )
oBrw:MakeTotals()
oBrw:REFRESH()
FUNCTION true / false / true
- Code: Select all Expand view
PROCEDURE tildafactu( oDbf, oBrw )
IF oDbf:LastRec() > 0
IF oDbf:marca == .f.
oDbf:marca := .t.
ELSE
oDbf:marca := .f.
ENDIF
ENDIF
oDbf:SAVE()
oBrw:GOTOP()
oBrw:REFRESH()
oBrw:MakeTotals()
RETURN