Dan, we are wrestling with this on production. This is behavior we are seeing. The patch on this bug sounds like it's working. Perhaps this needs it's own bug. I added it to this bug because this bug was reported due to our findings in a situation. An ongoing situation that has revealed this potential issue as well.
Below is a query that helps me find these (marked lost by action trigger in the last 30 days) You might want to tweak the date range depending on the size of your database.
select au.usrname,
acirc.id,acirc.xact_start,acirc.target_copy,acirc.due_date,acirc.stop_fines_time,acirc.checkin_time,acirc.duration,acirc.fine_interval,acirc.recurring_fine,acirc.max_fine,acirc.stop_fines,
mmbxs.total_paid,mmbxs.last_payment_ts,mmbxs.last_payment_type,mmbxs.total_owed,mmbxs.balance_owed,
ac.barcode,ac.price,ac.circ_modifier,ac.status_changed_time,
mb.sum,
maa.sum,
mp.sum,
mp.sum - maa.sum,
acirc.checkin_time - acirc.due_date,
(extract(day from (acirc.checkin_time - acirc.due_date))),
(extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine,
(case when (((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) > acirc.max_fine) then max_fine else ((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) end),
(case when (((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) > acirc.max_fine) then max_fine else ((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) end) - mmbxs.balance_owed
from
action.circulation acirc,
money.materialized_billable_xact_summary mmbxs,
asset.copy ac,
actor.usr au,
(select sum(amount) sum,xact from money.billing where not voided group by 2) mb,
(select sum(amount) sum,xact from money.account_adjustment where not voided group by 2) maa,
(select sum(amount) sum,xact from money.payment where not voided group by 2) mp
where
mp.xact=acirc.id and
mb.xact=acirc.id and
maa.xact=acirc.id and
au.id=acirc.usr and
acirc.xact_finish is null and
acirc.id in(
select target from action_trigger.event where
event_def in(select id from action_trigger.event_definition where reactor='MarkItemLost')
and run_time > now() - '30 days'::interval
)
and
acirc.id=mmbxs.id and
ac.id=acirc.target_copy and
ac.status!=3 and
mmbxs.balance_owed > 0 and
acirc.stop_fines = 'MAXFINES'
Dan, we are wrestling with this on production. This is behavior we are seeing. The patch on this bug sounds like it's working. Perhaps this needs it's own bug. I added it to this bug because this bug was reported due to our findings in a situation. An ongoing situation that has revealed this potential issue as well.
Below is a query that helps me find these (marked lost by action trigger in the last 30 days) You might want to tweak the date range depending on the size of your database.
select au.usrname, acirc.xact_ start,acirc. target_ copy,acirc. due_date, acirc.stop_ fines_time, acirc.checkin_ time,acirc. duration, acirc.fine_ interval, acirc.recurring _fine,acirc. max_fine, acirc.stop_ fines, paid,mmbxs. last_payment_ ts,mmbxs. last_payment_ type,mmbxs. total_owed, mmbxs.balance_ owed, ac.price, ac.circ_ modifier, ac.status_ changed_ time,
acirc.id,
mmbxs.total_
ac.barcode,
mb.sum,
maa.sum,
mp.sum,
mp.sum - maa.sum,
acirc.checkin_time - acirc.due_date,
(extract(day from (acirc.checkin_time - acirc.due_date))),
(extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine,
(case when (((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) > acirc.max_fine) then max_fine else ((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) end),
(case when (((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) > acirc.max_fine) then max_fine else ((extract(day from (acirc.checkin_time - acirc.due_date))) * recurring_fine) end) - mmbxs.balance_owed
from zed_billable_ xact_summary mmbxs, adjustment where not voided group by 2) maa, trigger. event where trigger. event_definitio n where reactor= 'MarkItemLost' ) target_ copy and
action.circulation acirc,
money.materiali
asset.copy ac,
actor.usr au,
(select sum(amount) sum,xact from money.billing where not voided group by 2) mb,
(select sum(amount) sum,xact from money.account_
(select sum(amount) sum,xact from money.payment where not voided group by 2) mp
where
mp.xact=acirc.id and
mb.xact=acirc.id and
maa.xact=acirc.id and
au.id=acirc.usr and
acirc.xact_finish is null and
acirc.id in(
select target from action_
event_def in(select id from action_
and run_time > now() - '30 days'::interval
)
and
acirc.id=mmbxs.id and
ac.id=acirc.
ac.status!=3 and
mmbxs.balance_owed > 0 and
acirc.stop_fines = 'MAXFINES'