Usando acbrnfe na UDM
Ola,
Para ficar mais facil estou colocando todos os componentes do Acbrnfe na minha UDM.
Algumas rotinas funcionaram bem, mas tem uma em especial que nao funciona
Se faco a consulta desse jeito da erro de schemas
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
nota := ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I];
dm.ACBrNFe.WebServices.Consulta.NFeChave := COPY(Xmls.Items.Strings[I], 1, length(Xmls.Items.Strings[I]) - 4);//ACBrNFe.NotasFiscais.Items[0].XML.NFeChave;
dm.ACBrNFe.WebServices.Consulta.Executar;
Se faco deste jeito da mensagem Nota Fiscal Eletronica na encontrada!
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
DM.ACBrNFe.NotasFiscais.Clear;
DM.ACBrNFe.NotasFiscais.LoadFromFile(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]);
DM.ACBrNFe.Consultar;
Tem algum problema colocar o componente em outro form, pq esta rotina estava funcionando da seguinte forma, eu so acrecentei dm.
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
ACBrNFe.NotasFiscais.Clear;
ACBrNFe.NotasFiscais.LoadFromFile(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]);
ACBrNFe.Consultar;
Para ficar mais facil estou colocando todos os componentes do Acbrnfe na minha UDM.
Algumas rotinas funcionaram bem, mas tem uma em especial que nao funciona
Se faco a consulta desse jeito da erro de schemas
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
nota := ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I];
dm.ACBrNFe.WebServices.Consulta.NFeChave := COPY(Xmls.Items.Strings[I], 1, length(Xmls.Items.Strings[I]) - 4);//ACBrNFe.NotasFiscais.Items[0].XML.NFeChave;
dm.ACBrNFe.WebServices.Consulta.Executar;
Se faco deste jeito da mensagem Nota Fiscal Eletronica na encontrada!
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
DM.ACBrNFe.NotasFiscais.Clear;
DM.ACBrNFe.NotasFiscais.LoadFromFile(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]);
DM.ACBrNFe.Consultar;
Tem algum problema colocar o componente em outro form, pq esta rotina estava funcionando da seguinte forma, eu so acrecentei dm.
if chavef = nxmlf then
begin
if FileExists(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]) then
begin
ACBrNFe.NotasFiscais.Clear;
ACBrNFe.NotasFiscais.LoadFromFile(ExtractFilePath(Application.ExeName)+'NFE\'+TRIM(DM.qEmpresaCNPJ.VALUE)+ '\' + FormatDateTime('YYYYMM', QRYDATAEMISSAO.AsDateTime)+ '\'+Xmls.Items.Strings[I]);
ACBrNFe.Consultar;
Alessandro Pancotte
Curtidas 0