[YEAR] tag used on invoices

  • Olivier Parent
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #147530 by Olivier Parent
[YEAR] tag used on invoices was created by Olivier Parent
Hi Tuan,

I have been using [YEAR] tag as a prefix for my invoices but it shows the current year. I would like the prefix to display the year the subscription has been created. Is there any other tag I should use for that purpose?

Best regards.

Olivier

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #147533 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [YEAR] tag used on invoices
Hello Olivier

That's the right tag. Maybe you can submit a support ticket sending me super admin account of your site, tell me ID of the record which has the wrong data for [YEAR] so that I can check and get back to you with the reason?

Tuan

Please Log in or Create an account to join the conversation.

  • Olivier Parent
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago - 3 years 10 months ago #147537 by Olivier Parent
Replied by Olivier Parent on topic [YEAR] tag used on invoices
Hi Tuan,

I have imported around 7,000 entries yesterday. Their created_date and from_date range from 2010 to 2021 but the invoices, which use the [YEAR] tag, all show 2021 as prefix.

Could it be that the [YEAR] tag shows the year the Joomla user has been created (which is when the data has been imported)?

Best regards.

Olivier
Last edit: 3 years 10 months ago by Olivier Parent.

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #147541 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [YEAR] tag used on invoices
That's the reason causing the error. If you have created_date field with properly data, then you can run this SQL command :

UPDATE jos_osmembership_subscribers SET invoice_year = 0

(replace jos_osmembership_subscribers with the right database table on your site)

After that, the data from created_date will be used to generate [YEAR] tag and it should work well

Regards,

Tuan
The following user(s) said Thank You: Olivier Parent

Please Log in or Create an account to join the conversation.

  • Olivier Parent
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #147543 by Olivier Parent
Replied by Olivier Parent on topic [YEAR] tag used on invoices
Thanks again Tuan!

it worked like a charm and I now have the right years on my invoices but it did not reset the invoice number (which should start at 1 every year). Any idea?

Olivier

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #147545 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [YEAR] tag used on invoices
As you imported the subscription, you will need to import it with right invoice_number . The setting reset invoice number will only works with subscriptions created when users subscribe for your plans via Membership Pro

BTW, could you please update the SQL command earlier to:

UPDATE jos_osmembership_subscribers SET invoice_year = YEAR(`created_date`) .

That should calculate the right invoice_year for each subcription

Regards,

Tuan
The following user(s) said Thank You: Olivier Parent

Please Log in or Create an account to join the conversation.

  • Olivier Parent
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #147546 by Olivier Parent
Replied by Olivier Parent on topic [YEAR] tag used on invoices
OK, that sounds perfect to me!

Have a great day.

Olivier

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #147551 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic [YEAR] tag used on invoices
Thanks Olivier, you too !

Please Log in or Create an account to join the conversation.