cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict Delivery if A/R Down Payment is unpaid. Query Required

former_member198649
Active Participant
0 Kudos

Hello All,

I need a query to Restrict Delivery if A/R Down Payment is unpaid in SAP Business One.

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this transaction notification if AR Down payment invoice not paid before creating Delivery order from Sales order,

if @object_type = '15' and (@TRANSACTION_TYPE = 'A')

begin

If exists(select T0.Baseentry from DLN1 T0 where T0.Baseentry IN (SELECT T0.Docentry FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] left join DPI1 T2 on T2.[BaseEntry] = T1.Docentry and T2.[BaseLine] = T1.[LineNum] INNER JOIN ODPI T3 ON T2.[DocEntry] = T3.[DocEntry] WHERE T3.[PaidSum] = 0) and t0.Docentry = @list_of_cols_val_tab_del )

begin

select @error = 1, @error_message = 'AR Downpayment Invoice not paid'

end

end

Regards,

Nagarajan

former_member198649
Active Participant
0 Kudos

Thanks Nagaranjan

Answers (0)