Commcare Supply ledger tables

Can anyone shed some light on this?

I do not want to do anything fancy like a requisitions or
receiving…just issues and returns, perhaps cycle count updates.
The information I can glean is that the ledger table (lookup table) is
created when you create a product listing and assign it to a location
(storeroom) but…can you see the columns that are created? Can
you update them similar to a lookup table for the initial load of the data.
I am just wanting to use the transactions to feed my inventory system with
the updates and issue/return transactions…

Any help on this would be appreciated.

I found this page on our wiki that has some information about using ledgers
in applications. That would be a good place to start:
https://confluence.dimagi.com/display/commtrack/Building+Apps+for+CommCare+Supply
I’ll warn though, that CommCare Supply is a very complex suite of
functionality, and I don’t think our documentation there is nearly as
thorough as our more standard features.

Ledgers can be accessed similarly to a lookup table, but as you suggested,
you can also write to them. Basic access can happen through the app
builder, but if you’re interested, here’s some documentation on the
underlying xml formats:


  • Ethan
··· On Thu, May 11, 2017 at 12:41 AM, John Harper < john.harper@grableservices.com> wrote:

Can anyone shed some light on this?

I do not want to do anything fancy like a requisitions or
receiving…just issues and returns, perhaps cycle count updates.
The information I can glean is that the ledger table (lookup table) is
created when you create a product listing and assign it to a location
(storeroom) but…can you see the columns that are created? Can
you update them similar to a lookup table for the initial load of the
data. I am just wanting to use the transactions to feed my inventory
system with the updates and issue/return transactions…

Any help on this would be appreciated.


You received this message because you are subscribed to the Google Groups
“CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I believe ledgers are a little less concrete than that. A ledger entry
exists essentially at the intersection of a case, a section id (usually
"stock"), and an “entry_id” (usually a product id). You can save a ledger
entry in a form, and you can attempt to access a ledger entry, passing in
those above parameters. If nothing has been saved to that case, section,
and entry, then it will be empty. This means that there’s no
initialization necessary before updating a storeroom’s current stock values.

At a given location (more precisely, its supply-point case), you should be
able to iterate through a list of products (which you can optionally
restrict to a program), and then update the “stock” section for each one.
You should later be able to read these values back, and it’s okay if some
values are missing - you’d typically just assume that means the value is “0”

Hope this helps!

  • Ethan
··· On Thu, May 11, 2017 at 2:45 PM, John Harper <john.harper@grableservices.com wrote:

Thanks Ethan,

I am looking into it…i did see in the documentation that the
ledger is automatically added during the creation of the product
record…{correct statement?} I would believe that this would happen
once i associate the product with the location {meaning the storeroom}
This would give me a unique…bin location from which to draw from.

if i wanted to cycle cnt a storeroom I would pull from the following
parameters…{location,programs,products…then the bins that
hold the individual stock balances in the ledger table}

Correct?

On Thursday, May 11, 2017 at 8:55:29 AM UTC-7, Ethan Soergel wrote:

I found this page on our wiki that has some information about using
ledgers in applications. That would be a good place to start:
https://confluence.dimagi.com/display/commtrack/Building+App
s+for+CommCare+Supply
I’ll warn though, that CommCare Supply is a very complex suite of
functionality, and I don’t think our documentation there is nearly as
thorough as our more standard features.

Ledgers can be accessed similarly to a lookup table, but as you
suggested, you can also write to them. Basic access can happen through the
app builder, but if you’re interested, here’s some documentation on the
underlying xml formats:
https://github.com/dimagi/commcare-core/wiki/ledgerxml
https://github.com/dimagi/commcare-core/wiki/ledgerdb

  • Ethan

On Thu, May 11, 2017 at 12:41 AM, John Harper < john....@grableservices.com> wrote:

Can anyone shed some light on this?

I do not want to do anything fancy like a requisitions or
receiving…just issues and returns, perhaps cycle count updates.
The information I can glean is that the ledger table (lookup table) is
created when you create a product listing and assign it to a location
(storeroom) but…can you see the columns that are created? Can
you update them similar to a lookup table for the initial load of the
data. I am just wanting to use the transactions to feed my inventory
system with the updates and issue/return transactions…

Any help on this would be appreciated.


You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.