Symptoms

Provider has found some recent orders in archived status. Though Orders Archive Interval (under System > Settings > Order Processing > Order Processing Setup) is set up to some bigger value, for example 12 months.

How these orders got archived and how to find out the user who did this?

Cause

The orders are archived not only automatically. Possible cases:

  1. When Provider/Reseller presses Delete button on order screen, the order is not really deleted but is moved to archived status. Then the message is displayed:

    Order has been moved to archive 
    
  2. When user presses Cancel Order(s) button in Customer Control Panel, the order is not canceled but moved to archived. This behavior has been reported as bug #PBA-36001.

Resolution

The last operation on order is saved in SalesOrderArc table. So you may find out who archived an order in the following way:

pba=> select "OrderID","OrderNbr","Customer_AccountID","UserArc","DateArc"::abstime from "SalesOrderArc" where "OrderID" = [order_id];
    OrderID  |   OrderNbr  | Customer_AccountID | UserArc |        DateArc
-------------+-------------+--------------------+---------+------------------------
  [order_id] | [order_nbr] |       [account_id] |[user_id]| [date]

Also, you may check BM.log for the mentioned time:

[14-09-11 18:46:02.094 Worker1.44  TH12859 NTE] Entering method BM_Container::Worker1.44.SalesOrderMoveToArc(user = [user_id], transaction = 2419489, SID = 143541, lang = en, HP)
[14-09-11 18:46:02.094 Worker1.44  TH12859 NTE]         1 input arguments :
                int32_t: [order_id]

From the database record and from this log we can see that user #[userid]_ initiated moving order [order_id] to archive.

Then you may find the account id to which this user belongs:

pba=> select "UsersID","AccountID","Login" from "IntUsers" where "UsersID"=[user_id];
 UsersID |   AccountID  |   Login
---------+--------------+------------
[user_id]| [account_id] | [login]

Internal content