CRM API submit and resubmit by VMS Verification

1
2
3
4
5
6
7
8
9
10
11
12
#first CRM API submit and VMS resubmit or reimbruse
select concat(a.prefix, a.voucher_text, a.suffix), b.* from voucher a, (
    select a.submit_time, b.action_id, a.voucher_id from (
        select min(a.action_time) as submit_time, a.voucher_id 
        from voucher_action a, voucher b 
        where a.action_id = 60 and a.user_id = 3324 
        and a.voucher_id = b.voucher_id
        group by a.voucher_id
    ) a left join voucher_action b on (a.voucher_id = b.voucher_id and b.action_id in (70) and b.user_id != 3324)
    where b.id is not null
     
) b where a.voucher_id = b.voucher_id