Histórico da Página
Aviso | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
Cadastrando o Processo de VENDA
Para integrarmos o processo VENDA com o PdvSync primeiramente é necessário acessar o cadastro do Processo para verificar se o processo VENDA foi criado automaticamente no Protheus.
...
Tabela: SL1
Chave: L1_FILIAL+L1_NUM
Vinculando o Processo de VENDA ao Assinante PdvSync
1- No módulo 12 (Controle de Lojas), acesse Atualizações/ RMI/ Cadastros/ Assinantes.
...
Configuração: Preencha este campo com as configurações do processo de VENDA. A URL deve ser preenchida com o caminho da API de VENDA, como mostra o exemplo abaixo:
Bloco de código | ||
---|---|---|
| ||
{ "url": "https://...comercial.../api/retaguarda/vendaMensagens/", "listasPublicacao": { "SL2": "self:oRegistro['VendaItems']", "SL4": "self:oRegistro['VendaPagamentos']" }, "ChaveUni": [ "Loja:IdRetaguarda", "Ccf", "SerieNota" ] } github.com/totvs/protheus-smart-hub-layouts/blob/39e02620bcaebc22bcae754a2f2dd08476fa1d06/pdvsync/configuracao/busca_venda.json |
Layout Envio: Preencha este campo de acordo com o exemplo abaixo:
Bloco de código | ||
---|---|---|
| ||
https://github.com/totvs/protheus-smart-hub-layouts/blob/39e02620bcaebc22bcae754a2f2dd08476fa1d06/pdvsync/envio/busca_venda.json{ "listIdProprietario": "&LjRetComp(self:aArrayFil[self:nFil][2],'CADASTRO DE LOJA')" } |
Layout Publicação: Layout que será utilizado para gerar a Publicação (tabela MHQ), especificamente o campo MHQ_MENSAG.
Bloco de código | ||
---|---|---|
| ||
https://github.com/totvs/protheus-smart-hub-layouts/blob/39e02620bcaebc22bcae754a2f2dd08476fa1d06/pdvsync/publicacao/busca_venda.json{ "L1_FILIAL": "&self:oRegistro['Loja']['IdRetaguarda']", "L1_CLIENTE": "&IIF( Empty(self:oRegistro['IdentificacaoFidelidade']), SuperGetMv('MV_CLIPAD', .F., '000001'), self:DePara('SA1', self:oRegistro['IdentificacaoFidelidade'], 2, 0) )", "L1_LOJA": "&IIF( Empty(self:oRegistro['IdentificacaoFidelidade']), SuperGetMv('MV_LOJAPAD', .F., '01'), self:DePara('SA1', self:oRegistro['IdentificacaoFidelidade'], 3, 0) )", "L1_OPERADO": "&LjAuxPosic('OPERADOR DE LOJA', 'MIH_ID', self:oRegistro['Operador']['IdRetaguarda'], 'banco')", "L1_EMISSAO": "&self:oRegistro['VendaData']", "L1_HORA": "&Substr(self:oRegistro['VendaData'],12,8)", "L1_EMISNF": "&self:oRegistro['VendaData']", "L1_DTLIM": "&self:oRegistro['VendaData']", "L1_NUMMOV": "&SubStr(cValToChar(self:oRegistro['IdCaixa']),1,2)", "L1_NUMCFIS": "&IIF( self:oRegistro['ModeloFiscal'] == 1, self:oXmlSefaz:get( , {'ide', 'nCFe'}, ''), IIF(self:oRegistro['ModeloFiscal'] == 2, self:oXmlSefaz:get( , {'ide', 'nNF'}, ''), self:oRegistro['Ccf']) )", "L1_DOC": "&IIF( self:oRegistro['ModeloFiscal'] == 1, self:oXmlSefaz:get( , {'ide', 'nCFe'}, ''), IIF(self:oRegistro['ModeloFiscal'] == 2, self:oXmlSefaz:get( , {'ide', 'nNF'}, self:oRegistro['Ccf']), self:oRegistro['Ccf']) )", "L1_SERIE": "&self:LayEstAuto('LG_SERIE')", "L1_SERPDV": "&cValToChar(self:oRegistro['SerieNota'])", "L1_SERSAT": "&IIF(self:oRegistro['ModeloFiscal'] == 1,self:oXmlSefaz:get( , {'ide', 'nserieSAT'}, ''), '')", "L1_KEYNFCE": "&IIF(self:oRegistro['Chaveacesso']==NIL,'',self:oRegistro['Chaveacesso'])", "L1_COMIS": 0, "L1_VLRTOT": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'},0) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VALBRUT": "&(self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'},0) +self:oXmlSefaz:getTotal({'ICMSTot', 'vOutro'}, 0) + self:oXmlSefaz:getTotal({'DescAcrEntr', 'vAcresSubtot'}, 0)) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VLRLIQ": "&(self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'},0) +self:oXmlSefaz:getTotal({'ICMSTot', 'vOutro'}, 0) + self:oXmlSefaz:getTotal({'DescAcrEntr', 'vAcresSubtot'}, 0)) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VALMERC": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'},0)", "L1_DESCONT": "&IIF( self:oRegistro['ModeloFiscal'] == 2, 0, self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0) )", "L1_DESPESA": "&IIF( self:oRegistro['ModeloFiscal'] == 1,self:oXmlSefaz:getTotal({'DescAcrEntr', 'vAcresSubtot'}, 0),self:oXmlSefaz:getTotal({'ICMSTot', 'vOutro'}, 0))", "L1_FRETE": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vFrete'}, 0)", "L1_SEGURO": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vSeg'}, 0)", "L1_ORIGEM": "N", "L1_CGCCLI": "&IIF( Empty(self:oRegistro['CpfCnpjConsumidor']), '', self:oRegistro['CpfCnpjConsumidor'] )", "L1_CONDPG": "&SuperGetMv('MV_CONDPAD', .F., 'CN')", "L1_SITUA": "IP", "L1_TIPO": "V", "L1_TIPOCLI": "F", "L1_ESPECIE": "&IIF( self:oRegistro['ModeloFiscal'] == 1, 'SATCE', IIF(self:oRegistro['ModeloFiscal'] == 2, 'NFCE', 'ECF') )", "L1_PDV": "&self:LayEstAuto('LG_PDV')", "L1_ESTACAO": "&self:LayEstAuto('LG_CODIGO')", "L1_INDPRES": "&self:oXmlSefaz:get( , {'ide', 'indPres'}, '')", "L1_TROCO1": "&IIF( self:oRegistro['ModeloFiscal'] == 1, self:oXmlSefaz:get( , {'pgto', 'vTroco'}, 0), self:oXmlSefaz:get( , {'pag', 'vTroco'}, 0) )", "SL2": [ { "L2_FILIAL": "&self:oRegistro['Loja']['IdRetaguarda']", "L2_PRODUTO": "&self:oXmlSefaz:getDet({'prod', 'cProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],'')", "L2_POSIPI": "&self:oXmlSefaz:getDet({'prod', 'NCM'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],'')", "L2_ITEM": "&StrZero(self:oRegistro['VendaItems'][nItem]['Sequencia'], TamSx3('L2_ITEM')[1])", "L2_DESCRI": "&Substr(self:oXmlSefaz:getDet({'prod', 'xProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia']),1,TamSx3('L2_DESCRI')[1])", "L2_QUANT": "&self:oXmlSefaz:getDet({'prod', 'qCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],'')", "L2_VRUNIT": "&self:oXmlSefaz:getDet({'prod', 'vUnCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0) - ( ( self:oXmlSefaz:getDet({'prod', 'vDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) + self:oXmlSefaz:getDet({'prod', 'vRatDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) ) / self:oXmlSefaz:getDet({'prod', 'qCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0) )", "L2_PRCTAB": "&self:oXmlSefaz:getDet({'prod', 'vUnCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0)", "L2_VLRITEM": "&self:oXmlSefaz:getDet({'prod', 'vProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0) - ( self:oXmlSefaz:getDet({'prod', 'vDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) + self:oXmlSefaz:getDet({'prod', 'vRatDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) )", "L2_LOCAL": "&SuperGetMv('MV_LOCPAD', .F., '01')", "L2_UM": "&self:oXmlSefaz:getDet({'prod', 'uCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],'')", "L2_VALDESC": "&self:oXmlSefaz:getDet({'prod', 'vDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_DESCPRO": "&self:oXmlSefaz:getDet({'prod', 'vRatDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_DESC": "&(self:oXmlSefaz:getDet({'prod', 'vDesc'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) * 100)/self:oXmlSefaz:getDet({'prod', 'vProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0)", "L2_DESPESA": "&self:oXmlSefaz:getDet({'prod', 'vOutro'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) + self:oXmlSefaz:getDet({'prod', 'vRatAcr'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_TES": "&RmiTesProd(self:oXmlSefaz:getDet({'prod', 'cProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0))", "L2_DOC": "&IIF( self:oRegistro['ModeloFiscal'] == 1, self:oXmlSefaz:get( , {'ide', 'nCFe'}, ''), IIF(self:oRegistro['ModeloFiscal'] == 2, self:oXmlSefaz:get( , {'ide', 'nNF'}, ''), self:oRegistro['Ccf']) )", "L2_SERIE": "&self:LayEstAuto('LG_SERIE')", "L2_ESPECIE": "&IIF( self:oRegistro['ModeloFiscal'] == 1, 'SATCE', IIF(self:oRegistro['ModeloFiscal'] == 2, 'NFCE', 'ECF') )", "L2_EMISSAO": "&self:oRegistro['VendaData']", "L2_VEND": "&IIF(Empty(LjAuxPosic('OPERADOR DE LOJA',,self:oRegistro['VendaItems'][nItem]['Vendedor']['IdRetaguarda'],'VENDEDOR')),SuperGetMv('MV_VENDPAD', .F., '000001'),LjAuxPosic('OPERADOR DE LOJA',,self:oRegistro['VendaItems'][nItem]['Vendedor']['IdRetaguarda'],'VENDEDOR'))", "L2_CF": "&self:oXmlSefaz:getDet({'prod', 'CFOP'}, self:oRegistro['VendaItems'][nItem]['Sequencia'],0)", "L2_PICM": "&self:oXmlSefaz:getDetIcms('pICMS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_VALICM": "&self:oXmlSefaz:getDetIcms('vICMS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_BASEICM": "&IIF( self:oRegistro['ModeloFiscal'] == 1, self:oXmlSefaz:getDet({'prod', 'vItem'}, self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),self:oXmlSefaz:getDetIcms('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) )", "L2_MODBC": "&self:oXmlSefaz:getDetIcms('modBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], '0')", "L2_ORIGEM": "&self:oXmlSefaz:getDetIcms('Orig', self:oRegistro['VendaItems'][nItem]['Sequencia'], '0')", "L2_CLASFIS": "&self:oXmlSefaz:getDetIcms('Orig', self:oRegistro['VendaItems'][nItem]['Sequencia'], ' ') + self:oXmlSefaz:getDetIcms('CST', self:oRegistro['VendaItems'][nItem]['Sequencia'], ' ')", "L2_VALPS2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('vPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_BASEPS2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_ALIQPS2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('pPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) ,0)", "L2_CSTPIS": "&self:oXmlSefaz:getDetPIS('CST', self:oRegistro['VendaItems'][nItem]['Sequencia'], '')", "L2_VALPIS": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('vPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_BASEPIS": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_ALIQPIS": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetPIS('pPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_VALCF2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('vCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_BASECF2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_ALIQCF2": "&IIF( RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('pCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) ,0)", "L2_CSTCOF": "&self:oXmlSefaz:getDetCOF('CST', self:oRegistro['VendaItems'][nItem]['Sequencia'], '')", "L2_VALCOFI": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('vCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_BASECOF": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_ALIQCOF": "&IIF( !RMIRetApur(self:oRegistro['IdentificacaoFidelidade']),self:oXmlSefaz:getDetCOF('pCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0),0)", "L2_BRICMS": "&self:oXmlSefaz:getDetIcms('vBCSTRet', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_ICMSRET": "&self:oXmlSefaz:getDetIcms('vICMSSTRet', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_BASFECP": "&IIF( self:oXmlSefaz:getDetIcms('vFCP', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) > 0, self:oXmlSefaz:getDetIcms('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0), 0)", "L2_ALQFECP": "&self:oXmlSefaz:getDetIcms('pFCP', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_VALFECP": "&self:oXmlSefaz:getDetIcms('vFCP', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_ALQFCST": "&self:oXmlSefaz:getDetIcms('pFCPSTRet', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_VFECPST": "&self:oXmlSefaz:getDetIcms('vFCPSTRet', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_PREDIC": "&IiF(self:oXmlSefaz:getDetIcms('pRedBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0) > 0,100-(self:oXmlSefaz:getDetIcms('pRedBC', self:oRegistro['VendaItems'][nItem]['Sequencia'],0)),0)" } ] } |
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas