Function Isn't Excluding Repeat Data
Looking at the code, I don't see a reason for the cursor. It's unclear what column is supposed to be unique, but you can handle your EXIST in a WHERE clause (i used NOT IN) and remove all the variables, and cursor as well.

insert into purchase_order (order_number, job_id, supplier_id, contact_id, user_list_id, status_id, notes)
SELECT 
    a.order_id
    ,j.job_id
    ,s.supplier_id
    ,sc.contact_id
    ,ul.user_list_id
    ,2
    ,null
FROM 
    _po_temp_b b
inner join
    _po_temp_a a on a.order_id = b.order_id
inner join
    job j on j.job_number = b.job_num
inner join
    supplier s on s.supplier_name = b.supp_name
inner join 
    supplier_contact sc on sc.supplier_id = s.supplier_id
inner join
    user_list ul on ul.user_order_number = b.user_num
where
    a.order_number not in (SELECT order_number FROM purchase_order)


You may need LEFT joins... it all depends.