You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Nicolas Malin <ma...@librenberry.net> on 2010/05/05 14:19:30 UTC

resolve invoiceId enchancement

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/


Re: resolve invoiceId enchancement

Posted by Nicolas Malin <ma...@librenberry.net>.
Jacques Le Roux wrote:
> I'm sure a patch in a Jira would be appreciated...
Ok Jacques, Leila and me have been create a patch available on Jira 
https://issues.apache.org/jira/browse/OFBIZ-3765

I wait you remark ;)

After, I will add service to manage invoice Id for french requirement.

Nicolas
>
> Jacques
>
> From: "Nicolas Malin" <ma...@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/
>>
>
>


-- 
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/


Re: resolve invoiceId enchancement

Posted by Jacques Le Roux <ja...@les7arts.com>.
I'm sure a patch in a Jira would be appreciated...

Jacques

From: "Nicolas Malin" <ma...@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/
>