Processing for creating printed forms 1c. Publications. Initializing Basic Variables

This article describes how to connect an external printable to the 1C base using the example of the "Trade Management 10.3" configuration

The "Trade Management 10.3" configuration is a configuration on the so-called "REGULAR" forms, and not on "MANAGED" forms like "Trade Management 11.2", we recommend reading for "MANAGED" forms.

Our instruction "shows" how to connect an external printing plate in 1C with a configuration on "REGULAR" forms, namely:

  • "Accounting 2.0"
  • "Trade Management 10.3"
  • "Salary and personnel management 2.5"
  • "Integrated Automation 1.1"
  • "Control manufacturing enterprise 1.3 "
  • "Retail 1.0"
  • and other similar configurations.

In order to connect an external printing plate in 1C, we need to go through 11 steps.

1 - Menu "Service". 2 - We select "External printing forms and processing". 3 - Next - "External printing forms" (see the figure below ↓)

In order to convince you that this instruction is suitable for other configurations on "STANDARD" forms - we will present the same initial 1-2-3 steps, but not in "Trade Management 10.3", but in "Accounting 2.0" everything is there as well, with the exception of slightly changed words in the subparagraphs, namely ...

1 - Menu "Service" (as in "UT 10.3", and in others).
2 - Here "Additional reports and processing", and not "External printing forms and processing" as in "UT 10.3",
but all the same, the meaning is the same and is in the same place in the "Service" menu.
3 - And then - "Additional external printing plates", i.e. an extra word "Additional" when compared with "UT 10.3" (see the figure below ↓)

Then we will continue with the example of "Trade Management 10.3" without unnecessary comparisons.
4 - Press the button "+" i.e. Add. 5 - The button where the folder is drawn (on hover, a hint will appear: "Replace external processing file").

In new versions of 1C (since August 2016), the program has a built-in warning mechanism about the dangers of using unknown external processors that may contain "viruses"; in earlier versions of the program, the warning will not occur! If it occurs, then to connect external processing it will be necessary - 6 - press the "Continue" button. (see picture below ↓)

7 - We select the directory in which the file of the external printing form we need is located. 8 - Select our file. 9 - Click "Open" (see the figure below ↓)

10 - An external printable can have auto-registration parameters, as in our case, here it makes sense to click "Yes" - thereby using these parameters during registration, i.e. automatically select those objects (documents or maybe, for example, directories) in which it will be possible to use a plug-in external printable (see the figure below ↓)

That's all, we have filled in the "Printed form ownership" table, thanks to the auto-registration parameters, we see the name of the connected external print form, perhaps you will fill in the "Comment" field, etc. You can add your objects to the "Printed form ownership" table, for example, for our processing "Universal printable form of the contract", which supports the printing of many documents and reference books, but the auto-registration parameters are set only for the main ones: 10* - Click on the green "Add" button and choose which objects to place for processing. Now all that remains is - 11 - press the "OK" button and (see the figure below ↓)

Now it's worth checking - have we done everything right?
To do this, select an object for verification, for example, the document "Sale of goods and services", which is indicated in the table "Printing plate ownership", which means that the connected printing form can be used in this document! Let's check ... (see the picture below ↓)

To check the possibility of printing, open any document of the form: "Sale of goods and services." 13 - Press the "Print" button.
We see - a selection window has appeared printed forms, among them there is - 14 - external printing plate connected by us (see the picture below ↓)

How to add (register) an external printing form (or processing) in 1C Accounting 8.3 (revision 3.0)

2019-05-15T13: 40: 54 + 00: 00

Often the accountant needs an additional printed form to any of the standard documents 1C: Accounting 8.3 (revision 3.0). Or you need additional processing, for example, to automatically fill out a document or enter a new one based on. Usually such an opportunity has already been developed by someone and can be found or ordered from a programmer. And now the revision has been received, it remains only to add it to the accounting department. How to do it? More on this below in steps.

1. Open 1C Accounting 3.0 and select the section "Administration" -\u003e "Print forms, reports and processing" in the left pane ():

2. Here find and select the "Additional reports and processing" item, having previously checked the "Additional reports and processing" checkbox on the left:

3. Click the "Add from File ..." button.

4. And select the file with external printable or processing (epf extension).

5. In the new window, click the "Save and Close" button.

6. Open required document and make sure that the print button has another version of the printable or an item in the "Create from" menu or a new button on the form toolbar. Done!

Respectfully, Vladimir Milkin (teacher and developer).

This article describes how to connect an external printing plate to the 1C base using the example of the "Trade Management 11.2" configuration

The "Trade Management 11.2" configuration is the configuration on the "MANAGED" forms!

Our instruction “shows” how to connect an external printable form in the 1C infobase with the configuration on “MANAGED” forms, namely:

  • "Accounting 3.0"
  • "Trade Management 11.2"
  • "Salary and personnel management 3.1"
  • "Integrated Automation 2.0"
  • "Small Business Management 1.6"
  • "Retail 2.2"
  • and other similar configurations.

In order to connect an external printing plate in 1C, we need to go through 11 steps.

1 - Menu "NSI and Administration" (In other configurations, such as in Enterprise Accounting 3.0, it can be called simply - "Administration"). 2 - Choose "Printed forms, reports and processing" (see the figure below ↓)

3 - Expand the "Reports and Processing" submenu (In other configurations, such as in Enterprise Accounting 3.0, this submenu may not appear, so go straight to the next step). 4 - We put a "tick" in the Use of additional reports and processing. 5 - Go to the section: Additional reports and processing. (see picture below ↓) ()

6 - Press the button "Create". (see picture below ↓)

In new versions of 1C (since August 2016), the program has a built-in warning mechanism about the dangers of using unknown external processors that may contain "viruses"; in earlier versions of the program, the warning will not occur! If it has arisen, then to connect an external printing plate it will be necessary - 7 - press the "Continue" button. (see picture below ↓)

8 - Select the directory in which the processing is located. 9 - We select it (the processing we need). 10 - Press the "Open" button. Or, instead of steps 9 and 10, you can simply double-click on the external printable we need in the selection window. (see picture below ↓)

If we need to add a placement for the added processing (For example, this is a Universal form of a contract from our site and we need the command to print this form to be displayed in some object, which is not initially displayed) - 11 - click on the placement line ("Place in:", maybe "Placement:") and select the necessary directories and documents. 12 - We complete the steps to connect an external printing form by pressing the button "Save and close". (see picture below ↓)

That's all! Congratulations! External printing plate is connected! Have we done everything right? Let's check ...

Before Recording and closing, we noticed that this external printable is placed in the document Sale of goods and services, which means that we can open any document of the type: "Sale of goods and services". press the "Print" button and see - a window for selecting printable forms has appeared, among them there is - 13 - external printing plate connected by us (see the picture below ↓)

Now for sure - everything. We hope this article was helpful to you.

Go to Service->Additional reports and processing->Additional external printing plates.

The form for the list of the reference book with external printable forms has opened. In the top menu of the list, click Add to... A form for creating a catalog item appears.

Press the Open button and select the file with the required printable form. After that, if necessary, set desired name (Name field).

If the printable contains auto-registration parameters, then a message about this will pop up. Push Yes.If this is not the case, then you yourself need to indicate to which document this form will be attached. To do this, add a line to the tabular section "Affiliation of the printable", where in the "Object representation" field select the type of document to which we are linking the form ... Since in our example this is the act of writing off materials, we select the document Requirement-invoice.

After that, go to any document Requirement-waybill, click Print, and select the form you just added.

For BP 3.0, ZUP 3.0, UT 11, KA 2.0, ERP 2.0.

To demonstrate how to add a printable in a managed interface, I'll show you adding external form invoices for payment to the document of the same name in Accounting 3.0.

We go to the corresponding section of the program:


It is necessary that the sign of using external reports and processing be enabled, follow the hyperlink to the list of external objects:

In the list that opens, click Create a:


In the dialog box, select the desired file:


The card of the external object is filled in: in the placement we see the type of the base object to which the form will be attached and just below its name:


Let's write and close the form of the created external object.

Now let's go to any document Invoice for payment to the buyer and display the print menu:


How to create an external printable from a finished one? 1C 8.0 / 8.1
_______________________________________________________

It is assumed that you already have knowledge gained in the process of reading the topic, therefore only new questions are discussed in detail.

So: we needed to slightly change the layout of the invoice for payment to the buyer (we will work with the configuration Accounting 1.6):
- remove the title in the layout of the invoice for payment (the text "Attention! Payment of this invoice ..., if you have a power of attorney and a passport.")
- change the view of the supplier (i.e. us) at the request of the bank
(task from real life with a running time of 15-20 minutes)

Processing creation will consist of two stages:
1 - creating a complete analogue of the original printing plate
2 - customization for your own needs

Stage one

First, let's create an empty external processing, only we will not create a layout -
we will copy it for later change from the main configuration. To copy the layout into processing from the configuration - it is enough
select it in the object tree, then go to the menu Edit-Copy, after in the tree of data processing in the branch of layouts select
on the menu Edit-Paste A more convenient way is to directly drag and drop this layout from the main configuration into the data tree.
processing.

And we write the following code:

Function Print () Export // ... here we will write something later EndFunction

What we did: an export (i.e. visible to other configuration objects) function is required for the external printable to work Printing,
which should return the generated spreadsheet document to the main program for preview and subsequent printing.

In order not to reinvent the wheel, let's see how the spreadsheet document is formed in the main configuration: for this we will go
to document module Invoice For Payment To Buyer Find the function in the module Printingwhich looks something like this:

// The procedure prints the document. It is possible to direct the printing to the // screen or printer, and also to print the required number of copies. // // The name of the print layout is passed as a parameter, // by the passed name we find the name of the layout in accordance with. // // Parameters: // LayoutName - string, layout name. // Procedure Print (LayoutName, Number of Instances \u003d 1, OnPrinter \u003d False, Direct Print \u003d False) Export // Get a copy of the document to print If LayoutName \u003d "Invoice" Then TabDocument \u003d PrintOrderInvoice (LayoutName); EndIf; UniversalMechanisms.PrintDocument (TabDocument, Number of Instances, OnPrinter, WorkWith Dialogues.GenerateDocumentHeader (ThisObject, ""), DirectPrint); EndProcedure // Print

In our case, it turns out that to print the invoice, the parameter is passed to this function Layout Name equal to string variable "score",
if we look at the code, we will see that the function is used to form a standard invoice Print Order Invoice (...)which now
we also need to find the document module in the code. It is usually located just above the function print (...)
So, here is the shorthand for this function:

// The function generates a spreadsheet document with a printed form of an order or invoice, // developed by methodologists // // Returned value: // A spreadsheet document - a generated printable // Function PrintOrderInvoice (Type) Request \u003d New Request; Request.SetParameter ("CurrentDocument", ThisObject.Link); // ... program code ... Layout Area.Parameters.Fill (Header); TabDocument.Display (Layout Area); Return of TabDocument; EndFunction // PrintOrderInvoice ()

As we can see, at the end of this function, the generated spreadsheet document is returned - we just have to completely copy the text
this function (starting with the line "Query \u003d New Query;" and ending with the line "Return TabDocument;") and insert it into the body of the prepared function
Printing in our processing module.

After we insert the function text, let's try to save the processing. The configurator will warn us that it has found errors in the module and will display
them into the service messages window. Here's an example test of these errors:

(ExternalProcessing.ExternalProcessing1 (102,7)): Variable is not defined (Type) If<\u003e Type \u003d "Account" Then (ExternalProcessing.ExternalProcessing1 (224,7)): Variable not defined (Type) If<\u003e Type \u003d "Account" Then (ExternalProcessing.ExternalProcessing1 (107,15)): Variable not defined (Structural Unit) IfTypeZnch (<\u003e Structural Unit) \u003d Type ("ReferenceRef.Bank Accounts") Then (ExternalProcessing.ExternalProcessing1 (108,40)): Variable not defined (Structural Unit) Bank \u003d? (NOT ValueFilled (<\u003e Structural Unit.Bank For Settlements), Structural Unit.Bank, Structural Unit.Bank For Settlements); (ExternalProcessing.ExternalProcessing1 (108,77)): Variable not defined (Structural Unit) Bank \u003d? (NOT ValueFilled (Structural Unit.BankFor Settlements),<\u003e Structural Unit.Bank, StructuralUnit.Bank For Settlements); (ExternalProcessing.ExternalProcessing1 (108,102)): Variable is not defined (Structural Unit) Bank \u003d? (NOT ValueFilled (Structural Unit.BankFor Settlements), StructuralUnit.Bank,<\u003e Structural Unit. Bank for Settlements); (ExternalProcessing.ExternalProcessing1 (112,38)): Variable not defined (StructuralUnit) AccountNumber \u003d Return SettlementAccount (<\u003e Structural Unit); (ExternalProcessing.ExternalProcessing1 (123,21)): Variable not defined (StructUnit) If EmptyString (<\u003e StructuralUnit.CorrespondentText) Then (ExternalProcessing.ExternalProcessing1 (125,27)): Variable is not defined (StructuralUnit) If ValueFilled (<\u003e Structural Unit.BankFor Settlements) Then (ExternalProcessing.ExternalProcessing1 (126,59)): Variable is not defined (Structural Unit) Correspondent Text \u003d Correspondent Text + "p / s" +<\u003e StructuralUnit.AccountNumber (ExternalProcessing.ExternalProcessing1 (127,15)): Variable not defined (StructuralUnit) + "in" +<\u003e Structural Unit. Bank + "" + Structural Unit. Bank. City; (ExternalProcessing.ExternalProcessing1 (127,47)): Variable is not defined (StructUnit) + "in" + StructuralUnit.Bank + "" +<\u003e Structural Unit. Bank City; (ExternalProcessing.ExternalProcessing1 (130,26)): Variable not defined (StructuralUnit) Correspondent Text \u003d<\u003e Structural Unit. Correspondent's Text; (ExternalProcessing.ExternalProcessing1 (112,17)): Procedure or function with the specified name is not defined (ReturnCalculatedAccount) AccountNumber \u003d<\u003e Return Settlement Account (Structural Unit);

Let's take a look at these errors:
*** 1. Variable is not defined (Type) - if you look at the source code of the function, it becomes clear that the type variable was a parameter:
Print Order Invoice Function (Type), we removed this parameter. In this case, this parameter contained a string with the name of the layout
for print. Because we only need to print one layout - we define this variable as follows: we change the title
functions Printing in the processing module:

Function Print (Type \u003d "Account")

What does this notation mean: it means that if a parameter was not passed to the function, then the parameter A type will take on
default "Score", which is what we need to work.

*** 2. Variable not defined (Structural Unit) - this variable is a document attribute Invoice for payment to the buyersince
we do not see this attribute in the module of the external printing form (we are not in the body of the document object), then we will get this variable through
link to the document, i.e. via processing props ReferenceObject, to which the program will send a link to the current document.
Add the following line to the beginning of the function:

*** 3. Procedure or function with the specified name is not defined (ReturnCalculatedAccount) - this function is defined (i.e. described) in the module
document, respectively - we just have to completely transfer the code of this function to our processing.

So now the processing module looks something like this:

Function Return Settlement Account (Counterparty Account) BankFor Settlements \u003d Counterparty Account.BankFor Settlements; Result \u003d? (BankFor Settlements.Empty (), Counterparty Account.Account Number, Counterparty Account.Bank.CorrAccount); Return Result; EndFunction // Return SettlementAccount () // The function generates a spreadsheet document with a printed form of an order or invoice, // developed by methodologists // // Returned value: // A spreadsheet document - a generated printable // Function Print (Type \u003d "Invoice") Export Structural Unit \u003d ObjectReference.StructuralUnit; Request \u003d New Request; Request.SetParameter ("CurrentDocument", ThisObject.Link); // ... program text ... Layout Area.Parameters.Fill (Header); TabDocument.Display (Layout Area); Return of TabDocument; EndFunction // PrintOrderInvoice ()

If everything is done correctly, now we can save the processing and we will get a complete external analogue of the built-in printing form.

Stage two

Now we will make the necessary changes when printing to the layout (it is assumed that you know how to work with layouts), and also change
supplier text in the invoice header.

As we can see from the program code, the recipient text is filled in this place:

If EmptyString (StructuralUnit.CorrespondentText) ThenCorrespondentText \u003d SupplierInformation.FullName; If the Value is Filled in (Structural Unit.BankFor Settlements) Then Correspondent Text \u003d Correspondent Text + "p / s" + Structural Unit.Account Number + "in" + Structural Unit.Bank + "" + StructuralUnit.BankCity; EndIf; Otherwise CorrespondentText \u003d StructuralUnit.CorrespondentText; EndIf; LayoutScope.Parameters.VectorPresentation \u003d CorrespondentText;

The customer has set a condition that the text for this cell is taken from the name of the payer in payment orders for
transfer of taxes. This text is stored in the props of the catalog item The organization - we only have
access it. If you look at the details of the document, then we will see that they store information about the organization,
according to which the document was issued, and the text we need is stored in the requisite of the organization - now we know how to get access:

LayoutScope.Parameters.VerificationSupplier \u003d ReferenceOnObject.Organization.PayerName when Taxes are enumerated;

That's all - the layout is ready to go and can be connected to the configuration!

In the topic, you can take the processing that should have been the result.

PS. Discussions, questions, suggestions - everything is in the topic.