Páginas filhas
  • Integração Microsiga Protheus e VTEX via LISTOFACCOUNTRECEIVABLEDOCUMENT (EAI) - Integração Financeira

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Protheus - Guia Cloud TOTVS - TDN   

1. VISÃO GERAL

Implementada a funcionalidade de Integração BackOffice do sistema Microsiga Protheus® (Importante: para release 12.1.25 ou superior) com o sistema  E-Commerce da VTEX®, possibilitando a troca de informações e processos detalhados abaixo.

Os dados são enviados/recebidos por meio da mensagem padronizada TOTVS com a funcionalidade EAI (Enterprise Application Integration), disponível no módulo Configurador.

Nesse modelo as integrações serão direcionandas diretamente a rotina FINA040 (Titulos a Receber). 


2. DETALHAMENTO

Deck of Cards
idCenario
effectTypefade
Card
id1
labelPreparação Integração EAI
effectTypefade
Expandir
titleConfiguração EAI

Para maiores informações de como configurar a integração,

Acesse:

Integração Microsiga Protheus e VTEX via FINANCEVTEX (EAI) - Integração Financeira

Card
id1
labelConfigurações
effectTypefade
Expandir
titleParâmetros Necessários

MV_LJEAIVT : Habilita a integração do VTEX com o MATA410 (Pedido de venda) 

Configurar o parâmetro como .T.

Card
id1
labelBreve explicação dos campos
effectTypefade
Expandir
titleCampos Json

"Transaction""RETAILSALES", - Campo necessário para o correto direcionamento ao adapter EAI

"Event":"upsert",  - Indicativo da operação (upsert - Inclusao ou alteração/DELETE - Exclusao do pedido)

"DeliveryType":"sync" - Indica se a operação será sincrona ou assincrona

"ItemCode":"VTEX001", - Codigo do produto

"OperationCode":"630", Código da TES

"CustomerVendorInternalId":"LOJ701_214_CLIENTE", - Código do Cliente

"ItemReserveInternalId":"" - Código da Reserva

"UUID":"LOJ701_214_RETAILSALES_A81", - Identificado único da comunicação (Presente na tabela XX3, campo XX3_UUID)


{

   

"Header": {

      

"Version": "

2

1.

005

000",

      

"CompanyId":

 

"T1",

      

"BranchId":

 

"

D MG 01

D MG 01",

      

"BusinessUnit": "

MG 

MG ",

      

"GeneratedOn": "2021-06-09T11:53:47Z",

      

"Enterprise":

 

"T1",

      

"ProductVersion": "12",

      

"SourceApplication":

 

"VTEX",

      

"ProductName":

 

"VTEX",

      

"Transaction":

 

"

RETAILSALES

FINANCEVTEX",

      

"StandardVersion": "1.000",

      

"UUID": "

LOJ701_214_RETAILSALES_A81

000000000000000860",

      

"SubType": "event",

      

"Type": "BusinessMessage",

      

"DeliveryType": "

sync

async"

   

},

   

"Content": {

      

"Event": "upsert",

     

"

CompanyId

Documents":

 "T1",
      "BranchId""D MG 01",
      "InternalId

[
{
"Prefix": "

LOJ701_348

001",

      

"DocumentCode": "

701222

000001",

      

"CustomerVendorInternalId": "

LOJ701_214_CLIENTE

",

      

"ECommerceOrder":

 "1133730662947-01",
      "PersonalIdentification":"26624641860"

"000001",

      

"TotalPrice":

160

200.00,

      "DiscountValue":0.00,
      "IncreaseValue":0,
      "NetPrice":160.00,
      "IssueDateDocument":"2021-06-09T11:55:00",
      "SerieCode":"U15",
      "GrossPrice":160.00,
      "CommodityPrice":160.00,
      "OperatorCode":"C07",
      "StationCode":"001",
      "Change":"0",
      "FreightValue"11.83,
      "KindOfDocument":"CF",
      "IsCanceled":false,
      "KeyAcessNFe":"",
      "StationSalePointCode":"001",
      "CarrierCode":"",
      "CarrierInternalId":"",
      "ListOfSaleItem":{
         "SaleItem":[
            {
               "ItemCode":"VTEX001",
               "ItemOrder":"

"CurrencyCode": "1",

               

"

Quantity

CustomerCode":

1.00,
               "UnitPrice":160.00

"000001",

               

"

ItemPrice

CustomerStore":

160.00,
               "DiscountAmount":10.00000

"01",

               

"

OperationCode

FinanceNature": "

630

999999",

               "IsCanceled":false,
               "ItemDeliveryType":"3",
               "ItemReserveInternalId":""
            }
         ]
      },
      "ListOfSaleCondition":{
         "SaleCondition":[
            {
               "DateOfPayment":"2021-06-09T00:00:00",
               "PaymentValue":75.00,
               "PaymentMethodCode":"CC",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            },
            {
               "DateOfPayment":"2021-06-09T00:00:00",
               "PaymentValue":75.00,
               "PaymentMethodCode":"BOL",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            }
         ]
      }
   }
}

Caso o pedido tenha que ser alterado deve ser enviado o  Campo "InternalId", com o numero do pedido do VTEX, o protheus irá entender que o pedido já existe e irá alterá-lo caso tenha as condições necessárias para a alteração

Exemplo JSON de Alteração:

{
   "Header":{
      "Version":"2.005",
      "CompanyId""T1",
      "BranchId""D MG 01",
      "BusinessUnit":"MG ",
      "GeneratedOn":"2021-06-09T11:53:47Z",
      "Enterprise""T1",
      "ProductVersion":"12",
      "SourceApplication""VTEX",
      "ProductName""VTEX",
      "Transaction""RETAILSALES",
      "StandardVersion":"1.000",
      "UUID":"LOJ701_214_RETAILSALES_A81",
      "SubType":"event",
      "Type":"BusinessMessage",
      "DeliveryType":"sync"
   },
   "Content":{
      "Event":"upsert",
     "CompanyId""T1",
      "BranchId""D MG 01",
      "InternalId":"LOJ701_348",
      "DocumentCode":"701222",
      "CustomerVendorInternalId":"LOJ701_214_CLIENTE",
      "ECommerceOrder""1133730662947-01",
      "PersonalIdentification":"26624641860",
      "TotalPrice":160.00,
      "DiscountValue":0.00,
      "IncreaseValue":0,
      "NetPrice":160.00,
      "IssueDateDocument":"2021-06-09T11:55:00",
      "SerieCode":"U15",
      "GrossPrice":160.00,
      "CommodityPrice":160.00,
      "OperatorCode":"C07",
      "StationCode":"001",
      "Change":"0",
      "FreightValue"11.83,
      "KindOfDocument":"CF",
      "IsCanceled":false,
      "KeyAcessNFe":"",
      "StationSalePointCode":"001",
      "CarrierCode":"",
      "CarrierInternalId":"",
      "ListOfSaleItem":{
         "SaleItem":[
            {
               "ItemCode":"VTEX001",
               "ItemOrder":"1",
               "Quantity":1.00,
               "UnitPrice":160.00,
               "ItemPrice":160.00,
               "DiscountAmount":10.00000,
               "OperationCode":"630",
               "IsCanceled":false,
               "ItemDeliveryType":"3",
               "ItemReserveInternalId":""
            }
         ]
      },
      "ListOfSaleCondition":{
         "SaleCondition":[
            {
               "DateOfPayment":"2021-06-09T00:00:00",
               "PaymentValue":75.00,
               "PaymentMethodCode":"CC",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            },
            {
               "DateOfPayment":"2021-06-09T00

"IssueDate": "24/06/2021",
"RealDate": "24/06/2021",
"Observation": "OBSERVACAO",
"PaymentMethodCode": "CC",
"PaymentDetail": [
{
"FinancialManagerCode": "001",
"UniqueSerialNumber":"123456",
"DateOfPayment": "2020-11-26T00:00:00",

               

"PaymentValue":

75.00

100,

               "PaymentMethodCode":"BOL",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            }
         ]
      }
   }
}

Caso o pedido tenha que ser excluído deve ser enviado o  Campo "Event", com o contéudo "DELETE" , o protheus irá entender que o pedido deverá serexcluído, caso tenha as condições necessárias para a exclusão

Exemplo JSON de Exclusão:

{
   "Header":{
      "Version":"2.005",
      "CompanyId""T1",
      "BranchId""D MG 01",
      "BusinessUnit":"MG ",
      "GeneratedOn":"2021-06-09T11:53:47Z",
      "Enterprise""T1",
      "ProductVersion":"12",
      "SourceApplication""VTEX",
      "ProductName""VTEX",
      "Transaction""RETAILSALES",
      "StandardVersion":"1.000",
      "UUID":"LOJ701_214_RETAILSALES_A81",
      "SubType":"event",
      "Type":"BusinessMessage",
      "DeliveryType":"sync"
   },
   "Content":{
      "Event":"upsert",
     "CompanyId""T1",
      "BranchId""D MG 01",
      "InternalId":"LOJ701_348",
      "DocumentCode":"701222",
      "CustomerVendorInternalId":"LOJ701_214_CLIENTE",
      "ECommerceOrder""1133730662947-01",
      "PersonalIdentification":"26624641860",
      "TotalPrice":160.00,
      "DiscountValue":0.00,
      "IncreaseValue":0,
      "NetPrice":160.00,
      "IssueDateDocument":"2021-06-09T11:55:00",
      "SerieCode":"U15",
      "GrossPrice":160.00,
      "CommodityPrice":160.00,
      "OperatorCode":"C07",
      "StationCode":"001",
      "Change":"0",
      "FreightValue"11.83,
      "KindOfDocument":"CF",
      "IsCanceled":false,
      "KeyAcessNFe":"",
      "StationSalePointCode":"001",
      "CarrierCode":"",
      "CarrierInternalId":"",
      "ListOfSaleItem":{
         "SaleItem":[
            {
               "ItemCode":"VTEX001",
               "ItemOrder":"1",
               "Quantity":1.00,
               "UnitPrice":160.00,
               "ItemPrice":160.00,
               "DiscountAmount":10.00000,
               "OperationCode":"630",
               "IsCanceled":false,
               "ItemDeliveryType":"3",
               "ItemReserveInternalId":""
            }
         ]
      },
      "ListOfSaleCondition":{
         "SaleCondition":[
            {
               "DateOfPayment":"2021-06-09T00:00:00",
               "PaymentValue":75.00,
               "PaymentMethodCode":"CC",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            },
            {
               "DateOfPayment":"2021-06-09T00:00:00",
               "PaymentValue":75.00,
               "PaymentMethodCode":"BOL",
               "FinancialManagerCode":"",
               "EftDate":"",
               "EftAutorization":"",
               "EftInstitute":"",
               "UniqueSerialNumber":"",
               "EftDocument":""
            }
         ]
      }
   

"Parcel": "2"
}
]
}
]
}
}

Card
id1
labelMensagem JSON
effectTypefade


Mensagens JSON para a integração dos Pedidos de Venda

Expandir
titleJson Pedido de Venda - Inclusão
Expandir
titleJson Pedido de Venda - Alteração
Expandir
titleJson Pedido de Venda - Exclusão



HTML
<!-- esconder o menu --> 


<style>
div.theme-default .ia-splitter #main {
    margin-left: 0px;
}
.ia-fixed-sidebar, .ia-splitter-left {
    display: none;
}
#main {
    padding-left: 10px;
    padding-right: 10px;
    overflow-x: hidden;
}

.aui-header-primary .aui-nav,  .aui-page-panel {
    margin-left: 0px !important;
}
.aui-header-primary .aui-nav {
    margin-left: 0px !important;
}
</style>