Menu

#1466 MPPMPRP.getDays always returns zero.

closed-fixed
nobody
None
9
2009-08-25
2008-08-15
Tony Snook
No

The method MPPMPRP.getDays has a return line that reads:
return (RequiredTime.multiply(WeeklyFactor)).divide(AvailableDayTime,BigDecimal.ROUND_UP);

The BigDecimal RequiredTime is only ever set to Env.ZERO and hence the method always returns zero.

Also the AvailableDays is only ever equal to 1 (or 0 if no days available)

All the lines with: AvailableDays =+ 1;
.........should be: AvailableDays += 1;

This way the AvailableDays will be accumalated.

Regards,

Tony

Discussion

  • Teo Sarca

    Teo Sarca - 2008-08-19

    Logged In: YES
    user_id=1311402
    Originator: NO

    Good catch Tony ! I've committed the changes as you suggested. Also I've fixed the "always return zero" issue, by calculating the workflow duration and converting it to hours. Can you help me with an review ?

    Revision: 6157
    http://adempiere.svn.sourceforge.net/adempiere/?rev=6157&view=rev
    Author: teo_sarca
    Date: 2008-08-19 15:59:30 +0000 (Tue, 19 Aug 2008)

    Log Message:
    -----------
    BF [ 2051941 ] MPPMPRP.getHoursAvailable hardcoded 6750000 ?
    BF [ 2053279 ] MPPMPRP.getDays always returns zero.
    * added some more javadoc comments
    * fixed some warnings

    Modified Paths:
    --------------
    branches/stable/base/src/org/eevolution/model/MPPMRP.java

     
  • Teo Sarca

    Teo Sarca - 2008-08-19
    • priority: 5 --> 9
    • status: open --> pending
     
  • Teo Sarca

    Teo Sarca - 2008-08-22
    • status: pending --> open
     
  • Teo Sarca

    Teo Sarca - 2008-08-22

    Logged In: YES
    user_id=1311402
    Originator: NO

    Revision: 6192
    http://adempiere.svn.sourceforge.net/adempiere/?rev=6192&view=rev
    Author: teo_sarca
    Date: 2008-08-22 14:27:04 +0000 (Fri, 22 Aug 2008)

    Log Message:
    -----------
    BF [ 2053279 ] MPPMPRP.getDays always returns zero
    * minor wrong use of "==" bug fix

    Modified Paths:
    --------------
    branches/stable/base/src/org/eevolution/model/MPPMRP.java

     
  • Teo Sarca

    Teo Sarca - 2008-08-22

    Logged In: YES
    user_id=1311402
    Originator: NO

    There remains only 1 issue to fix, discussed here: https://sourceforge.net/forum/message.php?msg_id=5179460

    In meantime can you help me with an review ?

    Best regards,
    Teo Sarca

     
  • Tony Snook

    Tony Snook - 2009-08-10
    • status: open --> pending-fixed
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.