• Loading from xml into 1s 8.2 example. Generating an XML file. Easy upload for third party application. The process of uploading data to xml. Connecting external processing

    How to load data downloaded from trade or salary into 1C: Accounting 8.3 (revision 3.0)?

    2016-12-01T12:52:06+00:00

    Most often, data from trade or payroll is transferred to accounting.

    The downloaded data is a file with the extension " .xml". How to load it into the program?

    1. Let's start with creating a backup copy accounting department, so that if the download spoils the database, we can return to its original state. It is written about creating backup copies.
    2. Now open the menu " All functions" (about it ).
    3. In the window that opens, find the item " Treatments" and open it with a plus sign.
    4. We find and open among its items processing " Universal data exchange in XML format".
    5. ".
    6. We indicate the path to the file from which we will load data.
    7. Press the button " Download data".

    If everything went well - great! If there are errors, then the reason is probably that inappropriate (outdated) rules were used for unloading from trade or salary - they need to be updated and re-unloaded.

    Sincerely, (teacher and developer).

    Simple data exchange between various accounting programs is one of the key points of their prevalence; in practice, for this it is enough to load XML into 1C or another product. Moreover, most often it is easy to do without converting it: all databases fully support the format standard. In practice, there are many ways to use XML to transfer data, all of them are implemented in 1C and compatible products.

    How to upload an XML file to a 1C database?

    Uploaded databases and individual documents can be transferred from users via any communication channels - on removable media, via email or through cloud storage. The format lends itself well to compression using archivers, which significantly speeds up copying and saves disk space.

    The general procedure for loading data from an XML file is as follows:

      Allow display of the “All functions” menu item. To do this, you need to check the corresponding box in the “Options” window (the tab is located in the “Tools” menu section).

      In the “All functions” menu, use the plus button to open the list of options, where you select the “Processing” item.

      In the proposed list, open the item “Universal data exchange in XML format”.

    By clicking the “Load data” button, they will be read from the file, saved into the database, and simultaneously checked for correctness. If errors are found in the document, the procedure will be terminated with specific text indicating the reason.

    How are XML files used in 1C?

    Using the same processing, the user can upload a selected list of data or the entire database into XML, thereby creating a backup copy of it. This must be done before introducing major adjustments to the global 1C module, if external processing is not possible for some reason.

    The format is used on the 1C: Enterprise 8 platform in the following areas:

      Uploading price lists, orders, printed forms of documents.

      Data exchange with banks, tax authorities, extra-budgetary funds.

      Transfer of payroll calculations from 1C: ZUP and other “specialized” configurations to the “general” 1C: Accounting 8.

    The same implementation of universal processing is used everywhere. If its functions are few, then they resort to developing their own versions of this module. Moreover, there is no need to change standard files; it is enough to then connect the necessary processing and run them to choose from - depending on the specific task.

    If a company has chosen a separate method for maintaining accounting and tax records, then processing for uploading/downloading financial data via XML format will become very popular. With its help, the figures necessary for calculating the tax base are transferred to the 1C: Taxpayer program or a similar software product. Due to the fact that files in this format are easily edited, using the Microsoft Office package it is easy to correct their content before sending it to the tax service.

    The same applies to the KUDiR (book of income and expenses), the journal of issued or received invoices. All this is transmitted through the VLSI++ system and, in addition to the process of editing the tabular part of the XML file, uploading in this format is necessary for subsequent loading into the service and transfer of data to the Federal Tax Service.

    An exchange with such a configuration as 1C: Trade Management is often in demand, because in business it is used to organize sales, management accounting, and accounting based on 1C: Accounting 8 functions autonomously, receiving only summary data on all movements of goods and money funds.

    If it’s easy to set up uploading orders or price lists, since it’s easy to use “any” data format, then the same bank account statements have to be saved in XML (as a generally accepted standard).

    Most often, the exchange occurs with the Client-Bank program. The upload process looks like this:

      An extract is generated for the period required by the user.

      Depending on the program version, click either the “Export” or “Export” button.

      In the window that opens, select the desired folder and file name.

    After completing the procedure, the document can be transferred on removable media or via the Internet (email, cloud storage with shared access, etc.). When you need to load a statement into the 1C configuration, select the “Bank and Cash Desk” section, then go to the “Bank Statements” journal.

    In front of the tabular part of the document (in the right corner), click the “More” button, after which a list of functions appears, where they select the “Exchange with the bank” item. The “Download Bank Statement” tab allows you to import data for a specified company name or for a specific bank account.

    After loading the statement into the 1C database, you will still need to process payment orders; this happens manually. An accountant can order the development of processing that will automate the process, but here you will need to contact a competent programmer.

    The XML format is also used to load various classifiers (KLADR, OKOF, ENAOF). If they are not present in the 1C program, you should avoid filling them in manually, since it is easy to make a mistake when specifying codes. It is worth using the XML file once, downloading the classifier from a reliable source.

    This can be done either by the user himself or by an invited specialist:

      In the main menu, select the “Directory” section.

      Click the “Action Settings” button.

      In the window that opens, indicate the item “Load okof classifier”, and then click on the “Add” button.

      In the “Service” section that appears, select the desired command and click “OK”.

    All you have to do is click on the “Open and read file” button, select the one you need on the disk or removable media, and open it with the appropriate key. Standard classifiers are automatically copied to the hard drive when installing the 1C platform and configuration. Moreover, when updating a version of one or another, folders with a revision number are created where the current file that meets the current requirements is located. Version 7 7 also has the ability to upload XML files, but this outdated platform often requires specialist help.

    Data transfer is a very important process in any accounting system, the 1C 8.3 and 8.2 platform is no exception. Below we will look at instructions on the easiest way to transfer data from one system to another that has a similar configuration (for different configurations, you can use a tool for programmers - or).

    Before any action is necessary, the changes are irreversible!

    The easiest and most convenient way to transfer data from 1C 8.3 to 1C 8.3 Accounting 3.0 is to use the processing Upload and load data in XML format (download - for 8.2 or for 1C 8.3 or on ITS). The treatment is universal and suitable for any configuration.

    We won’t go into details; let’s look at step-by-step instructions for migrating data using this processing using the example of the simplest transfer of goods.

    Uploading data to XML

    First of all, let’s open processing in the source database (from where we will unload goods) and look at the interface:

    Get 267 video lessons on 1C for free:

    You must immediately fill in the “File name” field - a new data file will be created along this path, which we will upload to the receiver database. Just below, in the tabular section “Data for uploading”, you need to select the data that we want to upload from the database.

    After selecting an object from the left table part, you can apply selection in the right table part:


    In our example, I want to unload all products with the name “Rake”.

    Once all the settings have been completed, the data can be uploaded. To do this, click on the “Upload data” button:


    Loading data from xml into 1s 8.3

    The data has been unloaded from the source database; now it needs to be transferred to the destination database.

    To do this, you need to start processing already in the database into which you need to load the data, and go to the “Download” tab, select the downloaded file on disk and click on the “Load data” button:


    This example is only suitable for transferring data between identical configurations on the 1C platform. To understand the exchange mechanism for programmers, we wrote an article -.

    Transferring information between databases is one of the tasks of their support and administration. For its effective implementation, processing is created in automated 1C complexes. They greatly facilitate routine work, speed up the processes of uploading and downloading information and at the same time implement control over its correctness. Uploading from 1c to xml allows you to create a file with the contents of any configured configuration object, and use it when you need to upload data to an identical configuration.

    Tools for creating uploads

    To export information contained in databases, the xml format is mainly used. For 1C, many processing methods have been developed (for example, UploadLoadDataxml82 epf), with the help of which it is possible to output and load data to a file. In this case, the user must receive a file of a certain structure, which allows the information stored in it to be loaded into the native database or transferred to another location. When creating an upload, the following rules must be observed:

    • Save the created files until complete recovery and completion of procedures for verifying the correctness of the transferred information;
    • If you use processing as a backup tool, create separate subfolders for data copies and keep a log of them for quick retrieval.

    The universal processing “Uploading and loading XML data” supplied in the 1C user support program, which can be found on the website or ITS disks, is an excellent tool for exporting and importing information. A computer user can upload both the entire database and its individual objects, and in addition to the actual export, various operations are performed to check information that help get rid of critical errors in the data. Processing 1c upload to xml works in two modes:

    • Unloading. Creates a file containing user-defined pageable objects;
    • Loading. Reads a previously exported file and writes the information contained in it to the information base.

    Processing allows you to check objects for invalid characters, and also includes a function for exporting information with restrictions.

    Uploading can be used not only when exchanging information between 1C databases. With its help, you can ensure the integration of various complexes, for example, 1C and the Parus system. The versatility of the XML format allows you to create programs for transferring information for almost any information banks. Processing, uploading and downloading xml data is the most important tool for exchanging information.

    The process of uploading data toxml

    Let's look at how to upload from 1c to xml in normal mode. After downloading the processing UploadLoadDataxml.epf and opening it, you must perform the following steps:

    • Select objects for export;
    • Set up the necessary filters, for example, by period;
    • Determine the location of the file with information on the disk subsystem;
    • Start unloading objects.


    It must be remembered that the header part of the upload file format differs from the file format used when uploading according to exchange plans.

    xml

    The xml is loaded into 1c into the receiving database with a configuration identical to the source database. Before loading xml 1c into 1c, you need to open processing in the receiving database. Then you need to specify the path to the previously uploaded file and download the data by clicking on the “Load data” button.

    If necessary, checkboxes are activated to load data in exchange mode in a distributed infobase and ignore errors that occur when loading objects.


    After this, you need to check the databases and make sure that all elements are loaded correctly so as not to lose them, for example, if an error occurs in the event handler after loading the object.


    This processing allows you to exchange data between the same (identical) configurations on the 1C 8.2 platform - Bukh, ZUP, UT, UPP and others, the main thing is that the configurations are the same!

    Processing screenshots

    (foto)

    Operating modes

    Processing implements 2 operating modes: Upload (creating an upload file of user-specified data) and Load (reading an upload file created by the mode of the same name and writing the data contained in it). The mode is set by selecting it in the Mode field.

    Before starting a particular mode (clicking the Run button), you need to specify the name of the upload file, either by entering it manually in the "File name" field, or using the button to select this field and the standard file selection dialog.

    In download mode, it is possible to edit the use of totals when writing registers, which may affect the download speed.

    The "Disable totals" and "Enable totals" buttons are available when the "Enable the ability to edit the use of totals during data loading" flag is set and are used to manually control the mode of using totals when loading data.

    Conditions for the applicability of processing

    Processing can only be used in cases where the information base in which the data was uploaded and the one in which the data was loaded are homogeneous (the configurations are identical, the data may differ), or all the uploaded objects are almost completely identical in composition and types of details and table parts, properties of the “leading” metadata object, etc. It should be noted that, due to these limitations, processing is mainly intended for exchange between homogeneous IS.

    The upload file format differs from the file format created when uploading according to an exchange plan in the header part. To upload data (directory elements, sets of register records, etc.), processing uses the same XML serialization mechanism as uploading according to exchange plans; in this part, the file formats are identical.

    Determining the composition of the unloading

    Processing allows for both full and partial uploading of infobase data to a file. The composition of the uploaded data is configured in the dialog by checking the boxes in the column of the tree that displays metadata objects for which data can be uploaded. An additional column of checkboxes, "If necessary", sets the need to unload objects of this type "by reference". That is, if the checkbox is checked only in the “If necessary” column, then the data for such an object will not be downloaded completely, but only to the extent that is necessary to maintain referential integrity in the infobase that will load the download file.

    When opening a form, processing sets the sign of unloading by reference to all objects, which guarantees the referential integrity of the unloaded fragment of the information base.

    When you click on the “Detect objects that are unloaded by link” button, processing analyzes what data links may be contained in objects that have the full unload attribute set, and automatically fills in the column of flags indicating the need to unload by link. If the object already has the full unload flag set, then the unload by reference flag is not set.

    Possible applications

    The use of this processing is possible, for example, to create a full or partial backup copy of data, exchange data between information bases, and also as an auxiliary tool when restoring problematic information bases.

    In an organization, accounting can be maintained not only in solutions on the 1C:Enterprise platform, but also in other software systems (Galaktika, Parus, SAP, etc.). This raises the challenge of integrating two applications.

    For example, some application (let's call it "X") needs to read a list of configuration documents. We will not talk about the practical benefits of solving such a problem; I will only note that the most convenient and universal way in such a situation would be to upload a list of documents in XML format.

    Exchange using this format is universal because most applications can work with it. Let's look at how you can upload a list of configuration documents to an XML file from 1C:Enterprise.

    Upload to XML

    And so, let's move on to the main thing. We need to traverse the list of document metadata and generate the list in the XML file. The following screenshot shows the algorithm for generating an XML file:

    Function CreateXML() Export // Get the name of the temporary file Path = GetTemporaryFileName() ; // Initialize the "XML Record" class Entry = New EntryXML; // Open a temporary file for writing - 8 ") ; // Write the XML file declaration Record. WriteDeclarationXML() ; // Record. WriteElementStart(" DocumentsConfigurations") ; // First element // Attribute of the first element with the date the file was created Record. WriteAttribute(" generated ", Format(CurrentDate(), " DF = yyyy-MM- ddThh:mm:ss; DLF= DT")) ; // Write an element for each configuration document. We put the name of the document in the text. For Each Doc From Metadata. Documents Cycle Recording. WriteElementStart("Document"); Record. WriteText(Doc.Name) ; Record. WriteEndElement() ; EndCycle; // Finish writing the first element Record. WriteEndElement() ; Record. Close(); // Close the file // Get the file's binary data and put it in temporary storage BinaryData = new BinaryData(Path) ; Address = PlaceInTemporaryStorage(BinaryData, New UniqueIdentifier) ​​; Return Address; // Return the address of the file to the storage EndFunction

    Each element created must be completed correctly. After executing “WriteStartofElement()”, the “WriteEndElement()” method must be executed, otherwise the structure of the XML file will be incorrect.

    The general template for creating XML files is the following sequence:

    // 1. Initialize the "XML Record" class Entry = New EntryXML; // 2. Open a temporary file for recording Record. OpenFile(Path, "UTF-8"); // 3. Write the declaration of the XML file Record. WriteDeclarationXML() ; // // 4. ++ Write the contents of the XML file Record. WriteElementStart("XMLElement") ; Record. WriteEndElement() ; // -- Write the contents of the XML file // 5. Close the file Record. Close();

    These five steps create almost any XML file.

    In our example, the generated file is converted to binary data and returned to the location where the CreateXML function is called. This file can then be written to the file system.

    You could see an example of the uploaded file in the screenshot above.

    Third party application

    As an example, I created an application in the .NET Framework to demonstrate reading an XML file in a third-party application.

    The program reads the created file and displays the documents in the form of a list:

    You can try it yourself, the application is available for download using the link at the end of the article.

    Versatility

    The XML format is used in most configurations for data exchange between application solutions on the 1C:Enterprise platform. Another commonly used communication method is through a COM connection. XML allows you to exchange with almost any application, which is why it deserves to be called universal.

    Files for download:

    XML file reader application.

    Processing the generation of the XML file.

    When an enterprise constantly uses some kind of software package in its work, then, naturally, the question of its ongoing support and administration always arises. There is no way to avoid the tasks of exchanging, storing and restoring data. Let's look at how to load or unload data from 1C in XML format, since this is an important procedure for this topic.

    They are built in such a way that when uploading, you can receive an XML file in which the data necessary for the client will be recorded. At the same time, simultaneously with the recording, the correctness of the transferred records is monitored for critical errors.

    Thus, uploading to an XML file (importing records) from one information base and subsequent loading from XML to another represents an exchange of data in XML format between databases.

    This procedure, especially with large amounts of information, saves a lot of manual work.

    Import (the resulting file) can also be used as an archive for recovery in unexpected situations (if lost or damaged).

    A lot of such processing tools have been developed, and they are available on the Internet. Responsibility for their use falls on the shoulders (and head) of the client.

    But for official users of Odeneski, the developers have created a universal processor “Upload/Load XML Data”.

    IMPORTANT. Export to XML in 1C and further loading into XML from 1C is acceptable for identical configurations - otherwise it will be damaged.

    Universal handler

    Key points for using the universal developer:

    • Save importing files until the transfer of records is completed and their correctness is checked;
    • When used as backup copies, a record of them should be kept to sort the search.

    Its operation has two modes: creating a file when saving information and reading/writing it when importing.

    In addition, the user can set additional restrictions both when exporting and loading data.

    Extracting records

    You can upload data both throughout the entire database and selectively - object by object.

    After downloading, installing and opening the handler, the following occurs:

    Their selection is made in the dialog box that opens after launch. To do this, check the boxes in the list that displays the metadata objects to be retrieved;

    1. The necessary filters are configured (for example, by date);
    2. Disk space is selected;
    3. The operation itself starts.

    Uploading records to the receiver

    The first step to accept data into the receiving database is to open the processor program in it.

    After the path to the source file has been specified and the procedure settings flags have been activated (if necessary), you can start the process with the “Load data” button.


    Now you know how to load or unload data from 1C in XML format to save data and exchange between databases.

    Write in the comments about your experience in this matter.

    In an organization, accounting can be maintained not only in solutions on the 1C:Enterprise platform, but also in other software systems (Galaktika, Parus, SAP, etc.). This raises the challenge of integrating two applications.

    For example, some application (let's call it "X") needs to read a list of configuration documents. We will not talk about the practical benefits of solving such a problem; I will only note that the most convenient and universal way in such a situation would be to upload a list of documents in XML format.

    Exchange using this format is universal because most applications can work with it. Let's look at how you can upload a list of configuration documents to an XML file from 1C:Enterprise.

    Upload to XML

    And so, let's move on to the main thing. We need to traverse the list of document metadata and generate the list in the XML file. The following screenshot shows the algorithm for generating an XML file:

    Function CreateXML() Export // Get the name of the temporary file Path = GetTemporaryFileName() ; // Initialize the "XML Record" class Entry = New EntryXML; // Open a temporary file for writing- 8 " ) ; // Write the XML file declaration Record. WriteDeclarationXML() ; // Record. WriteElementStart(" DocumentsConfigurations" ) ; // First element // Attribute of the first element with the date the file was created Record. WriteAttribute(" generated ", Format(CurrentDate(), " DF = yyyy-MM- ddThh:mm:ss; DLF= DT" ) ) ; // Write an element for each configuration document. We put the name of the document in the text. For Each Doc From Metadata. Documents Cycle Recording. WriteElementStart("Document"); Record. WriteText(Doc.Name) ; Record. WriteEndElement() ; EndCycle ; // Finish writing the first element Record. WriteEndElement() ; Record. Close(); // Close the file // Get the file's binary data and put it in temporary storage BinaryData = new BinaryData(Path) ; Address = PlaceInTemporaryStorage(BinaryData, New UniqueIdentifier) ​​; Return Address; // Return the address of the file to the storage EndFunction

    Each element created must be completed correctly. After executing “WriteStartofElement()”, the “WriteEndElement()” method must be executed, otherwise the structure of the XML file will be incorrect.

    The general template for creating XML files is the following sequence:

    // 1. Initialize the "XML Record" class Entry = New EntryXML; // 2. Open a temporary file for recording Record. OpenFile(Path, " UTF - 8 " ) ; // 3. Write the declaration of the XML file Record. WriteDeclarationXML() ; // // 4. ++ Write the contents of the XML file Record. WriteElementStart("XMLElement"); Record. WriteEndElement() ; // -- Write the contents of the XML file // 5. Close the file Record. Close();

    These five steps create almost any XML file.

    In our example, the generated file is converted to binary data and returned to the location where the CreateXML function is called. This file can then be written to the file system.

    You could see an example of the uploaded file in the screenshot above.

    Third party application

    As an example, I created an application in the .NET Framework to demonstrate reading an XML file in a third-party application.

    The program reads the created file and displays the documents in the form of a list:

    You can try it yourself, the application is available for download using the link at the end of the article.

    Versatility

    The XML format is used in most configurations for data exchange between application solutions on the 1C:Enterprise platform. Another commonly used communication method is through a COM connection. XML allows you to exchange with almost any application, which is why it deserves to be called universal.

    Files for download:

    XML file reader application.

    Processing the generation of the XML file.

    It will save time on entering information about the purchase of Peterhost services into 1C.
    To do this, you need to upload an XML file into 1C and from it a document “Receipt of goods and services” will be generated, containing information about the purchased services. An invoice can be generated based on this document.

    Detailed instructions are provided below.

    1. Connection of external processing

    1.1. If you are using the 1C:Enterprise 8.X information base with the “Enterprise Accounting 2.0” configuration, to load a document in CommerceML format you need to connect external processing ()
    This can be done in two ways:
    1. Save the external processing file locally to disk and open it through the menu “File” → “Open” before each loading of data in CML format.
    2. Connect processing to the information base (IS) permanently. Then it will be available to everyone (if working over a network) from the menu “Tools” → “Additional reports and processing” → “Additional external processing”.

    • In the “Service” menu, you must select “Additional reports and processing” - “Additional external processing”.
    • Click the “Add” button. The form for adding a new directory element will open:
    • In the “Name” field, indicate the name of the processing, for example, “Loading data in CommerceML format (RU-CENTER Group).”
    • Click the file selection button and specify the path to the download processing file ().
    • Click the “OK” button. Now the processing is connected to the infobase and is located in the “Additional external processing” directory, and it can be opened by double-clicking the mouse.

    1.2. If you are using the “Manufacturing Enterprise Management” (version 10.3 and higher) and “Trade Management” (version 1.3 and higher) configurations, this processing is already enabled and you can proceed to step 2.

    2. Formation of the document “Receipt of goods and services”

    As a result of the steps below, information about the services purchased from Peterhost will be entered into 1C.
    1. Next, you need to save an XML file with the data of the “Receipt of goods and services” document for the required period to your computer. The file in XML format is located in the Personal Account section under the link “XML for 1C”.
    Click the selection button to the right of the “Data file name” field and select this file (see Figure 1). To the question “Read data from a file?” answer "OK". The data file will be read by processing.
    2. If processing is able to determine all the correspondence between the file data elements and the infobase data, the question “Save the data to the infobase?” will be asked. If you answer “Yes”, a new document “Receipt of goods and services” will be created. Go to step 3.
    3. If not all data matches are identified, the message will be displayed: “When loading data, the program was unable to automatically find information security objects corresponding to the elements transferred in the exchange file...” and will offer to perform the comparison manually. In this case, you must do the following:

    • Click "OK". A form for comparing file objects and information security will open. It has several tabs that correspond to different types of objects (organizations, contractors, items, etc.). If any type of data has not been matched, there will be red exclamation marks on the corresponding tabs (see Figure 2).
    • Go to the appropriate bookmarks and manually match the elements. It should be taken into account that matches of counterparties and organizations are searched for by TIN, and matches of nomenclature are searched first by article number, then by name. If the element that corresponds to the file data is not in the IB, then it can be created automatically using the file data by clicking the “Create using data from file” button.
    • When adding items, you must check the “Service” property (see Figure 3). You can also change the full and short names of an item in the nomenclature.
    • On the “Accounts” tab, it is advisable to add item accounting accounts so that when creating the “Receipt of goods and services” document, these numbers are entered automatically. For example, the following values ​​can be set for services: “Accounting account” – 25 (Overall production expenses) and “Accounting for submitted VAT” – 19.04 (VAT on purchased services) (see Figure 4).
    • After comparing all the elements and clicking the “OK” button, the program will ask for confirmation to upload the document to the information security system, after which it will create a new document “Receipt of goods and services” (see Figure 5).

    3. Posting the document “Receipt of goods and services”

    To post the “Receipt of goods and services” document, you need to open it by double-clicking and fill in the missing fields, such as “Advance offset” (for example, “Automatic”) and the fields on the “Settlement accounts” tab (see Figure 6). The values ​​of these fields are determined by your organization's accounting policies. To post the document, click the “OK” button.

    4. Formation of the “Invoice” document

    After successfully creating and posting the “Receipt of goods and services” document, you can use it to create the “Invoice received” document. To do this, click on the appropriate link in the lower left part of the document form.