Added Order Status Does Not Reflect In "total Paid"

Added new order status and its amounts do not reflect in

?dispatch=orders.manage

Total paid

How to fix that?

Added new order status and its amounts do not reflect in

?dispatch=orders.manage

Total paid

How to fix that?

I suppose this is hardcoded:

if (is_array($orders)) {
    foreach ($orders as $k => $v) {
        $result['gross_total'] += $v['total'];
        if ($v['status'] == 'C' || $v['status'] == 'P') {
            $result['totally_paid'] += $v['total'];
        }
    }
}

Only processed and complete statuses are taken into account.

Yea but this does not make any sense as to why then there is such feature to create new status..

Basically I use this new order status P > C > I

to make order status > Invoice/Credit memo - invoice
this makes invoice +1 it is very tricky order status since invoice cannot go -1 unless breaking in to db...

What if

if ($v['status'] == 'C' || $v['status'] == 'P' || $v['status'] == 'I')

? Would this work?

Yea but this does not make any sense as to why then there is such feature to create new status..

Basically I use this new order status P > C > I

to make order status > Invoice/Credit memo - invoice
this makes invoice +1 it is very tricky order status since invoice cannot go -1 unless breaking in to db...

What if

if ($v['status'] == 'C' || $v['status'] == 'P' || $v['status'] == 'I')

? Would this work?

It should work.

I think there should be a setting for each order status.

I think so too.

I think there should be a setting for each order status.

There is the following code

$paid_statuses = array('P', 'C');

in these files:

- app/controllers/backend/index.php

- app/functions/fn.cart.php

You should extend it with your order status IDs

This works well! Thank you

There is the following code

$paid_statuses = array('P', 'C');

in these files:

- app/controllers/backend/index.php

- app/functions/fn.cart.php

You should extend it with your order status IDs

You are welcome!

Thanks for the tip, really should be something that is configured, if you can add the status you should be able to have it included in calculations if required.

thanks again

Has this changed lately? I looked in the files, but cannot find the codes that needs to be changed.

In the index.php file the line is

$paid_statuses = ['P', 'C'];

in the fn.cart.php it was changed to sql query which retrieves from database all statuses with the Inventory parameters set to Decrease

Hmm I dont find this in index.php. I find this:

$paid_statuses = fn_get_settled_order_statuses();

Can it be somewhere else?

Hmm I dont find this in index.php. I find this:

$paid_statuses = fn_get_settled_order_statuses();

Can it be somewhere else?

Yes, looks like it was also changed

So anyone know where "fn_get_settled_order_statuses" is defined?

So anyone know where "fn_get_settled_order_statuses" is defined?

app/functions/fn.cart.php

Found it. Adjusted. Works!

Thank you!

You are welcome! :)

Has this changed in ver 4.12.2? The dashboard total sales amount does not include some of the ordersatuses?

Now it depends on the "Consider order paid" setting of order statuses