Generated Numbers - client_counter

@peterjm

I can’t recreate this, $client_counter is working for me when i create invoices.

@david

Steps to reproduce:

https://demo.invoiceninja.com

Settings> Generated Numbers> Incoives

Set Number Pattern to:
Client Counter:{$client_counter}-Counter:{$counter}

Create a few invoices for different clients. The client_counter shows the same value as counter, where i thought it should be a unique counter for each client invoice count? Or im mis understanding the purpose of client_counter.

counter results

Thanks!

Ah so i think you can only have one counter operating at a time.

@david

ok. Well I tried setting Invoices Number Pattern to the following:
I-{$client_counter} (So that only one counter is operating at a time right?)

However the $client_counter value is still just showing same value as $counter would (it just counts the number of invoices ever created regardless of which client is being invoiced). Shouldn’t the $client_counter be showing the number of invoices for the client being invoiced?

Otherwise im not understanding its purpose of client_counter. How is it different from counter? My assumption was that it should be based on a new counter per client ID (which I would find really useful because i could have each invoice count per client ID and each client would know the total number of invoices they had)

Thanks,

  • Peter

@peterjm

I think i see a bug here, i’ll check in a fix for this.

@peterjm a fix for this is in the v5-develop branch,

please note you must use {client_id_number} with {client_counter} for it to work.

Can confirm this is working properly for me now in v5.0.47-C38 when i use both {$client_id_number} with {$client_counter}

2 Likes

Thanks for the update @peterjm!

Running into this new error on v5.1.5-C41

When i add $number as the error suggests it still shows up.

Thanks for reporting this, I’ll take a look

1 Like

I think the problem here (in part at least) is that the help message is wrong, the correct variables are $client_number and $client_id_number.

@david can you please confirm that’s correct?

correct, $client_number and $client_id_number

1 Like

ok but i cant get client_counter to work with any combination of:
a) client_number
b) client_id_number
or c) client_number and client_id_number

When i first noticed this i was using the exact same variables as i did in 5.0.47-c38. I think something changed and broke in the error checking?



This bug should be fixed in the next release

1 Like

Confirmed problem is fixed when i tested on v5.1.6-C42

Thank you!

1 Like

Thanks for the update!

Hello @hillel,

I have upgarded to 5.1.7 v5-stable today and can not confirm it is working:

Shouldn’t the TETO-Numbers start with TETO_0001, when $client_counter is used?

Do you have any idea, why?

Thanks for reporting this, @david any ideas?

I made git clone of the project and reinstalled v5.1.7-C42 again with artisan optimize an fresh company. The counter still counts up gloabally an not per client. Is there a artisan command to prevent any cached behaviour from previuos 5.1.4 or 5.1.6?

Hello @hillel, hello @david, I was wondering why the client_counter did not work on my installation, even it was confirmed workig. I found the reason: service nginx reload. Now I can confirm everything is working as inteded. Thank you and excuse caused confusion.

1 Like