Skip to Content

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

Hello All,

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 15, 2017 at 02:02 PM

    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

    Add comment
    10|10000 characters needed characters exceeded