Openbravo Issue Tracking System - Modules
View Issue Details
0013440ModulesAccruals and Deferralspublic2010-05-26 11:072010-09-10 18:54
psanjuan 
vmromanos 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
1.0.10 
0013440: Accruals and Deferrals enhancements - amount divided by period - New Calculation Type = Monthly
Calculation of acc&def-plan should be done in two ways which can be chosen by the user (only once can be setup in the system as the one to use by default, see proposed solution below).
    - Daily = daily basis calculation which is the way it works now. For an explanation on daily calculation see issue 13984
    - Monthly = monthly bases => which is the new one explained in this Feature Request.

 
Purchase Management || Transactions || Purchase Invoice || Header and enter a new invoice by entering below information:

Transaction document = AP invoice
Invoice date = Accounting Date = Tax Date = 10-01-2010
Acc & Def Type = Prepaid Expenses
Date From = 10-01-2010
Date To = 09-09-2011
Go to Lines and enter a line with a Line Net Amount = 21.000
Go back to the header and complete/Post the invoice.
Realize there is no way for a monthly calculation.
The way to implement this new feature request is:
There should be a new system key at client level (application path: General Setup || Client || Client || Client >> Information )
sistem key name: "Acc&Def calculation"
that system key should have 2 options:
- daily - if the user select this one system should behavied the way it behavies now, see issue 13984 for more information.
- monthly - if the user select this one system should behavied as explained below:

(1) It is only possible to enter full months in Periods fields, therefore:
The day of the Date to must be the day of the Data from -1

(2) If the day in the "Date From" is not the first day of a month, the amount for the first and the last month is distributed proportionally for the count of days in the first month

(3) all of the above according to below formulas

- Avg. monthly amount = Line Net Amount / Nº of months
- First month amount = (30-Day in "date from"+1) x Avg. monthly amount/30
- Last month amount = Line net amount - accumulated amount

It is important to highlight that for the Monthly Calculation: 30 days to be consider for each month


Example 1
Accounting date: 01.05.09
Date From: 01.5.09
Date To: 31.7.10
Amount 15.000,-
 => Number of months = 15 month => Average amount per month = 1000,-
System will generate 15 lines in the Plan.

05/09 1000,-
06/09 1000,-
.
.
.
06/10 1000,-
07/10 1000,-


Example2 :
Accounting Date=10-01-2010
From Date = 10-01-2010
To Date = 09-09-2011
Nº of months = 20
Amount = 20.000
Average amount = 20.000/20 = 1.000
system will create 21 lines
line 1 = First month amount (from 10-01-2010 to 30-01-2010)) = (30-10+1)*1.000/30 = 700
Line 2 to 20 = Middle months (from 01-02-2010 to 01-08-2011) = 1000 x 19 months = 19.000
Line 21 = Last month amount (from 01-09-2011 to 09-09-2011) = 20.000 - 19.700 = 300

Total = 700 + 19000 + 300 = 20000

No tags attached.
blocks defect 0013656 closed balamurugan Acc&Def Plan-amount divided by periods (monthly). Constrains to the "To Date" 
png 13440.png (67,879) 2010-08-31 12:25
https://issues.openbravo.com/file_download.php?file_id=3000&type=bug
png

png 13440_1.png (56,565) 2010-08-31 12:25
https://issues.openbravo.com/file_download.php?file_id=3001&type=bug
png

png 13440_2.png (56,626) 2010-08-31 12:25
https://issues.openbravo.com/file_download.php?file_id=3002&type=bug
png
Issue History
2010-05-26 11:07psanjuanNew Issue
2010-05-26 11:07psanjuanAssigned To => sathiyan
2010-05-26 11:45psanjuanDescription Updatedbug_revision_view_page.php?rev_id=446#r446
2010-05-26 16:47psanjuanPrioritynormal => urgent
2010-06-09 12:01psanjuanProposed Solution updated
2010-06-10 07:54balamuruganAssigned Tosathiyan => balamurugan
2010-06-10 15:19psanjuanProposed Solution updated
2010-06-11 13:04hgbotCheckin
2010-06-11 13:04hgbotNote Added: 0028305
2010-06-11 13:04hgbotStatusnew => resolved
2010-06-11 13:04hgbotResolutionopen => fixed
2010-06-11 13:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.accrualsanddeferrals/rev/8a22f25e073110fc61b77d9afc889271a5fb6eaf [^]
2010-06-14 16:25psanjuanProposed Solution updated
2010-06-14 16:27psanjuanDescription Updatedbug_revision_view_page.php?rev_id=498#r498
2010-06-15 09:20psanjuanRelationship addedblocks 0013656
2010-06-18 14:02arunkumarNote Added: 0028584
2010-06-18 14:02arunkumarStatusresolved => closed
2010-07-16 13:30psanjuanNote Added: 0029363
2010-08-27 13:57psanjuanProposed Solution updated
2010-08-31 11:17psanjuanSummaryAccruals and Deferrals enhancements - amount divided by period => Accruals and Deferrals enhancements - amount divided by period - New Calculation Type = Montly
2010-08-31 11:17psanjuanDescription Updatedbug_revision_view_page.php?rev_id=774#r774
2010-08-31 12:08psanjuanDescription Updatedbug_revision_view_page.php?rev_id=775#r775
2010-08-31 12:08psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=777#r777
2010-08-31 12:08psanjuanProposed Solution updated
2010-08-31 12:19psanjuanSummaryAccruals and Deferrals enhancements - amount divided by period - New Calculation Type = Montly => Accruals and Deferrals enhancements - amount divided by period - New Calculation Type = Monthly
2010-08-31 12:19psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=782#r782
2010-08-31 12:20psanjuanProposed Solution updated
2010-08-31 12:25psanjuanFile Added: 13440.png
2010-08-31 12:25psanjuanFile Added: 13440_1.png
2010-08-31 12:25psanjuanFile Added: 13440_2.png
2010-08-31 12:27psanjuanNote Added: 0030533
2010-08-31 13:18psanjuanAssigned Tobalamurugan => dalsasua
2010-09-06 10:04psanjuanStatusclosed => new
2010-09-09 12:47psanjuanProposed Solution updated
2010-09-09 12:57psanjuanProposed Solution updated
2010-09-09 16:23psanjuanProposed Solution updated
2010-09-09 17:22vmromanosStatusnew => scheduled
2010-09-09 17:22vmromanosAssigned Todalsasua => vmromanos
2010-09-09 17:22vmromanosfix_in_branch => pi
2010-09-09 18:47hgbotCheckin
2010-09-09 18:47hgbotNote Added: 0030909
2010-09-09 18:47hgbotStatusscheduled => resolved
2010-09-09 18:47hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.accrualsanddeferrals/rev/8a22f25e073110fc61b77d9afc889271a5fb6eaf [^] => http://code.openbravo.com/erp/pmods/org.openbravo.accrualsanddeferrals/rev/9c98ac73a4e265c3d1ecc3f939e815bf29cfeed5 [^]
2010-09-10 16:43psanjuanfix_in_branchpi =>
2010-09-10 16:43psanjuanProposed Solution updated
2010-09-10 18:41psanjuanStatusresolved => closed
2010-09-10 18:54psanjuanNote Added: 0030950
2010-09-10 18:54psanjuanFixed in Version => 1.0.10

Notes
(0028305)
hgbot   
2010-06-11 13:04   
Repository: erp/pmods/org.openbravo.accrualsanddeferrals
Changeset: 8a22f25e073110fc61b77d9afc889271a5fb6eaf
Author: Balamurugan Ramadoss <balamurugan.ramadoss <at> openbravo.com>
Date: Fri Jun 11 16:33:58 2010 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.accrualsanddeferrals/rev/8a22f25e073110fc61b77d9afc889271a5fb6eaf [^]

Fixes Issue 13440: Accruals and Deferrals enhancements - amount divided by period

---
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_REFERENCE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
A src-db/database/model/modifiedTables/AD_CLIENTINFO.xml
---
(0028584)
arunkumar   
2010-06-18 14:02   
Tested working fine
(0029363)
psanjuan   
2010-07-16 13:30   
Hi Patricia, Bala,

 

to 4.: We can presume that every month has 30 days. This makes things easier and so it works in every financial accounting software I know.

         So case 1 is correct and case 2 would be calculated like case 1.

 

To 5.: I would count the day of the date from field to the first month. Let’s do so!

 

Regards

Anja

Von: Patricia San Juan [mailto:patricia.sanjuan@openbravo.com]
Gesendet: Mittwoch, 16. Juni 2010 11:21
An: Bochmann, Anja Katharina; Gerke, Michael
Betreff: Re: Fwd: Re: FR 13440 - new requirements

 

Hi Anja,

can you please check just point 4 and 5 below and let me know if we get it right?
This is what Bala was referring to, he is still missing a confirmation from us.

#4: For "Monthly" basis calculation, Please confirm the following formula to calculate the first month amount.
(Patricia = I think it is right, but I'll check with HIS)


    First Month Amount = No.of Days in "DateFrom" X Avg. Monthly Amount / Total No. of Days in the month of "DateFrom"

For Example,

Case 1:

From 10.06.2010 To 09.08.2010 Net Amount = 1800 => 600 in June, 900 in July, 300 in August

    I. Avg. Monthly Amount = Net Amount / ( No. of Months Between "DateFrom" and "DateTo" - 1) => 1800/(3-1) = 900
    II. First Month Amount = No.of Days in "DateFrom" X Avg. Monthly Amount / Total No. of Days in the month of "DateFrom" => 20 X 900/30 = 600.00
    III. Last Month Amount = 900 - 600 = 300

Case 2:

From 10.07.2010 To 09.09.2010 Net Amount = 1800

    I. Avg. Monthly Amount = Net Amount / ( No. of Months Between "DateFrom" and "DateTo" - 1) => 1800/(3-1) = 900
    II. First Month Amount = No.of Days in "DateFrom" X Avg. Monthly Amount / Total No. of Days in the month of "DateFrom" => 21 X 900/31 = 609.68
    III. Last Month Amount = 900 - 609.68 = 290.32

#5: For "Monthly" basis calculation, Should we count the day itself in "Date From" field for calculating the first month amount? Please confirm.
For Example,

(Patricia = I think it is right, but I'll check with HIS)


If 12.03.2010, then No. of days in the first month would be either 20 or 19? Why this question arises is, in the proposed solution, it was given like,

From 10.06.2010 To 09.08.2010 Net Amount = 1800 => 600 in June, 900 in July, 300 in August

Here it is assumed that the day of "Date From" is not taken into account to calculate the first month amount.



thanks and regards,
Patricia.

On 15/06/10 13:01, Patricia San Juan wrote:

Hi Anja,
Can you please review below Bala's email and let me know if we are right or not?
Bala sent few questions and I've answered them inline..please see below.

Thanks and regards,
Patricia.

(0030533)
psanjuan   
2010-08-31 12:27   
This feature request has been modified as it is not working properly, see screens attached.
This Feature request has been now better explained.
In case of any doubts please add the corresponding notes.
(0030909)
hgbot   
2010-09-09 18:47   
Repository: erp/pmods/org.openbravo.accrualsanddeferrals
Changeset: 9c98ac73a4e265c3d1ecc3f939e815bf29cfeed5
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Sep 09 18:49:15 2010 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.accrualsanddeferrals/rev/9c98ac73a4e265c3d1ecc3f939e815bf29cfeed5 [^]

Fixed bug 13440 in module version 1.0.10
Adde new Calculation Type = Monthly

---
M src-db/database/model/functions/ACCDEF_GENERATE_PLAN.xml
M src-db/database/sourcedata/AD_MODULE.xml
---
(0030950)
psanjuan   
2010-09-10 18:54   
fixed in version 1.0.10