Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Query language and DCS > Items stock query

Forum

Search UsersRules
Items stock query
#1
Just came
Points:: 0
Joined:: Oct 8, 2012

Salam, friends!

I need to get quantity of items in stock for a specific items set. I use Managed Application Demo. Could someone please help me?

Profile
#2
Active user
Points:: 0
Joined:: Sep 26, 2012

On pane "Sales" choose report "Inventory balance". There you can make filter "In list" for items and creat report.

Profile
#3
Just came
Points:: 0
Joined:: Oct 8, 2012

Good, thank you!

Profile
#4
Just came
Points:: 0
Joined:: Oct 8, 2012

Hi!
I used this topic and this topic to create my query:

Code
SEL ECT
   Items.Ref,
   InventoryBalance.Company,
   InventoryBalance.QuantityBalance
FR OM
   Catalog.Items AS Items
      LEFT JOIN AccumulationRegister.Inventory.Balance AS InventoryBalance
      ON (InventoryBalance.Item = Items.Ref)

But it returns NULL instead of 0 for items having 0 Inventory balance...

Profile
#5
Active user
Points:: 0
Joined:: Nov 1, 2011

Hi!

Use ISNULL function:

Code
ISNULL(InventoryBalance.QuantityBalance, 0) AS QuantityBalance

Profile
#6
Just came
Points:: 0
Joined:: Oct 8, 2012

Thank you, Alexey! I changed my query in the following way:

Code
SEL ECT
   Items.Ref,
   InventoryBalance.Company,
   ISNULL(InventoryBalance.QuantityBalance, 0) AS QuantityBalance
FR OM
   Catalog.Items AS Items
      LEFT JOIN AccumulationRegister.Inventory.Balance AS InventoryBalance
      ON (InventoryBalance.Item = Items.Ref)

Now there is one more question: I need to filter the result by company. How can I do that?

Profile
#7
Active user
Points:: 0
Joined:: Nov 1, 2011

What do you want to get as result?
The list of all Items with balance for one particular company?

Code
SEL ECT
   Items.Ref,
   InventoryBalance.Company,
   ISNULL(InventoryBalance.QuantityBalance, 0) AS QuantityBalance
FR OM
   Catalog.Items AS Items
      LEFT JOIN AccumulationRegister.Inventory.Balance(, Company = &Company) AS InventoryBalance
      ON (InventoryBalance.Item = Items.Ref)

Profile
#8
Just came
Points:: 0
Joined:: Oct 8, 2012

Yes! Thank you, Alexey!

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.