Download & Extend

Validation for invoice number

Project:Storm
Version:6.x-2.x-dev
Component:Storm Invoice
Category:task
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

Currently, the invoice number is a default on the page load of the invoice node add form. If multiple people have the node add form open at once, it is quite possible to issue multiple invoices with the same number.

Validation would stop this from happening.

Comments

#1

Category:feature request» bug report
Priority:normal» major

In most countries rules exist for valid invoice numbers, e.g. usually there must not be duplicate invoice numbers and so on. Some basics are explained in Wikipedia, on top of this lots of national regulations exist. According to my (limited) knowledge of bookkeeping, the "Storm Invoice" module does not properly warrant to generate valid invoice numbers. Since the sole job of the "Storm invoice" module is to generate invcoices, this is a bug. Since unique invoice numbers are a key component of accounting, this is even a major issue.

I'd suggest to either validate the invoice numbers, as the original poster proposed on July 30, 2009, or to allow the user to generate proper invoice numbers by himself, e.g. with tokens. A proper (unique) invoice number could be easily generated, for example with this simple token:

<?php
return 'Invoice No. ' . '[yyyy]' . '[mm]' . '[dd]' . '-[nid]'
?>

This takes the node creation date and adds the node ID, which always results in a unique and incrementing invouce number (at least as long as you stick with one Drupal site). However, this would be much better than the current approach which can only result in serious fiscal trouble.

#2

Workaround (requires several node edits):

  • Generate the node title with the token above
  • Edit the "Storm invoice" node, and replace the invoice number with the node title
  • Pray that you don't forget to fix the "Storm invoice" before a tax auditor catches you

#3

Version:6.x-1.x-dev» 6.x-2.x-dev
Category:bug report» task

Good plan. Would you be able to submit a patch?

(This would need to go into the 2.x branch)

#4

Sorry, just user, not coder.

nobody click here