Skip to Content

Block invoice without a sales order through - SAP B1

Apr 21, 2017 at 07:05 PM


avatar image

Hi everyone, in the project management window it is possible to see the numbers of the invoiced amounts and the pending ones and so. When you have a sales order but do not make the invoice taking that sales order as the base document, the system duplicates that quantity and there would be non-real numbers.

So, my question is ... does the client invoice could be blocked unless there would be a sales order? I mean, that the user can not make an invoice if he / she does not have a sales order.

I don't know if I'm explaining myself well. So if someone needs more detailed explanation, please tell me. Thanks and regards.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
DIEGO LOTHER Apr 21, 2017 at 09:45 PM

Hi Anderson,

You can achieve your goal by two ways.

1. Transaction notification

You can use a query like below to avoid that the user input any invoice with one or more lines without base document.

IF @object_type = '13' AND @transaction_type IN ('A','U')
	IF (SELECT COUNT(DocEntry) FROM INV1 WHERE DocEntry = @list_of_cols_val_tab_del AND BaseType = -1) > 0
		SET @error = -1
		SET @error_message = 'Your invoice should have a base document like delivery, sales order, sales quotation...'

2. Approval procedure

You can use the query below in an approval procedure to avoid the user input any invoice with one more lines without base document without the authorization of the manager. In this situation the manager can handle the situation and can choose if the document is allowed or not.


I think that the second option is better than the first. Because can have some situtation that the user need create an invoice without base document and when this happens the manager can choose.

Hope it helps.

Kind Regards,

Diego Lother

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Pretty cool. I'm not very familiar with stored procedures, would you give me a simple explanation of how I could do an "approval procedure"?


Hi Anderson,

Sure. Follow the steps:

1. If you doesn't have an Approval Stage setup, first you need setup it.

Go To Administration -> Approval Procedures -> Approval Stages

In this screen you setup who are the persons should approve the document, and how many approvers is necessary to approve the document if the stage have more than one approver.

2. After this, go To Administration -> Approval Procedures -> Approval Templates

This form have 4 tabs that need setup.

a. Originator In this tab you should setup all user that need authorization to perform the action.

b. Documents In this tab you need select what documents need authorization.

c. Stage In this tab, you need setup the stage that you created in step 1.

d. Terms In this tab, you will setup what is the rule to fire the approval procedure process.

You can do this through pre defined rules or do this by query (our case) .

P.S: Teste 5 is the query that I provided on my answer.

The result of our configuration is: When a manager user do an A/R invoice that doesn't have base document for all lines, will be fire an approval request for the user setup on the stage tab.

If the lines of the A/R Invoice have base document, the approval procedure process will not be fired.

Hope it helps.

Kind Regards,

Diego Lother

img1.png (36.9 kB)
img2.png (39.3 kB)
img3.png (93.7 kB)
img4.png (44.5 kB)
img5.png (74.8 kB)
img6.png (32.6 kB)

Thank you so much!