# Quantity Delivered on Purchase Order

Hi all,

I am working on codes for a purchase order and I have created 3 fields: Quantity, Qty. To Deliver and Quantity Delivered.

Let’s say Quantity=5, Quantity Delivered=0

Initially,

The field Qty. To Deliver:= Quantiy

But, I change the quantity for the field Qty. To Deliver to 3 and I want the Quantity Delivered to be from 0 to 3.

I have checked the standard codes but I am still unable 2 do so.

Thanks

Liizz

I guess Quantity Delivered will be like Quantity shipped…it will be updated after posting…

If not, you have to write code on Quantity to Deliver onvalidate trigger…

Yes I have been able to do it. Thanks a lot…

After posting this problem, I find that I left a mistake. I have solved it now.

Thanks

Hi,

I wish to get some clarifications on the field Qty. to Receive and Quantity Received after posting. The calculations made on these fields when doing only Receive option.

These codes are present on the codeunit 90 but I am confused on how they made calculations on Qty. to Receive and Quantity Received fields.

Thanks

Liizz

How do we know what is written in CU90 by you?

Have you done any modification?

I have input Quantity=4 and Qty. to Receive=3

After posting of this purchase order, Qty. to Receive=1, Quantity Received=3, Qty. to Invoice=4.

I am taking the standard example of Purchase Order.

Thanks

Liizz

So you want to know where this calculation is done?

Yes when the Receive option is selected.

in CU90…check

END;

But how do we check if the Purchase has been posted when not all the Quantity has been received.

Lets say,

I feel that there is a validation being done before transfer fields to posted tables.

Thanks

Liizz

here it will check in CU90 whether there is any line with Qty to receive > 0 or not and uses Receive boolean for the same…

PurchLine.RESET;
PurchLine.SETRANGE(“Document Type”,“Document Type”);
PurchLine.SETRANGE(“Document No.”,“No.”);
PurchLine.SETFILTER(Quantity,’<>0’);
IF “Document Type” = “Document Type”::Order THEN
PurchLine.SETRANGE(“Receipt No.”,’’);
IF Subcontracting THEN
PurchLine.SETRANGE(“Line No.”,SubConPostLine);

Mohana, thanks a lot 4 ur help.

Infact am trying to understand the codes behind purchasing.

Now, the field Receipt No. where and when is it used?

Thanks

Liizz

Just search Receipt No. in CU90

But in the code, it mentions that the Doc. Type= Invoice and the field Receipt No. will contain a value.

But on a purchase order, how does that field get updated?

Thanks

Liizz

Where do you want to know in Purcahse Line when you receive the order?

Hi,

**Mohana,**I have question similar to this : Would You like to tell me where I can find how Qty. to Receive are sent to some Location(after posting, and choosing Received). I guess is in a CodeUnit 90 too, but I am a bit confused.