Items stock query

Common questions about 1C:Query language, Query builder tool and Data composition schema

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 8, 2012
Company: Mal Ratu Indah

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?

 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Sep 26, 2012
Company: individual

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

 
#3
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 8, 2012
Company: Mal Ratu Indah

Good, thank you!

 
#4
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 8, 2012
Company: Mal Ratu Indah

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...

 
#5
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Hi!

Use ISNULL function:

Code
ISNULL(InventoryBalance.QuantityBalance, 0) AS QuantityBalance

Edited: Alexey Alexandrovich - Oct 26, 2012 11:44 AM
 
#6
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 8, 2012
Company: Mal Ratu Indah

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?

 
#7
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

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)

Edited: Alexey Alexandrovich - Oct 26, 2012 05:37 PM
 
#8
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 8, 2012
Company: Mal Ratu Indah

Yes! Thank you, Alexey!

 
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.