Home

Linha Microsiga Protheus

Páginas filhas
  • Compensação entre cateiras automática -- 30895

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
Composition Setup
import.css=/download/attachments/327912/newLayout.css
Portuguese

Pagetitle
Compensação entre cateiras automática
Compensação entre cateiras automática

Compensação entre cateiras automática

 

 Implementada a utilização automática da rotina de Compensação entre Carteiras (FINA450).



FINA450(nPosArotina,aAutoCab,nOpcAuto)

 

aAutoCab 
Utilizado para enviar dados referentes ao processo, como:
- Data Inicial
- Data Final
- Valor limite
- Codigo do Cliente e loja
- Codigo do Fornece e loja
- Moeda
- Debito ou Credito
- Titulos Futuros
- Chave de Titulos a Receber (Array com Chave dos titulos a receber que serão compensados)
    SE1->E1_FILIAL+SE1->E1_PREFIXO+SE1->E1_NUM+SE1->E1_PARCELA+SE1->E1_TIPO
- Chave de Titulos a Pagar (Array com Chave dos titulos a Pagarque serão compensados)
     SE2->E2_FILIAL+SE2->E2_PREFIXO+SE2->E2_NUM+SE2->E2_PARCELA+SE2->E2_TIPO+SE2->E2_FORNECE+SE2->E2_LOJA
 nOpcAuto
2 = Compensação

 

Exemplo:


 #include "rwmake.ch"

 
User Function Auto450()
 
Local aAutoCab := {        {"AUTDVENINI450", cTod('31/08/11')         , nil},;
                                                                                              {"AUTDVENFIM450", cTod('31/08/11')               , nil},;
                                                                                              {"AUTNLIM450"     , 10000                                , nil},;
                                                                                              {"AUTCCLI450"       , "000001"                          , nil},;
                                                                                              {"AUTCLJCLI"          , "01"                                 , nil},;
                                                                                              {"AUTCFOR450"     , "000001"                          , nil},;
                                                                                              {"AUTCLJFOR"        , "01"                                 , nil},;
                                                                                              {"AUTCMOEDA450"  , "01"                               , nil},;                                    
                                                                                              {"AUTNDEBCRED" , 1                                        , nil},;
                                                                                              {"AUTLTITFUTURO", .F.                                      , nil},;
                                                                                              {"AUTARECCHAVE" , {}                                     , nil},;
                                                                                              {"AUTAPAGCHAVE" , {}                                     , nil}}
 
Private lMsHelpAuto := .T.
Private lMsErroAuto := .F.
                    
                 
                                                    
                                       // Dados do titulo a receber
                                       SE1->( dbSetOrder( 1 ) )
                                       SE1->( MsSeek( xFilial( "SE1" ) +                PadR( " " , TamSX3( "E1_PREFIXO" )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "REC1", TamSX3( "E1_NUM"     )[ 1 ] ) + ;
                                                                                                                                                                            PadR( " " , TamSX3( "E1_PARCELA" )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "NF " , TamSX3( "E1_TIPO"    )[ 1 ] ) ) )
                                      
                                       AAdd( aAutoCab[11,2], { xFilial( "SE1" ) +   PadR( " " , TamSX3( "E1_PREFIXO" )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( "REC1", TamSX3( "E1_NUM"     )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( " " , TamSX3( "E1_PARCELA" )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( "NF " , TamSX3( "E1_TIPO"    )[ 1 ] ) } )
                                                                                                                                                                           
                                       // Dados do titulo a pagar
                                       SE2->( dbSetOrder( 1 ) )
                                       SE2->( MsSeek( xFilial( "SE2" ) +                PadR( " "                , TamSX3( "E2_PREFIXO" )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "PAG1"        , TamSX3( "E2_NUM"     )[ 1 ] ) + ;
                                                                                                                                                                            PadR( " "                , TamSX3( "E2_PARCELA" )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "NF "            , TamSX3( "E2_TIPO"    )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "000001"     , TamSX3( "E2_FORNECE" )[ 1 ] ) + ;
                                                                                                                                                                            PadR( "01"                             , TamSX3( "E2_LOJA"    )[ 1 ] ) ) )
                                      
                                       AAdd( aAutoCab[12,2], { xFilial( "SE2" ) +  PadR( " "                , TamSX3( "E2_PREFIXO" )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( "PAG1"        , TamSX3( "E2_NUM"     )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( " "                , TamSX3( "E2_PARCELA" )[ 1 ] ) + ;
                                                                                                                                                                                                           PadR( "NF "            , TamSX3( "E2_TIPO"    )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( "000001"     , TamSX3( "E2_FORNECE" )[ 1 ] ) + ;
                                                                                                                                                                                                            PadR( "01"                                                    , TamSX3( "E2_LOJA"    )[ 1 ] ) } )
                                                                                                                                                                           
                                       MSExecAuto({|x,y,z| Fina450(x,y,z)}, nil , aAutoCab , 3 )
                                      
                                       If !lMsErroAuto
                                               msgalert("Incluido com sucesso! ")
                                               confirmsx8()
                                       Else
                                               msgalert("Erro na inclusao!")
                                               rollbacksx8()
                                               MostraErro()
                                       EndIf
 
 
Return