Can't have same invoiceID for invoices created in different years

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't have same invoiceID for invoices created in different years

Andrei Stan
Hello everyone,

I want to import some of my old invoices into ofbiz, and some of those
invoices have

the same id, but were created in different time periods, different years.

So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in 2020.

When importing the xml file with data for company, invoices etc., only
one of those two duplicates is imported, without erros from ofbiz's side.

Have anybody tried this in the Accounting Preferences by set the *Old
Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per org,
reset to one each year) *??

Thank you,

A.

Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

Michael Brohl-3
Hi Andrei,

if you load data through XML files, there is no application logic in
play. It's a plain import to the database.

So if you load invoices with the same invoice id (which is the primary
key for the invoice table), the second dataset will overwrite the first.

The mentioned setting will not help with the problem during import.
Because of the primary key, you cannot have the same invoice id twice so
*I guess* the setting will generate an invoice id with the year and id
(like 2021-1 or similar). But I'm not sure though...

Regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 20.02.21 um 09:48 schrieb Andrei Stan:

> Hello everyone,
>
> I want to import some of my old invoices into ofbiz, and some of those
> invoices have
>
> the same id, but were created in different time periods, different years.
>
> So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in
> 2020.
>
> When importing the xml file with data for company, invoices etc., only
> one of those two duplicates is imported, without erros from ofbiz's side.
>
> Have anybody tried this in the Accounting Preferences by set the *Old
> Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per
> org, reset to one each year) *??
>
> Thank you,
>
> A.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

Andrei Stan
Hello Michael,
Thank you for reply.
Can you suggest any best practices when having multiple invoices and at
the end of the (fiscal) year one wishes to reset the invoice counter?
Is there an option in ofbiz to do that?
Thanks,
A.

On 21.02.2021 00:28, Michael Brohl wrote:

> Hi Andrei,
>
> if you load data through XML files, there is no application logic in
> play. It's a plain import to the database.
>
> So if you load invoices with the same invoice id (which is the primary
> key for the invoice table), the second dataset will overwrite the first.
>
> The mentioned setting will not help with the problem during import.
> Because of the primary key, you cannot have the same invoice id twice
> so *I guess* the setting will generate an invoice id with the year and
> id (like 2021-1 or similar). But I'm not sure though...
>
> Regards,
>
> Michael Brohl
>
> ecomify GmbH - www.ecomify.de
>
>
> Am 20.02.21 um 09:48 schrieb Andrei Stan:
>> Hello everyone,
>>
>> I want to import some of my old invoices into ofbiz, and some of
>> those invoices have
>>
>> the same id, but were created in different time periods, different
>> years.
>>
>> So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in
>> 2020.
>>
>> When importing the xml file with data for company, invoices etc.,
>> only one of those two duplicates is imported, without erros from
>> ofbiz's side.
>>
>> Have anybody tried this in the Accounting Preferences by set the *Old
>> Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per
>> org, reset to one each year) *??
>>
>> Thank you,
>>
>> A.
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

adityasharma
Hi Andrie,

Though accounting is not forte, I think you could use the reference number
field to store the external invoice id and let the invoiceId be the
system's auto-generated value.

HTH
Thanks and regards,
Aditya Sharma

On Sun, Feb 21, 2021 at 4:38 PM Andrei Stan <[hidden email]> wrote:

> Hello Michael,
> Thank you for reply.
> Can you suggest any best practices when having multiple invoices and at
> the end of the (fiscal) year one wishes to reset the invoice counter?
> Is there an option in ofbiz to do that?
> Thanks,
> A.
>
> On 21.02.2021 00:28, Michael Brohl wrote:
> > Hi Andrei,
> >
> > if you load data through XML files, there is no application logic in
> > play. It's a plain import to the database.
> >
> > So if you load invoices with the same invoice id (which is the primary
> > key for the invoice table), the second dataset will overwrite the first.
> >
> > The mentioned setting will not help with the problem during import.
> > Because of the primary key, you cannot have the same invoice id twice
> > so *I guess* the setting will generate an invoice id with the year and
> > id (like 2021-1 or similar). But I'm not sure though...
> >
> > Regards,
> >
> > Michael Brohl
> >
> > ecomify GmbH - www.ecomify.de
> >
> >
> > Am 20.02.21 um 09:48 schrieb Andrei Stan:
> >> Hello everyone,
> >>
> >> I want to import some of my old invoices into ofbiz, and some of
> >> those invoices have
> >>
> >> the same id, but were created in different time periods, different
> >> years.
> >>
> >> So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in
> >> 2020.
> >>
> >> When importing the xml file with data for company, invoices etc.,
> >> only one of those two duplicates is imported, without erros from
> >> ofbiz's side.
> >>
> >> Have anybody tried this in the Accounting Preferences by set the *Old
> >> Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per
> >> org, reset to one each year) *??
> >>
> >> Thank you,
> >>
> >> A.
> >>
> >>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

Andrei Stan
Hello Aditya,

Thank you for the advice, i think is a good idea.

Regards,

A.


On 22.02.2021 07:45, Aditya Sharma wrote:

> Hi Andrie,
>
> Though accounting is not forte, I think you could use the reference number
> field to store the external invoice id and let the invoiceId be the
> system's auto-generated value.
>
> HTH
> Thanks and regards,
> Aditya Sharma
>
> On Sun, Feb 21, 2021 at 4:38 PM Andrei Stan <[hidden email]> wrote:
>
>> Hello Michael,
>> Thank you for reply.
>> Can you suggest any best practices when having multiple invoices and at
>> the end of the (fiscal) year one wishes to reset the invoice counter?
>> Is there an option in ofbiz to do that?
>> Thanks,
>> A.
>>
>> On 21.02.2021 00:28, Michael Brohl wrote:
>>> Hi Andrei,
>>>
>>> if you load data through XML files, there is no application logic in
>>> play. It's a plain import to the database.
>>>
>>> So if you load invoices with the same invoice id (which is the primary
>>> key for the invoice table), the second dataset will overwrite the first.
>>>
>>> The mentioned setting will not help with the problem during import.
>>> Because of the primary key, you cannot have the same invoice id twice
>>> so *I guess* the setting will generate an invoice id with the year and
>>> id (like 2021-1 or similar). But I'm not sure though...
>>>
>>> Regards,
>>>
>>> Michael Brohl
>>>
>>> ecomify GmbH - www.ecomify.de
>>>
>>>
>>> Am 20.02.21 um 09:48 schrieb Andrei Stan:
>>>> Hello everyone,
>>>>
>>>> I want to import some of my old invoices into ofbiz, and some of
>>>> those invoices have
>>>>
>>>> the same id, but were created in different time periods, different
>>>> years.
>>>>
>>>> So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in
>>>> 2020.
>>>>
>>>> When importing the xml file with data for company, invoices etc.,
>>>> only one of those two duplicates is imported, without erros from
>>>> ofbiz's side.
>>>>
>>>> Have anybody tried this in the Accounting Preferences by set the *Old
>>>> Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per
>>>> org, reset to one each year) *??
>>>>
>>>> Thank you,
>>>>
>>>> A.
>>>>
>>>>
Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

Suraj Khurana-2
In reply to this post by adityasharma
Hi Andrie,

You can also use prefix in invoice id's to always make them unique, if you
want to generate the sequence every year then the current year can be made
as InvoiceIdPrefix in PartyAcctgPreference entity.

HTH.
--
Best Regards,
Suraj Khurana
Senior Technical Consultant


On Mon, Feb 22, 2021 at 11:16 AM Aditya Sharma <[hidden email]>
wrote:

> Hi Andrie,
>
> Though accounting is not forte, I think you could use the reference number
> field to store the external invoice id and let the invoiceId be the
> system's auto-generated value.
>
> HTH
> Thanks and regards,
> Aditya Sharma
>
> On Sun, Feb 21, 2021 at 4:38 PM Andrei Stan <[hidden email]>
> wrote:
>
> > Hello Michael,
> > Thank you for reply.
> > Can you suggest any best practices when having multiple invoices and at
> > the end of the (fiscal) year one wishes to reset the invoice counter?
> > Is there an option in ofbiz to do that?
> > Thanks,
> > A.
> >
> > On 21.02.2021 00:28, Michael Brohl wrote:
> > > Hi Andrei,
> > >
> > > if you load data through XML files, there is no application logic in
> > > play. It's a plain import to the database.
> > >
> > > So if you load invoices with the same invoice id (which is the primary
> > > key for the invoice table), the second dataset will overwrite the
> first.
> > >
> > > The mentioned setting will not help with the problem during import.
> > > Because of the primary key, you cannot have the same invoice id twice
> > > so *I guess* the setting will generate an invoice id with the year and
> > > id (like 2021-1 or similar). But I'm not sure though...
> > >
> > > Regards,
> > >
> > > Michael Brohl
> > >
> > > ecomify GmbH - www.ecomify.de
> > >
> > >
> > > Am 20.02.21 um 09:48 schrieb Andrei Stan:
> > >> Hello everyone,
> > >>
> > >> I want to import some of my old invoices into ofbiz, and some of
> > >> those invoices have
> > >>
> > >> the same id, but were created in different time periods, different
> > >> years.
> > >>
> > >> So, for example, i have *EU-1 *created in 2019**and *EU-1 *created in
> > >> 2020.
> > >>
> > >> When importing the xml file with data for company, invoices etc.,
> > >> only one of those two duplicates is imported, without erros from
> > >> ofbiz's side.
> > >>
> > >> Have anybody tried this in the Accounting Preferences by set the *Old
> > >> Invoice Sequence Enum ID *to *Restart on Fiscal Year (no gaps, per
> > >> org, reset to one each year) *??
> > >>
> > >> Thank you,
> > >>
> > >> A.
> > >>
> > >>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Can't have same invoiceID for invoices created in different years

Eugen Stan
Hi,

On 22.02.2021 14:40, Suraj Khurana wrote:
> Hi Andrie,
>
> You can also use prefix in invoice id's to always make them unique, if you
> want to generate the sequence every year then the current year can be made
> as InvoiceIdPrefix in PartyAcctgPreference entity.

Interesting.

Does this mean that there is only one document series per party?

Does OFBIZ support a concept of document series?
A document series is similar to a database sequence + prefix and suffix
and it is used to assign the next id for a document type (invoice,
cotract, order, etc).


Regards,
Eugen
--
Eugen Stan
+40720 898 747 / netdava.com