Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028787Openbravo ERP09. Financial managementpublic2015-01-27 18:092015-05-12 17:40
vmromanos 
vmromanos 
immediateminoralways
closedfixed 
20Debian 5.0
 
3.0PR15Q3 
Sandrahuguet
Core
Production - Confirmed Stable
2012-05-21
3.0MP12
https://code.openbravo.com/erp/devel/pi/rev/c00d43ad77bdee88849caf11468e4c08c9e964e3 [^]
No
0028787: Impossible to create several calendars for the same organization
Right now it's impossible to create several calendars for the same organization along as the calendars have similar periods.
This is a restriction that from a functional point of view has no sense and it creates problems in modules (like Intrastat) where it may be interesting to define several calendars per organization.
Go to Fiscal Calendar window
Create a new record for org F&B España, S.A (note that sampledata has another calendar already created for this org)
Go to year and create 2014 year.
Run create periods process. An error is shown:
Error:
Saving failed. The dates period defined is overlapped with another period of an existing year.
Allow to create several calendars per organization
Ensure this restriction of overlapping periods is applied grouping by calendar
No tags attached.
related to design defect 0028040 closed vmromanos Modules It is not possible to obtain proper AEAT reports with Fiscal Calendar defined from July to June 
related to defect 0029823 closed vmromanos Openbravo ERP Open/Close Period Control window should only shown the calendars associated to an Organization 
depends on backport 00298083.0PR15Q2.1 closed vmromanos Openbravo ERP Impossible to create several calendars for the same organization 
depends on backport 00298093.0PR15Q1.4 closed vmromanos Openbravo ERP Impossible to create several calendars for the same organization 
caused by defect 00203363.0MP12 closed jecharri Openbravo ERP Should not be possible to create several periods for same date range in different years 
caused by defect 00222933.0MP20 closed jecharri Openbravo ERP Wrong checking in c_period_trg3 trigger 
Issue History
2015-01-27 18:09vmromanosNew Issue
2015-01-27 18:09vmromanosAssigned To => dmiguelez
2015-01-27 18:09vmromanosModules => Core
2015-01-27 18:09vmromanosTriggers an Emergency Pack => No
2015-01-27 18:10vmromanosRelationship addedcaused by 0020336
2015-02-26 10:28vmromanosRelationship addedrelated to 0028040
2015-02-26 17:21vmromanosTypedefect => design defect
2015-02-26 17:22vmromanosRelationship deletedrelated to 0028040
2015-02-26 17:23vmromanosRelationship addedcaused by 0028040
2015-02-26 17:24vmromanosRelationship deletedcaused by 0028040
2015-02-26 17:24vmromanosRelationship addedrelated to 0028040
2015-05-05 16:44psanjuanPrioritynormal => urgent
2015-05-07 10:18vmromanosRelationship addedcaused by 0022293
2015-05-07 10:26vmromanosRegression level => Production - Confirmed Stable
2015-05-07 10:26vmromanosRegression date => 2012-05-21
2015-05-07 10:26vmromanosRegression introduced in release => 3.0MP12
2015-05-07 10:26vmromanosRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/c00d43ad77bdee88849caf11468e4c08c9e964e3 [^]
2015-05-07 10:40vmromanosNote Added: 0077075
2015-05-07 10:40vmromanosPriorityurgent => immediate
2015-05-07 10:50vmromanosStatusnew => scheduled
2015-05-07 10:50vmromanosAssigned Todmiguelez => vmromanos
2015-05-07 12:12vmromanosTypedesign defect => defect
2015-05-07 12:21vmromanosNote Added: 0077088
2015-05-08 12:34psanjuanRelationship addedcauses 0029823
2015-05-08 13:05psanjuanNote Added: 0077234
2015-05-08 13:10psanjuanNote Edited: 0077234bug_revision_view_page.php?bugnote_id=0077234#r8486
2015-05-08 13:12psanjuanNote Edited: 0077234bug_revision_view_page.php?bugnote_id=0077234#r8487
2015-05-08 14:23psanjuanRelationship deletedcauses 0029823
2015-05-08 14:24psanjuanRelationship addedrelated to 0029823
2015-05-08 14:25psanjuanNote Edited: 0077234bug_revision_view_page.php?bugnote_id=0077234#r8490
2015-05-08 15:41psanjuanNote Edited: 0077234bug_revision_view_page.php?bugnote_id=0077234#r8495
2015-05-11 16:04hgbotCheckin
2015-05-11 16:04hgbotNote Added: 0077286
2015-05-11 16:04hgbotStatusscheduled => resolved
2015-05-11 16:04hgbotResolutionopen => fixed
2015-05-11 16:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6c02996661357804174204ba3dca9a390ed0c9ee [^]
2015-05-11 17:04SandrahuguetReview Assigned To => Sandrahuguet
2015-05-11 17:04SandrahuguetNote Added: 0077295
2015-05-11 17:04SandrahuguetStatusresolved => closed
2015-05-11 17:04SandrahuguetFixed in Version => 3.0PR15Q3
2015-05-12 17:40hudsonbotCheckin
2015-05-12 17:40hudsonbotNote Added: 0077345

Notes
(0077075)
vmromanos   
2015-05-07 10:40   
Note that the code that originally created the regression has been moved from C_PERIOD_TRG2 trigger (0020336) to C_YEARPERIODS function (0022293) and PeriodEventHandler.java (0022293)
(0077088)
vmromanos   
2015-05-07 12:21   
Test plan I:
Go to Fiscal Calendar window
Create a new record called TEST for org F&B España, S.A (note that sampledata has another calendar already created for this org)
Go to year and create 2014 year.
Go to periods tab and create a new record from 01/01/2014 to 31/01/2014.
Save it. Verify no error is raised

Test plan II:
Update ending date of the previously created period to 30/01/2014.
Save it. Verify no error is raised

Test plan III:
Update ending date of the previously created period to 31/01/2014.
Save it. Verify no error is raised

Test plan IV:
Create a new period for this year from 01/01/2014 to 31/01/2014.
Save it. Verify an error is displayed informing about the overlap
Change start date to 02/01/2014
Save it. Verify an error is displayed informing about the overlap

Test plan V:
Delete the periods previously created
Run the Create Periods process
Verify periods are properly created and no errors are raised.

Test plan VI:
Change the Fiscal Year name from 2014 to 2014_
Create a new Fiscal Year for 2014
Create a new period for this year from 01/01/2014 to 31/01/2014.
Save it. Verify an error is displayed informing about the overlap
Discard the changes.
Run Create Periods process.
Verify an error is displayed informing about the overlap
(0077234)
psanjuan   
2015-05-08 13:05   
(edited on: 2015-05-08 15:41)
Verified.

All scenarios above tested besides Open/Close Period Control window. New issue found. See issue 29823

Additional test: creation of another Calendar with a fiscal year 2014-2015, periods manually created for oct-14, nov-14, dec-14, jan-15, etc.


Issue related 20336 also verified.

1. Go to Fiscal Calendar "Calendario España". Go to Year 2012 and create new Period with any name and for date range: 01-03-2011 to 31-03-2011
2. Realize that you are able to create period although correct March2011 period already exist for year 2011

This scenario can not be reproduced anymore, that period (March 2011) can be created only for another Calendar than "Calendario España".

Intrastat Calendar also tested.

(0077286)
hgbot   
2015-05-11 16:04   
Repository: erp/devel/pi
Changeset: 6c02996661357804174204ba3dca9a390ed0c9ee
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu May 07 12:11:39 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6c02996661357804174204ba3dca9a390ed0c9ee [^]

Fixed bug 28787: Impossible to create several calendars for the same organization

Two pieces of code were affected by this bug:
PeriodEventHandler.java: EntityPersistenceEventObserver in charge of checking overlap in manual inserts/updates (or any java process) in c_period table
C_YEARPERIODS: db function associated to the create periods process inside the Fiscal Calendar | Year tab. It also verifies the periods don't overlap other periods.

The fix consists in checking that there is no date overlap per calendar. Before this fix the calendar wasn't taken into account, so it was not possible to define several calendars for the same organization with the same periods.

---
M src-db/database/model/functions/C_YEARPERIODS.xml
M src/org/openbravo/event/PeriodEventHandler.java
---
(0077295)
Sandrahuguet   
2015-05-11 17:04   
Code review + testing OK
(0077345)
hudsonbot   
2015-05-12 17:40   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/6d9fee60cdbd [^]
Maturity status: Test