Quotation generate to Sales Order

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

I’ve created two fields, PO Number by Customer and MCP Number, named PONumber in both DocumentForm Quotation and DocumentForm Sales Order. How can I ensure that when the Generate > Sales Order button is clicked, the value from the PONumber field in the Quotation is automatically populated into the PONumber field in SalesOrder? Please refer to the attached images 5.1 and 5.2 for more clarity.

Edited: Gigha - Oct 18, 2024 10:54 AM
 
#2
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Hello Gigha,

for each "Document" object in 1C, a predefined "Filling" procedure is available (pic. 1 and 2).

This procedure is called when one object is created based on another, for example when you make a "Sales Order" from "Quotation".
The "FillingData" parameter is passed to this procedure, which contains the data of the "parent" object.

Thus, using the "Filling" procedure in the "Sales Order" document, you can process the data of the "Quotation" document and fill "Sales Order" with the necessary values.

Look at image 3 - there is an example of this procedure from the working program for the document "SalesOrder".

Download 1.png (48.52 KB)
Download 2.png (14.18 KB)
Download 3.png (15.02 KB)
 
#3
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Sep 19, 2016
Company: Kobi Yazılım Hizmetleri A.Ş.

Hello! I see you work on 1C:Drive. There is a very nice tool for editing print templates in this configuration. Maybe it can be useful for you. I recommend you take a look.

And as Aleksandr wrote before you should make some changes on codes. Of course firstly you should check print procedure in document manager module. For changes i recommend you to use configuration extensions. For example you can send to extension any procedure like on 4th photo (right click and "Add to extension") and template and make changes there.

Also you can some an external data processor for printing form. I share an example in attachment.
SSL (standart subsystem library) version 3.1.7.183

 
#4
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Thank you for your addition!

Yes, you are right - it is better to make such minor changes not in the configuration itself (i.e. not to change the source code), but to use extensions.

Dear Gigha, let us know please if you are familiar with the technology of creating extensions or no?

I can prepare a small example for you...

 
#5
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

I create new field named NoPobyCustomer  in Packing Slip in GoodIssue.
When I in PackingSlip, click Generate > Good Issue. The value from NoPobyCustomer in PackingSlip doesn't automatically populated into the NoPobyCustomer field in GoodIssue.
What I want is value from NoPobyCustomer in PackingSlip is automatically populated into the NoPobyCustomer field in GoodIssue when click Generate.
I already add code in Object module.

Code
&Around("Filling")
Procedure Ext1_Filling(FillingData, FillingText, StandardProcessing) Export
   
   If TypeOf(FillingData) = Type("DocumentRef.DebitNote") Then
      
      AccountingPolicy = InformationRegisters.AccountingPolicy.GetAccountingPolicy(FillingData.Date, FillingData.Company);
      If Not AccountingPolicy.UseGoodsReturnToSupplier Then
         
         Raise StringFunctionsClientServer.SubstituteParametersToString(
            NStr("en = 'Company %1 doesn''t use goods issue for posting inventory entries at %2 (specify this option in accounting policy)'"),
            FillingData.Company,
            Format(FillingData.Date, "DLF=D"))
         
      EndIf;
         
   EndIf;
   
   FillingStrategy = New Map;
   FillingStrategy[Type("Structure")]                        = "FillByStructure";
   FillingStrategy[Type("DocumentRef.SalesOrder")]               = "FillBySalesOrder";
   FillingStrategy[Type("DocumentRef.PurchaseOrder")]            = "FillByPurchaseOrder";
   FillingStrategy[Type("DocumentRef.GoodsReceipt")]            = "FillByGoodsReceipt";
   FillingStrategy[Type("DocumentRef.SalesInvoice")]            = "FillBySalesInvoice";
   FillingStrategy[Type("DocumentRef.DebitNote")]               = "FillByDebitNote";
   FillingStrategy[Type("DocumentRef.SubcontractorOrderIssued")]   = "FillBySubcontractorOrderIssued";
   // begin Drive.FullVersion
   FillingStrategy[Type("DocumentRef.Production")]               = "FillByProduction";
   FillingStrategy[Type("DocumentRef.Manufacturing")]            = "FillByManufacturing";
   FillingStrategy[Type("DocumentRef.SubcontractorOrderReceived")]   = "FillBySubcontractorOrderReceived";
   // end Drive.FullVersion
   
   ObjectFillingDrive.FillDocument(ThisObject, FillingData, FillingStrategy, "Order");
   
   //Nomor PO by Customer dari SalesOrder generate ke GoodsIssue
   If TypeOf(FillingData) = Type("DocumentRef.SalesOrder") Then
      NomorPObyCustomer = FillingData.NomorPObyCustomer;
   EndIf; 
   
   //Nomor PO by Customer dari Packing Slip generate ke GoodsIssue
   If TypeOf(FillingData) = Type("DocumentRef.PackingSlip") Then
      NomorPObyCustomer = FillingData.NomorPObyCustomer;
   EndIf; 
   
   //Nomor PO by Customer dari SalesInvoice generate ke GoodsIssue
   If TypeOf(FillingData) = Type("DocumentRef.SalesInvoice") Then
      NomorPObyCustomer = FillingData.NomorPObyCustomer;
   EndIf;


   
EndProcedure

Edited: Gigha - Oct 29, 2024 12:51 PM
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.