Return PR status to "under approval" and make the financial table editable again.

PHOTO EMBED

Sun Jan 22 2023 11:03:08 GMT+0000 (Coordinated Universal Time)

Saved by @igor #drupal #mysql

$pr = \Drupal::entityTypeManager()->getStorage('cfp_payment_request')->load(4221);
$pr->setAmountDedicatedToAp(NULL);
$pr->set('date_of_completion', NULL);
$pr->setState('under_approval');
$pr->save();


$transition_history = $pr->get('transition_history')->getValue();
array_splice($transition_history, -2);
$pr->set('transition_history', $transition_history);
$pr->set('items_approvement_closed', FALSE);
$pr->save();
content_copyCOPY