resolve invoiceId enchancement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

resolve invoiceId enchancement

Malin Nicolas
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 | Threaded
Open this post in threaded view
|

Re: resolve invoiceId enchancement

Jacques Le Roux
Administrator
I'm sure a patch in a Jira would be appreciated...

Jacques

From: "Nicolas Malin" <[hidden email]>

> 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 | Threaded
Open this post in threaded view
|

Re: resolve invoiceId enchancement

Malin Nicolas
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" <[hidden email]>
>> 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/