Skip to Content
0
Nov 06, 2008 at 12:59 PM

Blovking Sales Order

11 Views

Hello

I would like to have some help

The issue is about approval procedure

My customer would like to block sales order when the total invoice fror a project is reached.

I have created a user defined table to list all project.... the table is @PRO

The limit is a user defined field called ZLIMITE

I have created a user defined field on marketing document where the user must select the project assigned to a sales order

The field is ZPROJET

Then I have the qyerry to be used through approuval procedure which calculate the sum of all invoices already made for the same project and the same customer

The query is not working could anyone tell me why

SELECT DISTINCT TRUE IF SUM(T0.DocTotal-T0.VATsum)>[@PRO].[U_ZLIMITE] FROM OINV T0 where T0.CardCode=$[$4.1.0] and [@PRO].[Code]=$[$U_ZPROJET.1.0]