Report showing current retail price of item.

JamieBrownJamieBrown Member Posts: 107
Hi,

I'm new to Navision so please bear with me. Any help would be very much appreciated.

We have a Sales Price table which has the following fields:
Item No.
Starting Date
Ending Date

This allows us to store multiple prices per product (e.g. where a sales price could be active for a week and then revert back to previous price) The current price is calculated from the starting and ending dates of the price.

The problem I have is that we have a great deal of item prices without any start or end dates. (As only one price exists for that item) We also have other permutations i.e. No starting date or no ending date.

The report needs to be able to show the current price of an item. Here is an example of an item with numerous prices:

Item No. Starting Date Ending Date Price
913751 5.87
913751 01/10/05 6.10
913751 16/12/05 4.66

The current price for this item is £4.66 (As it has the most recent start date). What logic is needed to show this on a single line against the Item No.?

I'm already filtering for 'possible' current prices:

SETFILTER("Sales Price"."Starting Date",'%2..|%1',TODAY,0D);
SETFILTER("Sales Price"."Ending Date",'%1..|%2',TODAY,0D);
SETFILTER("Sales Price"."Sales Type",'retail');

Once any help is greatly appreciated.

thanks
Jamie

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    The best way to approach this would be to let the codeunit 7000 Sales Price Calc. Mgt. handle this for you.

    This codeunits calculates the current price for you depending on the input you provide.

    Please have a look at the codeunit and report back your findings.
  • JamieBrownJamieBrown Member Posts: 107
    Mark,

    Just looked at the codeunit and to be honest, it blew my mind a bit.

    Do you know of a standard report that uses this codeunit? So I can see how it's called.

    thanks
    Jamie
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    It is called from all places in navision where a salesprice is required. Look or example at the sales line.

    You can off-course also make your own function to calculate the current sales price, but using this codeunit you are sure you do not mis something.
  • JamieBrownJamieBrown Member Posts: 107
    Mark,

    Found another instance of the codeunit being called and have modified accordingly.

    Thanks for your help!

    Jamie
Sign In or Register to comment.