Openbravo Issue Tracking System - Modules
View Issue Details
0013863ModulesBooking controlpublic2010-07-01 18:302010-12-31 09:57
psanjuan 
dalsasua 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
1.0.12 
0013863: New sequence number for booking control
A dependence of the booking control sequence from the fiscal calender (Year) is needed.

For every year in the fiscal calendar the sequence must start again.
As a result there could be more than one sequence in parallel for the same document type (one for the old year, one for the new year), because having different document types for different years is not a good idea and will not work.

Example:

2 invoices are booked in January 2009.

First invoice: Booking date is 02. January 2009 (=> booking period is Jan 2009). Booking control number is HIS-2009-1

Second invoice: Booking date is 30. December 2008 (=> booking period is Dec 2008). Booking control number is HIS-2008-120435

=> Booking control number is configured with a prefix of "HIS-" + year + "-", depends on the fiscal year and starts new for every new fiscal year.

 
n/a
In the Financial Management / Setup / Document Sequence / Sequence - there should be a periodicity section, with below data:
- Periodicity (yes/no) flag
- Period = Year
- Initial Value = numeric
- Periodic prefix = [HIS]-[YYYY]-
- Periodic sufix = -[(if needed)
Above sequence number will have into account the Fiscal Year while booking an invoice, therefore only when an invoice is booked/posted will get the correct booking number which will not be possible to change later on.
Fiscal year should be open/active in order to book and therefore use a sequence number setup that way.

No tags attached.
Issue History
2010-07-01 18:30psanjuanNew Issue
2010-07-01 18:30psanjuanAssigned To => sathiyan
2010-07-02 16:33psanjuanDescription Updatedbug_revision_view_page.php?rev_id=564#r564
2010-07-02 16:33psanjuanProposed Solution updated
2010-12-13 16:59psanjuanNote Added: 0033140
2010-12-13 18:56psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1320
2010-12-13 19:12psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1324
2010-12-14 12:59psanjuanAssigned Tosathiyan => dalsasua
2010-12-14 13:21psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1329
2010-12-14 13:25psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1330
2010-12-14 14:15dalsasuaNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1331
2010-12-14 15:32psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1332
2010-12-14 15:59psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1333
2010-12-15 17:10mgerkeNote Added: 0033209
2010-12-16 10:15psanjuanNote Added: 0033223
2010-12-16 11:15mgerkeNote Added: 0033227
2010-12-16 12:14psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1344
2010-12-16 15:41psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1350
2010-12-16 15:46psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1351
2010-12-16 15:56psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1352
2010-12-16 16:41psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1354
2010-12-16 17:08psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1355
2010-12-16 17:12psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1356
2010-12-16 17:21psanjuanNote Edited: 0033140bug_revision_view_page.php?bugnote_id=0033140#r1357
2010-12-17 09:51psanjuanNote Added: 0033257
2010-12-22 14:32hgbotCheckin
2010-12-22 14:32hgbotNote Added: 0033361
2010-12-22 14:32hgbotStatusnew => resolved
2010-12-22 14:32hgbotResolutionopen => fixed
2010-12-22 14:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.obbo/rev/9c95f7b82d36f7b8e4f9aefc42b1943be1e04307 [^]
2010-12-22 14:35dalsasuaNote Added: 0033362
2010-12-27 12:24hgbotCheckin
2010-12-27 12:24hgbotNote Added: 0033404
2010-12-27 12:24hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/mods/org.openbravo.obbo/rev/9c95f7b82d36f7b8e4f9aefc42b1943be1e04307 [^] => http://code.openbravo.com/erp/mods/org.openbravo.obbo/rev/fa04191ed9c0b0aaf4d3afa6f57e9cb85c28cb36 [^]
2010-12-29 12:59psanjuanNote Added: 0033425
2010-12-29 12:59psanjuanStatusresolved => closed
2010-12-31 09:53psanjuanFixed in Version => 1.0.12
2010-12-31 09:53psanjuanNote Edited: 0033257bug_revision_view_page.php?bugnote_id=0033257#r1399
2010-12-31 09:54psanjuanNote Edited: 0033257bug_revision_view_page.php?bugnote_id=0033257#r1400
2010-12-31 09:57psanjuanNote Added: 0033496
2010-12-31 09:58psanjuanNote Edited: 0033496bug_revision_view_page.php?bugnote_id=0033496#r1402
2010-12-31 09:58psanjuanNote Deleted: 0033496

Notes
(0033140)
psanjuan   
2010-12-13 16:59   
(edited on: 2010-12-16 17:21)
This note is meant to be a detailed explanation about how this feature is going to be implemented:

There must be a "Periodicity" section in the below listed application path:

“Financial Management || Accounting || Setup || Document Sequence “ |- Sequence tab.

There will be a new (Yes/No) flag field named "Reset per Year".
This field will have “No” as by default value, which means that the system will behave as nowadays.

In case the end-user set “Reset per Year” field as “Yes”, the “Advanced Booking Control Number per Fiscal Year” feature will work as described below for the “Booking Control Number Sequence”.

A new display logic will:

(1) hide the existing field "Next Assigned Number"

(2) show a new field named "First assigned number for the Year"; which will be set up as "1" by default, but could be later on changed by the end-user.

(3) populate a new sub-tab named “Year Sequence” containing 2 columns as described below:

First column named = “Year”
Second column named = “Next Assigned Number”.

System will behave as described below and taking into account below setup:

(1) for the existing fields:

* Prefix - [text] - by example [HIS]-[YYYY]
[YYYY] will be replaced with the "4-digits" year of the accounting date of the booking control document.
* Suffix - [text] - by example [BC]
* Incremented by [text] - by example [1]

(2) for the “new” fields:

* “Reset per Year” set up as “Yes”
* “First Assigned number for the Year” set up as “10000”

Documents having an accounting date of 2010 will have below booking control number:

HIS-2010-10000-BC
HIS-2010-10001-BC
HIS-2010-10002-BC
…..

Besides, the system will “automatically” update the new sub-tab “Sequences per Year” (in a trasparent way for the user). In our example:

Column "Year" = 2010
Column "Next assigned number" = 10003
Because the firts number for the year was "1000", 3 documents have been booked and the numbering increased by 1.

As an exception, in the case an end-user wants the booking control number to take as "First Assigned number for the Year" a diferent one that the one setup by default in the window "Financial Management || Accounting || Setup || Document Sequence “ |- Sequence tab - "First assigned number for the Year" field for a given year, he/she will have to manually create:

- the "Year", let's say 2012
- and the "Next assigned number", let's say 120000 manually
in the new sub-tab "Year Sequences" prior to any booking.

It is important to remark that:
A new version of the module Booking Control module is going to be released, including the functionality described in this feature request.

(0033209)
mgerke   
2010-12-15 17:10   
I think a better way to implement this behaviour is the usage of the "Advanced sequence" from "Advanced Asset Management" for booking control. There we have the dynamic "Fiscal year".

Everything we need is to start the sequence for every new year.

This has to be done by the "Advanced sequence", because there is the knowledge about the fiscal year. So the "Sequence" option on the "Line" tab needs a new field "Reset per Year". If this option is true, a new sequence entry is generated by the system for every fiscal year. The user chooses a sequence on the line tab (current behaviour), but this is only the template, from which the generated one is copied, e.g. with the name <sequenceTemplateName>-YYYY

And: If a new fiscal year is created, for every advanced sequence line of type "Sequence", a new sequence is generated.

In summary:
1. a new field "Reset per Year" on the Line tab of the "Advanced sequence" dialog
2. a function to generate (= copy) the sequences for all active fiscal years
3. the same function has to be called if a fiscal year is created as active or is activated
4. the dependency of the sequence used from the fiscal year in the "advanced sequence" must be controlled
5. booking control uses advanced sequence instead of sequence

I think this is much clearer, uses more existing structures and will make the Advanced sequence more useful than to 'drill out' the Sequence dialog.
(0033223)
psanjuan   
2010-12-16 10:15   
There is no way for us to implement what you are describing above because:
- Advanced Sequence depends on Booking Control, if we implement this feature the way you are describing Booking Control would depends on Advanced Sequence, creating a dead lock
- We can always have more "dynamic" values such as Organization if that is what you might need; but always through key words in the prefix and sufix.
We could have by example OOOOOOO to be replaced by the Org Name same as YYYY is replaced by the Fiscal Year.

Can you please let us know which dynamic values you might need we could get from the booking control document?
(0033227)
mgerke   
2010-12-16 11:15   
Comment to: First column named "year" on the sub-tab “Year Sequence”:
* initial entries should not be generated for years in the past
* if a new fiscal year is created, a new entries should be generated

I do not see the need for more dynamic values in Document Sequence, but I see the need for a "Restart counter every year" feature in the Advanced Document Sequence, if such a sequence is based on a fiscal year.
(0033257)
psanjuan   
2010-12-17 09:51   
(edited on: 2010-12-31 09:54)
13863 ready to go according to Michael email, see requirements described at Note dated on Dec 13, 2010

(0033361)
hgbot   
2010-12-22 14:32   
Repository: erp/mods/org.openbravo.obbo
Changeset: 9c95f7b82d36f7b8e4f9aefc42b1943be1e04307
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Wed Dec 22 14:30:01 2010 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.obbo/rev/9c95f7b82d36f7b8e4f9aefc42b1943be1e04307 [^]

Fixes issue 13863: New sequence number for booking control

---
M referencedata/standard/Dataset_for_Booking_control_feature.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_DATASET.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M src-db/database/sourcedata/AD_MODULE.xml
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
M src-db/database/sourcedata/AD_TAB.xml
M src-db/database/sourcedata/AD_TABLE.xml
M src/org/openbravo/obbo/ad_actionButton/BrowseDocument.html
M src/org/openbravo/obbo/process/BookingControlProcess.java
A src-db/database/model/modifiedTables/AD_SEQUENCE.xml
A src-db/database/model/tables/OBBO_SEQUENCE_YEAR.xml
A src-db/database/model/triggers/OBBO_AD_SEQUENCE.xml
A src-db/database/model/triggers/OBBO_SEQUENCE_YEAR_TRG.xml
A src-db/database/sourcedata/AD_FIELDGROUP.xml
A src-db/database/sourcedata/AD_MESSAGE.xml
---
(0033362)
dalsasua   
2010-12-22 14:35   
Fixed in Version 1.0.10

Please notice that two of the features can NOT be included in the module, so must be implemented through the industry template that will include this module. These features are:

1.- Hide the Next Assigned Number from Sequence tab, whenever the Reset Per Year flag is active
2.- Set the Next Assigned Number from Sequence Year sub-tab as non-editable.
(0033404)
hgbot   
2010-12-27 12:24   
Repository: erp/mods/org.openbravo.obbo
Changeset: fa04191ed9c0b0aaf4d3afa6f57e9cb85c28cb36
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Mon Dec 27 12:19:28 2010 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.obbo/rev/fa04191ed9c0b0aaf4d3afa6f57e9cb85c28cb36 [^]

Fixes issue 13863. Implemented feedback of code review

---
M src-db/database/model/modifiedTables/AD_SEQUENCE.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODULE.xml
M src/org/openbravo/obbo/process/BookingControlProcess.java
---
(0033425)
psanjuan   
2010-12-29 12:59   
QA OK - feature working