Hi
How this will work
Pline is Structured order Line Details Pack is Purchase Line PLine.SETFILTER("Document No.",PoNo); PLine.SETRANGE(PkLine1."Tax/Charge Group",'PACK'); IF PLine.FINDFIRST THEN IF PLine."Calculation Type" = PkLine1."Calculation Type"::Percentage THEN BEGIN Pack.RESET; Pack.SETRANGE("Document No.","Purchase Header"."No."); IF Pack.FINDFIRST THEN Pack.CALCSUMS(PackLine.Amount); Pkg += (Pack.Amount * PLine."Calculation Value") / 100; END ELSE BEGIN REPEAT Pkg += PLine.Amount; UNTIL PLine.NEXT=0; END;
Thanks
*This post is locked for comments