ALIAS SP_MOVF

VARIAVEL zCmdsDurante = ""

VARIAVEL #TEXTO_FONTE
  
   oLst:cAlias_DataCols := 'sp_movf'
   // oLst:Cab1( "DADOS DO PEDIDO "+Ltrim(Str(m_fNum,10))+", em "+Dtoc(s_datual)+" as "+time()  )
   oLst:Cab1( "DADOS DO PEDIDO "+sp_movf+", em "+Dtoc(s_datual)+" as "+time()  )
   // oLst:Cab3( m_cp_nome +" (Cod "+Ltrim(Str(m_cp_cod_for,6))+" )" )
 
   oLst:AddCab( '_LINHA_FINA_' )
   oLst:AddCab( '_CABCOLS_' )
   oLst:AddCab( '_LINHA_GROSSA_' )

   oLst:AddCol('Codigo;PCOD;N;9999999; 7;N;;Direita;NaoSome;')
   oLst:AddCol('Descricao;PDESC;C;@S35; 35;N;')
   oLst:AddCol('Qtd\nNFE;mqatend;N;99999.999;9;S;;Direita;NaoSome;')
   if sFgContaPecas
      oLst:AddCol('QPerfis;pPecas;N;99999;8;S;;Direita;NaoSome;')
   endif
   oLst:AddCol('PrUnNF;pvluven3;N;9999.999;8;S;')
   oLst:AddCol('CstTotl;mvalor3;N;9999.99;7;S;;Direita;Some;')
   oLst:AddCol('Minha\nQtd;pitens*mqatend;P;99999.999; 9;S;;Direita;NaoSome;')
   oLst:AddCol('Frc;pitens;N;9999;  4;S;')

   oLst:AddCol('Cf;pcategoria;C;xxx;3;S;')
   oLst:AddCol('Cfop;pCfop;C;9999;4;S;')
   oLst:AddCol('Tp;Ptipoitem;C;99;2;S;')
   oLst:AddCol('Finalidade;Efd_TipoItem(Ptipoitem);P;@S13;13;N;')

   // oLst:AddCol('Pr Vend;pvluvenda;N;9999.99;7;S;')
   // oLst:AddCol('Pr.Tabela;pvlutab;N;9999.99;7;S;')
   // oLst:AddCol('%Negoc;PdscCompr;N;999.99;6;S;')
   // oLst:AddCol('%Prd;Pdesconto;N;999.99;6;N;')
   // oLst:AddCol('%Rod;PdscRodape;N;999.99;6;S;')
   // oLst:AddCol('Pend;unid_fech-mqatend;P;9999; 4;N;')
   // oLst:AddCol('UndVnd;mquant;N;999999;  6;N;')
   //    oLst:AddCol('XmlCf;xml_categf;C;xxx;5;S;')
   //    oLst:AddCol('CstIcm;Cst_Icms;C;xxx;6;S;')
   //    oLst:AddCol('CstPIS;Cst_Pis;C;xxx;6;S;')
   //    oLst:AddCol('CstCOF;Cst_Cofins;C;xxx;6;S;')
   //    oLst:AddCol('Base_ICM;mBaseIcms;N;9999.99;8;S;')
   //    oLst:AddCol('%ICMs;mTaxaIcms;N;99.99;5;S;')
   //    oLst:AddCol('Tot_ICM;mTotIcms;N;9999.99;8;S;')
   //    oLst:AddCol('BaseST;mBaseRetid;N;9999.99;8;S;')
   //    oLst:AddCol('%ST;mTaxaST;N;99.99;5;S;')
   //    oLst:AddCol('ICM_ST;mIcmRetido;N;9999.99;8;S;')
   //    oLst:AddCol('*;pnegpos;C;x;1;S;')
   //    oLst:AddCol('BasePIS;vl_bc_pis;N;9999.99;8;S;')
   //    oLst:AddCol('%PIS;aliq_pis;N;99.99;5;S;')
   //    oLst:AddCol('Tot_PIS;vl_pis;N;9999.99;8;S;')
   //    oLst:AddCol('BaseCOF;vlbccofins;N;9999.99;8;S;')
   //    oLst:AddCol('%COF;aliqcofins;N;99.99;5;S;')
   //    oLst:AddCol('Tot_COF;vl_cofins;N;9999.99;8;S;')
   // oLst:AddCol('xmlCstIcm;xml_csticm;C;xxx;9;N;')
   // oLst:AddCol('xmlCstPis;xml_cstpis;C;xxx;9;N;')
   // oLst:AddCol('xmlCstCof;xml_cstcof;C;xxx;9;N;')
   // oLst:AddCol('XmlBaseICM;xml_IcmBC;N;9999.99;10;N;')
   // oLst:AddCol('Xml%ICM;xml_IcmTx;N;99.99;7;N;')
   // oLst:AddCol('XmlTotICM;xml_ICMVl;N;9999.99;9;N;')
    //   oLst:AddCol('%Liq;PdescComp;N;999.99;6;S;')
    //   oLst:AddCol('%Distr;PdescDist;N;999.99;6;S;')
    //   oLst:AddCol('%Repas;prepasse;N;999.99;6;S;')
    //   oLst:AddCol('%IPI;pipient;N;999.99;6;S;')
    //   oLst:AddCol('%DscTt;if(mvalor3>0,100*(mqatend*pvlutab-mvalor3)/(mqatend*pvlutab),0);P;999.99;6;N;')
      
   oLst:AddRodape( '_LINHA_FINA_', "", {|| "Pagina "+Str(++pag,4)+" / ####"} )

   // BLOCO_TXT zCmdsDurante
   //    znemis   := znemis + 1 
   //    ZVALEMIS := ZVALEMIS + CP_VALOR 
   // FIM_BLOCO_TXT

   // concilia->(DbGoTop(), oLst:DbEval(zCmdsDurante) )
   sp_movf->(DbGoTop(), oLst:DbEval() )

   oLst:lFecharGruposAbertos := .t.
   oLst:SetFormatSomaCol(2, {||"*Totais do Pedido: "}, .t.)
   oLst:PrtD('_LINHA_GROSSA_')
   oLst:PrtD({"style"=>"font:Courier-BoldOblique"}, '_SOMACOLS_GLOBAL_' )
   oLst:PrtD('_LINHA_FINA_')
   oLst:PrtD('')
   
   // debugalert('4')
   
   // oLst:PrtD('Valor das Emissoes :      '+Transform(zvalemis,'@e 999,999,999.99')+'   (Ref a '+Str(znemis,4)+' titulos) ' )
   // oLst:PrtD('Valor das Liquidacoes :   '+Transform(zvallqd, '@e 999,999,999.99')+'   (Ref a '+Str(znlqd,4)+' titulos) ' )
   // oLst:PrtD('Valor em Aberto :         '+Transform(zvalemis-zvallqd, '@e 999,999,999.99')+'   (Ref a '+Str(znemis-znlqd,4)+' titulos) ' )
   // oLst:PrtD('')
   // oLst:PrtD('Juros Pagos :             '+Transform(zjuros , '@e 999,999,999.99')+'   (Ref a '+Str(znlqdj,4)+' titulos) ' )
   // oLst:PrtD('Descontos Obtidos :       '+Transform(zdesct , '@e 999,999,999.99')+'   (Ref a '+Str(znlqdd,4)+' titulos) ' )

#FIM_TEXTO_FONTE