• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Invoice numbering with prefix

Invoice numbering with prefix 1 year 1 month ago #42668

I want to add invoice numbering to a form.
The numering should be like this: RLZ-202410001
The next one RLZ-202410002 and so on.

I have read that this is done by a hidden field and script.

Can anyone help me with this issue.

Thanks.
The administrator has disabled public write access.

Invoice numbering with prefix 5 months 1 week ago #43099

  • info5963
  • info5963's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 1
I would be interested in that too. Have you made any progress here?
It's been a while.

If you had to find out how to get the last ID in the submissions, that would be the first step.

There is a placeholder: {last_insert_id}
But this probably only relates to the mapping. Doesn't anyone have a solution? If you use the payment plugins offered, it must be possible somehow.
Last Edit: 5 months 1 week ago by info5963.
The administrator has disabled public write access.

Invoice numbering with prefix 5 months 1 week ago #43101

  • info5963
  • info5963's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 1
I solved it for myself like this:

// Assumption: the table prefix is jos_ (replace it with your actual prefix)

$db = JFactory::getDbo();
$query = $db->getQuery(true);

$query->select('MAX(SubmissionId) AS last_submission_id');
$query->from($db->quoteName('jos_rsform_submissions'));

$db->setQuery($query);
$lastSubmissionId = $db->loadResult();

// Increase the $lastSubmissionId by 1
$lastSubmissionId++;

$aktuellesJahr = date("Y");
// Add zeros in front of the submission ID to get a 5-digit number
$fuenfstelligeID = str_pad($lastSubmissionId, 5, '0', STR_PAD_LEFT);

// Fill in your field "invoice number"
$val = "RG-" . $aktuellesJahr . $fuenfstelligeID;
The administrator has disabled public write access.
The following user(s) said Thank You: werner04
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!