Eventos de chamada do Ponto de Entrada | nHnd := FCREATE(Alltrim(MV_PAR01)+Alltrim(cArquivo),0) // cQryAl001 := GetNextAlias() // cQuery := "SELECT VDC_FILIAL, VD9_CPODEF, SUM(VDC_VALOR) SUMVALOR" cQuery += " FROM "+RetSQLName('VDC')+" VDC INNER JOIN "+RetSQLName('VD9')+" VD9 ON " cQuery += " (VD9_FILIAL = '"+xFilial("VD9")+"' AND VD9_CODDEF = VDC_CODDEF AND VD9_CODCON = VDC_CODCON AND VD9.D_E_L_E_T_ = ' ')" cQuery += " WHERE VDC_DATA = '"+DTOS(MV_PAR04)+"' AND VDC_CODDEF = '"+Alltrim(MV_PAR03)+"' AND VDC.D_E_L_E_T_ = ' '" cQuery += " GROUP BY VDC_FILIAL,VD9_CPODEF" cQuery += " ORDER BY VDC_FILIAL,VD9_CPODEF" // dbUseArea( .T., "TOPCONN", TcGenQry( ,, cQuery ), cQryAl001, .F., .T. ) // while !((cQryAl001)->(eof())) // cLinha := Left(Alltrim((cQryAl001)->(VD9_CPODEF)),3) +; "00" +; Right(Alltrim((cQryAl001)->(VD9_CPODEF)),2) +; Right(Alltrim((cQryAl001)->(VDC_FILIAL)),2) +; ";" +; Alltrim(STR((cQryAl001)->(SUMVALOR)))+CHR(13)+CHR(10) // If ExistBlock("OXN51AGF") ExecBlock("OXN51AGF",.f.,.f.) EndIf // fwrite(nHnd,cLinha) // (cQryAl001)->(DBSkip()) enddo // fClose(nHnd) |
---|