Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/estimated cost #171

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ public String getHQL() {
}
}


if( isEstimatedCostSet() ){
ret.append( (ret.length()==0) ? "WHERE " : " AND " );
if( getEstimatedCost()==null ){
ret.append( "estimated cost is NULL" );
} else {
ret.append( "estimated cost = :arg"+(iArgNum++) );
}
}

if( isRolesSet() ){
ret.append( (ret.length()==0) ? "WHERE " : " AND " );
ret.append( "roles.id IN (:arg"+(iArgNum++)+")" );
Expand Down Expand Up @@ -340,6 +350,11 @@ public Object[] getArguments(){
if( isOfferSet() && getOffer()!=null ){
ret.add( offer );
}


if( isEstimatedCostSet() && getEstimatedCost()!=null ){
ret.add( estimatedCost );
}


if( isRolesSet() ){
Expand Down Expand Up @@ -418,7 +433,8 @@ public void reset(){
unsetClient();

unsetOffer();


unsetEstimatedCost();

unsetRoles();

Expand Down Expand Up @@ -565,8 +581,12 @@ public String toString() {
ret.append( ")" );
}




if( isEstimatedCostSet() ){
ret.append( "(estimated cost" );
ret.append( "="+estimatedCost );
ret.append( ")" );
}


if( isRolesSet() ){
Expand Down Expand Up @@ -857,8 +877,25 @@ public void setOffer( Offer offer ){
public void unsetOffer(){
this.offerSet = false;
}





public boolean isEstimatedCostSet(){
return estimatedCostSet;
}
public BigDecimal getEstimatedCost(){
return estimatedCost;
}
public void setEstimatedCost( BigDecimal estimatedCost ){
this.estimatedCost = estimatedCost;
this.estimatedCostSet = true;
}
public void unsetEstimatedCost(){
this.estimatedCostSet = false;
}



public boolean isRolesSet(){
return rolesSet;
}
Expand Down Expand Up @@ -957,7 +994,10 @@ public void unsetCosts(){

private boolean offerSet;
private Offer offer;



private boolean estimatedCostSet;
private BigDecimal estimatedCost;


private boolean rolesSet;
Expand All @@ -971,7 +1011,7 @@ public void unsetCosts(){

// Returns if there are a search condition active
public boolean isSearchActive() {
return customIsSearchActive()||startStartDateSet||endStartDateSet||startEndDateSet||endEndDateSet||openSet||nameSet||descriptionSet||billableSet||ownerIdSet||departmentIdSet||startInsertDateSet||endInsertDateSet||startUpdateDateSet||endUpdateDateSet||clientSet||rolesSet||costsSet||offerSet;
return customIsSearchActive()||startStartDateSet||endStartDateSet||startEndDateSet||endEndDateSet||openSet||nameSet||descriptionSet||billableSet||ownerIdSet||departmentIdSet||startInsertDateSet||endInsertDateSet||startUpdateDateSet||endUpdateDateSet||clientSet||rolesSet||costsSet||offerSet||estimatedCostSet;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<property name="insertDate" type="java.util.Date" column="insertDate" insert="false" update="false"/>
<property name="updateDate" type="java.util.Date" column="updateDate" insert="false" update="false"/>
<many-to-one name="offer" class="com.autentia.tnt.businessobject.Offer" column="offerId" unique="true" />
<property name="estimatedCost" type="java.math.BigDecimal" column="estimatedCost"/>

</class>
</hibernate-mapping>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public BigDecimal getTotalCost() {
return project.getTotalCost();
}


/**
* Go to edit page
*
Expand Down Expand Up @@ -871,6 +872,28 @@ public void setSearchClientValid(boolean val) {
}
}

public BigDecimal getSearchEstimatedCost() {
return search.getEstimatedCost();
}

public void setSearchEstimatedCost(BigDecimal val) {
if (search.isEstimatedCostSet()) {
search.setEstimatedCost(val);
}
}

public boolean isSearchEstimatedCostValid() {
return search.isEstimatedCostSet();
}

public void setSearchEstimatedCostValid(boolean val) {
if (val) {
search.setEstimatedCost(search.getEstimatedCost());
} else {
search.unsetEstimatedCost();
}
}


public List<ProjectRole> getSearchRoles() {
return search.getRoles();
Expand Down Expand Up @@ -1041,6 +1064,15 @@ public void setClient(Organization client) {
}
}

public BigDecimal getEstimatedCost() {
return project.getEstimatedCost();
}

public void setEstimatedCost(BigDecimal estimatedCost) {
project.setEstimatedCost(estimatedCost);
}


public Set<ProjectRole> getRoles() {

return project.getRoles();
Expand Down Expand Up @@ -1124,6 +1156,7 @@ public String getCostPerProject() {
return totalCost;
}


public HtmlInputText getOfferNumberInput() {
return offerNumberInput;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ error.disabledLogs=Logs disabled
error.notAuthorized=Unauthorized access
error.newPasswordEqualsOldPassword=New password can not be equals than current password

############################################################################################
# Convert error messages
#
javax.faces.converter.BigDecimalConverter.DECIMAL=''{0}'' must be a signed decimal number.


############################################################################################
# Random password generation
#
Expand Down Expand Up @@ -413,6 +419,7 @@ project.updateDate=Insert update
project.client=Organization
project.roles=Roles
project.costs=Costs
project.estimatedCost=Estimated Cost
project.workedHours=Worked Hours
project.costPerHour=Cost per Hour
project.costPerProject=Cost per Project
Expand All @@ -428,7 +435,7 @@ searchProject.title=Find Projects
detailProject.location=Administration - Detail Project
detailProject.title=Detail Project
# project - generated by stajanov (do not edit/delete)
editProject.totalCost=Total estimated cost
editProject.totalCost=Auto-calculated Cost

# idea - generated by stajanov (do not edit/delete)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ error.enabledLogs=Trazas habilitadas
error.disabledLogs=Trazas deshabilitadas
error.notAuthorized=Acceso no autorizado.

############################################################################################
# Converter error messages
#
javax.faces.converter.BigDecimalConverter.DECIMAL=''{0}'' no es un n\u00FAmero decimal.


error.newPasswordEqualsOldPassword=La nueva contrase\u00F1a no puede ser igual que la contrase\u00F1a actual

############################################################################################
Expand Down Expand Up @@ -416,6 +422,7 @@ project.updateDate=Fecha de inserci\u00F3n
project.client=Organizaci\u00F3n
project.roles=Roles
project.costs=Costes
project.estimatedCost=Coste estimado
project.workedHours=Horas Trabajadas
project.costPerHour=Coste por Hora
project.costPerProject=Coste del Proyecto
Expand All @@ -426,12 +433,12 @@ projects.location=Administraci\u00F3n - Proyectos
projects.title=Proyectos
editProject.location=Administraci\u00F3n - Editar Proyectos
editProject.title=Editar Proyectos
searchProject.location=Administraci\u00F3n - Buscar Proyectos
searchProject.location=Administraci\u00F3n - Buscar Proyectosf
searchProject.title=Buscar Proyectos
detailProject.location=Administraci\u00F3n - Detallar Proyectos
detailProject.title=Detallar Proyectos
# project - generated by stajanov (do not edit/delete)
editProject.totalCost=Coste total estimado
editProject.totalCost=Coste auto-calculado

# idea - generated by stajanov (do not edit/delete)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ error.enabledLogs=Logs habilitados
error.disabledLogs=Logs desabilitados
error.notAuthorized=Acesso não autorizado.
error.newPasswordEqualsOldPassword=A nova senha não pode ser igual à senha atual

############################################################################################
# Convert error messages
#
javax.faces.converter.BigDecimalConverter.DECIMAL=''{0}'' deve ser um número decimal assinado.


############################################################################################
# Random password generation
#
Expand Down Expand Up @@ -379,6 +386,8 @@ project.updateDate=Data de inser
project.client=Organização
project.roles=Tarefas
project.costs=custos
project.estimatedCost=Custo estimado
project.offer=Oferta
project.workedHours=Horas trabalhadas
project.costPerHour=Custo por Hora
project.costPerProject=Custo Proyecto
Expand All @@ -393,7 +402,7 @@ searchProject.title=Procurar Projetos
detailProject.location=Administração - Detalhar Projetos
detailProject.title=Detalhar Prohectos
# project - generated by stajanov (do not edit/delete)
editProject.totalCost=Custo total estimado
editProject.totalCost=Custo auto-calculado
# idea - generated by stajanov (do not edit/delete)
idea.id=Id
idea.creationDate=Data
Expand Down
Loading
Loading