En caso de tener personalizaciones en el archivo FATSPERTSS.INI es necesario realizar los siguientes ajustes, que se enmarcan a continuación: [XXX INICIALIZACION] (PRE) SD1->(DbSetOrder(1)) (PRE) SB1->(DbSetOrder(1)) (PRE) SYA->(DbSetOrder(1)) (PRE) SAH->(DbSetOrder(1)) (PRE) _aTotal[002] := chr(13) + chr(10) (PRE) _aTotal[003] := "99999999999999.99" (PRE) _aTotal[004] := {"SD1",""} (PRE) _aTotal[005] := IIf(Alltrim(SF1->F1_ESPECIE)=="NF","factura","notaDebito") (PRE) _aTotal[006] := Alltrim(SF1->F1_SERIE) + Alltrim(SF1->F1_DOC) + Alltrim(SF1->F1_ESPECIE) (PRE) _aTotal[007] := SuperGetMV("MV_CFDIAMB",.F.,"1") (PRE) _aTotal[008] := M485TotEnc(0,SF1->F1_SERIE, SF1->F1_FORNECE, SF1->F1_LOJA, SF1->F1_DOC, SF1->F1_ESPECIE, _aTotal[007],SF1->F1_SERIE2) (PRE) _aTotal[009] := TamSX3("F1_DOC")[1] (PRE) _aTotal[010] := "" (PRE) _aTotal[011] := SUBSTR(DTOS(SF1->F1_EMISSAO),0,4) + "-" + SUBSTR(DTOS(SF1->F1_EMISSAO),5,2) + "-" + SUBSTR(DTOS(SF1->F1_EMISSAO),7,2) + "T" + SF1->F1_HORA+"Z" (PRE) _aTotal[012] := "" (PRE) _aTotal[013] := alltrim(SA1->A1_EST) == "EX" (PRE) _aTotal[014] := alltrim(fGetSX5("XQ" + STR(SF1->F1_MOEDA,2))) (PRE) _aTotal[015] := "" (PRE) _aTotal[016] := "07" (PRE) _aTotal[017] := M485TPPAG(xFilial("SE4"), SF1->F1_COND) (PRE) _aTotal[018] := M485CUOTA(SF1->F1_FILIAL,SF1->F1_FORNECE,SF1->F1_LOJA,SF1->F1_SERIE,SF1->F1_DOC,SF1->F1_ESPECIE,SF1->F1_HORA) (PREREG) FsQuery(_aTotal[004],1,"D1_DOC='" + SF1->F1_DOC + "' AND D1_SERIE='" + SF1->F1_SERIE + "' AND D1_FORNECE='" + SF1->F1_FORNECE + "' AND D1_LOJA='" + SF1->F1_LOJA + "'","SD1->D1_DOC=SF1->F1_DOC .AND. SD1->D1_SERIE=SF1->F1_SERIE .AND. SD1->D1_FORNECE=SF1->F1_FORNECE .AND. SD1->D1_LOJA=SF1->F1_LOJA","D1_ITEM") .And. .T. [XXX ENCABEZADO] (PRE) SA1->(MSSeek(xFilial("SA1") + SF1->F1_FORNECE + SF1->F1_LOJA)) (PRE) SYA->(MsSeek(xFilial("SYA") + SA1->A1_PAIS)) (PREREG) (_aTotal[001] := '<?xml version="1.0" encoding="iso-8859-1"?>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '<DTE version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DTE_v1.0.xsd">' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '<Documento ID="'+ ALLTRIM(SF1->F1_SERIE2) + ALLTRIM(SF1->F1_DOC) +'">' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '<Encabezado>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <IdDoc>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Ambiente>' + _aTotal[007] + '</Ambiente>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <TipoEmision>NORMAL</TipoEmision>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <ContenidoTC></ContenidoTC>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Tipo>' + _aTotal[016] + '</Tipo>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Serie>' + Alltrim(SF1->F1_SERIE2) + '</Serie>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Numero>' + ALLTRIM(substr(SF1->F1_DOC,(_aTotal[009]-7),8)) + '</Numero>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Estado>ORIGINAL</Estado>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NumeroInterno>' + Alltrim(SF1->F1_DOC) + '</NumeroInterno>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <FechaEmis>' + _aTotal[011] + '</FechaEmis>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <CondPago>' + IIf(_aTotal[017] == "1","Contado","Credito") + '</CondPago>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </IdDoc>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Emisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <TipoContribuyente></TipoContribuyente>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <RegimenContable></RegimenContable>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <IDEmisor>' + Alltrim(SM0->M0_CGC) + '</IDEmisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NmbEmisor>' + Alltrim(SM0->M0_NOME) + '</NmbEmisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NombreEmisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <PrimerNombre>' + Alltrim(SM0->M0_NOMECOM) + '</PrimerNombre>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </NombreEmisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <FechaInicioActividades>2016-01-01</FechaInicioActividades>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <DomFiscal>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Calle>' + Alltrim(SM0->M0_ENDENT) + " " + Alltrim(SM0->M0_COMPENT) + '</Calle>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Departamento>' + Alltrim(SM0->M0_CIDENT) + '</Departamento>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Distrito>' + Alltrim(SM0->M0_CIDENT) + '</Distrito>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Ciudad>' + Alltrim(SM0->M0_CIDENT) + '</Ciudad>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Municipio>' + Alltrim(SM0->M0_CIDENT) + '</Municipio>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Pais>PE</Pais>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <CodigoPostal>' + ALLTRIM(SM0->M0_CEPENT) + '</CodigoPostal>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <GLN>' + Alltrim(SM0->M0_DSCCNA)+ '</GLN>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </DomFiscal>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <LugarExped>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Calle>' + Alltrim(SM0->M0_ENDENT) + " " + Alltrim(SM0->M0_COMPENT) + '</Calle>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </LugarExped>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </Emisor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Receptor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <DocRecep>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <TipoDocRecep>' + Alltrim(SA1->A1_TIPDOC) + '</TipoDocRecep>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NroDocRecep>' + IIF(Alltrim(SA1->A1_TIPDOC) $ "06",ALLTRIM(SA1->A1_CGC),IIF(_aTotal[013],"-",ALLTRIM(SA1->A1_PFISICA))) + '</NroDocRecep>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </DocRecep>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NmbRecep>' + Alltrim(SA1->A1_NOME) + '</NmbRecep>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += IIF(!Empty(SA1->A1_EMAIL),' <Contacto>' + ALLTRIM(SA1->A1_EMAIL) + '</Contacto>' + _aTotal[002],""),.T.) (PREREG) (_aTotal[001] += ' <DomFiscalRcp>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Calle>' + Alltrim(SA1->A1_END) + '</Calle>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Departamento>'+ fGetSX5("12" + SA1->A1_EST) + '</Departamento>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Distrito>' + alltrim(SA1->A1_BAIRRO) + '</Distrito>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Ciudad>' + alltrim(SA1->A1_BAIRRO) + '</Ciudad>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Municipio>' + alltrim(SA1->A1_MUN) + '</Municipio>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Pais>' + Alltrim(Posicione("SYA",1,xFilial("SYA") + SA1->A1_PAIS,"SYA->YA_CODERP")) + '</Pais>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <CodigoPostal>' + Alltrim(SA1->A1_CEP) + '</CodigoPostal>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <GLN>' + SA1->A1_GLN + '</GLN>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </DomFiscalRcp>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </Receptor>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Transporte>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <MedioTransporte>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <MetodoTransp>MetodoTransp</MetodoTransp>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </MedioTransporte>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </Transporte>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Totales>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Moneda>' + _aTotal[014] + '</Moneda>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <SubTotal>' + Alltrim(TRANSFORM(_aTotal[008][2], _aTotal[003])) + '</SubTotal>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += IIF(_aTotal[017] == "2",' <MntRet>' + Alltrim(TRANSFORM(_aTotal[018][2], _aTotal[003])) + '</MntRet>' + _aTotal[002],""),.T.) (PREREG) (_aTotal[001] += IIF(SF1->F1_DESCONT > 0,' <MntDcto>' + Alltrim(TRANSFORM(0, _aTotal[003])) + '</MntDcto>' + _aTotal[002],""),.T.) (PREREG) (_aTotal[001] += ' <VlrPagar>' + Alltrim(TRANSFORM(IiF(!_aTotal[008][3],SF1->F1_VALBRUT,0), _aTotal[003])) + '</VlrPagar>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <VlrPalabras>' + IIF(!_aTotal[008][3],EXTENSO(SF1->F1_VALBRUT,.f.,SF1->F1_MOEDA), fCero2Txt(SF1->F1_MOEDA))+ '</VlrPalabras>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <MontoPropina>0.00</MontoPropina>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += _aTotal[008][4],.T.) (PREREG) (_aTotal[001] += ' </Totales>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += _aTotal[008][5],.T.) (PREREG) (_aTotal[001] += '</Encabezado>' + _aTotal[002],.T.) [SD1 INVOICE] (PRE) DbGoTop() (PREREG) (SB1->(DbSeek(xFilial("SB1") + SD1->D1_COD)),.T.) (PREREG) (SAH->(DbSeek(xFilial("SAH") + SB1->B1_UM)),.T.) (PREREG) _aTotal[012] := M485GetRef( SD1->D1_NFORI, SD1->D1_SERIORI, SF1->F1_FORNECE, SF1->F1_LOJA,SF1->F1_ESPECIE,.f.,SF1->F1_MOTIVO,SF1->F1_TIPREF) (PREREG) _aTotal[010] := M485DETIMP(SD1->D1_SERIE,SD1->D1_FORNECE,SD1->D1_LOJA,SD1->D1_DOC,SD1->D1_ITEM,SF1->F1_ESPECIE,SD1->D1_COD, 0) (PREREG) _aTotal[015] := Posicione("SAH",1,xFilial("SAH")+ SB1->B1_UM,"AH_COD_CO") (PREREG) (_aTotal[001] += '<Detalle>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NroLinDet>' + Alltrim(SD1->D1_ITEM) + '</NroLinDet>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <CdgItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <TpoCodigo>' + Alltrim(SB1->B1_PRODSAT) + '</TpoCodigo>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <VlrCodigo>' + Alltrim(SB1->B1_COD) + '</VlrCodigo>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' </CdgItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <IndExe>1</IndExe>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <DscLang>ES</DscLang>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <DscItem>' + Alltrim(SB1->B1_DESC) + '</DscItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <QtyItem>' + Alltrim(TRANSFORM(SD1->D1_QUANT,_aTotal[003])) + '</QtyItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <UnmdItem>' + _aTotal[015] + '</UnmdItem>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <PrcBrutoItem>' + Alltrim(TRANSFORM(IIF(!_aTotal[010][7],_aTotal[010][4]/SD1->D1_QUANT,0),_aTotal[003])) + '</PrcBrutoItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <PrcNetoItem>' + Alltrim(TRANSFORM(_aTotal[010][2],_aTotal[003])) + '</PrcNetoItem>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <DescuentoMonto>' + Alltrim(TRANSFORM(0,_aTotal[003])) + '</DescuentoMonto>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += _aTotal[010][3],.T.) (PREREG) (_aTotal[001] += _aTotal[010][5],.T.) (PREREG) (_aTotal[001] += ' <MontoBrutoItem>' + ALLTRIM(TRANSFORM(_aTotal[010][4] ,_aTotal[003])) +'</MontoBrutoItem>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <MontoNetoItem>' + ALLTRIM(TRANSFORM(_aTotal[010][2]*SD1->D1_QUANT,_aTotal[003])) +'</MontoNetoItem>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <MontoTotalItem>' + ALLTRIM(TRANSFORM(_aTotal[010][4] ,_aTotal[003])) +'</MontoTotalItem>'+ _aTotal[002],.T.) (PREREG) (_aTotal[001] += _aTotal[010][6],.T.) (PREREG) (_aTotal[001] += '</Detalle>' + _aTotal[002],.T.) [XXX INVOICE_FIN] (PREREG) (_aTotal[001] += IIF(_aTotal[017] == "2",_aTotal[018][1],""),.T.) (PREREG) (_aTotal[001] += _aTotal[012],.T.) (PREREG) (_aTotal[001] += '<CAE>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <Tipo>String</Tipo>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NumeroInicial>' + Alltrim(SF1->F1_DOC) + '</NumeroInicial>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NumeroFinal>' + Alltrim(SF1->F1_DOC) + '</NumeroFinal>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <NroResolucion>' + Alltrim(SF1->F1_DOC) + '</NroResolucion>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += ' <FechaResolucion>' + Substr(_aTotal[011],1,10) + '</FechaResolucion>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '</CAE>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '<TimeStamp>' + _aTotal[011] + '</TimeStamp>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '</Documento>' + _aTotal[002],.T.) (PREREG) (_aTotal[001] += '</DTE>',.T.) (PREREG) ENCODEUTF8(_aTotal[001]) (POS) FsQuery(_aTotal[004],2) [XXX FACTURA] (PRE) _aTotal[094] := _aTotal[006] + ".XML" (ARQ) _aTotal[094] |