Inventory Report (simple!)

JKoBJKoB Member Posts: 40
Hey!

Background: We have a sales stock which is refilled each day by another stock.

What i need is a report which shows me the stock of 2 defined stocks. In addition it should show the "Qty. on Sales Order". Best would be If i had an additional field like "Qty. on Sales Order tomorrow".

Example how it could / should look like:


Set Filter [Item]
No._______
Vendor Item No. __AA*___

Print
No. // Description // Inventory Loc. A // Inventory Loc. B // Qty. on Sales Order // Qty. on sales order 2morrow


I think that shouldnt be to difficult... But i havent a clue where to start...
Explanations in noob-words pls :roll:

Thx in advance, Jakob

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi Jakob,

    You can acheive this with a report off the item table. You will have to calculate the inventory and sales order quantity in the onafterget record using flowfilters. e.g. (off the top of my head so might have compile problems)
    item.setfilter( "location filter", 'LOCA');
    item.calcfields( inventory );
    LocAQty := item.inventory;
    item.setfilter( "location filter", 'LOCB');
    item.calcfields( inventory );
    LocBQty := item.inventory;
    
    item.setfilter( "date filter", workdate);
    item.calcfields( "qty. on sales order" );
    OrdersToday := item."qty. on sales order";
    item.setfilter( "location filter", calcdate( '+1D', workdate));
    item.calcfields( "qty. on sales order");
    OrdersTomorrow := item."qty. on sales order";
    

    Hope this helps
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • JKoBJKoB Member Posts: 40
    Hey!

    Thx for your quick help! The only Prob i had with the code was that i wasnt able to use the SETFILTER for the date Filter. (but SETRANGE worked)

    For those which are as noob as me, here is the modded code i used:

    Globals:
    LOC1 // Decimal
    LOC2 // Decimal
    QoSOT // Decimal
    QoSOTM // Decimal
    QoSODaT // Decimal
    // Calc Inventory LOC1
    Item.SETFILTER("Location Filter", 'LOC1');
    Item.CALCFIELDS(Inventory);
    INVLOC1 := Inventory;
    
    // Calc Inventory LOC2
    Item.SETFILTER("Location Filter", 'LOC2');
    Item.CALCFIELDS(Inventory);
    INVLOC2 := Inventory;
    
    // release Filter (there might be an easier way)
    Item.SETFILTER("Location Filter", '');
    Item.CALCFIELDS(Inventory);
    
    // Calc Qty on Sales Order TODAY
    Item.SETRANGE("Date Filter", WORKDATE);
    Item.CALCFIELDS("Qty. on Sales Order");
    QoSOT := Item."Qty. on Sales Order";
    
    // Calc Qty on Sales Order TOMORROW
    Item.SETRANGE( "Date Filter", CALCDATE( '+1T', WORKDATE));
    Item.CALCFIELDS( "Qty. on Sales Order");
    QoSOTM := Item."Qty. on Sales Order";
    
    // Calc Qty on Sales Order DAY AFTER TOMORROW
    Item.SETRANGE( "Date Filter", CALCDATE( '+2T', WORKDATE));
    Item.CALCFIELDS( "Qty. on Sales Order");
    QoSODaT := Item."Qty. on Sales Order";
    
    // Release Filter (there might be an easier way)
    Item.SETRANGE( "Date Filter");
    Item.CALCFIELDS( "Qty. on Sales Order");
    

    Thx again, Jakob
  • DaveTDaveT Member Posts: 1,039
    Well done - Glad to help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.