ANTIGRAVITY escribe el código tal como yo lo hago y me gusta. ¿La ventaja? Busca donde tengo los ejemplos e imita mi forma de escribir. ¡Es genial! ¿El inconveniente? ¡Tarda mucho! Voy a probar OPENCODE, una recomendación de mi gran maestro: Antônio Liñares.
// =============================================================================
// PROGRAMA: RELVETPRN.PRG
// SISTEMA : CADASTRO DE VETERINARIOS (FIVEWIN 26.03 / HARBOUR)
// FINALIDADE: RELATORIOS DE IMPRESSAO USANDO A CLASSE TPRINTER (TPRINTER.PRG)
// BANCO DE DADOS: C:\FWH2603\SAMPLES\VETERINA.DBF
// =============================================================================
#include "FiveWin.ch"
#include "Print.ch"
#define CLR_TITULO RGB( 0, 51, 102 ) // Azul Escuro Institucional
#define CLR_SUBTIT RGB( 70, 70, 70 ) // Cinza Escuro
#define CLR_FUNDO RGB( 240, 243, 246 ) // Fundo cabecalho colunas
#define CLR_LINHA RGB( 180, 190, 200 ) // Linhas divisorias
// -----------------------------------------------------------------------------
// Ponto de entrada para execucao direta / independente
// -----------------------------------------------------------------------------
FUNCTION Main()
SET DATE BRITISH
SET CENTURY ON
SET EPOCH TO 1950
SET DELETED ON
// Abre o dialogo de opcoes do relatorio
DlgOpcoesRelatorio()
RETURN NIL
// -----------------------------------------------------------------------------
// Dialogo de Parametros e Opcoes de Impressao
// -----------------------------------------------------------------------------
FUNCTION DlgOpcoesRelatorio()
LOCAL oDlg, oFont, oFntBld, oFntTit
LOCAL nTipoRel := 1 // 1 = Sintetico (Paisagem), 2 = Ficha Analitica (Retrato)
LOCAL nFiltro := 1 // 1 = Todos, 2 = Somente Ativos, 3 = Somente Inativos
LOCAL nOrdem := 1 // 1 = Codigo, 2 = Nome, 3 = CRMV, 4 = Cidade
LOCAL lPreview := .T. // .T. = Preview, .F. = Impressao Direta
LOCAL lExecutou := .F.
DEFINE FONT oFont NAME "Segoe UI" SIZE 0, -12
DEFINE FONT oFntBld NAME "Segoe UI" SIZE 0, -12 BOLD
DEFINE FONT oFntTit NAME "Segoe UI" SIZE 0, -15 BOLD
DEFINE DIALOG oDlg TITLE "Relatorios de Veterinarios - TPrinter" ;
SIZE 440, 390 PIXEL TRUEPIXEL FONT oFont COLOR CLR_BLACK, RGB( 248, 250, 252 )
// Titulo
@ 15, 20 SAY "EMISSAO DE RELATORIOS - VETERINARIOS" ;
SIZE 400, 24 PIXEL OF oDlg FONT oFntTit COLOR CLR_TITULO, RGB( 248, 250, 252 )
@ 38, 20 SAY "Selecione o modelo, filtro e formato desejados:" ;
SIZE 380, 18 PIXEL OF oDlg COLOR CLR_SUBTIT, RGB( 248, 250, 252 )
// Grupo 1: Tipo de Relatorio
@ 65, 20 GROUP TO 135, 420 PIXEL OF oDlg PROMPT " Modelo do Relatorio " ;
FONT oFntBld COLOR CLR_TITULO, RGB( 248, 250, 252 )
@ 85, 35 RADIO nTipoRel ;
ITEMS "1. Relacao Geral Sintetica (Modo Paisagem / Formato Tabela)", ;
"2. Ficha Cadastral Analitica (Modo Retrato / Ficha Detalhada)" ;
SIZE 370, 20 PIXEL OF oDlg
// Grupo 2: Filtro por Situacao
@ 145, 20 GROUP TO 215, 420 PIXEL OF oDlg PROMPT " Situacao / Filtro " ;
FONT oFntBld COLOR CLR_TITULO, RGB( 248, 250, 252 )
@ 165, 35 RADIO nFiltro ;
ITEMS "Todos os Cadastrados", ;
"Apenas Veterinarios Ativos", ;
"Apenas Veterinarios Inativos" ;
SIZE 125, 20 PIXEL OF oDlg
// Grupo 3: Ordenacao
@ 225, 20 GROUP TO 285, 420 PIXEL OF oDlg PROMPT " Ordenacao dos Registros " ;
FONT oFntBld COLOR CLR_TITULO, RGB( 248, 250, 252 )
@ 245, 35 RADIO nOrdem ;
ITEMS "Codigo", "Nome", "CRMV", "Cidade" ;
SIZE 90, 20 PIXEL OF oDlg
// Opcao de Visualizar na Tela (Preview)
@ 295, 35 CHECKBOX lPreview PROMPT "Visualizar antes de imprimir (Preview)" ;
SIZE 280, 20 PIXEL OF oDlg FONT oFntBld
// Botoes
@ 330, 110 BUTTON "&Imprimir" OF oDlg SIZE 100, 34 PIXEL ;
FONT oFntBld ACTION ( lExecutou := .T., oDlg:End() )
@ 330, 230 BUTTON "&Cancelar" OF oDlg SIZE 100, 34 PIXEL ;
ACTION ( oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
oFont:End()
oFntBld:End()
oFntTit:End()
IF lExecutou
RelVeterinariosPrn( nTipoRel, nFiltro, nOrdem, lPreview )
ENDIF
RETURN NIL
// -----------------------------------------------------------------------------
// Funcao Principal de Impressao com TPrinter
// -----------------------------------------------------------------------------
FUNCTION RelVeterinariosPrn( nTipoRel, nFiltro, nOrdem, lPreview )
LOCAL cArqDbf := "C:\FWH2603\SAMPLES\VETERINA.DBF"
LOCAL lCloseDbf := .F.
DEFAULT nTipoRel := 1
DEFAULT nFiltro := 1
DEFAULT nOrdem := 1
DEFAULT lPreview := .T.
// Verifica e abre o DBF
IF ! File( cArqDbf )
cArqDbf := "VETERINA.DBF"
IF ! File( cArqDbf )
MsgStop( "Arquivo VETERINA.DBF nao localizado em C:\FWH2603\SAMPLES!", "Atencao" )
RETURN NIL
ENDIF
ENDIF
IF Select( "VET" ) == 0
USE ( cArqDbf ) NEW SHARED ALIAS VET
lCloseDbf := .T.
ELSE
SELECT VET
ENDIF
IF VET->( LastRec() ) == 0
MsgAlert( "O cadastro de Veterinarios esta vazio!", "Aviso" )
IF lCloseDbf
VET->( dbCloseArea() )
ENDIF
RETURN NIL
ENDIF
// Dispara o modelo escolhido
IF nTipoRel == 1
ImprimeSintetico( nFiltro, nOrdem, lPreview )
ELSE
ImprimeAnalitico( nFiltro, nOrdem, lPreview )
ENDIF
IF lCloseDbf
VET->( dbCloseArea() )
ENDIF
RETURN NIL
// -----------------------------------------------------------------------------
// MODELO 1: RELACAO SINTETICA DE VETERINARIOS (PAISAGEM - A4 LANDSCAPE)
// -----------------------------------------------------------------------------
STATIC FUNCTION ImprimeSintetico( nFiltro, nOrdem, lPreview )
LOCAL oPrn, oFontEmp, oFontTit, oFontCab, oFontSub, oFontDet, oFontBld, oFontRod
LOCAL oPenLinha, oPenGrossa
LOCAL nPagina := 0, nRow := 0, nLinhas := 0
LOCAL nTotReg := 0, nTotAtivo := 0, nTotInativo := 0
LOCAL cFiltroTxt := "", cOrdemTxt := ""
LOCAL aDados := {}, i := 0
LOCAL lZebrado := .F.
LOCAL cStatus := ""
// Carrega e filtra os dados para uma matriz para permitir ordenacao customizada
VET->( dbGoTop() )
DO WHILE ! VET->( Eof() )
cStatus := Upper( AllTrim( cValToChar( VET->ATIVO ) ) )
IF Empty( cStatus )
cStatus := "S" // Padrao ativo se nao definido
ENDIF
IF nFiltro == 2 .AND. cStatus != "S"
VET->( dbSkip() )
LOOP
ENDIF
IF nFiltro == 3 .AND. cStatus == "S"
VET->( dbSkip() )
LOOP
ENDIF
AAdd( aDados, { VET->CODIGO, ; // 1
AllTrim( VET->NOME ), ; // 2
AllTrim( VET->CRMV ), ; // 3
AllTrim( VET->ESPECIALID ), ; // 4
AllTrim( VET->CPF ), ; // 5
If( !Empty( VET->WHATSAPP ), AllTrim( VET->WHATSAPP ), ;
If( !Empty( VET->CELULAR ), AllTrim( VET->CELULAR ), AllTrim( VET->FONE ) ) ), ; // 6
AllTrim( VET->CIDADE ) + If( !Empty( VET->UF ), "/" + AllTrim( VET->UF ), "" ), ; // 7
If( cStatus == "S", "Ativo", "Inativo" ) } ) // 8
VET->( dbSkip() )
ENDDO
IF Len( aDados ) == 0
MsgAlert( "Nenhum veterinario encontrado para o filtro selecionado!", "Aviso" )
RETURN NIL
ENDIF
// Ordenacao da matriz
DO CASE
CASE nOrdem == 1 // Codigo
ASort( aDados,,, { |x,y| x[ 1 ] < y[ 1 ] } )
cOrdemTxt := "Codigo"
CASE nOrdem == 2 // Nome
ASort( aDados,,, { |x,y| Upper( x[ 2 ] ) < Upper( y[ 2 ] ) } )
cOrdemTxt := "Nome Alfab‚tico"
CASE nOrdem == 3 // CRMV
ASort( aDados,,, { |x,y| Upper( x[ 3 ] ) < Upper( y[ 3 ] ) } )
cOrdemTxt := "CRMV"
CASE nOrdem == 4 // Cidade
ASort( aDados,,, { |x,y| Upper( x[ 7 ] ) < Upper( y[ 7 ] ) } )
cOrdemTxt := "Cidade"
ENDCASE
DO CASE
CASE nFiltro == 1 ; cFiltroTxt := "Todos os Cadastrados"
CASE nFiltro == 2 ; cFiltroTxt := "Somente Ativos"
CASE nFiltro == 3 ; cFiltroTxt := "Somente Inativos"
ENDCASE
// Inicializa TPrinter
IF lPreview
PRINT oPrn NAME "Relacao de Veterinarios" PREVIEW
ELSE
PRINT oPrn NAME "Relacao de Veterinarios"
ENDIF
IF oPrn:hDC == 0
MsgStop( "Nao foi possivel inicializar o subsistema de impressao!", "Erro" )
RETURN NIL
ENDIF
oPrn:SetLandscape()
oPrn:SetPage( 9 ) // A4
// Definicao de Fontes e Canetas
DEFINE FONT oFontEmp NAME "Arial" SIZE 0, -13 BOLD OF oPrn
DEFINE FONT oFontTit NAME "Arial" SIZE 0, -11 BOLD OF oPrn
DEFINE FONT oFontSub NAME "Arial" SIZE 0, -8.5 OF oPrn
DEFINE FONT oFontCab NAME "Arial" SIZE 0, -8.5 BOLD OF oPrn
DEFINE FONT oFontDet NAME "Arial" SIZE 0, -8.0 OF oPrn
DEFINE FONT oFontBld NAME "Arial" SIZE 0, -8.0 BOLD OF oPrn
DEFINE FONT oFontRod NAME "Arial" SIZE 0, -7.5 OF oPrn
DEFINE PEN oPenLinha WIDTH 1 COLOR CLR_LINHA OF oPrn
DEFINE PEN oPenGrossa WIDTH 1.8 COLOR CLR_TITULO OF oPrn
PAGE
nPagina++
CabecalhoSintetico( oPrn, oFontEmp, oFontTit, oFontSub, oFontCab, ;
oPenLinha, oPenGrossa, @nRow, nPagina, cFiltroTxt, cOrdemTxt )
FOR i := 1 TO Len( aDados )
// Verifica quebra de pagina (limite util em A4 Paisagem ~ 18.5 cm)
IF nRow > 18.2
RodapeSintetico( oPrn, oFontRod, oPenLinha, nPagina )
ENDPAGE
PAGE
nPagina++
CabecalhoSintetico( oPrn, oFontEmp, oFontTit, oFontSub, oFontCab, ;
oPenLinha, oPenGrossa, @nRow, nPagina, cFiltroTxt, cOrdemTxt )
ENDIF
// Impressao das colunas da linha
oPrn:CmSay( nRow, 1.0, StrZero( aDados[ i, 1 ], 6 ), oFontDet )
oPrn:CmSay( nRow, 2.6, SubStr( aDados[ i, 2 ], 1, 40 ), oFontBld )
oPrn:CmSay( nRow, 10.0, SubStr( aDados[ i, 3 ], 1, 15 ), oFontDet )
oPrn:CmSay( nRow, 13.0, SubStr( aDados[ i, 4 ], 1, 26 ), oFontDet )
oPrn:CmSay( nRow, 18.2, aDados[ i, 5 ], oFontDet )
oPrn:CmSay( nRow, 21.2, aDados[ i, 6 ], oFontDet )
oPrn:CmSay( nRow, 24.6, SubStr( aDados[ i, 7 ], 1, 18 ), oFontDet )
oPrn:CmSay( nRow, 27.5, aDados[ i, 8 ], If( aDados[ i, 8 ] == "Ativo", oFontBld, oFontDet ) )
nRow += 0.48
oPrn:CmLine( nRow, 1.0, nRow, 28.7, oPenLinha )
nRow += 0.12
nTotReg++
IF aDados[ i, 8 ] == "Ativo"
nTotAtivo++
ELSE
nTotInativo++
ENDIF
NEXT
// Bloco de Totais ao final
IF nRow > 17.0
RodapeSintetico( oPrn, oFontRod, oPenLinha, nPagina )
ENDPAGE
PAGE
nPagina++
CabecalhoSintetico( oPrn, oFontEmp, oFontTit, oFontSub, oFontCab, ;
oPenLinha, oPenGrossa, @nRow, nPagina, cFiltroTxt, cOrdemTxt )
ENDIF
nRow += 0.3
oPrn:CmLine( nRow, 1.0, nRow, 28.7, oPenGrossa )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "TOTAIS DO RELATORIO:", oFontBld )
oPrn:CmSay( nRow, 6.0, "Total Listados: " + AllTrim( Str( nTotReg ) ), oFontBld )
oPrn:CmSay( nRow, 11.0, "Ativos: " + AllTrim( Str( nTotAtivo ) ), oFontBld )
oPrn:CmSay( nRow, 15.0, "Inativos: " + AllTrim( Str( nTotInativo ) ), oFontBld )
nRow += 0.5
oPrn:CmLine( nRow, 1.0, nRow, 28.7, oPenLinha )
RodapeSintetico( oPrn, oFontRod, oPenLinha, nPagina )
ENDPAGE
ENDPRINT
// Liberacao de Recursos
oFontEmp:End()
oFontTit:End()
oFontSub:End()
oFontCab:End()
oFontDet:End()
oFontBld:End()
oFontRod:End()
oPenLinha:End()
oPenGrossa:End()
RETURN NIL
// -----------------------------------------------------------------------------
// Cabecalho do Relatorio Sintetico
// -----------------------------------------------------------------------------
STATIC PROCEDURE CabecalhoSintetico( oPrn, oFontEmp, oFontTit, oFontSub, oFontCab, ;
oPenLinha, oPenGrossa, nRow, nPagina, cFiltroTxt, cOrdemTxt )
nRow := 1.0
// Topo: Nome da Empresa e Dados de Emissao
oPrn:CmSay( nRow, 1.0, "CLINICA VETERINARIA & PET SHOP - PETVET 1.0", oFontEmp, , CLR_TITULO )
oPrn:CmSay( nRow, 22.0, "Emissao: " + DToC( Date() ) + " as " + Time(), oFontSub )
nRow += 0.55
oPrn:CmSay( nRow, 1.0, "RELACAO CADASTRAL DE MEDICOS VETERINARIOS", oFontTit, , CLR_TITULO )
oPrn:CmSay( nRow, 22.0, "Filtro: " + cFiltroTxt + " | Ordem: " + cOrdemTxt, oFontSub )
nRow += 0.5
oPrn:CmLine( nRow, 1.0, nRow, 28.7, oPenGrossa )
// Cabecalho das Colunas
nRow += 0.15
oPrn:CmSay( nRow, 1.0, "CODIGO", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 2.6, "NOME COMPLETO DO VETERINARIO", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 10.0, "CRMV / UF", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 13.0, "ESPECIALIDADE",oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 18.2, "CPF", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 21.2, "CONTATO/CEL", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 24.6, "CIDADE / UF", oFontCab, , CLR_TITULO )
oPrn:CmSay( nRow, 27.5, "SITUACAO", oFontCab, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 28.7, oPenGrossa )
nRow += 0.25
RETURN
// -----------------------------------------------------------------------------
// Rodape do Relatorio Sintetico
// -----------------------------------------------------------------------------
STATIC PROCEDURE RodapeSintetico( oPrn, oFontRod, oPenLinha, nPagina )
LOCAL nRodRow := 19.3
oPrn:CmLine( nRodRow, 1.0, nRodRow, 28.7, oPenLinha )
nRodRow += 0.15
oPrn:CmSay( nRodRow, 1.0, "Sistema PetVet - Modulo de Cadastro de Veterinarios (TPrinter)", oFontRod )
oPrn:CmSay( nRodRow, 26.5, "Pagina: " + AllTrim( Str( nPagina ) ), oFontRod )
RETURN
// -----------------------------------------------------------------------------
// MODELO 2: FICHA CADASTRAL ANALITICA (RETRATO - A4 PORTRAIT)
// -----------------------------------------------------------------------------
STATIC FUNCTION ImprimeAnalitico( nFiltro, nOrdem, lPreview )
LOCAL oPrn, oFontEmp, oFontTit, oFontSec, oFontLbl, oFontTxt, oFontRod
LOCAL oPenLinha, oPenSec, oPenBorda
LOCAL nPagina := 0, nRow := 0
LOCAL cStatus := ""
LOCAL cObs := ""
// Inicializa TPrinter
IF lPreview
PRINT oPrn NAME "Ficha Cadastral do Veterinario" PREVIEW
ELSE
PRINT oPrn NAME "Ficha Cadastral do Veterinario"
ENDIF
IF oPrn:hDC == 0
MsgStop( "Nao foi possivel inicializar o subsistema de impressao!", "Erro" )
RETURN NIL
ENDIF
oPrn:SetPortrait()
oPrn:SetPage( 9 ) // A4
DEFINE FONT oFontEmp NAME "Arial" SIZE 0, -13 BOLD OF oPrn
DEFINE FONT oFontTit NAME "Arial" SIZE 0, -11 BOLD OF oPrn
DEFINE FONT oFontSec NAME "Arial" SIZE 0, -9 BOLD OF oPrn
DEFINE FONT oFontLbl NAME "Arial" SIZE 0, -8.5 BOLD OF oPrn
DEFINE FONT oFontTxt NAME "Arial" SIZE 0, -8.5 OF oPrn
DEFINE FONT oFontRod NAME "Arial" SIZE 0, -7.5 OF oPrn
DEFINE PEN oPenLinha WIDTH 1 COLOR CLR_LINHA OF oPrn
DEFINE PEN oPenSec WIDTH 1.5 COLOR CLR_TITULO OF oPrn
DEFINE PEN oPenBorda WIDTH 2 COLOR CLR_TITULO OF oPrn
VET->( dbGoTop() )
DO WHILE ! VET->( Eof() )
cStatus := Upper( AllTrim( cValToChar( VET->ATIVO ) ) )
IF Empty( cStatus ) ; cStatus := "S" ; ENDIF
IF nFiltro == 2 .AND. cStatus != "S"
VET->( dbSkip() )
LOOP
ENDIF
IF nFiltro == 3 .AND. cStatus == "S"
VET->( dbSkip() )
LOOP
ENDIF
PAGE
nPagina++
nRow := 1.0
// Cabecalho Principal da Pagina
oPrn:CmSay( nRow, 1.0, "CLINICA VETERINARIA & PET SHOP - PETVET 1.0", oFontEmp, , CLR_TITULO )
oPrn:CmSay( nRow, 14.5, "Emissao: " + DToC( Date() ) + " " + Time(), oFontTxt )
nRow += 0.55
oPrn:CmSay( nRow, 1.0, "FICHA CADASTRAL INDIVIDUAL DO MEDICO VETERINARIO", oFontTit, , CLR_TITULO )
oPrn:CmSay( nRow, 17.5, "Pagina: " + AllTrim( Str( nPagina ) ), oFontTxt )
nRow += 0.5
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenBorda )
// Bloco 1: Identificacao
nRow += 0.3
oPrn:CmSay( nRow, 1.0, "1. IDENTIFICACAO PROFISSIONAL", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "Codigo:", oFontLbl )
oPrn:CmSay( nRow, 3.2, StrZero( VET->CODIGO, 6 ), oFontTxt )
oPrn:CmSay( nRow, 7.0, "Situacao:", oFontLbl )
oPrn:CmSay( nRow, 9.2, If( cStatus == "S", "ATIVO NO SISTEMA", "INATIVO" ), oFontLbl, , ;
If( cStatus == "S", RGB( 0, 128, 0 ), RGB( 200, 0, 0 ) ) )
oPrn:CmSay( nRow, 14.0, "Tipo / Tabela:", oFontLbl )
oPrn:CmSay( nRow, 17.0, AllTrim( VET->TIPO ) + " / " + AllTrim( VET->TABELA ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "Nome Completo:", oFontLbl )
oPrn:CmSay( nRow, 4.0, AllTrim( VET->NOME ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "Nome Social/Apelido:", oFontLbl )
oPrn:CmSay( nRow, 5.0, AllTrim( VET->APELIDO ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "CRMV / UF:", oFontLbl )
oPrn:CmSay( nRow, 3.5, AllTrim( VET->CRMV ), oFontTxt )
oPrn:CmSay( nRow, 8.5, "Especialidade:", oFontLbl )
oPrn:CmSay( nRow, 11.5, AllTrim( VET->ESPECIALID ), oFontTxt )
// Bloco 2: Documentos
nRow += 0.7
oPrn:CmSay( nRow, 1.0, "2. DOCUMENTACAO E REGISTROS", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "CPF:", oFontLbl )
oPrn:CmSay( nRow, 2.5, AllTrim( VET->CPF ), oFontTxt )
oPrn:CmSay( nRow, 7.5, "RG:", oFontLbl )
oPrn:CmSay( nRow, 8.5, AllTrim( VET->RG ), oFontTxt )
oPrn:CmSay( nRow, 13.5, "Orgao Emissor:", oFontLbl )
oPrn:CmSay( nRow, 16.5, AllTrim( VET->ORGAO ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "CNPJ:", oFontLbl )
oPrn:CmSay( nRow, 2.5, AllTrim( VET->CNPJ ), oFontTxt )
oPrn:CmSay( nRow, 7.5, "Insc. Estadual:", oFontLbl )
oPrn:CmSay( nRow, 10.5, AllTrim( VET->IE ), oFontTxt )
oPrn:CmSay( nRow, 14.0, "Insc. Municipal:", oFontLbl )
oPrn:CmSay( nRow, 17.0, AllTrim( VET->IM ), oFontTxt )
// Bloco 3: Contato & Comunicacao
nRow += 0.7
oPrn:CmSay( nRow, 1.0, "3. CANAIS DE CONTATO E COMUNICACAO", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "Telefone Fixo:", oFontLbl )
oPrn:CmSay( nRow, 4.0, AllTrim( VET->FONE ), oFontTxt )
oPrn:CmSay( nRow, 8.5, "Telefone 2:", oFontLbl )
oPrn:CmSay( nRow, 11.0, AllTrim( VET->FONE2 ), oFontTxt )
oPrn:CmSay( nRow, 15.0, "Celular:", oFontLbl )
oPrn:CmSay( nRow, 17.0, AllTrim( VET->CELULAR ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "WhatsApp:", oFontLbl )
oPrn:CmSay( nRow, 3.5, AllTrim( VET->WHATSAPP ), oFontTxt )
oPrn:CmSay( nRow, 8.5, "MS Teams:", oFontLbl )
oPrn:CmSay( nRow, 11.0, AllTrim( VET->TEAMS ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "E-mail:", oFontLbl )
oPrn:CmSay( nRow, 3.0, AllTrim( VET->EMAIL ), oFontTxt )
oPrn:CmSay( nRow, 11.5, "Rede Social:", oFontLbl )
oPrn:CmSay( nRow, 14.2, AllTrim( VET->REDESOCIAL ), oFontTxt )
// Bloco 4: Endereco
nRow += 0.7
oPrn:CmSay( nRow, 1.0, "4. ENDERECO RESIDENCIAL / PROFISSIONAL", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "Logradouro:", oFontLbl )
oPrn:CmSay( nRow, 3.8, AllTrim( VET->ENDERECO ), oFontTxt )
oPrn:CmSay( nRow, 15.0, "Numero:", oFontLbl )
oPrn:CmSay( nRow, 17.0, AllTrim( VET->NUMERO ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "Complemento:", oFontLbl )
oPrn:CmSay( nRow, 4.0, AllTrim( VET->COMPLEMENT ), oFontTxt )
oPrn:CmSay( nRow, 10.5, "Bairro:", oFontLbl )
oPrn:CmSay( nRow, 12.5, AllTrim( VET->BAIRRO ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "Cidade:", oFontLbl )
oPrn:CmSay( nRow, 3.0, AllTrim( VET->CIDADE ), oFontTxt )
oPrn:CmSay( nRow, 10.5, "UF:", oFontLbl )
oPrn:CmSay( nRow, 11.5, AllTrim( VET->UF ), oFontTxt )
oPrn:CmSay( nRow, 14.5, "CEP:", oFontLbl )
oPrn:CmSay( nRow, 16.0, AllTrim( VET->CEP ), oFontTxt )
// Bloco 5: Dados Contratuais e Financeiros
nRow += 0.7
oPrn:CmSay( nRow, 1.0, "5. DADOS CONTRATUAIS E FINANCEIROS", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
oPrn:CmSay( nRow, 1.0, "Data Admissao:", oFontLbl )
oPrn:CmSay( nRow, 4.2, DToC( VET->ADMISSAO ), oFontTxt )
oPrn:CmSay( nRow, 8.5, "Data Demissao:", oFontLbl )
oPrn:CmSay( nRow, 11.8, DToC( VET->DEMISSAO ), oFontTxt )
oPrn:CmSay( nRow, 15.0, "Salario Base:", oFontLbl )
oPrn:CmSay( nRow, 17.6, Transform( VET->SALARIO, "@E 999,999.99" ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "% Comissao:", oFontLbl )
oPrn:CmSay( nRow, 3.8, Transform( VET->COMISSAO, "@E 999.99" ) + " %", oFontTxt )
oPrn:CmSay( nRow, 7.5, "Comissao Prod:", oFontLbl )
oPrn:CmSay( nRow, 10.8, AllTrim( VET->COMI_PROD ), oFontTxt )
oPrn:CmSay( nRow, 14.0, "Comissao Serv:", oFontLbl )
oPrn:CmSay( nRow, 17.3, AllTrim( VET->COMI_SERV ), oFontTxt )
nRow += 0.5
oPrn:CmSay( nRow, 1.0, "Representante:", oFontLbl )
oPrn:CmSay( nRow, 4.0, AllTrim( VET->CODREP ) + " - " + AllTrim( VET->REPRES ), oFontTxt )
oPrn:CmSay( nRow, 13.0, "Regiao:", oFontLbl )
oPrn:CmSay( nRow, 15.0, AllTrim( VET->CODREG ) + " - " + AllTrim( VET->REGIAO ), oFontTxt )
// Bloco 6: Observacoes
nRow += 0.7
oPrn:CmSay( nRow, 1.0, "6. OBSERVACOES GERAIS DO CADASTRO", oFontSec, , CLR_TITULO )
nRow += 0.45
oPrn:CmLine( nRow, 1.0, nRow, 20.0, oPenSec )
nRow += 0.2
cObs := AllTrim( VET->OBS1 )
IF !Empty( VET->OBS2 ) ; cObs += If( !Empty( cObs ), " ", "" ) + AllTrim( VET->OBS2 ) ; ENDIF
IF !Empty( VET->OBS3 ) ; cObs += If( !Empty( cObs ), " ", "" ) + AllTrim( VET->OBS3 ) ; ENDIF
IF !Empty( VET->OBS4 ) ; cObs += If( !Empty( cObs ), " ", "" ) + AllTrim( VET->OBS4 ) ; ENDIF
IF !Empty( VET->OBS5 ) ; cObs += If( !Empty( cObs ), " ", "" ) + AllTrim( VET->OBS5 ) ; ENDIF
IF !Empty( VET->OBS6 ) ; cObs += If( !Empty( cObs ), " ", "" ) + AllTrim( VET->OBS6 ) ; ENDIF
IF Empty( cObs )
cObs := "Nenhuma observacao cadastrada para este profissional."
ENDIF
oPrn:CmSay( nRow, 1.0, SubStr( cObs, 1, 95 ), oFontTxt )
IF Len( cObs ) > 95
nRow += 0.45
oPrn:CmSay( nRow, 1.0, SubStr( cObs, 96, 95 ), oFontTxt )
ENDIF
IF Len( cObs ) > 190
nRow += 0.45
oPrn:CmSay( nRow, 1.0, SubStr( cObs, 191, 95 ), oFontTxt )
ENDIF
// Rodape da Pagina
oPrn:CmLine( 28.0, 1.0, 28.0, 20.0, oPenLinha )
oPrn:CmSay( 28.2, 1.0, "Sistema PetVet 1.0 - Cadastro Geral de Veterinarios (TPrinter)", oFontRod )
oPrn:CmSay( 28.2, 16.5, "Documento Confidencial", oFontRod )
ENDPAGE
VET->( dbSkip() )
ENDDO
ENDPRINT
oFontEmp:End()
oFontTit:End()
oFontSec:End()
oFontLbl:End()
oFontTxt:End()
oFontRod:End()
oPenLinha:End()
oPenSec:End()
oPenBorda:End()
RETURN NIL
// FIM DE RELVETPRN.PRG
Regards, saludos.