1c development of your own configuration

A simple configuration for recording the movement of cartridges for laser equipment in an organization has been built using the 1C Enterprise 8.3 platform and the Taxi interface. The movement of each cartridge is taken into account (purchase, refilling, restoration, repair, installation in a printer, etc.) and the expense of funds for each cartridge. The main goal is to master application development based on the 1C Enterprise 8.3 platform using the example of building a workable and useful application.

I am an experienced programmer, but I have not seriously studied 1C before. In order to combine the pleasant (introduction to 1C Enterprise 8.3) with the useful (nobody canceled the work), let’s try to build a working configuration using the capabilities new version. Maybe the configuration development process will be useful for someone and will help beginners master 1C.

I work in the IT department of a large organization with a large number of laser printers and MFP. For them, accounting for the movement of cartridges is an urgent task and management requirement.

Statement of the problem.

Toner refilling, restoration, and repair of cartridges are carried out by a third party. It is necessary to take into account the movement of each cartridge, that is, purchase, refilling with toner, restoration, repair, installation in a specific printer (MFP), current location, write-off, etc. In addition, it is necessary to take into account the costs for each cartridge (costs of purchase, refilling with toner, etc. by supplier).

It’s clear that some reports are needed. Of course, everything should be as simple and clear as possible for users.

Implementation plan.

We use the 1C Enterprise 8.3 platform as the most modern at the moment.

To master the platform, we will try to use as many different configuration objects as possible and, naturally, the new Taxi interface. We will try to give objects names that are understandable and close to their functional purpose. For now, we will not touch on the “subtle” aspects of 1C operation, such as optimization of client-server interaction, distribution of roles, etc.

Let us first assume that our configuration will have the following objects:

Directories:

Nomenclature of Cartridges

Cartridges

Nomenclature of CartridgesPrices

Printers

Printer range

Suppliers

Documents:

Arrival Cartridges

Replacing the Cartridge

Write-off of Cartridges

Transfers:

Not really

Condition of Cartridges

Reasons for replacing cartridges

Information registers:

CartridgesReplacement

Accumulation registers:

CartridgesPayment

Algorithm of work.

The main “actor” is the list of available cartridges (Directory Cartridges). Initially, the list is filled with the document Arrival Cartridges Nomenclature of Cartridges. When purchasing a cartridge, the value of the details State in the document is selected as New. The purchase price is determined according to the directory Nomenclature of CartridgesPrices current date SerialNumber). Props Location defined as "C treasure".

Accounting for refills, restoration, repair, etc. of existing cartridges is also carried out by the document Arrival Cartridges. The type of cartridges is determined by the reference book Nomenclature of Cartridges. The state of the cartridge is determined from the enumeration Condition of Cartridges. The price of work (refueling, restoration) is determined according to the reference book Nomenclature of CartridgesPrices. The uniqueness of a cartridge is determined by its serial number (requisite SerialNumber).

When posting a document Arrival Cartridges V tabular part Replacing Cartridges directory Cartridges a line is added with the details of the current document and the corresponding cartridges (with the serial number from the document) in the directory Cartridges the value of the details changes State And Location.

In addition, in the accumulation register CartridgesPayment

Accounting for cartridge replacement in a specific printer (reference book) Printers) is carried out by document Replacing the Cartridge. The document indicates the current printer. The uniqueness of the printer is determined by the details SerialNumber. The cartridge to be installed and replaced is indicated ( serial numbers cartridges).

When posting a document Replacing the Cartridge in the tabular part of the directory Printers For the current printer, a line with the document details is added and the details are changed Cartridge. In the directory Cartridges for current cartridges the value of the details changes State And Location. For the installed cartridge in the props Location the current printer is registered, and for the removed cartridge - “ Warehouse".

In addition, in the register CartridgesReplacement movement on this document is recorded.

Write-off of cartridges is carried out in a separate document Write-off of Cartridges.

Thus, at the current moment in time in the directory Cartridges Each cartridge has a very specific state (new, refilled, empty, etc.) and a specific location ( "Warehouse" or a specific printer), which, through simple reports, allows you to assess the availability of cartridges with a given state and draw a conclusion about the need for purchase, refilling, etc. And of course, take into account costs.

Implementation.

Let's start with the actual configuration.

Let’s create an empty database in the configurator, proudly call it “IT specialist” and organize a subsystem Cartridge accounting. I will not describe step by step how to do this, since there are enough books on this issue.

First let's add the enumerations: Not really, Condition of Cartridges And Reasons for replacing cartridges, which we will need later. The composition of the transfers is visible in Fig. 2

Let's configure simple directories Nomenclature of Cartridges And Nomenclature of Printers.

Props Cartridge Type in the directory Nomenclature of Printers assign the type reference to a directory Nomenclature of Cartridges(Fig.3). Do not forget that all configuration objects we have created must be included in the subsystem Cartridge Accounting.

In the directory Printers Several details have a link type:

For further testing of the program, we will fill in several lines in the directories we have opened in Enterprise mode. Naturally, first we fill out simple directories, then - directories with details with links. In the future, the loading of complete real enterprise data is expected to be carried out using processing from Excel tables.

Now it's time to add documents to the configuration. Let's configure the document object in the configuration object tree Arrival Cartridges with details and tabular part Nomenclature of the Document. We don’t have accumulation registers in the configuration yet - bookmark Movement remains empty for the document. Since we will need to write our own processing of the document, and we write program code in the document form module, then we will create this very form (Fig. 9). We do everything by default, as written in the books (Form - Add - Document Form).

We will use this document when we receive both new and refilled (remanufactured, repaired) cartridges into the warehouse.

Finally, to record the receipt of cartridges, we create an accumulation register CartridgesPayment with measurements, resources and details (Fig. 10) .

Bookmarked Registrars indicate our document Arrival Cartridges. Save the configuration.

Returning through the tree of objects to the document Arrival Cartridges. On the bookmark Movement select register CartridgesPayment, launch the Motion Designer and fill in the Expression field with the values ​​of the document details (Fig. 11).

Click OK and you will be taken to Object module program code (Fig. 12).

Now the most interesting thing - you need to add program code to the Object Module to provide the following functionality when posting a document Arrival Cartridges.

When a new cartridge arrives (purchase) in the directory Cartridges a line must be added with the unique cartridge number and the corresponding (from the document) details. In this case, the props Cartridge Condition will mean " New", and the props Location- meaning " Warehouse" Tabular part of the directory Cartridges it is not filled in.

According to the algorithm of the program, you must initially enter each cartridge with its unique number in the directory Cartridges document Arrival of Cartridges.

When a cartridge refilled with toner (remanufactured, repaired, etc.) arrives, it is considered that a cartridge with the same number is already in the directory Cartridges, and in this case, when posting the document Arrival of Cartridges, a row is added to the table section Gas stations and the values ​​of the details change Location And State for the current cartridge. The code added to the Object Module is shown in Fig. 13.

Now you can conduct the first test of the program's performance. In Enterprise we create a document Arrival Cartridges(Fig. 14). Press the button Swipe and close. Go to the directory Cartridges and we see that a line with the details of the purchased cartridge with an empty tabular part has appeared (Fig. 15).

Let's open the register CartridgesPayment(menu item Cartridge payment register) and we will see a similar line there.

We create and post the second document Arrival Cartridges with the same cartridge, but refilled (Fig. 16).

Go to the directory Cartridges and we see that the cartridge we installed has a line added in the tabular section Gas stations and the props have changed State(Fig. 17).

Hooray! The program works!

Of course the functionality of the document Arrival Cartridges needs to be improved, for example, I would like the latest price of the service to be automatically entered into the field Price document from the directory Nomenclature of CartridgesPrices when choosing a supplier and for of this type cartridge.

This will happen later, but now let’s start replacing the cartridges - create a document Replacing the Cartridge and the corresponding information register CartridgesReplacement.

Details and tabular part of the document Nomenclature of the Document are shown in Fig. 18. We do not yet have suitable accumulation registers and information in the configuration, bookmark Movement We will not mark anything for the document. Since we will need to write our own document processing, we create a default DocumentForm.

To account for the replacement of cartridges, for a change we create an information register (not an accumulation register) CartridgesReplacement with measurements and details (Fig. 19) . It turned out so far without resources somehow .

Bookmarked Registrars indicate our document Replacing the Cartridge.

Save the configuration. Returning through the tree of objects to the document Replacing the Cartridge. On the bookmark Movement select register CartridgesReplacement, launch the Motion Designer and fill in the Expression field with the values ​​of the document details. Click OK and you will be taken to Object module document, where we see the already created Register movement constructor program code (Fig. 20).

Now we add to Object module program code to provide the following functionality when processing a document Replacing the Cartridge. In the directory Printers for a printer whose cartridge is being replaced, a line must be added in the tabular section Replacing Cartridges with the values ​​of the details from the document and the value of the attribute will change Cartridge NumberNow. In the directory Cartridges for removed and installed cartridges, the details of the details will change Location And State. Improved document processing procedure Replacing the Cartridge shown below.

ProcessingProcedure(Failure, Mode)

// used directories

Printers = Directories.Printers;

Cartridges = Directories.Cartridges;

// end of insert used reference books

// register CartridgesReplacement

Movements.CartridgesReplacement.Write = True ;

For each TechLineNomenclatureDocument From NomenclatureDocument Cycle

Movement = Movements.CartridgesReplacement.Add();

Movement.Cartridge Nomenclature = Cartridge Nomenclature;

Movement.RemovedCartridgeNumber = TechStringDocumentNomenclature.RemovedCartridgeNumber;

Movement.InstalledCartridgeNumber=

Motion.PrinterModel = PrinterModel;

Movement.PrinterSerialNumber = TechStringDocumentNomenclature.PrinterSerialNumber;

Motion.PrinterInventoryNumber =

Movement.CartridgeType = TechStringDocumentNomenclature.CartridgeType;

Movement.ReplacementWhoDid = ReplacementWhoDid;

Movement.ReasonReplacement = TechStringDocumentNomenclature.ReasonReplacement;

// change the Printers directory

NameString = TextStringDocumentNomenclature.PrinterSerialNumber;

Then CurrentObject =

Printers.FindByAttributes("SerialNumber",NameString).GetObject();

CurrentObject.CartridgeNumberNow =

TechStringDocumentNomenclature.InstalledCartridgeNumber;

NewRow = CurrentObject.ReplaceCartridges.Add();

NewRow.ReplacementDate = Date;

NewString.CartridgeType = TechStringDocumentNomenclature.CartridgeType;

NewLine.InstalledCartridgeNumber =

TechStringDocumentNomenclature.InstalledCartridgeNumber;

NewLine.RemovedCartridgeNumber =

TechStringDocument Nomenclature.RemovedCartridgeNumber;

NewLine.WhoReplaced = ReplacementWhoDid;

NewString.ReasonReplacement = TechStringDocumentNomenclature.ReasonReplacement;

CurrentObject.Write();

endIf;

// change the Cartridges directory - installed cartridge

NameString = DocumentStringNomenclature.InstalledCartridgeNumber;

then CurrentObject =

String = " ";

String = String + PrinterModel + " " +

TechStringDocument Nomenclature.PrinterSerialNumber + " " +

TechStringDocumentNomenclature.PrinterInventoryNumber;

CurrentObject.Location = String;

CurrentObject.Write();

endIf;

// removed cartridge

NameString = TextStringDocumentNomenclature.RemovedCartridgeNumber;

Then CurrentObject =

Cartridges.FindByAttributes("Number",NameString).GetObject();

CurrentObject.Location = "Warehouse";

CurrentObject.State = Enums.CartridgeState.Empty;

CurrentObject.Write();

endIf;

// end of changing directories

EndCycle;

EndProcedure;

For verification, fill out and submit the document Replacing the Cartridge(Fig.21) . Go to the directory Printers and we see that the selected printer has a row added to the tabular section Gas stations with details of the document we processed and details Cartridge NumberNow accepted the value of the number of the installed cartridge (Fig. 22).

In the directory Cartridges at the cartridge installed in the printer, in the props Location the data of the current printer has been recorded (Fig. 23). And in addition to the information register CartridgesReplacement movement on the document was recorded (Fig. 24)

Thus on at the moment The result is a configuration for recording the movement of cartridges for laser technology, which, in principle, can already be used in work.

From the point of view of the “ideology” of 1C, it is probably wrong to change the details of directories by posting documents, to use a directory to store current prices - this is where the previous experience of working with tables of the author of the article comes into play, and why is a directory not a table?

Naturally, functionality needs to be improved, reports added, bugs fixed, and debugged. More on this in the next part of the article.

The full version of the article is given in the file Part1.doc

I wrote how to install the 1C 8 platform and the 1C Enterprise Accounting 8 configuration itself.

Now we will look at how to create a new empty 1C 8.3 database for a new enterprise.

How to add an information base to 1C 8.3

This is not at all difficult to do, even easier than. However, it can be difficult for beginners to understand the nuances of installing and creating a database.

Step 1: Open 1C:Enterprise.

Step 2: If your list of databases is empty, the system will kindly offer new base data, if there are already databases in the list, click on the “Add” button. The system will display the following window:

Get 267 video lessons on 1C for free:

Step 3: Set the flag opposite “Creating a new information base” and click the “next” button

Step 4: Select from the list of databases the configuration that we want to create, for example, Enterprise Accounting. The standard configuration always includes a “demo” base. This is a demonstration base filled with demo information on which you can test some points and learn. I strongly recommend deploying such a 1C database for training.

Step 5: Set the name of the future database, do not change anything, click “next”.

Step 6: At this step you need to specify the location of the files to create the 1C database on your hard drive. I advise you to choose non-system partitions.

In this material, based on 1C Enterprise 8.3 and 8.2, we will consider in detail the recommendations and main stages of developing a configuration from scratch.

In general, the whole process can be divided into stages:

What is the idea behind the 1C configuration?

The creation of all software products, of course, must begin with an idea. In general, by its nature it should be unique. However, exceptions may occur when you cannot provide the future user with unique functions that are not contained in one of the other software. It is advisable to keep your idea secret from the general public, because it is, in fact, the most important thing for today's software.

Selecting a site for future functionality software product

In this case, you need to decide: will the new functionality be standalone or integrated into one of the popular ones? typical configurations. There are cases where it can combine both.

All methods have pros and cons:

Testing this configuration

Testing a software product is one of the most important and difficult stages in creating software. You cannot allow the user to find errors, because this will greatly underestimate the assessment of the software.

Configuration protection

Every configuration written from scratch needs protection from thieves and intruders. There are various protection systems, for example, hardware or software.

After creating the configuration, you need to register copyright for it. This will protect it from intruders.

If the 1C 8.3 platform is already installed on your computer or server, then you can create a new 1C 8.3 Enterprise database yourself. How to do this is written in this article.

There are two ways to create a new database on the 1C 8.3 platform:

  1. Based on another working base with an already configured configuration
  2. From the configuration template included in the 1C 8.3 package

The first method is suitable for organizations that already have a working program and need to make a copy of it or an empty database with similar settings. The second method is for those who want to create a new database with standard 1C settings. A standard configuration template is included in the kit that you purchased from 1C. This template can also be downloaded from the 1C website.

Look convenient program for small businesses with an unlimited number of enterprises

Quick transfer of accounting to BukhSoft

How to create a new 1C 8.3 database based on an existing one

Select “Creating an infobase without configuration...” (4) and click “Next” (5).

Enter the name of the new database (6), select the location type “On this computer..." (7), and click the "Next" button (8).

In the new window, specify the directory where the new database will be located (9) and click “Next” (10).

In the window that opens, click the “Done” button (11).

Now, when you start 1C, you see a new database (12) in the list. Now you need to configure a new 1C 8.3 database based on the existing one.

Step 2. Save the existing database configuration

Launch 1C, click on the old database (1), the configuration of which you want to transfer to the new database, and click the “Configurator” button (2).

The old database configurator window will open. Go to the “Configuration” section (3) and select “Save configuration to file” (4). In the window that opens, select a folder and save the file there.

Step 3. Load the saved configuration into the new database

Launch 1C, click on the new database (1), into which you need to load the configuration of the old database, and click the “Configurator” button (2).

In the configurator window, in the “Configuration” section (3), click on the “Open configuration” link (4).

Select the configuration file (6) that you saved in the old database and click “Open” (7).

The configuration will be loaded into the new database. Once the download is complete, a message (8) will appear indicating that the download is complete. Click the “Yes” button (9) to update the database.

After the update, the message “Reorganization of information” (10) appears with a list of changes. Click Accept (11) to complete the configuration update.

How to create a new 1C 8.3 database from a template

Step 1. Add a new infobase

Launch 1C and click the “Add” button (1).

Select “Create a new infobase” (2) and click the “Next” button (3).

Select “Creating an infobase from a template” (4), indicate the release of the 1C program that you want to install (5), and click “Next” (6).

Enter the name of the new database (7), select the information base location type “On this computer...” (8), and click the “Next” button (9).

In the new window, specify the directory where the new database will be located (10) and click “Next” (11).

In the window that opens, click the “Done” button (12). A new database has been created.

Now when you start 1C in the list information bases you see a new database (13) with template 1C settings.

The new base is ready for use. You can begin to reflect the facts of economic activity in it.

In the work of a 1C programmer, there are often requirements to develop configurations from scratch. It's not difficult. To make sure of this, let’s check it from our own experience.

We are starting a series of publications on developing a 1C configuration from scratch. Let's start with the “My warehouse and trade management” configuration (for the 1C thick client).

Independent creation of a 1C database from scratch

1. Create a folder on the disk, for example C:\1C\myUt.

4. After logging in, a configuration tree window opens on the left (if it doesn’t open, return to the previous point).

5. Open the configuration properties (right-click on the Configuration line, select Properties).

6. Enter the name of the configuration. The name must be one line. According to the rules of good manners - hunchbacked (no spaces, but each word begins with a capital letter). In our case, it will be “My Trade Management”.

7. Let's change the main launch mode. We will not apply for development yet managed forms and develop a configuration for a regular (thick client). Therefore, we will install the “Regular application”.

8. In the Brief information field, enter “My warehouse and trade management. Edition 1." This is a description of the configuration. Let's copy the same into the Detailed information field.

9. In the Screensaver field, click Open. He will prompt you to choose a picture for the screensaver. Format - .jpg. Size 195x70 pixels.

10. In the Supplier field, enter your name. In the version field, the value is “1.0”.

11. Leave the remaining values ​​as default. Click save (File / Save) and update (Configuration / Update database configuration).

12. We have just created the basis of the 1C configuration from scratch. Certainly large number There are still some adjustments ahead, but we can handle it.

See you in episode 2.
Good luck!

Download the ready-made database using these instructions >>

Connection