I'm sure a patch in a Jira would be appreciated...

Jacques

From: "Nicolas Malin" <malin.nico...@librenberry.net>
Hello,

I looked the code to manage a specific invoiceId generation for a customer and 
this mail is to be sure my understanding is right.
I found that all specific id generation are managed by PartyAcctgPreference for invoice, quote and order and use an enumeration (invoiceSequenceEnumId) to select invoice id resolution process.

I continued to follow the way and I reached getNextInvoiceId service with many elseif on invoiceSequenceEnumId. It's difficult to read and understand this method. If someone want to add a new process for a specific customer, it's not really a best pratice adding directly in source code (I can do that without problems with addons, but it's not the subject).

To make easier the customer adaptation and not having getNextInvoiceId with an if forrest, I suggest to move enumeration to some customMethods. We can change invoiceSequenceEnumId to invoiceSeqCustMethId and in getNextInvoiceId we just need to check if a customMethod is defined and call it.

This enchancement permit to define official invoiceId service resolution and 
simplify specific customer service resolution.

For backward compatibilty, we can transform invoiceSequenceEnumId to 
oldInvoiceSequenceEnumId.
At your comments ;)

Nicolas

--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/



Reply via email to