state invoice change in mysql

Created on 15 December 2023, 7 months ago
Updated 2 January 2024, 6 months ago

Problem/Motivation

Hello,

I would like when we change the state (ex: pending -> paid) of an invoice in mysql, that it be directly updated on Drupal, do you have any solutions?

I found with drush cr but it's not good if i have new status every 5 min.

Thank you,

💬 Support request
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @eydouu
  • Status changed to Fixed 6 months ago
  • 🇮🇱Israel jsacksick

    Doing this via DB queries is definitely not recommended...
    But basically, you can invoke the following code if you still decide to pursue this approach:

    \Drupal::entityTypeManager()->getStorage('commerce_invoice')->resetCache(['<the invoice ID>']);
    

    Replace "the invoice ID" by the invoice ID of course :).

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024