'Nome       : ivaAno.Imp
'Tipo       : Imp
'Data       : 1998/08/12
'Versao     : 1.0
'Descricao  : Formato de impresso para Declaracao Anual do IVA

'-----------------------------------------------------------------------------
' Definicao global do documento
'-----------------------------------------------------------------------------
#DEF
Caracteres invalidos             [CarInv]=#
##


'-----------------------------------------------------------------------------
' Campos especificos
'-----------------------------------------------------------------------------
#ESP
Especifico 1                      [EspOp1]=Opcao 1
Especifico 2                      [EspOp2]=Opcao 2
'Logotipo                         [DocLogo]=c:\tmp\x.bmp
##


'-----------------------------------------------------------------------------
' Configuracao do documento
'-----------------------------------------------------------------------------
#DOC
Nome                       [DocNom]=PRW
Vias                       [DocVia]=Original
Tipo                       [DocTip]=
Personalizacao             [DocPer]=
Dados especificos          [DocEsp]=ESP1,FAC

'formato
Saida/Impressora           [DocSai]=WIN
Linhas por pagina          [DocLpg]=10
Formato do papel           [DocPap]=72L
Ajustar pagina             [DocApg]=3

'funcoes de listagem
Listar cabecalho            [FxCAB]=DocCab
Listar linhas               [FxLIN]=DocLin
Listar fim                  [FxFIM]=DocFim
##


'-----------------------------------------------------------------------------
' Variaveis
'-----------------------------------------------------------------------------
#VAR
Var1      = var
var2      = FrmVal$(Doc_DtHoje,45,0)
##


#PGM
'-----------------------------------------------------------------------------
' Funcoes para inicializacao
'-----------------------------------------------------------------------------
SUB FxIni 'funcao de inicializacao
PrWIN AJT_F, 56.7,  56.7                   'ajuste para milimetros
'PrWIN AJT_F, "CM"                          'ajuste para centimetros
'PrWIN AJT_F, "MM"                           'ajuste para milimetros

'PrWIN AJT_F,  567,   567                   'ajuste para centimetros
PrWIN AJT_D,  0.0,   0.0                   'deslocamento de ajuste

'PrWIN FON, "REG" , "Arial"                     'registar nome de fonte
PrWIN IMG_F, 1, "C:\tmp\Oli.Bmp"                'imagem (logotipo)
'PrWIN IMG_F, 2, "C:\tmp\img.jpg"                'imagem (logotipo)
'PrWIN FON, "INI"                                 'activar fonte base (num reg=1, tam=12, normal)

PrWIN ET,  2                                 'espessura de traco
end sub


SUB FxFim 'funcao de finalizacao
PrWIN FON, "REG"                          'limpar registo de fontes
end sub


'-----------------------------------------------------------------------------
' Funcoes para impressao do documento
'-----------------------------------------------------------------------------
SUB DocCabIni 'inicializacao do documento
'
end sub


SUB DocCabFim 'finalizar documento
'
end sub



SUB DocPag01 'pagina 1
PrWIN AJT_B, 0.0, 0.0                        'posicao base
PrWIN COR_F, 15                              'cor de fundo

if MemNum(0) <> 0 then                       'usa formato ?
   call DocFrm01                             'listar formato
end if
end sub


SUB DocFrm01 'formato da pagina 1

PrWIN AJT_B,  0, 0                                       'posicao base

'Quadro 06
'Operacoes internas activas - Existencias
PrPAG TX_SP, 26, 27,1,FrmVal$(CtaLc$("C_102"),21,-13.0)   'Celula 102
PrPAG TX_SP, 26, 28,1,FrmVal$(CtaLc$("C_104"),21,-13.0)   'Celula 104
PrPAG TX_SP, 26, 29,1,FrmVal$(CtaLc$("C_105"),21,-13.0)   'Celula 105
PrPAG TX_SP, 26, 30,1,FrmVal$(CtaLc$("C_113"),21,-13.0)   'Celula 113
PrPAG TX_SP, 26, 31,1,FrmVal$(CtaLc$("C_117"),21,-13.0)   'Celula 117
PrPAG TX_SP, 26, 33,1,FrmVal$(CtaLc$("C_151"),21,-13.0)   'Celula 151

'Operacoes internas activas - Outros bens e servicos
PrPAG TX_SP, 58, 27,1,FrmVal$(CtaLc$("C_103"),21,-13.0)   'Celula 103
PrPAG TX_SP, 58, 28,1,FrmVal$(CtaLc$("C_104A"),21,-13.0)  'Celula 104-A
PrPAG TX_SP, 58, 29,1,FrmVal$(CtaLc$("C_106"),21,-13.0)   'Celula 106
PrPAG TX_SP, 58, 30,1,FrmVal$(CtaLc$("C_115"),21,-13.0)   'Celula 115
PrPAG TX_SP, 58, 31,1,FrmVal$(CtaLc$("C_118"),21,-13.0)   'Celula 118
PrPAG TX_SP, 58, 32,1,FrmVal$(CtaLc$("C_129"),21,-13.0)   'Celula 129
PrPAG TX_SP, 58, 33,1,FrmVal$(CtaLc$("C_152"),21,-13.0)   'Celula 152

'Quadro 09
'Operacoes externas activas - Existencias
PrPAG TX_SP, 26, 36,1,FrmVal$(CtaLc$("C_202"),21,-13.0)   'Celula 202
PrPAG TX_SP, 26, 41,1,FrmVal$(CtaLc$("C_241"),21,-13.0)   'Celula 241
PrPAG TX_SP, 26, 42,1,FrmVal$(CtaLc$("C_251"),21,-13.0)   'Celula 251
PrPAG TX_SP, 26, 43,1,FrmVal$(CtaLc$("C_264"),21,-13.0)   'Celula 264

'Operacoes externas activas - Outros bens e servicos
PrPAG TX_SP, 58, 36,1,FrmVal$(CtaLc$("C_203"),21,-13.0)   'Celula 203
PrPAG TX_SP, 58, 37,1,FrmVal$(CtaLc$("C_205"),21,-13.0)   'Celula 205
PrPAG TX_SP, 58, 38,1,FrmVal$(CtaLc$("C_210"),21,-13.0)   'Celula 210
PrPAG TX_SP, 58, 39,1,FrmVal$(CtaLc$("C_211"),21,-13.0)   'Celula 211
PrPAG TX_SP, 58, 40,1,FrmVal$(CtaLc$("C_212"),21,-13.0)   'Celula 212
PrPAG TX_SP, 58, 41,1,FrmVal$(CtaLc$("C_242"),21,-13.0)   'Celula 242
PrPAG TX_SP, 58, 42,1,FrmVal$(CtaLc$("C_252"),21,-13.0)   'Celula 252
PrPAG TX_SP, 58, 43,1,FrmVal$(CtaLc$("C_265"),21,-13.0)   'Celula 265

'Quadro 12
'Operacoes com o exterior - Imobilizado
PrPAG TX_SP, 26, 45,1,FrmVal$(CtaLc$("C_110"),21,-13.0)   'Celula 110
PrPAG TX_SP, 26, 46,1,FrmVal$(CtaLc$("C_120"),21,-13.0)   'Celula 120
PrPAG TX_SP, 26, 47,1,FrmVal$(CtaLc$("C_501"),21,-13.0)   'Celula 501
PrPAG TX_SP, 26, 48,1,FrmVal$(CtaLc$("C_502"),21,-13.0)   'Celula 502
PrPAG TX_SP, 26, 49,1,FrmVal$(CtaLc$("C_590"),21,-13.0)   'Celula 590

'Operacoes com o exterior - Outras
PrPAG TX_SP, 58, 45,1,FrmVal$(CtaLc$("C_111"),21,-13.0)   'Celula 111
PrPAG TX_SP, 58, 46,1,FrmVal$(CtaLc$("C_121"),21,-13.0)   'Celula 121
PrPAG TX_SP, 58, 47,1,FrmVal$(CtaLc$("C_503"),21,-13.0)   'Celula 503
PrPAG TX_SP, 58, 48,1,FrmVal$(CtaLc$("C_504"),21,-13.0)   'Celula 504
PrPAG TX_SP, 58, 49,1,FrmVal$(CtaLc$("C_591"),21,-13.0)   'Celula 591
end sub



SUB DocPag02 'pagina 2
PrWIN AJT_B, 0.0, 0.0                        'posicao base
PrWIN COR_F, 15                              'cor de fundo

if MemNum(0) <> 0 then                       'usa formato ?
   call DocFrm02                             'listar formato
end if
end sub


SUB DocFrm02 'formato da pagina 2
PrWIN AJT_B,  0, 0                            'posicao base

'Quadro 9-A
'Existencias
PrPAG TX_SP, 26, 03,1,FrmVal$(CtaLc$("C_01"),21,-13.0)    'Celula 01
PrPAG TX_SP, 26, 04,1,FrmVal$(CtaLc$("C_02"),21,-13.0)    'Celula 02
PrPAG TX_SP, 26, 05,1,FrmVal$(CtaLc$("C_03"),21,-13.0)    'Celula 03

'Imobilizado
PrPAG TX_SP, 58, 03,1,FrmVal$(CtaLc$("C_04"),21,-13.0)    'Celula 04
PrPAG TX_SP, 58, 04,1,FrmVal$(CtaLc$("C_05"),21,-13.0)    'Celula 05
PrPAG TX_SP, 58, 05,1,FrmVal$(CtaLc$("C_06"),21,-13.0)    'Celula 06

'Outros bens e servicos
PrPAG TX_SP, 26, 07,1,FrmVal$(CtaLc$("C_07"),21,-13.0)    'Celula 07
PrPAG TX_SP, 26, 08,1,FrmVal$(CtaLc$("C_08"),21,-13.0)    'Celula 08
PrPAG TX_SP, 26, 09,1,FrmVal$(CtaLc$("C_09"),21,-13.0)    'Celula 09

'total do imposto dedutivel
PrPAG TX_SP, 58, 07,1,FrmVal$(CtaLc$("C_10"),21,-13.0)    'Celula 10
PrPAG TX_SP, 58, 08,1,FrmVal$(CtaLc$("C_11"),21,-13.0)    'Celula 11
PrPAG TX_SP, 58, 09,1,FrmVal$(CtaLc$("C_12"),21,-13.0)    'Celula 12

'Quadro 14
'recebimentos antecipados
PrPAG TX_N , xx, 38," ",MemTxt$("")                       'recebimentos antecipados (SIM)
PrPAG TX_N , xx, 46," ",MemTxt$("")                       'recebimentos antecipados (NAO)
PrPAG TX_SP, 26, 12,1,FrmVal$(CtaLc$("C_701"),21,-11.0)   'Celula 702
PrPAG TX_SP, 26, 13,1,FrmVal$(CtaLc$("C_702"),21,-11.0)   'Celula 703
PrPAG TX_SP, 26, 14,1,FrmVal$(CtaLc$("C_703"),21,-11.0)   'Celula 704
end sub
##

#FIM             'terminar processamento
