Possible bug? Purchase Invoice line and Unit Price.

I started this same thread at mibuso but with no luck. So, maybe some here has a comment…

Ehh… I just need confirmation is this has been corrected in some of updates or maybe it is not a bug at all.

On purchase line there is a field called Unit Price (LCY). This field is populated with “Unit Price” from the item card.
If foreign currency is used on Purchase Order then this field gets a wrong value (actually it gets value multiplied with currency factor if currency used on Purchase Order). Original value is taken from the item card wich holds LCY value not FCY so it does not need to be calculated to FCY (“unit price (LCY)” is name of the field in purchase line).

I searched through code of table Purchase Line and found Function called UpdateUOMQtyPerStockQty where next lines has been added after 3.6v Navision:

“Unit Price (LCY)” :=
GetDate,PurchHeader.“Currency Code”,
“Unit Price (LCY)”,PurchHeader.“Currency Factor”);

You may see here that it calculates LCY to FCY amount and stores it to a field that is LCY.
This is 4.0 SP3. On 3.6, there is the same function but without this line.


I found that these lines are not added in 4.0 SP1 which means that they came with 4.0 SP2.

Exactly what should be the bug? That the line is included or not include?

the bug is that the line IS included in 4.0 SP2 (and 4.0 SP3).

Isn’t it obvious from the name of function?

Value from function ExchangeLCYToFCY is stored into field that is called “(LCY)”

Base on the fact that this line is still in NAV 5.0 - and it also was there in version 3.60 and 3.70, then I am sure that this was a bug in NAV 4.0.

maybe this is missunderstanding:

This specific line does not exists till 4.0SP2. It is added in 4.0SP2. When this line is added, I have wrong values in that field, and the name of function in line looks wrong.

I do not have a 5.0DB at this moment (has it at home) would you pls be kind to check does this line exists in 5.0 or not? (I’m little bit confused with your answer and just need clarification).

If this line still exists in 5.0 then either they didn’t noticed problem or they think it is not a problem.


you may have found out by yourself, by now, but I just read your post. I’ve checked 5.0 (Italian version) and the line is there!

Hmmm… I know that people rarely uses this field and perhaps that is the reason why no one saw that before but doesn’t seems right to me.

I’ll stick to this thread for a while to see if anyone other has a comment and than post a comment to MS…

Ofcourse, thanx Anna for your effort :slight_smile:

Well I gave you this answer already:

You are welcome. It wasn’t such a great effort, actually! [:P]

As Erik just pointed out, he had already given the answer, although I didn’t get it at first

And I said that it was not there in 3.60, not till SP2 4.0, that part confused me, Eric. Well, I’ll contact MS for further details, cause this gaves me a lot of headaches in some custiomization (that was working on 3.60 [:)]).

Thnx a lot, both of you.

P.S. “something went wrong” message on posting this message… Several time (whole day).

Today or yesterday? Yesterday the database had run full (too many posts too quick), which gave problems when posting new posts. But I have expanded it, so there should not be problems with posts now… I hope!


Ok, MS confirmed me that this is a bug with low priority resolution. They think that the name of the field is wrong and that the field has to contain FCY value (which means that the line is correct and needs to be there, the problem is in the LCY field).

I received an update by Microsoft with a solution (which was obvious). It seems that the field name Is ok and update of the field values was wrong so that line has to be deleted:

old code

IF PurchHeader.“Currency Code” <> ‘’ THEN BEGIN
“Unit Cost” :=
GetDate,PurchHeader.“Currency Code”,
“Unit Cost (LCY)”,PurchHeader.“Currency Factor”);

“Unit Price (LCY)” :=
GetDate,PurchHeader.“Currency Code”,
“Unit Price (LCY)”,PurchHeader.“Currency Factor”);

New code

IF PurchHeader.“Currency Code” <> ‘’ THEN
“Unit Cost” :=
GetDate,PurchHeader.“Currency Code”,
“Unit Cost (LCY)”,PurchHeader.“Currency Factor”)

Hey Pheno, thanks forposting the solution. [Y]