@ 1, 0.50 XBROWSE oLbx ALIAS "DATA" COLUMNS "data1","data2","valor1","valor2","valor3","valor4","valor1 - valor2" SIZE 285, 95 OF oDlg
cT_Clientes:= _cPrefijo+'_clientes'
cT_Facturas:= _cPrefijo+'_facturas'
cT_Pagos := _cPrefijo+'_pagos'
cQuery := "SELECT "
cQuery += "Cli.rif_cliente, "
cQuery += "Cli.razon_social_cliente, "
cQuery += "Fac.numero_documento, "
cQuery += "Fac.fecha_documento, "
cQuery += "Fac.fecha_vencimiento, "
dHoy:=subs(dToc(_dFechaDeHoy),7,4)+"/"+subs(dToc(_dFechaDeHoy),4,2)+"/"+subs(dToc(_dFechaDeHoy),1,2)
cQuery += "DATEDIFF('"+dHoy+"', Fac.fecha_vencimiento),"
cQuery += "Fac.monto, "
cQuery += "(SELECT SUM(monto_pago) FROM "+cT_Pagos+" WHERE codigo_cliente=Cli.codigo_cliente AND numero_documento=Fac.numero_documento) AS nPagos , "
cQuery += "Fac.concepto, "
cQuery += "Cli.codigo_cliente, "
cQuery += "Fac.codigo_cliente "
cQuery += "FROM "
cQuery += cT_Clientes + " AS Cli , "
cQuery += cT_Facturas + " AS Fac "
cQuery += "WHERE Fac.codigo_cliente = Cli.codigo_cliente ;"
TRY
oFacturas:=_oSqlConex:Query( cQuery )
CATCH
Fnct_MsgErrorBD("NoMySql" , .f. , "No hay conexión a La Base de Datos" , "Sin Acceso a La Red","Error en servicio de Datos",)
return .f.
END TRY
*****************************************************************************************************************************************
Define cursor oCursorBar resource 'manito'
Define cursor oCursorIndicador resource 'Indicador'
Define Font oFHeadBrw Name "Segoe UI SemiBold" Size 0, -14
Define Dialog oDlg_Facturas resource "oDlg_Facturas" title 'Gestión de Documentos Por Cobrar'
oDlg_Facturas:lHelpIcon:=.f.
Redefine Image oSeekImage Resource "Buscar" id 15 of oDlg_Facturas
Redefine get oGetSeek Var cSeek Id 11 of oDlg_Facturas on change (cSeek:=oGetSeek:GetText() )
oGetSeek:SetFont(_oFontGets)
oGetSeek:SetColorFocus( CLR_YELLOW )
Redefine xBrowse oBrwFacturas Id 4007 DATASOURCE oFacturas AUTOCOLS AUTOSORT ;
COLUMNS 1, 2, 3, 4, 5, 6, 7, 8, (7-8), 9, 10, 1 ;
HEADERS _cIdEmpresa, "Cliente", "N# Doc. ","Emisión", "Vencto.", "Dias Vcdo.", ;
"Monto "+_cSignoMoneda , "Pagos", "Saldo Doc.", "Concepto"
Redefine xBrowse oBrwFacturas Id 4007 DATASOURCE oFacturas AUTOCOLS AUTOSORT COLUMNS "rif_cliente", "razon_social_cliente", "numero_documento", "fecha_documento", "fecha_vencimiento","nDiasVencido", "monto", "nPagos", "monto-nPagos"
#include "fivewin.ch"
#include "xBrowse.ch"
Function Inicio()
LOCAL cServer := "127.0.0.1"
LOCAL cUser := "tuuser", cDBName := "basedatosnnn"
LOCAL cPassword := "tupassw"
LOCAL oServer3, oRs, cQuery1
LOCAL oDlg, oBrw
SET DATE FORMAT TO "dd-mm-yyyy"
MsgRun( "Conectando con tuservidor.com...", "Pruebas...",;
{|oDlgx| oServer3 := Maria_Connect( cServer, cDBName, cUser, cPassword ) } )
TEXT INTO cQuery1
SELECT vta.codigopro,vta.numdoc,vta.fechadoc,vta.fechapag,vta.totaldoc
FROM vta_cob AS vta
WHERE fechapag <> '' AND marca = 'FC'
ORDER BY numdoc
ENDTEXT
oRs := oServer3:RowSet( cQuery1 )
DEFINE DIALOG oDlg FROM 10,10 TO 400,520 PIXEL
@ 10,10 XBROWSE oBrw OF oDlg SIZE 235,170 PIXEL ;
DATASOURCE oRs ;
COLUMNS "numdoc", "fechadoc", "fechapag", "Dias_Dif", "totaldoc" ;
HEADERS "Documento", "Fecha Emisión", "Fecha Pago", "Días Dif.", "Total Doc" ;
NOBORDER CELL LINES AUTOSORT
// *** Aquí se asigna valor al campo calculado:
oBrw:oCol("Días Dif."):bEditValue := {|| oRs:fechapag - oRs:fechadoc }
oBrw:CreateFromCode()
oDlg:oClient := oBrw
ACTIVATE DIALOG oDlg CENTERED
oServer3:Close()
Return(NIL)
//-------------
Cgallegoa wrote:Jose:
- Code: Select all Expand view
#include "fivewin.ch"
#include "xBrowse.ch"
Function Inicio()
LOCAL cServer := "127.0.0.1"
LOCAL cUser := "tuuser", cDBName := "basedatosnnn"
LOCAL cPassword := "tupassw"
LOCAL oServer3, oRs, cQuery1
LOCAL oDlg, oBrw
SET DATE FORMAT TO "dd-mm-yyyy"
MsgRun( "Conectando con tuservidor.com...", "Pruebas...",;
{|oDlgx| oServer3 := Maria_Connect( cServer, cDBName, cUser, cPassword ) } )
TEXT INTO cQuery1
SELECT vta.codigopro,vta.numdoc,vta.fechadoc,vta.fechapag,vta.totaldoc
FROM vta_cob AS vta
WHERE fechapag <> '' AND marca = 'FC'
ORDER BY numdoc
ENDTEXT
oRs := oServer3:RowSet( cQuery1 )
DEFINE DIALOG oDlg FROM 10,10 TO 400,520 PIXEL
@ 10,10 XBROWSE oBrw OF oDlg SIZE 235,170 PIXEL ;
DATASOURCE oRs ;
COLUMNS "numdoc", "fechadoc", "fechapag", "Dias_Dif", "totaldoc" ;
HEADERS "Documento", "Fecha Emisión", "Fecha Pago", "Días Dif.", "Total Doc" ;
NOBORDER CELL LINES AUTOSORT
// *** Aquí se asigna valor al campo calculado:
oBrw:oCol("Días Dif."):bEditValue := {|| oRs:fechapag - oRs:fechadoc }
oBrw:CreateFromCode()
oDlg:oClient := oBrw
ACTIVATE DIALOG oDlg CENTERED
oServer3:Close()
Return(NIL)
//-------------
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 73 guests