Skip to Content
avatar image
Former Member

Approval Procedure - Terms Based on Query HELP !

Hi,

I have two requirement on the approval query, basically the concept is the same just that it apply in different document. So there will be two different query.

Requirement A:

A/P Invoice need approval if Doctotal > 1000 AND CardCode NOT IN ('A001', 'A002')
Which mean A/P Invoice can be created directly if Doctotal < 1000 or Doctotal > 1000 and CardCode is A001/A002

Requirement B:

Outgoing Payment need approval if Doctotal > 1000 AND CardCode NOT IN ('A001', 'A002')
Which mean Outgoing Payment can be created directly if Doctotal < 1000 or Doctotal > 1000 and CardCode is A001/A002

Thank you

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 23, 2017 at 12:27 PM

    Hi Olga,

    If I understood correct. Use this queries:

    A/P Invoice

    SELECT CASE WHEN $[$4.0.0] NOT IN ('A001', 'A002') AND $[$29.0.NUMBER] > 1000 THEN 'TRUE' ELSE 'FALSE' END

    Outgoing Payment

    SELECT CASE WHEN $[$5.0.0] NOT IN ('A001', 'A002') AND $[$45.0.NUMBER] > 1000 THEN 'TRUE' ELSE 'FALSE' END

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 23, 2017 at 08:34 AM

    Hi,

    Try for AP Invoice,

    SELECT Distinct 'True' FROM OPCH T0 WHERE $[$4.0.0] IN ('V20000','V30000') and $[$29.0.Number] >1000

    Note: Change card code in above query.

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Nagarajan,

      It doesn't work when I try to create the A/P Invoice, show error message as below:

      Could not commit transaction: Error -1 detected during transaction

      Thanks

  • Jan 23, 2017 at 12:47 PM

    Try this query,

    SELECT Distinct 'True' FROM OPCH T0 WHERE $[-$4.0.0] NOT IN ('V20000','V30000') and $[$29.0.Number] >1000

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      The query doesn't work either.

      It showed error message in a second and the document can be created even meet the approval condition.

      Error message = "Internal error (-1003) occurred [Message 131-183]

      Thanks

  • Jan 24, 2017 at 07:41 AM

    Try this,

    SELECT Distinct 'True' FROM OPCH T0 WHERE $[-$4.0.0] NOT IN ('V20000','V30000') and $[OPCH.Doctotal.Number] >1000

    Add comment
    10|10000 characters needed characters exceeded