[jira] Created: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

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

[jira] Created: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
Wrong week numbers in the fixed asset calendar
----------------------------------------------

                 Key: OFBIZ-392
                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
             Project: OFBiz (The Open for Business Project)
          Issue Type: Improvement
          Components: accounting
            Reporter: Bilgin Ibryam
            Priority: Minor
         Attachments: UtilDateTime.patch

Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).

Regards,
Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-392?page=all ]

Bilgin Ibryam updated OFBIZ-392:
--------------------------------

    Attachment: UtilDateTime.patch

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-392?page=comments#action_12443789 ]
           
Jacques Le Roux commented on OFBIZ-392:
---------------------------------------

Hi Bilgin,

Please have you an example that shows this error ? It's interesting to choose the week start day, but I'd appreciate that you change also calls to weekNumber (as in applications/accounting/webapp/accounting/fixedasset/month.bsh the only one I found). Never mind now I will change it if I commit your patch.

Thanks

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-392?page=comments#action_12443828 ]
           
Bilgin Ibryam commented on OFBIZ-392:
-------------------------------------

Hi,
For example today is 20 October and it is 42 week of the year, but in fixed asset calendar it is shown as week 41.
And also the first week of the next year 1-7 January is shown as 52 week of the 2006.
The same problem has the 2008 year.
Also 2009 has 53 weeks, but fixed asset calendar shows only 52. I think that all the week numbers are wrong.
And i will fix also month.bsh of course.

Regards,
Bilgin

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-392?page=all ]

Jacopo Cappellato updated OFBIZ-392:
------------------------------------

    Attachment: UtilDateTime-reviewed.patch

I'd propose this slightly different patch, where I've used Calendar.SUNDAY instead of 1 Calendar.MONDAY instead of 2: I think that in this was it's a bit more easier to read.

However, I don't quite understand the following code:

if(startOfWeek == Calendar.MONDAY) {
   calendar.setMinimalDaysInFirstWeek(4);
} else if(startOfWeek == Calendar.SUNDAY) {
   calendar.setMinimalDaysInFirstWeek(3);
}

but this is due to my ignorance about the method calendar.setMinimalDaysInFirstWeek(...)

Apart from this, I really think that this is a good patch because it reimplements an old method following a more standard approach (i.e. using the Calendar class instead of custom code).


> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime-reviewed.patch, UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-392?page=comments#action_12443898 ]
           
Jacques Le Roux commented on OFBIZ-392:
---------------------------------------

I'm surely missing something : 20 october 2006 is in week 42 in screenshot above (grrrr I tried 3 times to send this screenshoot, loosing my comment at each attempt)

Anyway I will commit Jacopo's patch ASA I'm sure to understand all that.

BTW forget about month.bsh, it's a cover that's called, my mistake, sorry.

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime-reviewed.patch, UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-392?page=comments#action_12443903 ]
           
Jacques Le Roux commented on OFBIZ-392:
---------------------------------------

OK, I understand now. Currently It's OK if you are in OFBiz english setting but not if you are some other settings (french for instance).
About setMinimalDaysInFirstWeek :
setMinimalDaysInFirstWeek

public void setMinimalDaysInFirstWeek(int value)

    Sets what the minimal days required in the first week of the year are; For example, if the first week is defined as one that contains the first day of the first month of a year, call the method with value 1. If it must be a full week, use value 7.

    Parameters:
        value - the given minimal days required in the first week of the year.

I applied your patch and it seems that it is not fixing this problem. I tried debugging and it's not called in this case. Have you tried your fix ?

Anyway I agree that we should better using calendar here than in house code. Just have enough time yet to go further...

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>            Priority: Minor
>         Attachments: UtilDateTime-reviewed.patch, UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-392) Wrong week numbers in the fixed asset calendar

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-392?page=all ]

Jacques Le Roux closed OFBIZ-392.
---------------------------------

    Fix Version/s: SVN trunk
       Resolution: Fixed
         Assignee: Jacques Le Roux

I commited in revision 466364 the slightly modified Jacopo's patch.

But actually that was not solving the problem. To fix it I added some locale settings in month.ftl .
I'm not quite sure why these should be "en". But I'm sure it works with it and don't without.
I assume it's because we calculate date values before in this locale (set from command line).
It seems that it's the same type of problem that the one who arises and forced us to put -Duser.language=en in command line some times ago.

> Wrong week numbers in the fixed asset calendar
> ----------------------------------------------
>
>                 Key: OFBIZ-392
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-392
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Bilgin Ibryam
>         Assigned To: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: UtilDateTime-reviewed.patch, UtilDateTime.patch
>
>
> Week numbers in the fixed asset calendar are not correct. So i fixed the problematic function and also added a possibility for choosing the week start day (Sunday or Monday).
> Regards,
> Bilgin

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira