📜 ⬆️ ⬇️

We expand the functionality of the exchange of orders between 1C-Bitrix and 1C Enterprise UT 11

The exchange of orders between 1C Enterprise 8.3 Trade Management 11.1 (hereinafter referred to as 1C UT) and an online store based on 1C-Bitrix 14.0 (hereinafter referred to as Bitrix) is part of the standard “boxed” exchange mechanism between these systems. The user forms an order on the site, and then according to the schedule and, starting with a certain order status, orders are uploaded to 1C UT. The description of this mechanism in its standard form can be found on the links indicated at the end of this article, the article on how to expand the specified functionality and adjust it to the workflow of a particular commercial enterprise.

In the standard version, this exchange mechanism does not fully automate the work of the manager on the 1C UT side: the fact is that the details of the order, such as the payment method, delivery method, are transferred to the 1C UT side and are recorded in the add. information about the order.


')
But the order delivery fields, as well as the carrier (upon delivery by the carrier), the method of payment, the warehouse - remain empty.



And in order to place an order for further workflow, the user needs to look at the additional information and manually fill in the order all the listed fields (automatic filling of the warehouse is, of course, a controversial issue, but, as a rule, it’s convenient that by default when creating an order Main warehouse).



It would seem that this is just 8 clicks of the mouse, but with a large number of orders per day, these routine operations tire the user very much. Therefore, there was the task of finalizing the export of orders from Bitrix to 1C UT in such a way that the delivery fields, the carrier, the payment method field and the warehouse field are automatically filled in during the exchange.

In addition, an important condition of the task was also not to violate the integrity of the 1C UT configuration, so as not to remove it from support, so it was decided to allocate part of the exchange module responsible for order exchange, put it into external processing, and then modify the functionality of this external processing .

We will not focus in detail on how to arrange external processing for the 1C Enterprise 8.3 platform, because this is a well-known thing for 1C programmers. Let's go through only key moments. Since the processing must be fulfilled both during manual start and during the performance of the routine task (according to the schedule), in the main module of external processing, parameters for both these modes should be specified in the Information for External Processing function.

 ()   =  ; .("", "    "); .("", ); .("", "1.0"); .("", ""); .("", "    ,   ");  =  ; ..(""); ..(""); ..(""); ..(""); ..("");  = .(); . = "1"; . = "  ()"; . = ; . = ""; . = "";  = .(); . = "2"; . = "  ()"; . = ; . = ""; . = ""; .("", );  ;  


In the same place, in the main processing module, it is necessary to describe the procedure that we will hang on the procedural task, and which will directly start the exchange:

  ()  (); (., ("ru = ' '"));  


In the procedure above, we used the function called Download Requisites. In this function, we select the previously specified details of the advanced exchange settings from the repository:

  ()   = "";  = " ";  = "SHARE";  =  ();  = .().;   = .(,,,);  ("    ."); ;   =   ("   !");        [.] = [.]; ([.]); ; ;  


And in order to set advanced exchange options, we add a form to the external processing, in which the user can select the order exchange node (the order exchange node pre-configured according to the standard manual), and also compare the delivery methods on the site with the delivery methods on the 1C side UT, and methods of payment on the website with methods of payment on the side of 1C UT. It should be clarified that the carrier - on the side of 1C UT - is the counterparty, so when comparing the method of delivery carried out by any forwarding service, you will need to choose a counterparty-freight. This will allow in the future to form a bill of lading for the order, without choosing the counterparty carrier again each time.



Saving additional details of the exchange is carried out by the procedure Save the Details from the form module (not to be confused with the main module of external processing).

  ()   = "";  = " ";  = "SHARE";  =  ();  = ("");  = .().;        = ([.]);   = ("")  .(., [.].());  .(., [.]);  ; .(, , , , );  


Parameters will be saved in the Storage of General Settings - this is a very handy tool of the 1C Enterprise platform.

There, in the form module, we describe the DownloadRequisition () procedure in the same way as the UploadRequisition () procedure from the main external processing module.

Another procedure from the form module is the manual start of the exchange.

  ()  = (""); .(., ("ru = ' '"));  


After these preparations have been made, we copy from the standard exchange module with the 1C UT configuration site all the procedures that we need to exchange orders (you can copy the entire text of the module). Further, already in our module of external processing of the expanded exchange of orders, we modify the exchange procedures so that when exchanging through this processing, our additional settings are taken into account, namely:

In the Create Update procedure, we find a place where additional order information is filled (in a cycle):

Properties Order. Paste (Props, Value);

We add after this line:

    = " "   = ..(, "");    =   .. = .; .. = .;      ...  .. = .; ;  //   ; ;   = " "   = ..(, "");    =   .. = .; ; ; 


In the same procedure after the end of the cycle, in which are recorded additional. insert information:

  .      ..  [""] = ..; ; ; 


This is done in order to immediately establish an order with the main warehouse by default.

It's all. It remains only to register the processing in the enterprise mode (I remind you that this is done in the Administration-Configure system settings - Print forms processing and processing - Additional reports and processing).



Set matching for payment methods.



Set matching for shipping methods:



Hang up the processing for the routine task, and orders coming from the site will immediately have all the necessary properties so that they can immediately be used to form a cash receipt or receipt of non-cash funds, the sale of goods and services, etc.



References:
1. Description of the order exchange protocol between 1C-Bitrix and 1C UT Enterprise ;
2. Description of the standard exchange setting on the 1C-Bitrix side ;
3. Description of the standard exchange settings on the 1C side of UT Enterprises ;
4. Description of the CommerceML 2 format .

Source: https://habr.com/ru/post/216219/


All Articles