r369 - in trunk/chorem-entities/src/main: java/org/chorem java/org/chorem/project xmi
Author: meynier Date: 2013-07-18 16:49:49 +0200 (Thu, 18 Jul 2013) New Revision: 369 Url: http://chorem.org/projects/chorem/repository/revisions/369 Log: Updated ChoremClient to match the new model Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java trunk/chorem-entities/src/main/xmi/chorem-model.properties Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-07-18 13:28:33 UTC (rev 368) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-07-18 14:49:49 UTC (rev 369) @@ -397,9 +397,17 @@ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Wikitty w = this.restore(e.getWikittyId()); - if(w.hasExtension("Contract") && w.getFieldAsDouble("Contract", "dailyReturn") != 0) { + Wikitty companyW = null; + if(e.getCompany(false) != null) + companyW = restore(e.getCompany(false).getWikittyId()); + + if(w.hasExtension("EmployeeHR") && w.getFieldAsDouble("EmployeeHR", "dailyReturn") != 0) { return w.getFieldAsDouble("Contract", "dailyReturn"); } + else if(companyW != null && companyW.hasExtension("CompanyHR") + && companyW.getFieldAsDouble("CompanyHR", "dailyReturn") != 0) { + return companyW.getFieldAsDouble("CompanyHR", "dailyReturn"); + } else { return this.getConfiguration().getDailyReturn(); } @@ -413,10 +421,20 @@ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //Code commented before confirmation or modification of the contract implementation //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + Wikitty w = this.restore(e.getWikittyId()); + Wikitty companyW = null; + if(e.getCompany(false) != null) + companyW = restore(e.getCompany(false).getWikittyId()); - Wikitty w = this.restore(e.getWikittyId()); - if(w.hasExtension("Contract") && w.getFieldAsDouble("Contract", "dailyHoursWorked") != 0) { - return w.getFieldAsDouble("Contract", "dailyHoursWorked"); + if(companyW.hasExtension("CompanyHR") && companyW.getFieldAsDouble("CompanyHR", "dailyHoursWorked") != 0) { + if(w.hasExtension("EmployeeHR") && w.getFieldAsDouble("EmployeeHR", "partialTime") != 0) { + return companyW.getFieldAsDouble("CompanyHR", "dailyHoursWorked") * + (w.getFieldAsDouble("EmployeeHR", "partialTime")/100); + } + else { + return companyW.getFieldAsDouble("CompanyHR", "dailyHoursWorked"); + } + } else { return this.getConfiguration().getDailyHoursWorked(); Modified: trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java 2013-07-18 13:28:33 UTC (rev 368) +++ trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java 2013-07-18 14:49:49 UTC (rev 369) @@ -36,8 +36,8 @@ private Double expectedProfit = null; private Double lossOrProfit = null; private Double resultPerDay = null; - private Double avgReturn = null; - private Double realReturn = null; + private Double avgReturn = null; + private Double realReturn = null; /** Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties =================================================================== --- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2013-07-18 13:28:33 UTC (rev 368) +++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2013-07-18 14:49:49 UTC (rev 369) @@ -69,8 +69,8 @@ # # CompanyHR # -org.chorem.entities.Company.class.tagvalue.version=1.0 -org.chorem.entities.Company.class.tagvalue.toString=%Company.name|noname$s +org.chorem.entities.CompanyHR.class.tagvalue.version=1.0 +org.chorem.entities.CompanyHR.class.tagvalue.toString=%Company.name|noname$s # # Configuration # @@ -114,6 +114,7 @@ org.chorem.entities.EmployeeHR.attribute.dailyReturn.tagvalue.help=Seuil de rentabilite productif org.chorem.entities.EmployeeHR.attribute.productivityRate.tagvalue.help=Taux de productivité org.chorem.entities.EmployeeHR.attribute.partialTime.tagvalue.help=Taux de travail (temps complet:100, mi-temps:50) +org.chorem.entities.EmployeeHR.attribute.partialTime.tagvalue.default=100 # # Evaluation (a mettre ici) #
participants (1)
-
meynier@users.chorem.org