Jump to content

[INCL. PATCH] Two digit YEAR in invoice numbering


Hix

Recommended Posts

Guys,

easy to implement, but would help a lot of people:

TWO digit year in invoice numbering -- eg. 16100986 -- {shortyear}{month}{day}{num} -- Settings > Company > Invoice Customization

here is the patch (but use rather that attached one):

--- ./invoices-old.php  2016-10-09 11:45:43.000000000 +0200
+++ ./app/models/invoices.php   2016-10-09 12:10:29.000000000 +0200
@@ -2383,8 +2383,8 @@
                // Set the id format accordingly, also replace the {year} tag with the appropriate year,
                // the {month} tag with the appropriate month, and the {day} tag with the appropriate day
                // to ensure the id_value is calculated appropriately on a year-by-year basis
-               $tags = array("{year}", "{month}", "{day}");
-               $replacements = array($this->Date->format("Y"), $this->Date->format("m"), $this->Date->format("d"));
+               $tags = array("{year}", "{shortyear}", "{month}", "{day}");
+               $replacements = array($this->Date->format("Y"), $this->Date->format("y"), $this->Date->format("m"), $this->Date->format("d"));
                $vars['id_format'] = str_ireplace($tags, $replacements, $inv_format);

                // Creates subquery to calculate the next invoice ID value on the fly


 

 

patch

Link to comment
Share on other sites

That is so cool :D I've added this to mine now you've shown me how to do it.

$tags = array("{year}", "{shortyear}", "{month}", "{day}", "{GB}", "{EU}", "{US}");
$replacements = array($this->Date->format("Y"), $this->Date->format("y"), $this->Date->format("m"), $this->Date->format("d"), 'GB', 'EU', 'US');

Be neat if we can set the Country for the company and use that tag like some companies do: GB02389234 EU2389423 etc.

Now mine is: GB1610091 [{GB}{shortyear}{month}{day}{num}]

@Paul do you like this feature request to have the short date?

Link to comment
Share on other sites

it would be cool... I think this is quite an important stuff, especially under this stupid EU/CZ jurisdisction (we're from Prague, CZ).

A lot of companies over here use also a CUSTOMER ID in their invoicing schemas.. so.. a lot of macros would be useful.

The good thing imho is that it is soo easy to implement i Blesta.. 

Also -- this can be a game-changes for NEW customers moving over to Blesta -- they can CONTINUE with their numbering.

And thats important especially under restrictive jurisdictions, such as atmost of EU countries.

You got weird numbering scheme? Or you changed anything? Well... you could be tampering with somehing -> deep check of your accounting stuff :) 

 

Link to comment
Share on other sites

24 minutes ago, Hix said:

it would be cool... I think this is quite an important stuff, especially under this stupid EU/CZ jurisdisction (we're from Prague, CZ).

A lot of companies over here use also a CUSTOMER ID in their invoicing schemas.. so.. a lot of macros would be useful.

The good thing imho is that it is soo easy to implement i Blesta.. 

Also -- this can be a game-changes for NEW customers moving over to Blesta -- they can CONTINUE with their numbering.

And thats important especially under restrictive jurisdictions, such as atmost of EU countries.

You got weird numbering scheme? Or you changed anything? Well... you could be tampering with somehing -> deep check of your accounting stuff :) 

 

I've just tried to grab the client ID and I failed lol.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...