Moderador: Moderadores
PROCEDURE pFiscTotais
LOCAL mTmpFile, mStruOk, mTipLan, mMesLan, mTotal, mAnoLan
IF ! AbreArquivos( "jpfiscal" )
RETURN
ENDIF
SELECT jpfiscal
IF ! MsgYesNo( "Faz somatória do LFiscal para resumo?" )
RETURN
ENDIF
Mensagem( "Aguarde, somando..." )
mTmpFile := TempFileArray(2)
mStruOk := { { "MES", "C", 7, 0 }, { "ENTRADAS", "N", 10, 0 }, { "SAIDAS", "N", 10, 0 } }
fErase( mTmpFile[ 1 ] )
SELECT 0
dbCreate( mTmpFile[ 1 ], mStruOk )
USE ( mTmpFile[ 1] ) alias temp
INDEX ON temp->Mes TO ( mTmpFile[ 2 ] )
SELECT jpfiscal
OrdSetFocus( "jpfiscal3" )
GOTO TOP
DO WHILE ! Eof()
GrafProc()
mTipLan := jpfiscal->lfTipLan
mMesLan := Month( jpfiscal->lfDatLan )
mAnoLan := Year( jpfiscal->lfDatLan )
mTotal := 0
DO WHILE mMesLan == Month( jpfiscal->lfDatLan ) .AND. mAnoLan == Year( jpfiscal->lfDatLan ) .AND. ;
mTipLan == jpfiscal->lfTipLan .AND. ! Eof()
mTotal += 1
SKIP
ENDDO
SELECT temp
SEEK StrZero( mAnoLan, 4 ) + "/" + StrZero( mMesLan, 2 )
IF Eof()
RecAppend()
REPLACE temp->Mes WITH StrZero( mAnoLan, 4 ) + "/" + StrZero( mMesLan, 2 )
RecUnlock()
ENDIF
RecLock()
IF mTipLan == "1"
REPLACE temp->Saidas WITH temp->Saidas + mTotal
ELSE
REPLACE temp->Entradas WITH temp->Entradas + mTotal
ENDIF
RecUnlock()
SELECT jpfiscal
ENDDO
SELECT temp
GOTO TOP
BrowseDBF( { { "MES ENTRADAS SAÍDAS", { || temp->Mes + " " + Str( temp->Entradas, 10 ) + " " + Str( temp->Saidas, 10 ) } } } )
SELECT ( Select( "temp" ) )
CLOSE DATABASES
fErase( mTmpFile[ 1 ] )
fErase( mTmpFile[ 2 ] )
RETURN
PROCEDURE pFiscTotais
LOCAL oTBrowse
LOCAL cnSQL := ADOClass():New( AppConexao() )
IF ! MsgYesNo( "Faz somatória do LFiscal para resumo?" )
RETURN
ENDIF
Mensagem( "Aguarde, somando..." )
WITH OBJECT cnSQL
:cSQL := "SELECT CONCAT_WS( '-', LPAD( YEAR( LFDATLAN ), 4, '0' ), LPAD( MONTH( LFDATLAN ), 2, '0' ) ) AS ANOMES, " + ;
" SUM( IF( LFTIPLAN = 1, 1, 0 ) ) AS SAIDAS," + ;
" SUM( IF( LFTIPLAN = 2, 1, 0 ) ) AS ENTRADAS" + ;
" FROM JPFISCAL" + ;
" GROUP BY CONCAT_WS( '-', LPAD( YEAR( LFDATLAN ), 4, '0' ), LPAD( MONTH( LFDATLAN ), 2, '0' ) )" + ;
" ORDER BY ANOMES DESC"
:Execute()
oTBrowse := { ;
{ "ANO/MES", { || :String( "ANOMES", 7 ) } }, ;
{ "ENTRADAS", { || Transform( :Number( "ENTRADAS" ), PicVal(14,2) ) } }, ;
{ "SAIDAS", { || Transform( :Number( "SAIDAS" ), PicVal(14,2) ) } } }
BrowseADO( cnSQL, oTBrowse, "ANOMES", { || "" } )
KEYBOARD ""
:CloseRecordset()
ENDWITH
RETURN
STATIC FUNCTION imprime()
LOCAL oPDF, nKey, m_ClaIcmVl, m_ClaIcmIs, m_ClaIcmOu, m_TotVlCon, m_TotIcmBa, m_TotIcmIs, m_TotIcmOu, m_TotIpiIs, m_TotIpiOu, m_ClaVlCon
LOCAL m_ClaIcmBa, m_ClaIpiBa, m_ClaIpiIs, m_ClaIpiOu, m_TotIpiVl, m_TotIcmVl, m_TotIpiBa, m_ClaIpiVl, m_Data
oPDF := PDFClass():New()
oPDF:SetType( nOpcPrinterType )
oPDF:Begin()
nKey = 0
oPDF:acHeader := {"","",""}
oPDF:acHeader[ 1 ] = "RESUMO DA MOVIMENTACAO, POR DATA"
IF nOpcData == 1
oPDF:acHeader[ 2 ] = " "
ELSE
oPDF:acHeader[ 2 ] = "Periodo: " + Dtoc( m_datai ) + " a " + Dtoc( m_dataf ) + iif( nOpcGrf == 1, "", " " + acTxtGrf[ nOpcGrf ] )
ENDIF
oPDF:acHeader[ 3 ] = Space(10) + "--DATA-- ---VALOR CONTABIL-- --BASE DE CALCULO-- -IMPOSTO DEB/CRED.- --ISENTOS/N.TRIBUT- -------OUTROS------"
STORE 0 to m_totvlcon, m_toticmba, m_toticmvl, ;
m_toticmis, m_toticmou
STORE 0 to m_totipiba, m_totipivl, m_totipiis, m_totipiou
SELECT jpfiscal
OrdSetFocus( "jpfiscal3" )
SEEK "2" SOFTSEEK
oPDF:PageHeader()
oPDF:DrawText( oPDF:nRow, 0, "ENTRADAS:" )
oPDF:nRow += 2
DO WHILE nKey != K_ESC .AND. ! Eof()
GrafProc()
nKey = Inkey()
IF jpfiscal->lfDatLan > m_dataf .AND. nOpcData == 2
SKIP
LOOP
ENDIF
IF jpfiscal->lfDatLan < m_datai .AND. nOpcData == 2
SKIP
LOOP
ENDIF
m_data := Substr( Dtoc( jpfiscal->lfDatLan ),iif( nOpcTotais == 1, 1, 4 ) )
STORE 0 to m_clavlcon, m_claicmba, m_claicmvl, ;
m_claicmis, m_claicmou
STORE 0 to m_claipiba, m_claipivl, m_claipiis, m_claipiou
DO WHILE nKey != K_ESC .AND. jpfiscal->lfTipLan=="2" .AND. ! Eof()
IF Substr( Dtoc( jpfiscal->lfDatLan ),iif( nOpcTotais == 1, 1, 4 ) ) != m_Data
EXIT
ENDIF
nKey = Inkey()
GrafProc()
IF jpfiscal->lfDatLan > m_dataf .AND. nOpcData == 2
SKIP
LOOP
ENDIF
IF jpfiscal->lfDatLan < m_datai .AND. nOpcData == 2
SKIP
LOOP
ENDIF
m_clavlcon = Round( m_clavlcon + jpfiscal->lfValCon, 2 )
IF jpfiscal->lfIcmVal != 0
m_claicmba = Round( m_claicmba + jpfiscal->lfIcmBas, 2 )
m_claicmvl = Round( m_claicmvl + jpfiscal->lfIcmVal, 2 )
ENDIF
IF jpfiscal->lfValCon - jpfiscal->lfIcmBas - jpfiscal->lfIcmOut > 0
m_claicmis = Round( m_claicmis + ( jpfiscal->lfValCon - jpfiscal->lfIcmBas - jpfiscal->lfIcmOut ), 2 )
ENDIF
IF jpfiscal->lfIcmOut != 0
m_claicmou = Round( m_claicmou + jpfiscal->lfIcmOut, 2 )
ENDIF
IF jpfiscal->lfIpiVal != 0
m_claipiba = Round( m_claipiba + jpfiscal->lfIpiBas, 2 )
m_claipivl = Round( m_claipivl + jpfiscal->lfIpiVal, 2 )
ENDIF
IF jpfiscal->lfValCon - jpfiscal->lfIpiBas - jpfiscal->lfIpiOut - jpfiscal->lfIpiVal > 0
m_claipiis = Round( m_claipiis + ( jpfiscal->lfValCon - jpfiscal->lfIpiBas - jpfiscal->lfIpiOut - jpfiscal->lfIpiVal ), 2 )
ENDIF
IF jpfiscal->lfIpiOut != 0
m_claipiou = Round( m_claipiou + jpfiscal->lfIpiOut, 2 )
ENDIF
SKIP
ENDDO
IF m_clavlcon != 0
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 10, m_Data )
oPDF:DrawText( oPDF:nRow, 20, m_clavlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_claicmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_claicmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_claicmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_claicmou, PicVal(14,2) )
m_totvlcon = Round( m_totvlcon + m_clavlcon, 2 )
m_toticmba = Round( m_toticmba + m_claicmba, 2 )
m_toticmvl = Round( m_toticmvl + m_claicmvl, 2 )
m_toticmis = Round( m_toticmis + m_claicmis, 2 )
m_toticmou = Round( m_toticmou + m_claicmou, 2 )
m_totipiba = Round( m_totipiba + m_claipiba, 2 )
m_totipivl = Round( m_totipivl + m_claipivl, 2 )
m_totipiis = Round( m_totipiis + m_claipiis, 2 )
m_totipiou = Round( m_totipiou + m_claipiou, 2 )
oPDF:nRow += 1
ENDIF
ENDDO
oPDF:MaxRowTest()
oPDF:DrawLine( oPDF:nRow, 0, oPDF:nRow, oPDF:MaxCol() )
oPDF:nRow += 1
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "*** ICMS ***" )
oPDF:DrawText( oPDF:nRow, 20, m_totvlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_toticmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_toticmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_toticmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_toticmou, PicVal(14,2) )
oPDF:DrawLine( oPDF:nRow + 1, 0, oPDF:nRow + 1, oPDF:MaxCol() )
oPDF:nRow += 3
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "SAIDAS:" )
oPDF:nRow += 2
oPDF:MaxRowTest()
STORE 0 to m_totvlcon, m_toticmba, m_toticmvl, ;
m_toticmis, m_toticmou
STORE 0 to m_totipiba, m_totipivl, m_totipiis, m_totipiou
SELECT jpfiscal
OrdSetFocus("jpfiscal3")
SEEK "1" SOFTSEEK
DO WHILE nKey != K_ESC .AND. jpfiscal->lfTipLan=="1" .AND. ! Eof()
nKey = Inkey()
GrafProc()
IF jpfiscal->lfDatLan > m_dataf .AND. nOpcData == 2
SKIP
LOOP
ENDIF
IF jpfiscal->lfDatLan < m_datai .AND. nOpcData == 2
SKIP
LOOP
ENDIF
m_data := Substr( Dtoc( jpfiscal->lfDatLan ), iif( nOpcTotais == 1, 1, 4 ) )
STORE 0 to m_clavlcon, m_claicmba, m_claicmvl, m_claicmis, m_claicmou, m_claipiba, m_claipivl, m_claipiis, m_claipiou
DO WHILE nKey != K_ESC .AND. jpfiscal->lfTipLan=="1" .AND. ! Eof()
IF Substr(Dtoc(jpfiscal->lfDatLan),iif(nOpcTotais==1,1,4)) != m_Data
EXIT
ENDIF
nKey = Inkey()
GrafProc()
IF jpfiscal->lfDatLan > m_dataf .AND. nOpcData == 2
SKIP
LOOP
ENDIF
IF jpfiscal->lfDatLan < m_datai .AND. nOpcData == 2
SKIP
LOOP
ENDIF
IF ( nOpcGrf == 2 .AND. jpfiscal->lfGRF != "S" ) .OR. ( nOpcGrf == 3 .AND. jpfiscal->lfGRF == "S" )
SKIP
LOOP
ENDIF
m_clavlcon = Round( m_clavlcon + jpfiscal->lfValCon, 2 )
IF jpfiscal->lfIcmBas != 0
m_claicmba = Round( m_claicmba + jpfiscal->lfIcmBas, 2 )
ENDIF
IF jpfiscal->lfIcmVal != 0
m_claicmvl = Round( m_claicmvl + jpfiscal->lfIcmVal, 2 )
ENDIF
IF jpfiscal->lfValCon - jpfiscal->lfIcmBas - jpfiscal->lfIcmOut > 0
m_claicmis = Round( m_claicmis + ( jpfiscal->lfValCon - jpfiscal->lfIcmBas - jpfiscal->lfIcmOut ), 2 )
ENDIF
IF jpfiscal->lfIcmOut != 0
m_claicmou = Round( m_claicmou + jpfiscal->lfIcmOut, 2 )
ENDIF
IF jpfiscal->lfIpiVal != 0
m_claipiba = Round( m_claipiba + jpfiscal->lfIpiBas, 2 )
m_claipivl = Round( m_claipivl + jpfiscal->lfIpiVal, 2 )
ENDIF
IF jpfiscal->lfValCon - jpfiscal->lfIpiBas - jpfiscal->lfIpiOut - jpfiscal->lfIpiVal > 0
m_claipiis = Round( m_claipiis + ( jpfiscal->lfValCon - jpfiscal->lfIpiBas - jpfiscal->lfIpiOut - jpfiscal->lfIpiVal ), 2 )
ENDIF
IF jpfiscal->lfIpiOut != 0
m_claipiou = Round( m_claipiou + jpfiscal->lfIpiOut, 2 )
ENDIF
SKIP
ENDDO
IF m_clavlcon != 0
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 10, m_data )
oPDF:DrawText( oPDF:nRow, 20, m_clavlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_claicmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_claicmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_claicmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_claicmou, PicVal(14,2) )
m_totvlcon = Round( m_totvlcon + m_clavlcon, 2 )
m_toticmba = Round( m_toticmba + m_claicmba, 2 )
m_toticmvl = Round( m_toticmvl + m_claicmvl, 2 )
m_toticmis = Round( m_toticmis + m_claicmis, 2 )
m_toticmou = Round( m_toticmou + m_claicmou, 2 )
m_totipiba = Round( m_totipiba + m_claipiba, 2 )
m_totipivl = Round( m_totipivl + m_claipivl, 2 )
m_totipiis = Round( m_totipiis + m_claipiis, 2 )
m_totipiou = Round( m_totipiou + m_claipiou, 2 )
oPDF:nRow += 1
ENDIF
ENDDO
oPDF:MaxRowTest()
oPDF:DrawLine( oPDF:nRow, 0, oPDF:nRow, oPDF:MaxCol() )
oPDF:nRow += 1
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "*** ICMS ***" )
oPDF:DrawText( oPDF:nRow, 20, m_totvlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_toticmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_toticmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_toticmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_toticmou, PicVal(14,2) )
oPDF:End()
RETURN .T.
STATIC FUNCTION imprime()
LOCAL oPDF, nKey, m_TotVlCon, m_TotIcmBa, m_TotIcmIs, m_TotIcmOu, m_TotIpiIs, m_TotIpiOu
LOCAL m_TotIpiVl, m_TotIcmVl, m_TotIpiBa, cSQLGroup
LOCAL cnSQL := ADOClass():New( AppConexao() )
oPDF := PDFClass():New()
oPDF:SetType( nOpcPrinterType )
oPDF:Begin()
nKey = 0
oPDF:acHeader := {"","",""}
oPDF:acHeader[ 1 ] = "RESUMO DA MOVIMENTACAO, POR DATA"
IF nOpcData == 1
oPDF:acHeader[ 2 ] = " "
ELSE
oPDF:acHeader[ 2 ] = "Periodo: " + Dtoc( dDataInicial ) + " a " + Dtoc( dDataFinal ) + iif( nOpcGrf == 1, "", " " + acTxtGrf[ nOpcGrf ] )
ENDIF
oPDF:acHeader[ 3 ] = Space(10) + "--DATA-- ---VALOR CONTABIL-- --BASE DE CALCULO-- -IMPOSTO DEB/CRED.- --ISENTOS/N.TRIBUT- -------OUTROS------"
oPDF:PageHeader()
oPDF:DrawText( oPDF:nRow, 0, "ENTRADAS:" )
oPDF:nRow += 2
WITH OBJECT cnSQL
cSQLGroup := "LPAD( YEAR( LFDATLAN ), 4, '0' ), LPAD( MONTH( LFDATLAN ), 2, '0' )"
IF nOpcTotais == 1
cSQLGroup += ", LPAD( Day( LFDATLAN ), 2, '0' )"
ENDIF
cSQLGroup := "CONCAT_WS( '-', " + cSQLGroup + " )"
:cSQL := "SELECT LFTIPLAN, " + cSQLGroup + " AS DATA, " + ;
" SUM( LFVALCON ) AS VALCON, SUM( IF( LFICMVAL = 0, 0, LFICMBAS ) ) AS ICMBAS," + ;
" SUM( LFICMVAL ) AS ICMVAL, SUM( LFICMOUT ) AS ICMOUT," + ;
" SUM( IF( LFVALCON - LFICMBAS - LFICMOUT > 0, LFVALCON - LFICMBAS - LFICMOUT, 0 ) ) AS ICMISE," + ;
" SUM( LFIPIVAL ) AS IPIVAL, SUM( IF( LFIPIVAL > 0, LFIPIBAS, 0 ) ) AS IPIBAS," + ;
" SUM( IF( LFVALCON - LFIPIBAS - LFIPIOUT - LFIPIVAL > 0, LFVALCON - LFIPIBAS - LFIPIOUT - LFIPIVAL, 0 ) ) AS IPIISE," + ;
" SUM( LFIPIOUT ) AS IPIOUT" + ;
" FROM JPFISCAL" + ;
" WHERE LFTIPLAN IN ( '1', '2' )"
IF nOpcData == 2
:cSQL += " AND LFDATLAN BETWEEN CAST( " + DateSQL( dDataInicial ) + " AS DATE )" + ;
" AND CAST( " + DateSQL( dDataFinal ) + " AS DATE )"
ENDIF
IF nOpcGrf <> 1
:cSQL += " AND LFGRF " + iif( nOpcGrf == 2, "=", "<>" ) + " 'S'"
ENDIF
:cSQL += " GROUP BY LFTIPLAN, " + cSQLGroup + ;
" HAVING VALCON > 0" + ;
" ORDER BY LFTIPLAN DESC, DATA"
:Execute()
STORE 0 to m_totvlcon, m_toticmba, m_toticmvl, m_toticmis, m_toticmou
STORE 0 to m_totipiba, m_totipivl, m_totipiis, m_totipiou
DO WHILE :String( "LFTIPLAN", 1 ) == "2" .AND. nKey != K_ESC .AND. ! :Eof()
GrafProc()
nKey := Inkey()
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 10, :String( "DATA" ) )
oPDF:DrawText( oPDF:nRow, 20, :Number( "VALCON" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, :Number( "ICMBAS" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, :Number( "ICMVAL" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, :Number( "ICMISE" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, :Number( "ICMOUT" ), PicVal(14,2) )
m_totvlcon += :Number( "VALCON" )
m_toticmba += :Number( "ICMBAS" )
m_toticmvl += :Number( "ICMVAL" )
m_toticmis += :Number( "ICMISE" )
m_toticmou += :Number( "ICMOUT" )
m_totipiba += :Number( "ICMBAS" )
m_totipivl += :Number( "IPIVAL" )
m_totipiis += :Number( "IPIISE" )
m_totipiou += :Number( "IPIOUT" )
oPDF:nRow += 1
:MoveNext()
ENDDO
oPDF:MaxRowTest()
oPDF:DrawLine( oPDF:nRow, 0, oPDF:nRow, oPDF:MaxCol() )
oPDF:nRow += 1
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "*** ICMS ***" )
oPDF:DrawText( oPDF:nRow, 20, m_totvlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_toticmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_toticmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_toticmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_toticmou, PicVal(14,2) )
oPDF:DrawLine( oPDF:nRow + 1, 0, oPDF:nRow + 1, oPDF:MaxCol() )
oPDF:nRow += 3
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "SAIDAS:" )
oPDF:nRow += 2
oPDF:MaxRowTest()
STORE 0 to m_totvlcon, m_toticmba, m_toticmvl, m_toticmis, m_toticmou
STORE 0 to m_totipiba, m_totipivl, m_totipiis, m_totipiou
DO WHILE :String( "LFTIPLAN", 1 ) == "1" .AND. nKey != K_ESC .AND. ! :Eof()
nKey := Inkey()
GrafProc()
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 10, :String( "DATA" ) )
oPDF:DrawText( oPDF:nRow, 20, :Number( "VALCON" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, :Number( "ICMBAS" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, :Number( "ICMVAL" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, :Number( "ICMISE" ), PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, :Number( "ICMOUT" ), PicVal(14,2) )
m_totvlcon += :Number( "VALCON" )
m_toticmba += :Number( "ICMBAS" )
m_toticmvl += :Number( "ICMVAL" )
m_toticmis += :Number( "ICMISE" )
m_toticmou += :Number( "ICMOUT" )
m_totipiba += :Number( "IPIBAS" )
m_totipivl += :Number( "IPIVAL" )
m_totipiis += :Number( "IPIISE" )
m_totipiou += :Number( "IPIOUT" )
oPDF:nRow += 1
:MoveNext()
ENDDO
oPDF:MaxRowTest()
oPDF:DrawLine( oPDF:nRow, 0, oPDF:nRow, oPDF:MaxCol() )
oPDF:nRow += 1
oPDF:MaxRowTest()
oPDF:DrawText( oPDF:nRow, 0, "*** ICMS ***" )
oPDF:DrawText( oPDF:nRow, 20, m_totvlcon, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 40, m_toticmba, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 60, m_toticmvl, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 80, m_toticmis, PicVal(14,2) )
oPDF:DrawText( oPDF:nRow, 100, m_toticmou, PicVal(14,2) )
:CloseRecordset()
ENDWITH
oPDF:End()
RETURN .T.
Pasta de d:\cdrom\FONTES\INTEGRA
10/02/2020 10:26 1.473 pcontreddisp.prg
10/02/2020 10:26 1.589 pcontredrenum.prg
10/02/2020 10:26 4.449 pconthistorico.prg
10/02/2020 10:26 3.012 pediimpplaref.prg
10/02/2020 10:26 5.811 pfiscrel0020.prg
10/02/2020 10:26 1.828 ptesteconsultadfe.prg
10/02/2020 10:26 3.558 psetupempresa.prg
10/02/2020 10:26 9.561 ze_pdfbolbradescoclass.prg
10/02/2020 10:26 5.384 ze_ftp.prg
10/02/2020 10:26 240 ze_seguro.prg
10/02/2020 10:26 48.987 ze_pdfboletoclass.prg
10/02/2020 10:26 1.653 ptesqueryc.prg
10/02/2020 10:26 792 pdfestatus.prg
12/02/2020 18:42 2.866 ze_novaversao.prg
14/02/2020 11:19 621 psetupcapicom.prg
19/03/2020 11:43 6.353 ze_webservice.prg
19/03/2020 20:06 2.863 ze_resource.prg
22/03/2020 13:14 17.515 ze_updatedefault.prg
06/05/2020 01:12 2.275 pconttotais.prg
06/05/2020 10:38 5.262 pcontrel0385.prg
17/05/2020 18:13 5.644 pcontlancpad.prg
17/05/2020 18:41 4.409 pcontimpsped.prg
17/05/2020 18:55 7.293 pjpempresa.prg
19/05/2020 11:00 7.775 pcontsetup.prg
03/06/2020 13:25 4.981 ptesdadabe.prg
04/06/2020 13:03 4.566 ze_excel1.prg
04/06/2020 13:03 6.659 ze_excel2.prg
04/06/2020 13:03 6.069 ze_updateexeup.prg
04/06/2020 13:10 11.954 ze_logerr.prg
07/06/2020 16:53 6.359 pcontlancalote.prg
10/06/2020 07:50 9.963 pretitau.prg
10/06/2020 07:50 6.760 pprecombustivel.prg
10/06/2020 07:52 4.215 psitejpa.prg
10/06/2020 07:53 6.862 ptestregiao.prg
10/06/2020 07:54 3.460 ze_helpprint.prg
10/06/2020 07:54 4.606 ze_spedxmllist.prg
10/06/2020 07:54 15.642 ze_SpedXmlMDFE.prg
10/06/2020 07:55 5.797 pjpagenda.prg
10/06/2020 07:55 5.079 pestototarmazem.prg
10/06/2020 07:55 2.334 pediimpanpcnae.prg
10/06/2020 08:05 2.114 ptescep.prg
10/06/2020 08:05 4.181 pnotagerarps.prg
10/06/2020 08:05 8.878 pjptransp.prg
10/06/2020 08:05 4.811 pjpmotori.prg
10/06/2020 08:05 4.617 pjpnfbase.prg
10/06/2020 08:05 4.627 pjpibpt.prg
10/06/2020 08:05 5.872 pjpdecreto.prg
10/06/2020 08:05 3.580 pfiscblocok.prg
10/06/2020 08:05 1.857 pestovalest.prg
10/06/2020 08:05 1.715 pestoentfor.prg
10/06/2020 08:05 1.582 pedixls.prg
10/06/2020 08:05 2.924 pediimpibgecnae.prg
10/06/2020 08:05 2.308 pedixml2.prg
10/06/2020 08:05 2.680 pediimpanploc.prg
10/06/2020 08:05 2.494 pediimpanpage.prg
10/06/2020 08:05 2.661 pediimpanpati.prg
10/06/2020 08:05 2.970 pedi0260.prg
10/06/2020 08:05 4.561 pcontimpexcel.prg
10/06/2020 08:05 7.424 ljptransp.prg
10/06/2020 08:05 3.255 ljpforpag.prg
10/06/2020 08:06 2.794 pediimpanpins.prg
10/06/2020 08:06 1.727 pdfemanif.prg
17/06/2020 10:55 6.463 ptesjson.prg
18/06/2020 17:21 7.053 pjppedidofatura.prg
19/06/2020 12:45 15.541 pjppedidocupom.prg
19/06/2020 12:45 4.213 pjppedidonfe.prg
23/06/2020 15:18 6.708 ze_enviaemail.prg
24/06/2020 17:19 44.621 pdfeserver.prg
27/06/2020 17:58 5.202 ze_SpedCadastroClass.prg
28/06/2020 06:31 697 pdfenaoenc.prg
28/06/2020 20:59 18.347 pjppedidocte.prg
29/06/2020 07:41 31.833 pdfesalva.prg
01/07/2020 19:10 1.240 ptesbase.prg
02/07/2020 09:05 5.854 pfiscrel0070.prg
02/07/2020 09:05 6.688 pfiscrel0010.prg
02/07/2020 09:05 14.113 ljpestoquec.prg
02/07/2020 09:09 17.214 pfiscrel0130.prg
05/07/2020 09:10 8.665 ljpitem.prg
07/07/2020 10:32 26.352 ze_updatee.prg
07/07/2020 10:32 19.656 ze_updatec.prg
07/07/2020 10:32 19.315 ze_updateb.prg
07/07/2020 10:32 2.004 ze_updatea.prg
08/07/2020 21:07 9.587 pcontrel0330.prg
08/07/2020 21:08 4.266 pcontrel0370.prg
08/07/2020 21:08 4.502 pcontrel0470.prg
08/07/2020 21:08 10.303 pcontrel0550.prg
08/07/2020 21:12 12.824 pcontrel0520.prg
08/07/2020 21:15 6.127 pcontsintetica.prg
08/07/2020 21:21 10.260 pcontrel0250.prg
08/07/2020 21:21 11.513 pcontrel0300.prg
08/07/2020 21:21 10.414 pcontrel0320.prg
08/07/2020 21:23 2.639 pcontemitidos.prg
08/07/2020 21:24 7.024 pcontfecha.prg
08/07/2020 21:24 3.361 pcontimpplano.prg
08/07/2020 21:24 9.433 pcontrecalculo.prg
08/07/2020 21:24 10.155 pcontrel0270.prg
08/07/2020 21:24 10.592 pcontrel0310.prg
08/07/2020 21:24 7.926 pcontrel0340.prg
08/07/2020 21:25 4.779 pcontsaldo.prg
08/07/2020 21:25 522 pcont_lucro.prg
09/07/2020 11:46 3.203 pcontnumdia.prg
09/07/2020 13:35 8.390 pcontrel0360.prg
09/07/2020 13:56 8.631 pcontrel0390.prg
09/07/2020 14:57 19.263 pcontrel0380.prg
09/07/2020 14:57 10.912 pcontrel0530.prg
09/07/2020 14:58 18.258 pcontrel0210.prg
09/07/2020 14:58 8.744 pcontrel0010.prg
09/07/2020 15:14 24.039 ze_updateg.prg
12/07/2020 23:39 3.175 pbancorelsaldo.prg
12/07/2020 23:39 6.526 pbancorelextrato.prg
13/07/2020 17:04 5.148 pnotaservico.prg
13/07/2020 17:04 3.561 pnotaxls.prg
13/07/2020 17:09 3.494 pbol0050.prg
13/07/2020 17:09 8.866 pbol0040.prg
13/07/2020 17:09 13.261 pbol0020.prg
13/07/2020 17:09 7.593 ljpimposto.prg
13/07/2020 17:09 19.968 ljpcadastro.prg
13/07/2020 17:10 1.221 pdfegerapdf.prg
13/07/2020 17:10 2.818 pdfeemail.prg
13/07/2020 17:10 2.583 pdfecteinut.prg
13/07/2020 17:10 3.019 pdfectecancel.prg
13/07/2020 17:11 4.456 pfinanrelmaifor.prg
13/07/2020 17:11 4.852 pfinanrelmaicli.prg
13/07/2020 17:11 7.741 pfinanrelfluxo.prg
13/07/2020 17:11 1.759 pedi0270.prg
13/07/2020 17:11 6.555 pdfezipxml.prg
13/07/2020 17:11 2.694 pdfenfeinut.prg
13/07/2020 17:15 14.254 pfiscsaidas.prg
13/07/2020 17:15 15.088 pfiscentradas.prg
13/07/2020 17:15 8.007 pfisccorrecao.prg
13/07/2020 17:15 34.254 pfinanrelreceber.prg
14/07/2020 00:44 22.720 pjpforpag.prg
14/07/2020 13:08 24.975 lbalger.prg
14/07/2020 22:19 60.359 ze_SpedXmlNFE.prg
15/07/2020 11:05 23.568 ze_update2020.prg
16/07/2020 15:34 1.937 pprecancel.prg
16/07/2020 18:20 22.033 ze_updatef.prg
16/07/2020 18:32 25.600 ze_updated.prg
17/07/2020 00:16 6.036 ze_prot.prg
17/07/2020 14:05 32.443 pdfeimporta.prg
17/07/2020 14:05 11.524 ljpfisica.prg
17/07/2020 14:05 19.431 ljpestoqueb.prg
17/07/2020 14:05 28.749 ljpestoquea.prg
17/07/2020 14:06 11.802 pestorelanalise.prg
17/07/2020 14:06 2.147 pestoitemxls.prg
17/07/2020 14:10 2.454 pnotageranfe.prg
17/07/2020 14:10 11.947 pnotaficcliven.prg
17/07/2020 14:10 18.108 pnotaconsprod.prg
17/07/2020 14:10 7.529 pjpvendedor.prg
17/07/2020 14:10 8.948 pjpveiculo.prg
17/07/2020 14:10 70.792 pjppedido.prg
17/07/2020 14:10 5.888 pjpfisicab.prg
17/07/2020 14:10 5.328 pjpfisicaa.prg
17/07/2020 14:10 5.302 pjpcomissao.prg
17/07/2020 14:10 36.621 pjpcadastro.prg
17/07/2020 14:10 6.104 pfiscrel0140.prg
17/07/2020 14:10 8.922 pfiscnotas.prg
17/07/2020 14:13 3.133 ppretabcombreaj.prg
17/07/2020 14:13 8.448 pprereltabmulti.prg
17/07/2020 14:13 10.721 pprereltabcomb.prg
17/07/2020 14:13 10.649 pprehtmltabpre.prg
17/07/2020 14:13 4.251 pnotavervendas.prg
17/07/2020 14:13 14.080 pnotaromaneio.prg
17/07/2020 14:13 5.206 pnotarelvendcli.prg
17/07/2020 14:13 31.155 pnotarelnotas.prg
17/07/2020 14:13 4.648 pnotarelcompcli.prg
17/07/2020 14:13 5.249 pnotarelclivend.prg
17/07/2020 14:13 3.401 pnotaproximas.prg
17/07/2020 14:13 7.373 pprevalperc.prg
17/07/2020 14:16 10.473 pedi0010.prg
17/07/2020 14:16 4.881 pestorecalculo.prg
17/07/2020 14:16 16.049 pjpestoque.prg
17/07/2020 17:16 7.651 ze_updateexedown.prg
19/07/2020 18:25 1.453 pbancoconsolida.prg
20/07/2020 10:51 21.494 ppretabcomb.prg
20/07/2020 16:40 27.435 ljppedido.prg
21/07/2020 19:36 28.337 pnotaplanilha.prg
21/07/2020 19:44 9.840 pnotarelmapa.prg
21/07/2020 19:44 11.633 pnotarelcompmes.prg
21/07/2020 19:44 28.292 pjppedidonota.prg
22/07/2020 14:51 21.005 pjpnotfis.prg
22/07/2020 14:51 25.233 pjpmdfcab.prg
22/07/2020 18:55 20.828 pfinanrelpagar.prg
22/07/2020 18:55 34.443 pfinanedreceber.prg
22/07/2020 18:55 27.430 pfinanedpagar.prg
22/07/2020 18:55 11.167 pfinanbaixaport.prg
22/07/2020 18:55 7.592 pediexpclarcon.prg
22/07/2020 18:55 4.108 pedi0190.prg
22/07/2020 18:55 6.712 pedi0150.prg
22/07/2020 18:55 3.437 pcont_valid.prg
22/07/2020 18:55 6.368 pcontrel0230.prg
22/07/2020 18:55 41.114 pcontlancainclui.prg
22/07/2020 18:55 15.811 pcontlancaedit.prg
22/07/2020 18:55 23.229 pcontfcont.prg
22/07/2020 18:55 504 pcontctaadm.prg
22/07/2020 18:55 14.394 pcontcontas.prg
22/07/2020 18:55 12.588 pbol0030.prg
22/07/2020 18:55 2.024 pauxpisenq.prg
22/07/2020 18:55 1.279 pauxpiscst.prg
22/07/2020 18:55 2.668 pauxorimer.prg
22/07/2020 18:55 1.311 pauxmodfis.prg
22/07/2020 18:55 1.409 pauxipienq.prg
22/07/2020 18:55 1.727 pauxipicst.prg
22/07/2020 18:55 1.770 pauxicmcst.prg
22/07/2020 18:55 4.382 pauxcnae.prg
22/07/2020 18:55 1.319 pauxcarcor.prg
22/07/2020 18:55 4.819 ljplicmov.prg
22/07/2020 18:57 4.091 ppretabela.prg
22/07/2020 18:57 9.436 pprereltabgeral.prg
22/07/2020 18:57 85.082 pjppedidosub.prg
22/07/2020 18:57 14.540 pjplicmov.prg
22/07/2020 18:57 27.534 pjpitem.prg
22/07/2020 18:57 26.149 pjpimposto.prg
22/07/2020 18:57 27.782 pjpanpmov.prg
22/07/2020 18:57 58.105 pfiscsped.prg
23/07/2020 01:15 2.621 pbancografresumo.prg
23/07/2020 01:15 4.130 pbancograficomes.prg
23/07/2020 01:15 6.000 pbancogera.prg
23/07/2020 01:15 11.653 pbancocomparames.prg
23/07/2020 01:15 4.160 pbancoccusto.prg
23/07/2020 01:17 8.155 pbancorelccusto.prg
23/07/2020 01:18 9.277 ze_update.prg
23/07/2020 05:02 12.892 pbancolanca.prg
24/07/2020 15:36 4.883 pcont_func.prg
24/07/2020 17:36 56.221 pcontsped.prg
25/07/2020 02:51 5.635 pcontfiscal.prg
25/07/2020 15:08 1.143 pfisctotais.prg
26/07/2020 03:38 39.191 pfiscsintegra.prg
26/07/2020 16:52 28.664 ze_updateh.prg
26/07/2020 22:14 6.121 pfiscrel0120.prg
26/07/2020 22:14 12.455 pfiscrel0090.prg
26/07/2020 22:14 9.841 pfiscrel0060.prg
26/07/2020 22:21 8.353 pfiscrel0110.prg
26/07/2020 22:21 21.403 pfiscrel0030.prg
26/07/2020 22:25 11.886 pfiscrel0100.prg
26/07/2020 22:25 10.571 pfiscrel0080.prg
26/07/2020 22:25 7.784 pfiscrel0050.prg
26/07/2020 22:28 21.806 pfiscrel0040.prg
238 arquivo(s) 2.629.844 bytes
STATIC FUNCTION OkGrupo( mplGrupo )
LOCAL lReturn := .T.
@ Row(), 35 SAY Pad( iif( mplGrupo == "A", "Ativo", iif( mplGrupo == "P", "Passivo", iif( mplGrupo == "R", "Result.", "" ) ) ), 20 )
IF ! mplGrupo $ "APR"
MsgWarning( "Grupo tem que ser (A)tivo, (P)assivo ou (R)esultado!" )
lReturn := .F.
ENDIF
RETURN lReturn
STATIC FUNCTION OkGrupo( mplGrupo )
LOCAL lReturn := .T., nPos
LOCAL aGrupoList := { "A:Ativo", "P:Passivo", "R:Resultado" } // "L:Patr.Liq", "C:Compensacao", "O:Outras" }
nPos := hb_AScan( aGrupoList, { | e | mplGrupo == Left( e, 1 ) } )
@ Row(), 35 SAY Pad( iif( nPos == 0, "", Substr( aGrupoList[ nPos ], 3 ), 20 )
IF nPos == 0
cList := ""
FOR EACH oElement IN aGrupoList
cList += oElement + iif( oElement:__EnumIsLast, "", ", " )
NEXT
MsgWarning( "Opções disponíveis:" + cList )
lReturn := .F.
ENDIF
RETURN lReturn
19/06/2020 17:41 7.666 ze_update.prg
26/06/2020 10:37 22.801 ze_update2020.prg
31/03/2020 18:20 2.004 ze_updatea.prg
28/05/2020 01:29 19.315 ze_updateb.prg
28/05/2020 01:34 19.656 ze_updatec.prg
08/06/2020 22:12 25.138 ze_updated.prg
22/03/2020 13:14 17.515 ze_updatedefault.prg
19/06/2020 17:41 26.352 ze_updatee.prg
10/06/2020 07:54 7.647 ze_updateexedown.prg
04/06/2020 13:03 6.069 ze_updateexeup.prg
14/05/2020 14:23 21.976 ze_updatef.prg
19/06/2020 12:35 23.814 ze_updateg.prg
20/05/2020 03:43 20.502 ze_updateh.prg
13 arquivo(s) 220.455 bytes
07/08/2020 14:22 9.328 ze_update.prg
07/08/2020 15:06 14.480 ze_update2020.prg
01/08/2020 06:36 2.071 ze_updatea.prg
07/08/2020 14:49 17.200 ze_updateb.prg
07/08/2020 15:00 15.497 ze_updatec.prg
07/08/2020 14:55 18.460 ze_updated.prg
30/07/2020 04:09 15.340 ze_updatedefault.prg
07/08/2020 15:03 15.372 ze_updatee.prg
17/07/2020 17:16 7.651 ze_updateexedown.prg
04/06/2020 13:03 6.069 ze_updateexeup.prg
07/08/2020 14:30 13.279 ze_updatef.prg
07/08/2020 14:46 16.967 ze_updateg.prg
07/08/2020 15:05 23.646 ze_updateh.prg
13 arquivo(s) 175.360 bytes
STATIC FUNCTION UpdateDeleteOld()
LOCAL cFile, nIdade, aList := { ;
"ba_auto", ;
"ba_grup", ;
"ba_movi", ;
"jpbaauto", ;
"jpbaccusto", ;
"jpbagrup", ;
"jpanpage", ;
"jpanpati", ;
"jpanpins", ;
"jpanploc", ;
"jpbamovi", ;
"jpanpope", ;
"jpanppro", ;
"jpbancario", ;
"jpbarra", ;
"jpcadastro", ;
"jpcarcor", ;
"jpclista", ;
"jpcep", ;
"jpcfop", ;
"jpcomissao", ;
"jpcotaca", ;
"jpcotcli", ;
"jpcotfor", ;
"jpcotpro", ;
"jpcte", ;
"jpdecret", ;
"jpdocrel", ;
"jpedicfg", ;
"jpestoque", ;
"jpfinan", ;
"jpfiscal", ;
"jpfisica", ;
"jpforpag", ;
"jpibpt", ;
"jpimposto", ;
"jpitem", ;
"jpitped", ;
"jplicmov", ;
"jplogsi", ;
"jpmdfcab", ;
"jpmdfdet", ;
"jpmotori", ;
"jpnfbase", ;
"jpnfeger", ;
"jpnfexml", ;
"jpnotaca", ;
"jpnotfis", ;
"jpordbar", ;
"jpordres", ;
"jpordser", ;
"jppedido", ;
"jppreco", ;
"jpprehis", ;
"jppretab", ;
"jpromcab", ;
"jpromdet", ;
"jptexto", ;
"jptransa", ;
"jptransp", ;
"jpveiculo", ;
"jpvendedor", ;
"jpvvdem", ;
"jpvvfin", ;
"nfbase", ;
"rastrea" }
SayScroll( "Verificando velhos/desativados" )
nIdade := iif( IsMaquinaJPA(), -1, 15 )
FOR EACH cFile IN aList
DeleteOldFiles( cFile + ".dbf", nIdade )
DeleteOldFiles( cFile + ".cdx", nIdade )
NEXT
RETURN NIL
JoséQuintas escreveu:NÃO... não terminei ainda.... continua faltando o contábil e relacionados.
Pra esses... nem tem nada de nota fiscal, estoque, etc. pra converter de DBF, é só apagar mesmo.
METHOD TableList() CLASS ADOClass
LOCAL acTableList := {}, Rs
IF ".XLS" $ Upper( ::cn:ConnectionString )
rs := ::cn:openSchema(20) // adSchemaTables
DO WHILE ! Rs:Eof()
IF ! "Print_Are" $ rs:Fields( "Table_Name" ):Value .AND. ;
! "FilterDatabase" $ rs:Fields( "Table_Name" ):Value
AAdd( acTableList, "[" + rs:Fields( "Table_Name" ):Value + "]" )
ENDIF
rs:MoveNext()
ENDDO
rs:Close()
ELSE
::cSQL := "SELECT DISTINCT table_name AS TABELA FROM information_schema.TABLES WHERE table_schema=" + StringSQL( Lower( AppEmpresaApelido() ) )
::Execute()
DO WHILE ! ::Eof()
AAdd( acTableList, ::Value( "TABELA" ) )
::MoveNext()
ENDDO
::CloseRecordset()
ENDIF
RETURN acTableList
Retornar para Contribuições, Dicas e Tutoriais
Usuários vendo este fórum: Nenhum usuário registrado online e 13 visitantes