-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qual - Optimize requests in sells journal for situation invoices #30609
Qual - Optimize requests in sells journal for situation invoices #30609
Conversation
Have you tried your code with the constant INVOICE_USE_SITUATION = 2, which adds "progressive" situation invoices to v20? |
Hi @aspangaro, I haven't tried with INVOICE_USE_SITUATION = 2 yet. |
It's a new mode for situation invoice integrated in v20 (hidden for the moment). The mode 2 of the constant must be replaced the mode 1 officialy in v21. This work comes from the GIFF situation invoice, the difference between the two modes is that situation invoices were on a cumulative mode and now it will be on a progressive mode. |
Hello, This PR not depends on INVOICE_USE_SITUATION const, I only add a method not to fetch and load invoice object (many SQL requests). |
@@ -6764,56 +6764,23 @@ public function get_prev_progress($invoiceid, $include_credit_note = true) | |||
// phpcs:enable | |||
global $invoicecache; | |||
|
|||
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing this ?
We know that if this condition is true, we must do nothing and we can return 0 (no fetch at all to do)
* Moved invoice line class to separate file. Removed unnecessary requires. * Fixed requires * Fixed require
* fix phpstan * fix phpstan
I had some troubles in retrieving the "develop" branch and some unwanted PR was introduced in it. |
Qual - Optimize requests in sells journal for situation invoices
Remark
When you got a lot of invoices and you set "INVOICE_USE_SITUATION" to 1, you can excess the max execution time.