Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

ipomeno

Validar NFSe Salvador com PHP

Recommended Posts

Pessoal estou tentando validar um XML gerado para NFSe com PHP.

Estou usando DOMDocument::schemaValidate, mas sempre retorna a mensagem Element 'EnviarLoteRpsEnvio': No matching global declaration available for the validation root.

 

Sei que o problema deve estar nos cabeçalhos do XSD e do XML. Não estou conseguindo ajustar a referência nos dois arquivos.

 

O cabeçalho no XML está assim:

<?xml version="1.0" encoding="UTF-8"?><EnviarLoteRpsEnvio xmlns="http://www.abrasf.org.br" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abrasf.org.br nfse_salvador.xsd">

O cabeçalho no XSD está assim:

 

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.abrasf.org.br"
            xmlns="http://www.abrasf.org.br"
            xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
            attributeFormDefault="unqualified"
            elementFormDefault="qualified">

Será que alguém pode me ajudar?

 

Se precisarem de mais informações, estou deixando os documentos XML e XSD.

 

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.abrasf.org.br"
            xmlns="http://www.abrasf.org.br"
            xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
            attributeFormDefault="unqualified"
            elementFormDefault="qualified">
    <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema20020212.xsd"/>


    <!-- definition of simple elements -->
    <xsd:simpleType name="tsNumeroNfse">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoVerificacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="9"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsStatusRps">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsStatusNfse">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNaturezaOperacao">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2|3|4|5|6"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsRegimeEspecialTributacao">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2|3|4|5|6"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsSimNao">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroRps">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsSerieRps">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="5"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsTipoRps">
        <xsd:restriction base="xsd:byte">
            <!--  ALTERADO POR SALVADOR
MOTIVO: Validando apenas opcao 1 (RPS).
<xsd:pattern value="1|2|3"/> -->
            <xsd:pattern value="1"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsOutrasInformacoes">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsValor">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="15"/>
            <xsd:fractionDigits value="2" fixed="true"/>
            <xsd:minInclusive value="0"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsItemListaServico">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="5"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoCnae">
        <xsd:restriction base="xsd:int">
            <xsd:totalDigits value="7"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoTributacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="20"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsAliquota">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="5"/>
            <xsd:fractionDigits value="4"/>
            <xsd:minInclusive value="0"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsDiscriminacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="2000"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoMunicipioIbge">
        <xsd:restriction base="xsd:int">
            <xsd:totalDigits value="7"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsInscricaoMunicipal">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
<xsd:minLength value="1"/>
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
        <!--  
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
-->
    </xsd:simpleType>
    <xsd:simpleType name="tsRazaoSocial">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="115"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNomeFantasia">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCnpj">
        <!--  ALTERADO POR SALVADOR
MOTIVO: CNPJ aceita so numeros
<xsd:restriction base="xsd:string">
<xsd:length value="14" fixed="true"/>
<xsd:whiteSpace value="collapse"/>
</xsd:restriction> -->
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="14"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="125"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="10"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsComplementoEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsBairro">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsUf">
        <xsd:restriction base="xsd:string">
            <xsd:length value="2" fixed="true"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCep">
        <xsd:restriction base="xsd:int">
            <xsd:totalDigits value="8" fixed="true"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsEmail">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="80"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsTelefone">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="11"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCpf">
        <!--  ALTERADO POR SALVADOR
MOTIVO: CPF aceita so numeros
<xsd:restriction base="xsd:string">
<xsd:length value="11" fixed="true"/>
</xsd:restriction> -->
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="11"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsIndicacaoCpfCnpj">
        <xsd:restriction base="xsd:byte">
            <!--  ALTERADO POR SALVADOR
MOTIVO: Nao aceita opcao 3 (Nao informado).
<xsd:pattern value="1|2|3"/> -->
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
<xsd:simpleType name="tsCodigoObra">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
<xsd:minLength value="1"/>
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
    <xsd:simpleType name="tsArt">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="15"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroLote">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroProtocolo">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="50"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsSituacaoLoteRps">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2|3|4"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsQuantidadeRps">
        <xsd:restriction base="xsd:int">
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsDescricaoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="200"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoCancelamentoNfse">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"/>
            <xsd:minLength value="1"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsIdTag">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
        </xsd:restriction>
    </xsd:simpleType>


    <!-- definition of complex elements -->


    <xsd:complexType name="tcCpfCnpj">
        <xsd:choice>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: CNPJ é opcional quando tomador estrangeiro.
            <xsd:element name="Cpf" type="tsCpf" minOccurs="1" maxOccurs="1"/> -->
            <xsd:element name="Cpf" type="tsCpf" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
    </xsd:complexType>
    <xsd:complexType name="tcEndereco">
        <xsd:sequence>
            <xsd:element name="Endereco" type="tsEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Numero" type="tsNumeroEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Complemento" type="tsComplementoEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Bairro" type="tsBairro" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Uf" type="tsUf" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Cep" type="tsCep" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcContato">
        <xsd:sequence>
            <xsd:element name="Telefone" type="tsTelefone" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Email" type="tsEmail" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoOrgaoGerador">
        <xsd:sequence>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Uf" type="tsUf" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoRps">
        <xsd:sequence>
            <xsd:element name="Numero" type="tsNumeroRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Serie" type="tsSerieRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Tipo" type="tsTipoRps" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoPrestador">
        <xsd:sequence>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Inscricao Municipal obrigatoria.
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/> -->
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoTomador">
        <xsd:sequence>
            <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcDadosTomador">
        <xsd:sequence>
            <xsd:element name="IdentificacaoTomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Razao Social obrigatorio.
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="0" maxOccurs="1"/> -->
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Endereco" type="tcEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoIntermediarioServico">
        <xsd:sequence>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcValores">
        <xsd:sequence>
            <xsd:element name="ValorServicos" type="tsValor" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ValorDeducoes" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorPis" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorCofins" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorInss" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorIr" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorCsll" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="IssRetido" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ValorIss" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorIssRetido" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OutrasRetencoes" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="BaseCalculo" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Aliquota" type="tsAliquota" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorLiquidoNfse" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="DescontoIncondicionado" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="DescontoCondicionado" type="tsValor" minOccurs="0" maxOccurs="1"/> 
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcDadosServico">
        <xsd:sequence>
            <xsd:element name="Valores" type="tcValores" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ItemListaServico" type="tsItemListaServico" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoCnae" type="tsCodigoCnae" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoTributacaoMunicipio" type="tsCodigoTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Discriminacao" type="tsDiscriminacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcDadosConstrucaoCivil">
        <xsd:sequence>
            <xsd:element name="CodigoObra" type="tsCodigoObra" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Art" type="tsArt" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcDadosPrestador">
        <xsd:sequence>
            <xsd:element name="IdentificacaoPrestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NomeFantasia" type="tsNomeFantasia" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Endereco" type="tcEndereco" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcInfRps">
        <xsd:sequence>
            <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IncentivadorCultural" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Status" type="tsStatusRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RpsSubstituido" type="tcIdentificacaoRps" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Tomador obrigatório
            <xsd:element name="Tomador" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/> -->
            <xsd:element name="Tomador" type="tcDadosTomador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ContrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
        <!--  ALTERADO POR SALVADOR
   MOTIVO: ID obrigatorio
        <xsd:attribute name="id" type="tsIdTag" use="required"/>-->
        <xsd:attribute name="id" type="tsIdTag"/>
    </xsd:complexType>
    <xsd:complexType name="tcRps">
        <xsd:sequence>
            <xsd:element name="InfRps" type="tcInfRps" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
   MOTIVO: Assinatura nao obrigatoria para os lotes gerados através do ReciboNet(Consultoria)
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/> -->
            <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoNfse">
        <xsd:sequence>
            <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcInfNfse">
        <xsd:sequence>
            <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoVerificacao" type="tsCodigoVerificacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IdentificacaoRps" minOccurs="0" type="tcIdentificacaoRps" maxOccurs="1"/>
            <xsd:element name="DataEmissaoRps" type="xsd:date" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IncentivadorCultural" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Competencia" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NfseSubstituida" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Campo não usado.
            <xsd:element name="ValorCredito" type="tsValor" minOccurs="0" maxOccurs="1"/>-->
            <xsd:element name="PrestadorServico" type="tcDadosPrestador" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Tomador obrigatório
            <xsd:element name="TomadorServico" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/> -->
            <xsd:element name="TomadorServico" type="tcDadosTomador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OrgaoGerador" type="tcIdentificacaoOrgaoGerador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ContrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/> 
        </xsd:sequence>
        <!--  ALTERADO POR SALVADOR
   MOTIVO: ID obrigatorio.
        <xsd:attribute name="id" type="tsIdTag"/>-->
        <xsd:attribute name="id" type="tsIdTag" use="required" />
    </xsd:complexType>
    <xsd:complexType name="tcNfse">
        <xsd:sequence>
            <xsd:element name="InfNfse" type="tcInfNfse" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
   MOTIVO: Maximo de uma assinatura
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/> -->
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>


    <!--  ALTERADO POR SALVADOR
MOTIVO: Cancelamento somente por processo administrativo
    <xsd:complexType name="tcInfPedidoCancelamento">
        <xsd:sequence>
            <xsd:element name="IdentificacaoNfse" type="tcIdentificacaoNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoNfse" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"/>
    </xsd:complexType>
    <xsd:complexType name="tcPedidoCancelamento">
        <xsd:sequence>
            <xsd:element name="InfPedidoCancelamento" type="tcInfPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcConfirmacaoCancelamento">
        <xsd:sequence>
            <xsd:element name="Pedido" type="tcPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataHoraCancelamento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"/>
    </xsd:complexType>


    <xsd:complexType name="tcCancelamentoNfse">
        <xsd:sequence>
            <xsd:element name="Confirmacao" type="tcConfirmacaoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType> -->


    <xsd:complexType name="tcInfSubstituicaoNfse">
        <xsd:sequence>
            <xsd:element name="NfseSubstituidora" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
        <!--  ALTERADO POR SALVADOR
   MOTIVO: ID obrigatorio.
        <xsd:attribute name="id" type="tsIdTag"/>-->
        <xsd:attribute name="id" type="tsIdTag" use="required" />
    </xsd:complexType>
    <xsd:complexType name="tcSubstituicaoNfse">
        <xsd:sequence>
            <xsd:element name="SubstituicaoNfse" type="tcInfSubstituicaoNfse" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
   MOTIVO: Maximo de uma assinatura
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/> -->
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcCompNfse">
        <xsd:sequence>
            <xsd:element name="Nfse" type="tcNfse" minOccurs="1" maxOccurs="1"/>
            <!--  ALTERADO POR SALVADOR
       MOTIVO: Cancelamento somente por processo adminsitrativo
            <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse" minOccurs="0" maxOccurs="1"/> -->
            <xsd:element name="NfseSubstituicao" type="tcSubstituicaoNfse" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="CompNfse" type="tcCompNfse"/>
    <xsd:element name="ListaMensagemRetorno">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="MensagemRetorno" type="tcMensagemRetorno" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:complexType name="tcMensagemRetorno">
        <xsd:sequence>
            <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Correcao" type="tsDescricaoMensagemAlerta" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcMensagemRetornoLote">
        <xsd:sequence>
            <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcLoteRps">
        <xsd:sequence>
            <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="QuantidadeRps" type="tsQuantidadeRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ListaRps" minOccurs="1" maxOccurs="1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Rps" maxOccurs="unbounded" type="tcRps" minOccurs="1">
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
        <!--  ALTERADO POR SALVADOR
   MOTIVO: ID obrigatorio.
        <xsd:attribute name="id" type="tsIdTag" use="required"/>-->
        <xsd:attribute name="id" type="tsIdTag"/>
    </xsd:complexType>


    <xsd:element name="EnviarLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="DataRecebimento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="EnviarLoteRpsEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <!--  ALTERADO POR SALVADOR
   MOTIVO: Lote obrigatorio.
       <xsd:element name="LoteRps" type="tcLoteRps"/> -->
                <xsd:element name="LoteRps" type="tcLoteRps" minOccurs="1" maxOccurs="1"/>
                <!--  ALTERADO POR SALVADOR
   MOTIVO: Assinatura nao obrigatoria para os lotes gerados através do ReciboNet(Consultoria).
       <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/> -->
                <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
            </xsd:sequence>
<xsd:attribute name="rnh" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarSituacaoLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="Situacao" type="tsSituacaoLoteRps" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarSituacaoLoteRpsEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarNfseRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="CompNfse" type="tcCompNfse" minOccurs="1" maxOccurs="1"/>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarNfseRpsEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarNfseResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="CompNfse" maxOccurs="unbounded" type="tcCompNfse" minOccurs="0"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarNfseEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="NumeroNfse" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="PeriodoEmissao" minOccurs="0" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="DataInicial" type="xsd:date" minOccurs="1" maxOccurs="1"/>
                            <xsd:element name="DataFinal" type="xsd:date" minOccurs="1" maxOccurs="1"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="CompNfse" maxOccurs="unbounded" type="tcCompNfse" minOccurs="1"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="ConsultarLoteRpsEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>


    <!--  ALTERADO POR SALVADOR
MOTIVO: Cancelamento somente por processo administrativo
    <xsd:element name="CancelarNfseResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="Cancelamento" type="tcCancelamentoNfse"/>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>


    <xsd:element name="CancelarNfseEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Pedido" type="tcPedidoCancelamento"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element> -->
</xsd:schema>

O arquivo XML...

<?xml version="1.0" encoding="UTF-8"?>
<EnviarLoteRpsEnvio xmlns="http://www.abrasf.org.br" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abrasf.org.br nfse_salvador.xsd">
  <LoteRps id="200">
    <NumeroLote>201500000000001</NumeroLote>
    <Cnpj>06071725000157</Cnpj>
    <InscricaoMunicipal>500008712345678</InscricaoMunicipal>
    <QuantidadeRps>1</QuantidadeRps>
    <ListaRps>
      <Rps>
        <InfRps id="200">
          <IdentificacaoRps>
            <Numero>201500000000001</Numero>
            <Serie>C4DR3</Serie>
            <Tipo>1</Tipo>
          </IdentificacaoRps>
          <DataEmissao>2015-09-06T17:09:06</DataEmissao>
          <NaturezaOperacao>1</NaturezaOperacao>
          <OptanteSimplesNacional>1</OptanteSimplesNacional>
          <IncentivadorCultural>1</IncentivadorCultural>
          <Status>1</Status>
          <Servico>
            <Valores>
              <ValorServicos>1000.00</ValorServicos>
              <IssRetido>2</IssRetido>
            </Valores>
            <ItemListaServico>10100</ItemListaServico>
            <Discriminacao>Teste de emissao no sistema de homologacao de NFS-e 1</Discriminacao>
            <CodigoMunicipio>3305802</CodigoMunicipio>
          </Servico>
          <Prestador>
            <Cnpj>06071725000157</Cnpj>
            <InscricaoMunicipal>500008790283765</InscricaoMunicipal>
          </Prestador>
          <Tomador>
            <RazaoSocial>Tomador Exemplo</RazaoSocial>
          </Tomador>
        </InfRps>
        <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
          <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <Reference URI="#200">
              <Transforms>
                <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
              </Transforms>
              <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
              <DigestValue>2jmj7l5rSw0yVb/vlWAYkK/YBwk=</DigestValue>
            </Reference>
          </SignedInfo>
          <SignatureValue>...</SignatureValue>
          <KeyInfo>
            <X509Data>
              <X509Certificate>...</X509Certificate>
            </X509Data>
          </KeyInfo>
        </Signature>
      </Rps>
    </ListaRps>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
      <SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <Reference URI="#200">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
          <DigestValue>2jmj7l5rSw0yVb/vlWAYkK/YBwk=</DigestValue>
        </Reference>
      </SignedInfo>
      <SignatureValue>...</SignatureValue>
      <KeyInfo>
        <X509Data>
          <X509Certificate>...</X509Certificate>
        </X509Data>
      </KeyInfo>
    </Signature>
  </LoteRps>
</EnviarLoteRpsEnvio>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por daemon
      Boa tarde,
       
      Eu tenho uma rotina que faz uma leitura do arquivo .xml de vários sites.

      Eu consigo pegar o tópico e a descrição, e mostrar a imagem que esta na pagina do link.
      Para isso utilizo esta função:
      function getPreviewImage($url) { // Obter o conteúdo da página $html = file_get_contents($url); // Criar um novo objeto DOMDocument $doc = new DOMDocument(); @$doc->loadHTML($html); // Procurar pela tag meta og:image $tags = $doc->getElementsByTagName('meta'); foreach ($tags as $tag) { if ($tag->getAttribute('property') == 'og:image') { return $tag->getAttribute('content'); } } // Se não encontrar og:image, procurar pela primeira imagem na página $tags = $doc->getElementsByTagName('img'); if ($tags->length > 0) { return $tags->item(0)->getAttribute('src'); } // Se não encontrar nenhuma imagem, retornar null return null; } // Uso: $url = "https://example.com/article"; $imageUrl = getPreviewImage($url); if ($imageUrl) { echo "<img src='$imageUrl' alt='Preview'>"; } else { echo "Nenhuma imagem encontrada"; }  
      Mas estou com um problema, esta funcão funciona quando coloco em uma pagina de teste.php. Preciso mostrar em uma página inicial diversas fotos de todos os links. (No caso acima só funciona 1).
    • Por violin101
      Caros amigos, saudações.
       
      Por favor, me permita tirar uma dúvida com os amigos.

      Tenho um Formulário onde o Usuário digita todos os Dados necessários.

      Minha dúvida:
      --> como faço após o usuário digitar os dados e salvar, o Sistema chamar uma Modal ou mensagem perguntando se deseja imprimir agora ?

      Grato,
       
      Cesar
    • Por Carcleo
      Tenho uma abela de usuarios e uma tabela de administradores e clientes.
      Gostaria de uma ajuda para implementar um cadastro
       
      users -> name, login, passord (pronta) admins -> user_id, registratiom, etc.. client -> user_id, registratiom, etc...
      Queria ajuda para extender de user as classes Admin e Client
      Olhem como estáAdmin
      <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Admin extends User {     use HasFactory;            protected $fillable = [         'name',         'email',         'password',         'registration'     ];      private string $registration;     public function create(         string $name,          string $email,          string $password,         string $registration     )     {         //parent::create(['name'=>$name, 'email'=>$email, 'password'=>$password]);         parent::$name = $name;         parent::$email = $email;         parent::$password = $password;         $this->registration = $registration;     } } User
      <?php namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Database\Eloquent\Relations\BelongsToMany; class User extends Authenticatable {     /** @use HasFactory<\Database\Factories\UserFactory> */     use HasFactory, Notifiable;     static string $name;     static string $email;     static string $password;     /**      * The attributes that are mass assignable.      *      * @var list<string>      */     protected $fillable = [         'name',         'email',         'password',     ];          /**      * The attributes that should be hidden for serialization.      *      * @var list<string>      */     protected $hidden = [         'remember_token',     ];     /**      * Get the attributes that should be cast.      *      * @return array<string, string>      */     protected function casts(): array     {         return [             'email_verified_at' => 'datetime',             'password' => 'hashed',         ];     }          public function roles() : BelongsToMany {         return $this->belongsToMany(Role::class);     }       public function hasHole(Array $roleName): bool     {                 foreach ($this->roles as $role) {             if ($role->name === $roleName) {                 return true;             }         }         return false;     }         public function hasHoles(Array $rolesName): bool     {                 foreach ($this->roles as $role) {             foreach ($rolesName as $rolee) {             if ($role->name === $rolee) {                 return true;             }          }         }         return false;     }         public function hasAbility(string $ability): bool     {         foreach ($this->roles as $role) {             if ($role->abilities->contains('name', $ability)) {                 return true;             }         }         return false;     }     } Como gravar um Admin na tabela admins sendo que ele é um User por extensão?
      Tentei assim mas é claro que está errado...
      public function store(Request $request, Admin $adminModel) {         $dados = $request->validate([             "name" => "required",             "email" => "required|email",             "password" => "required",             "registration" => "required"         ]);         $dados["password"] =  Hash::make($dados["password"]);                  $admin = Admin::where("registration",  $dados["registration"])->first();                  if ($admin)              return                    redirect()->route("admin.new")                             ->withErrors([                                 'fail' => 'Administrador já cadastrados<br>, favor verificar!'                   ]);                            $newAdmin = $adminModel->create(                                    $dados['name'],                                    $dados['email'],                                    $dados['password'],                                    $dados['registration']                                 );         dd($newAdmin);         $adminModel->save();         //$adminModel::create($admin);                  return redirect()->route("admin.new")->with("success",'Cadastrado com sucesso');     }  
    • Por violin101
      Caros amigos, saudações.
       
      Gostaria de tirar uma dúvida com os amigos, referente a PDV.
       
      Estou escrevendo um Sistema com Ponto de Vendas, a minha dúvida é o seguinte, referente ao procedimento mais correto.

      Conforme o caixa vai efetuando a venda, o Sistema de PDV já realiza:
      a baixa direto dos produtos no estoque
      ou
      somente após concretizar a venda o sistema baixa os produtos do estoque ?
       
      Grato,
       
      Cesar
       
    • Por violin101
      Caros amigos do grupo, saudações e um feliz 2025.
       
      Estou com uma pequena dúvida referente a Teclas de Atalho.

      Quando o Caps Lock está ativado o Comando da Tecla de Atalho não funciona.
      ou seja:
      se estiver para letra minúscula ====> funciona
      se estiver para letra maiúscula ====> não funciona
       
      Como consigo evitar essa falha, tanto para Letra Maiúscula quanto Minúscula ?

      o Código está assim:
      document.addEventListener( 'keydown', evt => { if (!evt.ctrlKey || evt.key !== 'r' ) return;// Não é Ctrl+r, portanto interrompemos o script evt.preventDefault(); });  
      Grato,
       
      Cesar
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.