Project Borrow/Payback – Warning at Receipt

A little Project Manufacturing geekery here. PJM allows you to borrow from one project and pay back  at a later date. There’s a nice dashboard that shows which project has borrowed which items from a lending project and functionality in ASCP that suggests a buy to pay back the borrowed item. But there’s nothing that triggers the stockroom to do the payback transaction when they receive this PO.

This personalization was to provide that functionality.

Details of the personalization are below:

The trigger is:

(SELECT COUNT(*) FROM
PJM_BORROW_TRANSACTIONS b,
PJM_BORROW_PAYBACKS p,
PJM_SEIBAN_NUMBERS s
WHERE :rcv_transaction.item_id =b.inventory_item_id
and :rcv_transaction.project = s.project_number
and b.borrow_project_id = s.project_id
and (b.loan_quantity)-(NVL((p.payback_quantity),0))>0
and b.borrow_transaction_id = p.borrow_transaction_id(+)
)>0

The message is:

=select ‘This project, ‘||:rcv_transaction.project||’, owes ‘||to_char((b.loan_quantity)-(NVL((p.payback_quantity),0)))||’ of this item to project ‘||sb.project_number||’.Please perfom a project payback transaction.’
FROM PJM_BORROW_TRANSACTIONS b,
PJM_BORROW_PAYBACKS p,
PJM_SEIBAN_NUMBERS sa,
PJM_SEIBAN_NUMBERS sb
WHERE b.borrow_transaction_id = p.borrow_transaction_id(+)
AND b.borrow_project_id = sa.project_id
AND b.lending_project_id = sb.project_id
and sa.project_number = :rcv_transaction.project
and b.inventory_item_id = :rcv_transaction.item_id

1 comment to Project Borrow/Payback – Warning at Receipt

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>