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']" }, "ChaveUni": [ "numeroLoja", "cupom", "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": "" } |
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": "05", "L1_CLIENTE": "&IIF( Empty(self:oRegistro['IdentificacaoCliente']), SuperGetMv('MV_CLIPAD', .F., '000001'), self:DePara('SA1', self:oRegistro['IdentificacaoCliente'], 2, 0) )", "L1_LOJA": "&IIF( Empty(self:oRegistro['IdentificacaoCliente']), SuperGetMv('MV_LOJAPAD', .F., '01'), self:DePara('SA1', self:oRegistro['IdentificacaoCliente'], 3, 0) )", "L1_OPERADO": "C23", "L1_EMISSAO": "&self:oRegistro['VendaData']", "L1_EMISNF": "&self:oRegistro['VendaData']", "L1_DTLIM": "&self:oRegistro['VendaData']", "L1_NUMMOV": "&SubStr(cValToChar(self:oRegistro['IdCaixa']),1,2)", "L1_NUMCFIS": "&self:oRegistro['Ccf']", "L1_DOC": "&self:oRegistro['Ccf']", "L1_SERIE": "&self:LayEstAuto('LG_SERIE')", "L1_SERPDV": "&cValToChar(self:oRegistro['SerieNota'])", "L1_SERSAT": "&IIF(self:oRegistro['ModeloFiscal'] == 1, self:oRegistro['Periferico']['NumeroSerie'], '')", "L1_KEYNFCE": "&self:oRegistro['Chaveacesso']", "L1_COMIS": 0, "L1_VLRTOT": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'}) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VALBRUT": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'}) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VLRLIQ": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'}) - self:oXmlSefaz:getTotal({'ICMSTot', 'vDesc'}, 0) - self:oXmlSefaz:getTotal({'DescAcrEntr', 'vDescSubtot'}, 0)", "L1_VALMERC": "&self:oXmlSefaz:getTotal({'ICMSTot', 'vProd'})", "L1_DESCONT": "&IIF(Len(self:oRegistro['VendaDescontoAcrescimos']) > 0 .And. self:oRegistro['VendaDescontoAcrescimos'][1]['Valor'] < 0 , Abs(self:oRegistro['VendaDescontoAcrescimos'][1]['Valor']), 0)", "L1_DESPESA": "&IIF(Len(self:oRegistro['VendaDescontoAcrescimos']) > 0 .And. self:oRegistro['VendaDescontoAcrescimos'][1]['Valor'] > 0 , self:oRegistro['VendaDescontoAcrescimos'][1]['Valor'], 0)", "L1_ORIGEM": "N", "L1_CGCCLI": "&IIF( Empty(self:oRegistro['CpfCnpjConsumidor']), '', self:oRegistro['CpfCnpjConsumidor'] )", "L1_CONDPG": "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_INDPRES": "&self:oXmlSefaz:get( , {'ide', 'indPres'}, '')", "SL2": [ { "L2_FILIAL": "05", "L2_PRODUTO": "&self:oXmlSefaz:getDet({'prod', 'cProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "L2_ITEM": "&StrZero(self:oRegistro['VendaItems'][nItem]['Sequencia'], TamSx3('L2_ITEM')[1])", "L2_DESCRI": "&self:oXmlSefaz:getDet({'prod', 'xProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "L2_QUANT": "&self:oXmlSefaz:getDet({'prod', 'qCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "L2_VRUNIT": "&self:oXmlSefaz:getDet({'prod', 'vUnCom'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "L2_VLRITEM": "&self:oXmlSefaz:getDet({'prod', 'vProd'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "L2_LOCAL": "&SuperGetMv('MV_LOCPAD', .F., '05')", "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_TES": "&SuperGetMv('MV_TESSAI', .F., '501', '05')", "L2_EMISSAO": "&self:oRegistro['VendaData']", "L2_VEND": "&IIF(Empty(self:oRegistro['VendaItems'][nItem]['Vendedor']['IdRetaguarda']),'',self:GetCadAux(self:oRegistro['VendaItems'][nItem]['Vendedor']['IdRetaguarda'],'OPERADOR DE LOJA','VENDEDOR'))", "L2_CF": "&self:oXmlSefaz:getDet({'prod', 'CFOP'}, self:oRegistro['VendaItems'][nItem]['Sequencia'])", "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": "&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": "&self:oXmlSefaz:getDetPIS('vPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_BASEPS2": "&self:oXmlSefaz:getDetPIS('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_ALIQPS2": "&self:oXmlSefaz:getDetPIS('pPIS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_CSTPIS": "&self:oXmlSefaz:getDetPIS('CST', self:oRegistro['VendaItems'][nItem]['Sequencia'], '')", "L2_VALCF2": "&self:oXmlSefaz:getDetCOF('vCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_BASECF2": "&self:oXmlSefaz:getDetCOF('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_ALIQCF2": "&self:oXmlSefaz:getDetCOF('pCOFINS', self:oRegistro['VendaItems'][nItem]['Sequencia'], 0)", "L2_CSTCOF": "&self:oXmlSefaz:getDetCOF('CST', self:oRegistro['VendaItems'][nItem]['Sequencia'], '')", "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": "&self:oXmlSefaz:getDetIcms('vBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], '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_PREDIC": "&self:oXmlSefaz:getDetIcms('pRedBC', self:oRegistro['VendaItems'][nItem]['Sequencia'], '0')" } ] } |
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas