Abrangências: | Advanced Protheus 6.09 , Advanced Protheus 7.10 , Microsiga Protheus 8.11 , Microsiga Protheus 10 |
Versões: | Todas |
Compatível Países: | Todos |
Sistemas Operacionais: | Todos |
Compatível às Bases de Dados: | Todos |
O ponto de entrada OC020ZTIT tem como finalidade tratar as informações dos títulos antes de serem exibidas através da consulta.
Function FS_M_CJRCAL()
Private aTitAbe := {}
Private aTitPag := {}
Private xCol := {}
Private cCliente:= ""
Private nDias := 0
Private nJuros := 0
Private nQtdAbe := 0
Private nValAbe := 0
Private nQtdAVe := 0
Private nValAVe := 0
Private nQtdAtr := 0
Private nValAtr := 0
Private nQtdPag := 0
Private nValPag := 0
Private nQtdTot := 0
Private nValTot := 0
Private nValAJr := 0
Private nPergJur:= 0
Private dPergDat:= dDataBase
Private nContador:= 0
Private oOk := LoadBitmap( GetResources(), "LBTIK" )
Private oNo := LoadBitmap( GetResources(), "LBNO" )
Private lMarcarA:= .f.
Private lMarcarP:= .f.
Private aSN := {OemToAnsi(STR0004),OemToAnsi(STR0005)}
Private cRecibo := STR0004
Private lNroEnd := .f.
Private nOpca := 0
Private cQAlias := "SQLSE1"
Private cQAlAux := "SQLSE5"
Private cQuery := ""
DbSelectArea("SX3")
DbSetOrder(2)
If DbSeek("A1_NUMERO")
lNroEnd := .t.
EndIf
cOBS1 := STR0006+STR0007
cOBS2 := STR0008+STR0009+STR0010+STR0011+Transform(GetMv("MV_JUROS"),"@E 99.9999")+STR0012
DEFINE MSDIALOG oDlgPergJur TITLE STR0013 From 5,25 to 19,90 of oMainWnd
@ 015,012 SAY STR0014 OF oDlgPergJur SIZE 175,10 PIXEL COLOR CLR_BLACK
@ 013,187 MSCOMBOBOX oSN VAR cRecibo ITEMS aSN SIZE 23,08 OF oDlgPergJur PIXEL COLOR CLR_HBLUE
@ 028,012 SAY STR0015 OF oDlgPergJur SIZE 95,10 PIXEL COLOR CLR_BLACK
@ 026,069 MSGET oPergJur VAR nPergJur PICTURE "@E 9,999.9999" SIZE 43,4 OF oDlgPergJur PIXEL COLOR CLR_HBLUE WHEN cRecibo == STR0004
@ 026,170 MSGET oPergDat VAR dPergDat PICTURE "@D" SIZE 40,4 OF oDlgPergJur PIXEL COLOR CLR_HBLUE WHEN cRecibo == STR0004
@ 028,114 SAY ("% "+STR0016) OF oDlgPergJur SIZE 90,10 PIXEL COLOR CLR_BLACK
@ 057,012 SAY cOBS1 OF oDlgPergJur SIZE 230,20 PIXEL COLOR CLR_BLACK
@ 067,012 SAY cOBS2 OF oDlgPergJur SIZE 230,30 PIXEL COLOR CLR_BLACK
DEFINE SBUTTON FROM 020,216 TYPE 1 ACTION ( nOpca:=1 , oDlgPergJur:End()) ENABLE OF oDlgPergJur PIXEL
@ 007,008 TO 041,213 LABEL "" OF oDlgPergJur PIXEL //caixa 1
@ 007,213 TO 041,249 LABEL STR0017 OF oDlgPergJur PIXEL //caixa botao ok
@ 049,008 TO 099,249 LABEL STR0018 OF oDlgPergJur PIXEL //caixa 2
ACTIVATE MSDIALOG oDlgPergJur CENTER
If nOpca == 1
cNomeCli := Alltrim(left(SA1->A1_NOME,15)) + "..."
If dPergDat < dDataBase
dPergDat := dDataBase
EndIf
cQuery := "SELECT * FROM "+RetSqlName("SE1")+" SE1 WHERE SE1.E1_FILIAL='"+xFilial("SE1")+"' AND "
cQuery += "SE1.E1_CLIENTE='"+SA1->A1_COD+"' AND SE1.E1_LOJA='"+SA1->A1_LOJA+"' AND SE1.D_E_L_E_T_=' ' "
dbUseArea( .T., "TOPCONN", TcGenQry( ,, cQuery ), cQAlias , .F., .T. )
Do While !( cQAlias )->( Eof() )
nQtdTot++
nValTot+= ( cQAlias )->( E1_VALOR )
nJurMes := 0
If cRecibo == STR0004
If nPergJur == 0
DbSelectArea("SEE")
DbSetOrder(1)
If DbSeek(xFilial("SEE") + ( cQAlias )->( E1_PORTADO ) , .F. )
If SEE->(FieldPos("EE_JURMES")) # 0
nJurMes := SEE->EE_JURMES
Else
nJurMes := GetMv("MV_JUROS")/100
EndIf
Else
nJurMes := GetMv("MV_JUROS")/100
EndIf
Else
nJurMes := nPergJur/100
EndIf
Else
nJurMes := 0
EndIf
// cIdeTit := ( cQAlias )->( E1_PREFORI ) + " " + ( cQAlias )->( E1_NUM ) + "-" + ( cQAlias )->( E1_PARCELA ) + " " + ( cQAlias )->( E1_TIPO )
cIdeTit := ( cQAlias )->( E1_PREFORI ) + " " + ( cQAlias )->( E1_NUM ) + "-" + ( cQAlias )->( E1_PARCELA ) + " " + ( cQAlias )->( E1_TIPO )
If ( cQAlias )->( E1_SALDO ) > 0
// DbSelectArea("SA6")
// DbSetOrder(1)
// DbSeek( xFilial("SA6") + ( cQAlias )->( E1_PORTADO ) , .F. )
DbSelectArea("SX5")
DbSetOrder(1)
DbSeek(xFilial("SX5")+"07"+( cQAlias )->( E1_SITUACA ))
nQtdAbe++
nValAbe+= ( cQAlias )->( E1_SALDO )
nDias := ( stod(( cQAlias )->( E1_VENCTO )) - dPergDat )
If nDias < 0
nQtdAtr++
nValAtr+= ( cQAlias )->( E1_SALDO )
nJuros:= ( (-1) * nDias *( nJurMes * ( cQAlias )->( E1_SALDO ) ) /30 )
nValAJr+= ( cQAlias )->( E1_SALDO ) + Val(str(nJuros,12,2))
Else
nQtdAVe++
nValAVe+= ( cQAlias )->( E1_SALDO )
nJuros:= 0
EndIf
// Aadd( aTitAbe , { cIdeTit , stod(( cQAlias )->( E1_EMISSAO )) , stod(( cQAlias )->( E1_VENCTO )) , nDias , ( cQAlias )->( E1_VALOR ) , ( cQAlias )->( E1_SALDO ) , Val(str(nJuros,12,2)) , ( cQAlias )->( E1_PORTADO ) + "-" + SA6->A6_NREDUZ , .f. } )
Aadd( aTitAbe , { cIdeTit , stod(( cQAlias )->( E1_EMISSAO )) , stod(( cQAlias )->( E1_VENCTO )) , nDias , ( cQAlias )->( E1_VALOR ) , ( cQAlias )->( E1_SALDO ) , Val(str(nJuros,12,2)) , ( cQAlias )->( E1_PORTADO ) + " " + ( cQAlias )->( E1_SITUACA ) + "-" + X5Descri(), .f. } )
Else
DbSelectArea("SX5")
DbSetOrder(1)
DbSeek(xFilial("SX5")+"07"+( cQAlias )->( E1_SITUACA ))
nQtdPag++
nValPag += ( cQAlias )->( E1_VALOR )
dDtPagto := stod(( cQAlias )->( E1_BAIXA ))
cSE5Banc := ""
cSE5Baix := ""
cQuery := "SELECT SE5.E5_BANCO , SE5.E5_DTDISPO , SE5.E5_MOTBX FROM "+RetSqlName("SE5")+" SE5 WHERE SE5.E5_FILIAL='"+xFilial("SE5")+"' AND "
cQuery += "SE5.E5_PREFIXO='"+( cQAlias )->( E1_PREFIXO )+"' AND SE5.E5_NUMERO='"+( cQAlias )->( E1_NUM )+"' AND "
cQuery += "SE5.E5_PARCELA='"+( cQAlias )->( E1_PARCELA )+"' AND SE5.E5_TIPO='"+( cQAlias )->( E1_TIPO )+"' AND "
cQuery += "SE5.E5_TIPODOC='VL' AND SE5.D_E_L_E_T_=' ' "
dbUseArea( .T., "TOPCONN", TcGenQry( ,, cQuery ), cQAlAux , .F., .T. )
Do While !( cQAlAux )->( Eof() )
// DbSelectArea("SA6")
// DbSetOrder(1)
// DbSeek( xFilial("SA6") + ( cQAlAux )->( E5_BANCO ) , .F. )
dDtPagto := stod(( cQAlAux )->( E5_DTDISPO ))
// cSE5Banc := ( cQAlAux )->( E5_BANCO ) + "-" + SA6->A6_NREDUZ
cSE5Banc := ( cQAlAux )->( E5_BANCO )
cSE5Baix := ( cQAlAux )->( E5_MOTBX )
( cQAlAux )->( DbSkip() )
EndDo
( cQAlAux )->( dbCloseArea() )
nDias := ( stod(( cQAlias )->( E1_VENCTO )) - dDtPagto )
nJuros:= ( ( cQAlias )->( E1_VALOR ) - ( cQAlias )->( E1_DESCONT ) + ( cQAlias )->( E1_MULTA ) + ( cQAlias )->( E1_JUROS ) + ( cQAlias )->( E1_CORREC ) )
// Aadd( aTitPag , { cIdeTit , stod(( cQAlias )->( E1_EMISSAO )) , stod(( cQAlias )->( E1_VENCTO )) , dDtPagto , nDias , ( cQAlias )->( E1_VALOR ) , nJuros , cSE5Banc +" "+ cSE5Baix , .f. } )
Aadd( aTitPag , { cIdeTit , stod(( cQAlias )->( E1_EMISSAO )) , stod(( cQAlias )->( E1_VENCTO )) , dDtPagto , nDias , ( cQAlias )->( E1_VALOR ) , nJuros , cSE5Banc +" "+ cSE5Baix + ( cQAlias )->( E1_SITUACA ) + "-" + X5Descri() , .f. } )
EndIf
If ExistBlock("OC020ZTIT")
ExecBlock("OC020ZTIT",.f.,.f.)
EndIf
( cQAlias )->( DbSkip() )
EndDo
( cQAlias )->( dbCloseArea() )
OFIOC020, OC020ZTIT
OC020ZTIT - Trata informações de títulos ( [ ] )
Nome | Tipo | Descrição | Default | Obrigatório | Referência | ||||||||||||
Array of Record |
-
()
#INCLUDE "rwmake.ch"/*/ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜܱ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ÉÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍ»±±±±º Programa ³OC020ZTIT ³ Autor ³ Otavio ³ Data ³ 04/03/10 º±±±±ÈÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍͼ±± º±±±±º º±±±±º º±±±±ÈÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ±± º±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß/*/User Function OC020ZTIT() if ( cQAlias )->E1_TIPO $ "CCC.CCD" nJuros := 0EndifReturn(.t.)
Nome | Tipo | Escopo | Pode Alterar | descrição | ||||||||||
Array of Record | Global | Não |