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

SP for the OINV for Negative amount

Hi Experts,

I have tried a SP for blocking the OINV when the Vatsum or Doctotal is negative due to AR Downpayment adjustment.

IF @transaction_type IN ('A', 'U') AND @object_type = '13'

BEGIN

If exists (SELECT T0.DocEntry FROM OINV T0

where (t0.VatSum < 0 or t0.DocTotal < 0)

and t0.docentry =@list_of_cols_val_tab_del)

Begin

SET @error = 123

SET @error_message = 'Tax or Doctotal is Negative'

End

END

Regards,

Dwarak

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on May 22, 2013 at 01:34 PM

    Hi,

    What is your problem in above SP?

    Working without any error.

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 22, 2013 at 01:33 PM

    Try this

    IF @transaction_type IN ('A', 'U') AND @object_type = '13'

    BEGIN

    If exists (SELECT T0.DocEntry FROM OINV T0

    where

    t0.docentry =@list_of_cols_val_tab_del AND (t0.VatSum <= '0' or t0.DocTotal < ='0'))

    Begin

    SET @error = 123

    SET @error_message = 'Tax or Doctotal is Negative'

    End

    END

    Regards

    Kennedy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2013 at 08:10 PM

    Hi Dwarak,

    I suggest you to run a simple query first to see if you can get anything:

    SELECT T0.DocEntry FROM OINV T0 where t0.VatSum < 0 or t0.DocTotal < 0

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 27, 2013 at 01:48 AM

    Hi Dwarakanath P

    Please check and the close the Thread with correct and helpful answers 😊

    Regards

    Kennedy

    Add a comment
    10|10000 characters needed characters exceeded

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.