Pesquisar na Comunidade
Showing results for tags 'ct-e 3.00'.
Encontrado 1 registro
-
Estou implantando o CT-e 3.00 em meu sistema, tive que fazer algumas alterações no componente para evitar alguns erros sobre os Schemas da Versão 3.00. Segue as alterações feitas: "pcteCTe" Alterado de: TNatCarga = class(TPersistent) private FxDime : String; FcinfManu : Integer; // Alterar para ser uma lista FcIMP : String; // Alterar para ser uma lista public property xDime: String read FxDime write FxDime; property cinfManu: Integer read FcinfManu write FcinfManu; property cIMP: String read FcIMP write FcIMP; end; para: TNatCarga = class(TPersistent) private FxDime : String; FcinfManu : TpInfManu; FcIMP : String; // Alterar para ser uma lista public property xDime: String read FxDime write FxDime; property cinfManu: TpInfManu read FcinfManu write FcinfManu; property cIMP: String read FcIMP write FcIMP; end; "pcteCTeR" Alterado de: if Leitor.rExtrai(3, 'natCarga') <> '' then begin CTe.infCTeNorm.aereo.natCarga.xDime := Leitor.rCampo(tcStr,'xDime'); CTe.infCTeNorm.aereo.natCarga.cinfManu := Leitor.rCampo(tcInt,'cInfManu'); CTe.infCTeNorm.aereo.natCarga.cIMP := Leitor.rCampo(tcStr,'cIMP'); end; para: if Leitor.rExtrai(3, 'natCarga') <> '' then begin CTe.infCTeNorm.aereo.natCarga.xDime := Leitor.rCampo(tcStr,'xDime'); CTe.infCTeNorm.aereo.natCarga.cinfManu := StrToTpInfManu(ok, Leitor.rCampo(tcStr,'cInfManu')); CTe.infCTeNorm.aereo.natCarga.cIMP := Leitor.rCampo(tcStr,'cIMP'); end; "pcteCTeW" a procedure "GerarAereo" foi Alterado de: Gerador.wGrupo('tarifa', '#07'); Gerador.wCampo(tcStr, '#08', 'CL ', 01, 02, 0, CTe.infCTeNorm.aereo.tarifa.CL, DSC_CL); Gerador.wCampo(tcStr, '#09', 'cTar ', 01, 04, 0, CTe.infCTeNorm.aereo.tarifa.cTar, DSC_CTAR); Gerador.wCampo(tcDe2, '#10', 'vTar ', 01, 15, 0, CTe.infCTeNorm.aereo.tarifa.vTar, DSC_VTAR); Gerador.wGrupo('/tarifa'); if (trim(CTe.infCTeNorm.aereo.natCarga.xDime) <> '') or (CTe.infCTeNorm.aereo.natCarga.cinfManu <> 0) or (trim(CTe.infCTeNorm.aereo.natCarga.cImp) <> '') then begin Gerador.wGrupo('natCarga', '#11'); Gerador.wCampo(tcStr, '#12', 'xDime ', 05, 14, 0, CTe.infCTeNorm.aereo.natCarga.xDime, DSC_XDIME); Gerador.wCampo(tcInt, '#13', 'cInfManu', 01, 02, 0, CTe.infCTeNorm.aereo.natCarga.cinfManu, DSC_CINFMANU); Gerador.wCampo(tcStr, '#14', 'cIMP ', 03, 03, 0, CTe.infCTeNorm.aereo.natCarga.cIMP, DSC_CIMP); Gerador.wGrupo('/natCarga'); para: if CTe.infCTe.versao >= 3 then begin if (trim(CTe.infCTeNorm.aereo.natCarga.xDime) <> '') or (TpInfManuToStr(CTe.infCTeNorm.aereo.natCarga.cinfManu) <> '') then begin Gerador.wGrupo('natCarga', '#11'); Gerador.wCampo(tcStr, '#12', 'xDime ', 05, 14, 0, CTe.infCTeNorm.aereo.natCarga.xDime, DSC_XDIME); Gerador.wCampo(tcInt, '#13', 'cInfManu', 02, 02, 0, TpInfManuToStr(CTe.infCTeNorm.aereo.natCarga.cinfManu), DSC_CINFMANU); Gerador.wGrupo('/natCarga'); end; Gerador.wGrupo('tarifa', '#07'); Gerador.wCampo(tcStr, '#08', 'CL ', 01, 02, 0, CTe.infCTeNorm.aereo.tarifa.CL, DSC_CL); Gerador.wCampo(tcStr, '#09', 'cTar ', 01, 04, 0, CTe.infCTeNorm.aereo.tarifa.cTar, DSC_CTAR); Gerador.wCampo(tcDe2, '#10', 'vTar ', 01, 15, 0, CTe.infCTeNorm.aereo.tarifa.vTar, DSC_VTAR); Gerador.wGrupo('/tarifa'); end else begin Gerador.wGrupo('tarifa', '#07'); Gerador.wCampo(tcStr, '#08', 'CL ', 01, 02, 0, CTe.infCTeNorm.aereo.tarifa.CL, DSC_CL); Gerador.wCampo(tcStr, '#09', 'cTar ', 01, 04, 0, CTe.infCTeNorm.aereo.tarifa.cTar, DSC_CTAR); Gerador.wCampo(tcDe2, '#10', 'vTar ', 01, 15, 0, CTe.infCTeNorm.aereo.tarifa.vTar, DSC_VTAR); Gerador.wGrupo('/tarifa'); if (trim(CTe.infCTeNorm.aereo.natCarga.xDime) <> '') or (TpInfManuToStr(CTe.infCTeNorm.aereo.natCarga.cinfManu) <> '') or (trim(CTe.infCTeNorm.aereo.natCarga.cImp) <> '') then begin Gerador.wGrupo('natCarga', '#11'); Gerador.wCampo(tcStr, '#12', 'xDime ', 05, 14, 0, CTe.infCTeNorm.aereo.natCarga.xDime, DSC_XDIME); Gerador.wCampo(tcInt, '#13', 'cInfManu', 01, 02, 0, TpInfManuToStr(CTe.infCTeNorm.aereo.natCarga.cinfManu), DSC_CINFMANU); Gerador.wCampo(tcStr, '#14', 'cIMP ', 03, 03, 1, CTe.infCTeNorm.aereo.natCarga.cIMP, DSC_CIMP); Gerador.wGrupo('/natCarga'); end; procedure "GerarAquav" foi Alterado de: procedure TCTeW.GerarAquav; var i, j: Integer; begin Gerador.wGrupo('aquav', '#01'); Gerador.wCampo(tcDe2, '#02', 'vPrest ', 01, 15, 1, CTe.infCTeNorm.aquav.vPrest, DSC_VPREST); Gerador.wCampo(tcDe2, '#03', 'vAFRMM ', 01, 15, 1, CTe.infCTeNorm.aquav.vAFRMM, DSC_VAFRMM); Gerador.wCampo(tcStr, '#04', 'nBooking ', 01, 10, 0, CTe.infCTeNorm.aquav.nBooking, DSC_NBOOKING); Gerador.wCampo(tcStr, '#05', 'nCtrl ', 01, 10, 0, CTe.infCTeNorm.aquav.nCtrl, DSC_NCTRL); Gerador.wCampo(tcStr, '#06', 'xNavio ', 01, 60, 1, CTe.infCTeNorm.aquav.xNavio, DSC_XNAVIO); ... Gerador.wCampo(tcStr, '#09', 'nViag ', 01, 10, 0, CTe.infCTeNorm.aquav.nViag, DSC_NVIAG); Gerador.wCampo(tcStr, '#10', 'direc ', 01, 01, 1, TpDirecaoToStr(CTe.infCTeNorm.aquav.direc), DSC_DIREC); Gerador.wCampo(tcStr, '#11', 'prtEmb ', 01, 60, 0, CTe.infCTeNorm.aquav.prtEmb, DSC_PRTEMB); Gerador.wCampo(tcStr, '#12', 'prtTrans ', 01, 60, 0, CTe.infCTeNorm.aquav.prtTrans, DSC_PRTTRANS); Gerador.wCampo(tcStr, '#13', 'prtDest ', 01, 60, 0, CTe.infCTeNorm.aquav.prtDest, DSC_PRTDEST); Gerador.wCampo(tcStr, '#14', 'tpNav ', 01, 01, 1, TpNavegacaoToStr(CTe.infCTeNorm.aquav.tpNav), DSC_TPNAV); Gerador.wCampo(tcStr, '#15', 'irin ', 01, 10, 1, CTe.infCTeNorm.aquav.irin, DSC_IRIN); para: procedure TCTeW.GerarAquav; var i, j: Integer; begin Gerador.wGrupo('aquav', '#01'); Gerador.wCampo(tcDe2, '#02', 'vPrest ', 01, 15, 1, CTe.infCTeNorm.aquav.vPrest, DSC_VPREST); Gerador.wCampo(tcDe2, '#03', 'vAFRMM ', 01, 15, 1, CTe.infCTeNorm.aquav.vAFRMM, DSC_VAFRMM); if (CTe.infCTe.versao = 2) then begin Gerador.wCampo(tcStr, '#04', 'nBooking ', 01, 10, 0, CTe.infCTeNorm.aquav.nBooking, DSC_NBOOKING); Gerador.wCampo(tcStr, '#05', 'nCtrl ', 01, 10, 0, CTe.infCTeNorm.aquav.nCtrl, DSC_NCTRL); end; Gerador.wCampo(tcStr, '#06', 'xNavio ', 01, 60, 1, CTe.infCTeNorm.aquav.xNavio, DSC_XNAVIO); ... Gerador.wCampo(tcStr, '#09', 'nViag ', 01, 10, 0, CTe.infCTeNorm.aquav.nViag, DSC_NVIAG); Gerador.wCampo(tcStr, '#10', 'direc ', 01, 01, 1, TpDirecaoToStr(CTe.infCTeNorm.aquav.direc), DSC_DIREC); if (CTe.infCTe.versao = 2) then begin Gerador.wCampo(tcStr, '#11', 'prtEmb ', 01, 60, 0, CTe.infCTeNorm.aquav.prtEmb, DSC_PRTEMB); Gerador.wCampo(tcStr, '#12', 'prtTrans ', 01, 60, 0, CTe.infCTeNorm.aquav.prtTrans, DSC_PRTTRANS); Gerador.wCampo(tcStr, '#13', 'prtDest ', 01, 60, 0, CTe.infCTeNorm.aquav.prtDest, DSC_PRTDEST); Gerador.wCampo(tcStr, '#14', 'tpNav ', 01, 01, 1, TpNavegacaoToStr(CTe.infCTeNorm.aquav.tpNav), DSC_TPNAV); end; Gerador.wCampo(tcStr, '#15', 'irin ', 01, 10, 1, CTe.infCTeNorm.aquav.irin, DSC_IRIN); "pcnConversao" Foi adicionado as seguintes funções: TpInfManu = (imCEEAV, imAPCDEA, imSAC, imAPDENR, imAPQI, imGSR, imNR, imAPCC, imAAGA, imPI965, imPI966, imPI967, imPI968, imPI969, imPI970, imOUTRO); function TpInfManuToStr(const t: TpInfManu): string; function StrToTpInfManu(out ok: boolean; const s: string): TpInfManu; function TpInfManuToStr(const t: TpInfManu): string; begin result := EnumeradoToStr(t, ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','99'], [imCEEAV, imAPCDEA, imSAC, imAPDENR, imAPQI, imGSR, imNR, imAPCC, imAAGA, imPI965, imPI966, imPI967, imPI968, imPI969, imPI970, imOUTRO]); end; function StrToTpInfManu(out ok: boolean; const s: string): TpInfManu; begin result := StrToEnumerado(ok, s, ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','99'], [imCEEAV, imAPCDEA, imSAC, imAPDENR, imAPQI, imGSR, imNR, imAPCC, imAAGA, imPI965, imPI966, imPI967, imPI968, imPI969, imPI970, imOUTRO]); end; em Anexo as UNIT's Alteradas. E um fr3 alterado para a Versão 3.00, já com os campos sobre vale pedágio, veículos, motorista e outros campos removidos conforme o Manual de Ve300. att José Suzano Simione pcteCTe.pas pcteCTeR.pas pcteCTeW.pas pcnConversao.pas