Skip to Content
author's profile photo Former Member
Former Member

GRPO

hai

i create a Gpro Document for 5000 qty and Based on the Grpo i create a Two Ap invoice .

example

Grpo 5000 Qty - Ap invoice 2000 qty

Ap invoice 4000 Qty

AP invoice Qty Greater than the Grpo Qty so i want block this scenario ? Any Store procedure is there ??

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 26, 2012 at 11:28 AM

    HI

    Try this

    IF(@object_type = '18') and (@transaction_type in ('A', 'U'))

    begin

    IF Exists (select T0.DocEntry from OINV t0 inner join inv1 t1 on t0.docentry=t1.docentry inner join pdn1 t2 on t1.baseentry=t2.docentry and t1.itemcode = t2.itemcode

    where T0.DocEntry = @list_of_cols_val_tab_del and (sum(t1.Quantity)>sum(t2.quantity))

    Begin

    SET @error = 1

    SET @error_message = 'Invoice qty exceeded the GRN Qty'

    End

    End

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI

      Try now

      IF((@object_type = '18') and (@transaction_type in ('A', 'U'))

      begin

      IF Exists (select T0.DocEntry from OINV t0 inner join inv1 t1 on t0.docentry=t1.docentry inner join pdn1 t2 on t1.baseentry=t2.docentry and t1.itemcode = t2.itemcode

      where T0.DocEntry = @list_of_cols_val_tab_del and (sum(t1.Quantity)>sum(t2.quantity))

      Begin

      SET @error = 1

      SET @error_message = 'Invoice qty exceeded the GRN Qty'

      End

      End

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.