How to calculate quantity from item ledger entry

valkatamakevalkatamake Member Posts: 38
as you know quantity (for sale) in item ledger entry are negative entries
how to calculate how much i have sold (in report)

itemA sale -1
itemA sale -5
Itema sale -3

the result of sold itemA is 9

PS1: Please don't tell me to look at report 712 because i don't understand a bit

PS2: I am suggesting to crate a "how to" section for begginers with simple codes and explaining for every line (which line what it does).I think it will prevent most of the stupidest questions (like mine right now) . Just thinking :roll:

Comments

  • kapamaroukapamarou Member Posts: 1,152
    For start look at Field 72 Sales (Qty.) on the Item Table.
    It Sums the (Invoiced) quantities from the Item Ledger Entries, reversing the sign. So:

    Using Item: You set the filters that you wish (Date, Dimension, Variant etc.)
    Item.SETRANGE(...)
    ...
    ...
    Item.CALCFIELDS("Sales (Qty.)");

    Using directly Item Ledger Entry:

    Set the same filter on the fields
    ItemLedgerEntry.SETRANGS("Posting Date",0D,TODAY);
    ...
    ...
    ..
    ItemLedgerEntry.CALCSUMS(Quantity);

    Play around a bit and ask if you need any more info.
  • valkatamakevalkatamake Member Posts: 38
    evharisto :P
Sign In or Register to comment.