sul-dlss / FOLIO-Project-Stanford

Task management for Stanford’s analysis of FOLIO.
2 stars 0 forks source link

Update Awaiting Payment amounts in Budget Summary #691

Closed ahafele closed 1 week ago

ahafele commented 1 week ago

Details are in a JIRA ticket https://jirasul.stanford.edu/jira/browse/FOLIO-280 Prior work was done at https://github.com/sul-dlss/FOLIO-Project-Stanford/issues/655.

Need to let Suzette know when this is scheduled to be done.

jgreben commented 1 week ago

These are the sql commands that will update the budgets:

update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(268.72)) where jsonb->>'name' = 'ABRAHAMSW-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(38.98)) where jsonb->>'name' = 'CONNOLLYG-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'CRAIGW-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'FELTONC-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(5050.79)) where jsonb->>'name' = 'FIELD-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'FURBUSH-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(13755.88)) where jsonb->>'name' = 'GERMANIC-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(1217.76)) where jsonb->>'name' = 'HEARST-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(6496.09)) where jsonb->>'name' = 'HOWELL1-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(8648.63)) where jsonb->>'name' = 'HOWELL2-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(2352.55)) where jsonb->>'name' = 'JAGELS-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(13520.1)) where jsonb->>'name' = 'JAPANHV-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'KEMBLE-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(2955.41)) where jsonb->>'name' = 'KLEINM-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'KLINEROET-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(10863.32)) where jsonb->>'name' = 'LMBSP-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(3489.84)) where jsonb->>'name' = 'MUFFLEY-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(8461.14)) where jsonb->>'name' = 'ROMANCE-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(12954.94)) where jsonb->>'name' = 'STANDISH-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(0)) where jsonb->>'name' = 'VICKERS1-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(2070.6)) where jsonb->>'name' = 'WARREN-SUL-SUL2025'; update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '{awaitingPayment}', to_jsonb(11071.2)) where jsonb->>'name' = 'YOUNGHMAP-SUL-SUL2025';

jgreben commented 1 week ago

This is the bash command I used to generate the sql file:

for line in `cat Awaiting_payment_updates.csv`; do echo $line | awk -F',' '{print "update sul_mod_finance_storage.budget set jsonb = JSONB_SET(jsonb, '\''{awaitingPayment}'\'', to_jsonb("$3")) where jsonb->>'\''name'\'' = '\''"$1"-SUL-SUL2025'\'';"}'; done > awaiting_payments_test.sql
scanedastanford commented 1 week ago

@jgreben Here is the updated sheet. The correct amounts are highlighted in column C. These should replace what is currently showing as awaiting payment in FOLIO. Incorrect_awaiting_transactions.xlsx