#include "Fivewin.ch"
#include "xbrowse.ch"
#include "splitter.ch"
#include "report.ch"
static octae
FUNCTION xBrwgen()
local odlgx
local oBrw, oSpli
local nProa := 0
local napea
local aMae := array(0)
local oGet := array(7)
local beval := {|| aMae := iif(empty(nproa),buspro(),buspro(nproa)), iif(len(aMae) > 0,(nproa := aMae[1],napea := aMae[2],odlgx:update(),filtro(nproa,oBrw,oGet,oDlgx),.t.),odlgx:end())}
local aSelGrad := { { .5, RGB( 255, 255, 251 ), RGB( 255, 237, 178 ) }, ;
{ .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }
local aGradBarSel := {{.5,RGB(255,255,251), RGB( 255, 196, 178 ) },;
{ .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }
local nSaldo := 0
local z := 0
local cAmtPict
if !pasaje("CTAEXPO");return nil; endif
DATABASE oCtae
oCtae:setorder(1)
oCtae:beof := {|| nil}
oCtae:bBoF := {|| nil}
oCtae:setfilter({|| (oCtae:cAlias)->npro = 0 } )
//oCtae:setfilter( "(oCtae:cAlias)->npro = 0 " )
DEFINE DIALOG oDlgx resource "dia_xbrowse"
REDEFINE GET oGet[1] VAR nproa id 121 of odlgx update valid eval(beval)
REDEFINE GET oGet[2] VAR napea id 120 of odlgx update
REDEFINE BTNBMP oGet[3] id 101 of oDlgx resource "btngastos","btnastos1" ACTION ctaexpo(oCtae,oBrw,nproa,.t.,.t.) update
REDEFINE BTNBMP oGet[4] id 102 of oDlgx resource "btnpagos","btnpagos1" ACTION ctaexpo(oCtae,oBrw,nproa,.f.,.t.) update
REDEFINE BTNBMP oGet[5] id 103 of oDlgx resource "btncambiar","btncambiar1" ACTION ctaexpo(oCtae,oBrw,nproa,,.f.) update
REDEFINE BTNBMP oGet[6] id 104 of oDlgx resource "BTNIMPRI","BTNIMPRI1" ACTION Reporte(nProa,oCtae) update
//REDEFINE BTNBMP oGet[7] id 105 of oDlgx resource "BTNELIMINA","BTNELIMINA1" ACTION borrar(nProa,oCtae)
for z = 3 to 6
oGet[z]:disable()
next
REDEFINE SPLITTER oSpli ID 111 COLOR rgb(234,234,234) of odlgx _3DLOOK
XbrNumFormat( "E", .t. )
cAmtPict := NumPict( 11, 2 )
REDEFINE XBROWSE oBrw ID 110 OF oDlgx OBJECT oCtae;
COLUMNS ;
{ { || If( oCtae:npro = nproa, oCtae:fecha, "") }}, ;
{ { || If( oCtae:npro = nproa, oCtae:factura, "") }}, ;
{ { || If( oCtae:npro = nproa, oCtae:opera, "") }}, ;
{ { || If( oCtae:npro = nproa .and. oCtae:lsumo, oCtae:importe, 0 ) }}, ;
{ { || If( oCtae:npro = nproa .and. ! oCtae:lsumo, oCtae:importe, 0 ) }}, ;
{ { || If( oCtae:npro = nproa, oCtae:saldo, 0 ) }} ;
HEADERS "Fecha", "Comprobante", "Descripción","Debe" ,"Haber","Total";
COLSIZES 80,90,190,100,100,100;
PICTURES nil, nil,NIL, cAmtPict, cAmtPict, cAmtPict ;
LINES CELL UPDATE
WITH OBJECT oBrw
:lDisplayZeros := .f.
:nMarqueeStyle := MARQSTYLE_HIGHLROWRC
// :nColDividerStyle := LINESTYLE_BLACK // default
:nStretchCol := STRETCHCOL_WIDEST
:lColDividerComplete := .f.
// :l2007 := .t. // default
:lAllowColHiding := .f.
END WITH
activate dialog odlgx
cierroalias(oCtae:cAlias,oCtae)
return nil
/***************************************************************************/
static function borrar(nProa,oCtae)
return nil
/***************************************************************************/
static function filtro(nproa,oBrw,oGet,odlgx)
local z := 0
oCtae:setfilter()
oCtae:setfilter({|| (oCtae:cAlias)->npro = nproa})
for z = 3 to 6
oGet[z]:enable()
next
odlgx:update()
oBrw:refresh()
oBrw:gotop()
oBrw:gobottom()
return nil
/***************************************************************************/
static function reporte(nproa )
local oinfo
local dFec := dehasta()
local cAlias
if empty(dFec)
return nil
endif
if !pasaje("ctaexpo");return nil;endif
cAlias := alias(select())
set order to 1
set filter to (cAlias)->npro = nproa
dbgotop()
dbseek(dFec[1])
REPORT oInfo title "Movimiento de Cuenta" preview;
FOOTER "Página Nro:"+str(oInfo:nPage,3) RIGHT;
CAPTION "Visualizar movimientos"
COLUMN DATA (cAlias)->fecha title "Fecha" picture "@d"
COLUMN DATA (cAlias)->factura title "Comprobante"
COLUMN DATA Alltrim((cAlias)->opera) title "Detalle"
COLUMN DATA iif((cAlias)->lsumo,(cAlias)->importe,"") title "Debe" PICTURE "@E 9,999,999.99" RIGHT
COLUMN DATA iif((cAlias)->lsumo,space(14),(cAlias)->importe) title "Haber" PICTURE iif((cAlias)->lsumo,"","@E 9,999,999.99") RIGHT
COLUMN DATA (cAlias)->saldo title "Saldo" PICTURE "@E 9,999,999.99" RIGHT
ENDREPORT
oInfo:nTitleUpLine := RPT_SINGLELINE
oInfo:nTitleDnLine := RPT_SINGLELINE
oInfo:nTotalLine := RPT_SINGLELINE
ACTIVATE REPORT oInfo WHILE ((cAlias)->fecha) >= dFec[1] .and. ((cAlias)->fecha <= dFec[2])
dbclosearea()
return nil
/******************************************************************************/