Keep hardcoded 365 days version for testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
2.2 KiB
JSON
32 lines
2.2 KiB
JSON
{
|
|
"gitSyncId": "11976947d24e48cf90c738f1_c8a3dcce-d31d-42fe-9aa7-7773bd28f1d9",
|
|
"id": "Operations - Unused Items_unused_items",
|
|
"pluginId": "postgres-plugin",
|
|
"pluginType": "DB",
|
|
"unpublishedAction": {
|
|
"actionConfiguration": {
|
|
"body": "SELECT\n i.item_number AS \"Item Number\",\n i.item_descrip1 AS \"Description\",\n CASE i.item_type\n WHEN 'P' THEN 'Purchased'\n WHEN 'M' THEN 'Manufactured'\n WHEN 'R' THEN 'Reference'\n WHEN 'T' THEN 'Tooling'\n WHEN 'O' THEN 'Outside Process'\n WHEN 'B' THEN 'Breeder'\n WHEN 'C' THEN 'Co-Product'\n WHEN 'F' THEN 'Phantom'\n ELSE i.item_type\n END AS \"Item Type\",\n CASE WHEN i.item_active THEN 'Active' ELSE 'Inactive' END AS \"Status\",\n cc.comment_user AS \"Created By\",\n COALESCE(i.item_created, cc.comment_date)::date AS \"Date Created\",\n last_txn.last_transaction_date::date AS \"Last Transaction\",\n (CURRENT_DATE - COALESCE(last_txn.last_transaction_date, i.item_created, cc.comment_date)::date) AS \"Days Unused\"\nFROM item i\nLEFT JOIN comment cc\n ON cc.comment_source_id = i.item_id\n AND cc.comment_source = 'I'\n AND cc.comment_text = 'Created'\nLEFT JOIN (\n SELECT\n isite.itemsite_item_id,\n MAX(ih.invhist_transdate) AS last_transaction_date\n FROM itemsite isite\n JOIN invhist ih ON ih.invhist_itemsite_id = isite.itemsite_id\n GROUP BY isite.itemsite_item_id\n) last_txn ON last_txn.itemsite_item_id = i.item_id\nWHERE (CURRENT_DATE - COALESCE(last_txn.last_transaction_date, i.item_created, cc.comment_date)::date) >= 365\nORDER BY \"Days Unused\" DESC",
|
|
"encodeParamsToggle": true,
|
|
"paginationType": "NONE",
|
|
"pluginSpecifiedTemplates": [
|
|
{
|
|
"value": true
|
|
}
|
|
],
|
|
"timeoutInMillisecond": 30000
|
|
},
|
|
"confirmBeforeExecute": false,
|
|
"datasource": {
|
|
"id": "xTuple_GoLive",
|
|
"isAutoGenerated": false,
|
|
"name": "xTuple_GoLive",
|
|
"pluginId": "postgres-plugin"
|
|
},
|
|
"dynamicBindingPathList": [],
|
|
"name": "unused_items",
|
|
"pageId": "Operations - Unused Items",
|
|
"runBehaviour": "AUTOMATIC",
|
|
"userSetOnLoad": false
|
|
}
|
|
}
|