Topic: Proper Way to create a module / add-on

Hi guys, what's the best way to add additional modules / add-ons without affecting much of the core system code?

I want to add a customized cheque printing module which tracks cheque no as well but I don't want to change much of the core code too much since I want to continue to update the system to latest CVS. I will gladly share the module once I get it working.

My goal is to be able to make payments by checks, recording not only the reference sequence but also a check no sequence. Both for PO payments by checks as well as Bill Payments all referencing the chequing sequence. Ex : 1000, 1001, etc. I will also have the ability to print on a pre-stock cheque by PDF with two stubs.

Any direction on what the best approach is would be great.

Re: Proper Way to create a module / add-on

Hi t2webby

To track cheque numbers you can use class found in references.inc file, although it implies adding new document type number in types.inc. If you really do not want to change database structure and want to keep your code isolated from FA changes your module can create private file in company/... subdirectory to store/track cheque numbers.

Add-on module's framework in FA is currently very simple and can be successfully used  only for pieces of software loosely related to main source code. The best place for it is in modules subdirectory. Example modules you will find on download page.
You can also make your extension as a set of patches/patched source files installed manually on main source tree.

BTW Cheques are nearly not used in transactions in EU so, maybe this is historical reason for lack of this functionality in FA.

Janusz

Re: Proper Way to create a module / add-on

ok great, I will patch what I need to do for now. But will there be any plans in the near future to have Cheque features? I think it will certainly get alot of North American type companies on board

Re: Proper Way to create a module / add-on

Hello t2webby,

I think it would be great, if you create a module for printing cheques. You can use any of the existing modules as a model. And you can look in the /reporting folder, repXXX.php to see how to make a report. You can also look in the file /reporting/includes/reporting.inc how to initiate a report outside the report-central.

And, of course, use Janusz's suggestion to keep track of check numbers.

If this turns out to be good, we will consider incorporating the cheque printing in coming releases.

/Joe

5 (edited by t2webby 07/19/2008 06:07:39 am)

Re: Proper Way to create a module / add-on

I'm currently working on this right now, basically its going to be its own separate module that issues 'cheque' numbers to a given payment (whether it is bank payment or supplier payment). This way, not much is changed to FA's current payment process and trunk code.  A cheque no is referenced to an existing processed payment transaction. Cheque numbers will be unique with a check_config table keeping reference of the check numbers.

It would also have to keep track of which bank chequing account the cheque is referenced to. An additional table called check_ref would be used to keep the issued cheque references to which payment transaction. Once a check is issued to a payment transaction, it can then be printed. I still have to figure out this part out. I will keep you posted. Basically i'll look at how the reports are printed and go from there. There's many standards of Cheques out there, right now i'm just creating one that follows the CPA standard (canadian). But I can see future work in having some kind of margin and output setup for individual customizable needs.

6 (edited by t2webby 08/13/2008 03:47:32 pm)

Re: Proper Way to create a module / add-on

Hey guys, I got the chequing module working. Basically plugs right and works right into the RC2 release. If you guys are interested in having it I can email / send it to you in hopes perhaps you can use / expand it as part of future releases.

Let me know

Re: Proper Way to create a module / add-on

Great. you can send it to <joe.hunt.consulting  at  gmail dot com>. Sorry, I have to keep mey email spam-free, I hope you understand it.

/Joe

Re: Proper Way to create a module / add-on

I sent it, let me know if you got it.