Modified calculations for the total column when automatic budgeting enabled
The budget cell will represent the total available budget, and the calculated read-only total, will be the result of substracting the consumed budget due to the hours and cost categories of the assinged task criteria. FEA: ItEr77S17AutomaticBudgeting
This commit is contained in:
parent
dd4d117fa1
commit
50a6f91b1a
10 changed files with 19 additions and 15 deletions
|
|
@ -1705,6 +1705,10 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
return getBudget().add(getResourcesBudget());
|
||||
}
|
||||
|
||||
public BigDecimal getSubstractedBudget() {
|
||||
return getBudget().subtract(getResourcesBudget());
|
||||
}
|
||||
|
||||
public BigDecimal getResourcesBudget() {
|
||||
return Registry.getTransactionService().runOnReadOnlyTransaction(
|
||||
new IOnTransaction<BigDecimal>() {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class ProjectStatusReportDTO {
|
|||
imputedHours = sumChargedEffort.getTotalChargedEffort();
|
||||
}
|
||||
|
||||
setBudget(orderElement.getTotalBudget());
|
||||
setBudget(orderElement.getSubstractedBudget());
|
||||
|
||||
setExpensesBudget(orderElement.getBudget());
|
||||
setResourcesBudget(orderElement.getResourcesBudget());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="resourcesList" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="projectStatus" uuid="17a95f07-ce2e-43c0-8da8-bfe1b9d826c2">
|
||||
<property name="ireport.zoom" value="2.0"/>
|
||||
<property name="ireport.x" value="624"/>
|
||||
<property name="ireport.x" value="560"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<style name="dejavu-sans" isDefault="true" fontName="DejaVu Sans" fontSize="8"/>
|
||||
<style name="row-grey" style="dejavu-sans">
|
||||
|
|
@ -307,7 +307,7 @@
|
|||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||
<font isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{total}]]></textFieldExpression>
|
||||
<textFieldExpression><![CDATA[$R{expenses}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement uuid="faae6657-606f-49ed-b11f-1085bc10a38a" x="647" y="17" width="50" height="15"/>
|
||||
|
|
@ -353,7 +353,7 @@
|
|||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||
<font isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{expenses}]]></textFieldExpression>
|
||||
<textFieldExpression><![CDATA[$R{total}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement uuid="fa84e2c6-ce40-4e3b-aac5-15258e0dc0bb" x="502" y="17" width="49" height="15"/>
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ public class AssignedHoursToOrderElementController extends
|
|||
return assignedHoursToOrderElementModel.getResourcesBudget();
|
||||
}
|
||||
|
||||
public BigDecimal getTotalBudget() {
|
||||
return assignedHoursToOrderElementModel.getTotalBudget();
|
||||
public BigDecimal getCalculatedBudget() {
|
||||
return assignedHoursToOrderElementModel.getCalculatedBudget();
|
||||
}
|
||||
|
||||
public BigDecimal getMoneyCost() {
|
||||
|
|
|
|||
|
|
@ -246,11 +246,11 @@ public class AssignedHoursToOrderElementModel implements IAssignedHoursToOrderEl
|
|||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public BigDecimal getTotalBudget() {
|
||||
public BigDecimal getCalculatedBudget() {
|
||||
if (orderElement == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return getBudget().add(getResourcesBudget());
|
||||
return getBudget().subtract(getResourcesBudget());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public interface IAssignedHoursToOrderElementModel{
|
|||
|
||||
public BigDecimal getCostOfHours();
|
||||
|
||||
public BigDecimal getTotalBudget();
|
||||
public BigDecimal getCalculatedBudget();
|
||||
|
||||
public BigDecimal getResourcesBudget();
|
||||
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ public class OrderElementTreeController extends TreeController<OrderElement> {
|
|||
}
|
||||
|
||||
public void addResourcesBudgetCell(final OrderElement currentElement) {
|
||||
BigDecimal value = currentElement.getTotalBudget();
|
||||
BigDecimal value = currentElement.getSubstractedBudget();
|
||||
Textbox autoBudgetCell = new Textbox(Util.addCurrencySymbol(value));
|
||||
autoBudgetCell.setDisabled(true);
|
||||
addCell(autoBudgetCell);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class OrdersTreeComponent extends TreeComponent {
|
|||
}
|
||||
|
||||
});
|
||||
columns.add(new OrdersTreeColumn(_("Expenses"), "budget",
|
||||
columns.add(new OrdersTreeColumn(_("Budget"), "budget",
|
||||
_("Total task budget")) {
|
||||
|
||||
@Override
|
||||
|
|
@ -100,8 +100,8 @@ public class OrdersTreeComponent extends TreeComponent {
|
|||
});
|
||||
|
||||
if (resourcesBudgetEnabled) {
|
||||
columns.add(new OrdersTreeColumn(_("Budget"), "budget",
|
||||
_("resources")) {
|
||||
columns.add(new OrdersTreeColumn(_("Expenses"), "budget",
|
||||
_("Budget minus resources costs")) {
|
||||
|
||||
@Override
|
||||
protected void doCell(OrderElementTreeitemRenderer treeRenderer,
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ public class TaskElementAdapter {
|
|||
@Override
|
||||
public BigDecimal getMoneyCostBarPercentage() {
|
||||
return MoneyCostCalculator.getMoneyCostProportion(
|
||||
getMoneyCost(), getTotalCalculatedBudget());
|
||||
getMoneyCost(), getBudget());
|
||||
}
|
||||
|
||||
private BigDecimal getBudget() {
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@
|
|||
<label
|
||||
value="${i18n:_('Total calculated budget')}:" />
|
||||
<hbox>
|
||||
<label value="@{assignedHoursToOrderElementController.totalBudget}" />
|
||||
<label value="@{assignedHoursToOrderElementController.calculatedBudget}" />
|
||||
<label value="@{assignedHoursToOrderElementController.currencySymbol}" />
|
||||
</hbox>
|
||||
</row>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue