385: AND -- Check allow freight constraint and
386: -- prevent transactions with charges from being changed
387: -- into transactions that do not allow charges.
388: NOT EXISTS ( SELECT 'violates allow freight'
389: FROM ra_customer_trx_lines ctl
390: WHERE ctl.customer_trx_id = p_customer_trx_id
391: AND (
392: (
393: ctt.allow_freight_flag = 'N'
402: )
403: AND -- Check creation sign constraint
404: NOT EXISTS (
405: SELECT 'VIOLATES CREATION SIGN'
406: FROM ra_customer_trx_lines ctl
407: WHERE ctl.customer_trx_id = p_customer_trx_id
408: GROUP BY ctt.creation_sign
409: HAVING DECODE(
410: SIGN( SUM(ctl.extended_amount) ),