Requisition line convert to purchase line

hi,

I am facing a problem when i create a requsition from sale order, and calculate a plan(same item with same vendor ) then two or more line are created then click carryout action message then purchase order created with two item(Item is same with vendor) but client requirement is if item and vendor is same then create only one line for same vendor. i write a code of 333 codeunit (insert purchase header function) but same item cannot be acumalte with Quantity. where exact location of write a code.(Please write a littile bit code).

Thanks

Sunil Mishra

Hi,

You need to write code in CU 333 Function InsertPurchorderline

LineCount := LineCount + 1;

IF NOT PlanningResiliency THEN

Window.UPDATE(4,LineCount);

TESTFIELD(“Currency Code”,PurchOrderHeader.“Currency Code”);

//Customized Code

recPurLine.RESET;

recPurLine.SETRANGE(recPurLine.“Document Type”,PurchOrderHeader.“Document Type”);

recPurLine.SETRANGE(recPurLine.“Document No.”,PurchOrderHeader.“No.”);

recPurLine.SETRANGE(recPurLine.“No.”,ReqLine2.“No.”);

recPurLine.SETRANGE(recPurLine.“Variant Code”,ReqLine2.“Variant Code”);

IF recPurLine.FINDFIRST THEN BEGIN

recPurLine.Quantity:=recPurLine.Quantity+ReqLine2.Quantity;

recPurLine.VALIDATE(recPurLine.Quantity,recPurLine.Quantity);

recPurLine.MODIFY;

END //Customized code

ELSE

Change as per your requirement.

Hi,

suppose that Requsition line Created after calculate Plan

Item A 5(qty) V1(vendor)

A 10(Qty) V1

B 4(Qty) V1

then create a purchase order (after carry out action message)

A 15 V1

A 10 V1

B 4 V1

But Client Want

A 15 V1(Accumalte the item with Qty ,Item display only one time)

B 4 V1

Thanks

Have you tried above code ???

I tried then reply to you with above example.

thanks

Hi,

Problem solved problem is me end.

Thanks

Sunil

Good