W
W
warrior30592019-03-09 10:04:50
1C
warrior3059, 2019-03-09 10:04:50

The document is not posted. How to solve the problem?

Error when executing handler - 'Processing Posting'
due to:
{Document.Invoice.ObjectModule(68)}: Error when calling context method (Execute)
QueryResult = Query2.Execute();
due to:
{(17, 28)}: Field not found "Document Nomenclature.Nomenclature"
Document Nomenclature.<<?>>Nomenclature = Cost of
GoodsRemains.Nomenclature Procedure ProcessingPerforming(Failure, Mode)
of Movement.Remains of Goods.Write = True;
Movements.ProductCost.Write = True;
Moves.Sales.Record = True;
//Temporary table manager VT
Manager = New TemporaryTable Manager;
Request = New Request;
Query.TempTableManager = VTManager;
Query.Text =
"SELECT
| InvoiceProducts.Item, |
InvoiceProducts.Item.Item Type AS ItemType,
| SUM(InvoiceProducts.Quantity) AS QuantityInDocument,
| SUM(InvoiceProducts.AmountInDocument) AS Amount
Invoice.InvoiceDocument.Invoice
|FROM
| HOW InvoiceGoods
|WHERE
| InvoiceGoods.Ref = &Reference
|
|GROUP BY
| InvoiceGoods.Item,
| InvoiceGoods.Item.Nomenclature Type";
Query.SetParameter("Link", Link);
QueryResult = Query.Execute();
Request2 = New Request;
Query2.TempTableManager = VTManager;
Query2.Text =
"SELECT
| Document Nomenclature.Nomenclature,
| Document Nomenclature.Nomenclature Type, | Document
Nomenclature.QuantityInDocument , |Document
Nomenclature.AmountInDocument , | FROM | Document Nomenclature AS Document Nomenclature | LEFT JOIN
| Nomenclature B
| (CHOOSE
| Document Nomenclature . Nomenclature
| FROM
| Document Nomenclature)) AS Cost of Goods Remains
| ON Nomenclature of the Document.Nomenclature = Cost of GoodsRemains.Nomenclature
| LEFT JOIN Accumulation Register.Goods Remains.Remains(
| ,
| Nomenclature IN
| (SELECT
| Document Nomenclature.Nomenclature
| FROM
|Document Nomenclature)) AS Goods RemainsRemains
| Software NomenclatureDocument.Nomenclature = Remains of GoodsRemains.Nomenclature";
Movements.Cost of Goods.Record();
Movements.Remainders of Goods.Record();
QueryResult = Query2.Execute();
//TR = RequestResult.Unload();
SamplingDetailRecords = QueryResult.Select();
While SelectionDetailedRecords.Next() Loop
If SelectionDetailedRecords.Quantity = 0 Then ItemCost =
0;
Else
CostItems = SampleDetailRecords.Cost / SampleDetailRecords.Quantity;
EndIf;
If SamplingDetailedRecords.ItemType = Enumerations.ItemType.Item Then
Movement = Movement.Remains ofItems.Add();
Movement.MovementType = MovementTypeAccumulation.Expense;
Movement.Period = Date;
Movement.Nomenclature = SelectionDetailRecords.Nomenclature;
Movement.Warehouse = Warehouse;
Movement.Quantity = SampleDetailRecords.Quantity;
Movement = Movements.ProductCost.Add();
Movement.MovementType = MovementTypeAccumulation.Expense;
Movement.Period = Date;
Movement.Nomenclature = SelectionDetailRecords.Nomenclature;
Movement.Cost = SampleDetailRecords.ProductCost * SampleDetailRecords.Quantity;
EndIf;
// Sales Register
Movement = Movements.Sales.Add();
Movement.Period = Date;
Movement.Nomenclature = SelectionDetailedRecords.Product;
Movement.Quantity = SelectionDetailRecords.QuantityInDocument;
Movement.Sum = SelectionDetailRecords.SumInDocument;
Movement.Cost = SampleDetailRecords.ProductCost * SampleDetailRecords.QuantityInDocument;
EndCycle;
Motion.Record();
If Mode = Document Posting Mode.Operative Then
// Check for negative balances
Query3 = New Query;
Query3.TempTableManager = VTManager;
Query3.Text = "SELECT
| Goods RemainsRemains.Nomenclature,
| Goods RemainsRemains.QuantityRemains
|FROM
| Accumulation Register.Goods Remains.Remains(
| ,
| Nomenclature To
| (CHOOSE
| Document Nomenclature . Nomenclature
| FROM
| Document Nomenclature)
| AND Warehouse = &Warehouse) HOW Goods RemainsRemains
|WHERE
| RemainingGoodsRemains.QuantityRemaining < &QuantityRemaining";
Query3.SetParameter("Warehouse", Warehouse);
QueryResult = Query3.Execute();
SamplingDetailedRecords = QueryResult.Select();
While SamplingDetailedRecords.Next() Loop
Message = New MessageToUser();
Message.Text = "Missing" + String(- SelectionDetailedRecords.QuantityRemainder) + "units of goods """ + SelectionDetailedRecords.Nomenclature + """";
Message.Notify();
Rejection = true;
EndCycle;
EndIf;
EndProcedure

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kalapanga, 2019-03-09
@warrior3059

But there really is no Nomenclature field in the Nomenclature of the Document! Look at the query that forms this table for yourself. There is a Good, not a Nomenclature.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question