Você está na página 1de 3

For x := 1 To Len(HttpSession->aScj14P)

aEstrut := Estrut(HttpSession->aScj14P[x][07],1)

If Len(aEstrut) > 0
aAdd(aProdutos,{aEstrut[2],aEstrut[4]})
EndIF
Next x
// nI := If(Empty(MV_PAR03),1,MV_PAR03)
// nNum := If(Empty(aLinha[x][4]),1,aLinha[x][4])
// For y := 1 To nNum
// MSCBLOADGRF("SIGA.PCX")
// MSCBINFOETI("Ex.: BOBY","MODELO 1")
// MSCBBEGIN(1,5) // ,124.5) //120 Tamanho da etiqueta
// MSCBPRINTER("ELTRON",cPorta,,40,.F.)
//MSCBPRINTER("TLP2844",cPorta,,,.f.)
// MSCBCHKStatus(.F.)


// MSCBLOADGRF("SIGA.PCX")
// MSCBINFOETI("Ex.: BOBY","MODELO 1")
// MSCBBEGIN(1,5) // ,124.5) //120 Tamanho da etiqueta
/*
Nome fantasia da Empresa INOAR
Codigo do produto B1_COD
Descrio do produto B1_DESCR
Unidades Embalagens B5_EAN141 a 148
Numero do lote D3_LOTECTL
Data Validade D3_DTVALID
*/
// cSeq := StrZero(1,1)
//MSCBSay - Imprime uma String
// ( nXmm ,nYmm, cTexto ,cRotao, cFonte, cTam, [ *lRev
erso ] ,[ lSerial ], [ cIncr ] ,[ *lZerosL ] ,[ lNoAlltrim ] )
//cBarra := '789' + ALLTRIM(SM0->M0_CODFIL) + ALLTRIM(SUBSTR((cAl
iasNew)->D1_COD,1,5)) //+ cSeq
// MSCBSAYBAR(05 , 60, cBarra ,'N' ,'MB07',20,.F.,.T.,,
,3,2) //Codigo produto em Barras
//Next y

//If cXAviso=='P'
//EndIf

//MSCBSAY(15,10, "Teste De Impressao ","R","4","1,1")
MSCBSAY(05, 12 , "DT: " + DtoC(aLinha[x][11]) , "N" , "4" , "2 ,2")

MSCBSAY(05, 21 , "NOTA FISCAL: "+AllTrim(aLinha[x][12])
, "N" , "4" , "2 ,2")
MSCBSAY(05, 29 , "COD.: "+AllTrim(aLinha[x][02])
, "N" , "4" , "2 ,2")
MSCBSAY(05, 37 , "DESCRI.: "+AllTrim(aLinha[x][03])
, "N" , "4" , "2 ,2")
MSCBSAY(05, 45 , "FORNEC.: "+AllTrim(cNomFor)
, "N" , "4" , "2 ,2")
MSCBSAY(05, 53 , "LOTE: " + AllTrim(aLinha[x][05]) , "N
" , "4" , "2 ,2")
MSCBSAY(05, 61 , "VALID.: " + DtoC(aLinha[x][06]) , "N"
, "4" , "2 ,2")
MSCBSAY(05, 69 , "QUANT..: " + STRZERO(aLinha[x][07],2
)+"/"+STRZERO( aLinha[x][4],2)+"Vol" , "N" , "4" , "2 ,2")


MSCBSAY(05, 79 , "" , "N" , "4" , "2 ,2")

cQuery := "SELECT SD1.D1_ITEM, SD1.D1_COD, SB1.B1_DESC,SB1.B1_QE, SD1.D
1_LOTECTL, SD1.D1_DTVALID, SD1.D1_QUANT, SD1.D1_FORNECE, SD1.D1_LOJA, SD1.D1_DTD
IGIT, SD1.D1_EMISSAO, SD1.D1_DOC, SD1.D1_SERIE "
cQuery += " FROM "
cQuery += RetSqlName("SD1") + " SD1 "
cQuery += " INNER JOIN "+RetSqlName("SB1") + " SB1 "
cQuery += " ON SB1.B1_COD=SD1.D1_COD AND SD1.D_E_L_E_T_ = ' '
AND SD1.D1_FILIAL = '"+xFilial("SD1")+"' "
cQuery += " INNER JOIN "+RetSqlName("SA2") + " SA2 "
cQuery += " ON SA2.A2_COD=SD1.D1_FORNECE AND SA2.A2_LOJA=SD1.D
1_LOJA AND SA2.D_E_L_E_T_ = ' ' AND SA2.A2_FILIAL = '"+xFilial("SA2")+"' "
cQuery += " WHERE SD1.D1_FILIAL = '" + xFilial("SD1") + "' "
cQuery += " AND SD1.D_E_L_E_T_ = ' ' "
cQuery += " AND SD1.D1_DOC = '"+mv_par01+"' AND SD1.D1_SERIE = '"+mv_p
ar02+"'"
// If !Empty(MV_PAR02)
// cQuery += " AND SD3.D3_COD = '"+mv_par02+"' "
// EndIf
cQuery += " ORDER BY SD1.D1_DOC, SD1.D1_SERIE, SD1.D1_COD "
//cQuery := ChangeQuery(cQuery)
dbUseArea(.T.,"TOPCONN",TcGenQry(,,cQuery),cAliasNew,.T.,.T.)
tcsetfield(cAliasNew,'D1_DTVALID','D',8,0)
tcsetfield(cAliasNew,'D1_EMISSAO','D',8,0)
tcsetfield(cAliasNew,'D1_DTDIGIT','D',8,0)
(cAliasNew)->(dbGoTop())

While (cAliasNew)->(!Eof())

AADD(aLinha,{(cAliasNew)->D1_ITEM, (cAliasNew)->D1_COD, (cAliasN
ew)->B1_DESC,(cAliasNew)->B1_QE, (cAliasNew)->D1_LOTECTL, (cAliasNew)->D1_DTVAL
ID, (cAliasNew)->D1_QUANT, (cAliasNew)->D1_FORNECE, (cAliasNew)->D1_LOJA, (cAlia
sNew)->D1_DTDIGIT, (cAliasNew)->D1_EMISSAO, (cAliasNew)->D1_DOC, (cAliasNew)->D1
_SERIE})
cNomFor := Posicione("SA2",1,xFilial("SA2")+(cAliasNew)->D1_FORN
ECE+(cAliasNew)->D1_LOJA,"A2_NREDUZ")
(cAliasNew)->(dbSkip())
EndDo