D
D
Dmitry Krapivin2017-07-27 19:20:24
1C-Enterprise
Dmitry Krapivin, 2017-07-27 19:20:24

How to get data from the accumulation register about the balance and where did the item come from?

I need to get data on how many nomenclatures (tractors) a particular organization currently has left. And from which organization they were received (example: in the remainder of the Tractor K-700 with lot number 23411 - 1 piece, received from Minsk Tractors LLC). Here are just the fields "sender" or "recipient" in the accumulation register GoodsIn WarehousesRemains (virtual table) are missing.
how to get the data from where the nomenclature was received (tractor)
SELECT
GoodsIn WarehousesRemains.Organization,
GoodsInWarehousesRemains.Nomenclature,
GoodsInWarehousesRemains.In StockBalance
FROM
Accumulation Register.GoodsInWarehouses.Remains(&Period, Organization = &Organization) AS GoodsInWarehousesRemains

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2017-07-27
@kiru

If there is no such field in the GoodsInWarehouses table, then you need to do a LEFT JOIN with the table where these fields are. Or not to do it... In the current formulation, such a question cannot have an answer (except perhaps from psychics).
But let's try to go from the end. If you analyze the remains of tractors in the warehouse, it means that you don't care who sold them. More precisely, supplier = manufacturing plant, i.e. for each tractor, it is predetermined (and if there are several of them, then you simply have no chance, looking at the number of the remainder, to understand from whom they came). Most likely (if you have something like UT or UPP), the nomenclature has the attribute "MainSupplier". In this case, the solution is simple:
CHOOSE
GoodsInWarehousesRemains.Organization,
GoodsInWarehousesRemains.Nomenclature,
GoodsInWarehouseRemains.Nomenclature.Main Supplier,
GoodsInWarehousesRemains.InStockBalance From Accumulation Register.GoodsInWarehouse.Remains(&Period, Organization = &Organization) AS
GoodsInWarehousesRemains

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question