Additional Invoice status

This might be a feature request but i’m curious is there a way to add additional invoice status. In addition to draft, sent, viewed, paid and overdue, i would like to have a status for completed. I also use this for order management and i keep getting confused about which are open orders.
```

This isn’t very difficult.

Edit /application/modules/invoices/controllers/invoices.php, add this after line 50:

        case 'complete':
            $this->mdl_invoices->is_complete();
            break;

Next, edit /application/modules/invoices/models/mdl_invoices.php, add a comma after the ) on line 47 and add this:

        '5' => array(
            'label' => lang('complete'),
            'class' => 'complete',
            'href' => 'invoices/status/complete'
        )

On line 399, add:

public function is_complete()
{
    $this->filter_where('invoice_status_id', 5);
    return $this;
}

/application/modules/invoices/views/index.php, after line 28, add:

<li <?php if ($status == 'complete') { ?>class="active"<?php } ?>><a
                href="<?php echo site_url('invoices/status/complete'); ?>"><?php echo lang('complete'); ?></a></li>

Additional changes need to be made to guest view if you want guests to view completed as well.

1 Like

Thank you for the reply.

Your modification works, but it doesn’t work at the same time. I can see the completed status and i can put invoices into completed status but i can’t put paid invoices into completed status. Also the first column, or status column, on the invoice page is there a way to add “Completed” where it says draft, paid, etc.

Any ideas how to fix?

Forgot to add style to the button class, edit your custom.css here
/assets/default/css/custom.css

add this to the end, you can change to color of your preference.
.label.complete{background-color:#800000}

As for not being able to mark paid invoices complete, I’ll have to dig deeper and don’t have much time right now but will try to solve this week

I would assume that the invoice becomes read-only after being marked as paid. Security measure for inadvertently change already completed invoices.

Check this, the invoice should be mostly greyed out.

Nope i disabled this early on because i have customers who will add stuff to their order 2 days later.

Edit: also the css code change doesn’t work. I even tried putting !important after the background color.

.label.complete{background-color: black; !important}

tried with both just “black” and the color codes themselves.

v1.5, colors are elsewhere it seems!

I added a specific color in both assets/invoiceplane/sass/_ip_variables.scss & assets/invoiceplane_blue/sass/_ip_variables.scss

I also added code in various places as described above; the behaviour seems OK, I am almost there, the only issue is that the button in dashboard and in invoice view does not get coloured and is printed white on white although specific colors have been defined in the _ip_variables.scss files

Also, my new status (signed) is shown without capital S while all other status are capitalised. This is strange as I duplicated all code blocks from the ‘viewed’ sections to make it and it has exactly the same syntax.

Any idea?

There are a lot of better ways to do this probably and a lot has changed since this modification. But, you should still be able to add the style to the stylesheet you are using. For example, I use the InvoicePlane_Blue template, so adding it to
/assets/invoiceplane_blue/css/style.css works for me.

As for the capital ‘S’, I assume you would need to be sure the language file has a lower case.

However, you still won’t be able to mark complete once paid. There is something still in there that prevents changing a paid invoice to another status but I haven’t needed to find it. Simply disabling the setting doesn’t change this.

thanks for the s->S
I discovered the language file (did not know about it) and it was indeed lacking ‘signed’ => ‘Signed’ which I added in the custom file, will see what this does

for the colors, I see that the css you link to is a huge text block, I tried to duplicate
.viewed{color:#F89406}
rename it
.signed{color:#F89406}

did the same for
.label.viewed{background-color:#faa937}
creating a copy
.label.signed{background-color:#faa937}

but still did not get the button coloured when status set to 'signed’
I did that in both blue and standard for good measure no better !!

The css is minified, hence the block look. Add .label.signed{background-color:#faa937} to the end of the file. If still not working, be sure that you have changed line 50 in Mdl_Invoices to

        'class' => 'signed',

lower case

1 Like

You know that you would have to re-compile all assets again if you change values in these files?

Please add ANY custom CSS in the custom.css file. Nowhere else. This file was added for this purpose.

editing assets/core/css/custom.css to

/* =============================================================================
   InvoicePlane
   Custom Stylesheet

   All changes made in this file will override the default styles.
   ========================================================================== */

.label.signed{background-color:#FF4500}
.signed{color:#FF0000}

does not deliver

by contrast adding the same text at the end of assets/invoiceplane/css/style.css

did the job without recompiling anything, just reloading the page.

could it be that assets/core/css/custom.css is not loaded/sourced?

The file should be loaded as the last stylesheet in the app.
The HTML should look similar to this:

Also, maybe browser caching?

1 Like

bingo @Kovah, the empty custom css was cached
Thanks!!!