BrightSide Workbench Full Report + Source Code
org.turro.erp.entity.RequiredUsage Class Reference
Inheritance diagram for org.turro.erp.entity.RequiredUsage:
Collaboration diagram for org.turro.erp.entity.RequiredUsage:

Public Member Functions

double getCost ()
 
void setCost (double cost)
 
boolean isCostMaximum ()
 
void setCostMaximum (boolean costMaximum)
 
double getDedication ()
 
void setDedication (double dedication)
 
String getDescription ()
 
void setDescription (String description)
 
long getId ()
 
void setId (long id)
 
AptitudeDegree getAptitudeDegree ()
 
void setAptitudeDegree (AptitudeDegree aptitudeDegree)
 
AptitudeDegree getAptitudeAssesment ()
 
void setAptitudeAssesment (AptitudeDegree aptitudeAssesment)
 
boolean isCanChange ()
 
void setCanChange (boolean canChange)
 
HumanResource getHumanResource ()
 
void setHumanResource (HumanResource resource)
 
Set< OrderItemgetOrderItems ()
 
Set< OrderItemgetUpdatedOrderItems ()
 
void setOrderItems (Set< OrderItem > orderItems)
 
double getPrice ()
 
void setPrice (double price)
 
String getProductDescription ()
 
void setProductDescription (String productDescription)
 
long getProductId ()
 
void setProductId (long productId)
 
boolean isProviderFixed ()
 
void setProviderFixed (boolean providerFixed)
 
long getProviderId ()
 
void setProviderId (long providerId)
 
long getProviderProductId ()
 
void setProviderProductId (long providerProductId)
 
Date getPurchaseDate ()
 
long getLineTypeId ()
 
void setLineTypeId (long lineTypeId)
 
long getContractPreferenceId ()
 
void setContractPreferenceId (long contractPreferenceId)
 
void setPurchaseDate (Date purchaseDate)
 
double getPurchaseLag ()
 
void setPurchaseLag (double purchaseLag)
 
PurchaseMode getPurchaseMode ()
 
void setPurchaseMode (PurchaseMode purchaseMode)
 
Task getPurchaseTask ()
 
void setPurchaseTask (Task purchaseTask)
 
boolean isRepresentHours ()
 
void setRepresentHours (boolean representHours)
 
Resource getResource ()
 
void setResource (Resource resource)
 
Task getTask ()
 
void setTask (Task task)
 
double getUnits ()
 
void setUnits (double units)
 
long getViewId ()
 
void setViewId (long viewId)
 
Contract getProvider ()
 
void setProvider (Contract provider)
 
Product getProduct ()
 
void setProduct (Product product)
 
IProduct getIProduct ()
 
void setIProduct (IProduct product)
 
ProductByContractor getProviderProduct ()
 
void setProviderProduct (ProductByContractor providerProduct)
 
LineType getLineType ()
 
void setLineType (LineType lineType)
 
RegisterView getView ()
 
void setView (RegisterView view)
 
boolean isProductType ()
 
boolean isHumanResourceType ()
 
boolean hasResource ()
 
void prepareHumanResource ()
 
void prepareProduct ()
 
boolean isEmpty ()
 
void clearEmptyLines ()
 
String getName ()
 
String getType ()
 
HumanResourceAptitude getHumanResourceAptitude ()
 
void setHumanResourceAptitude (HumanResourceAptitude hro)
 
HumanResourceAptitude getHumanResourceAptitudeAssest ()
 
ResourceAptitude getResourceAptitude ()
 
void setResourceAptitude (ResourceAptitude ro)
 
boolean fits (HumanResource humanResource)
 
boolean isInternal ()
 
double getOrderUnits ()
 
void setOrderUnits (double orderUnits)
 
OrderItem startOrder ()
 
OrderItem startOrder (double orderUnits)
 
UsageStatus getStatus ()
 
long getResourceId ()
 
double getEstimatedDuration ()
 
double getExpectedDuration ()
 
double getRealDuration ()
 
double getExpectedDedication ()
 
double getRealDedication ()
 
double getEstimatedUnits ()
 
double getCalculatedUnitCost ()
 
double getEstimatedUnitCost ()
 
double getEstimatedCost ()
 
double getExpectedUnits ()
 
double getExpectedUnitCost ()
 
double getExpectedCost ()
 
double getRealUnits ()
 
double getRealUnitCost ()
 
double getRealCost ()
 
double getEstimatedPrice ()
 
double getProposedPrice ()
 
double getUnitPrice ()
 
double convertToReal (double convertedUnits)
 
double getMostRealCost ()
 

Protected Attributes

transient int preparedType = 0
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 49 of file RequiredUsage.java.

Member Function Documentation

◆ clearEmptyLines()

void org.turro.erp.entity.RequiredUsage.clearEmptyLines ( )

Definition at line 467 of file RequiredUsage.java.

467  {
468  }
Here is the caller graph for this function:

◆ convertToReal()

double org.turro.erp.entity.RequiredUsage.convertToReal ( double  convertedUnits)

Definition at line 785 of file RequiredUsage.java.

785  {
786  return (units * convertedUnits) / getEstimatedUnits();
787  }
Here is the call graph for this function:

◆ fits()

boolean org.turro.erp.entity.RequiredUsage.fits ( HumanResource  humanResource)

Definition at line 529 of file RequiredUsage.java.

529  {
530  return this.humanResource != null &&
531  ((this.humanResource.getId() == humanResource.getId()) ||
532  humanResource.fits(aptitudeDegree, new Date()));
533  }
boolean fits(IContact contact)
Here is the call graph for this function:

◆ getAptitudeAssesment()

AptitudeDegree org.turro.erp.entity.RequiredUsage.getAptitudeAssesment ( )

Definition at line 142 of file RequiredUsage.java.

142  {
143  return aptitudeAssesment;
144  }
Here is the caller graph for this function:

◆ getAptitudeDegree()

AptitudeDegree org.turro.erp.entity.RequiredUsage.getAptitudeDegree ( )

Definition at line 134 of file RequiredUsage.java.

134  {
135  return aptitudeDegree;
136  }
Here is the caller graph for this function:

◆ getCalculatedUnitCost()

double org.turro.erp.entity.RequiredUsage.getCalculatedUnitCost ( )

Definition at line 700 of file RequiredUsage.java.

700  {
701  return new UsageValuation(this).getUnitCost();
702  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContractPreferenceId()

long org.turro.erp.entity.RequiredUsage.getContractPreferenceId ( )

Definition at line 246 of file RequiredUsage.java.

246  {
247  return contractPreferenceId;
248  }
Here is the caller graph for this function:

◆ getCost()

double org.turro.erp.entity.RequiredUsage.getCost ( )

Definition at line 94 of file RequiredUsage.java.

94  {
95  return cost;
96  }
Here is the caller graph for this function:

◆ getDedication()

double org.turro.erp.entity.RequiredUsage.getDedication ( )

Definition at line 110 of file RequiredUsage.java.

110  {
111  return dedication;
112  }
Here is the caller graph for this function:

◆ getDescription()

String org.turro.erp.entity.RequiredUsage.getDescription ( )

Definition at line 118 of file RequiredUsage.java.

118  {
119  return description;
120  }
Here is the caller graph for this function:

◆ getEstimatedCost()

double org.turro.erp.entity.RequiredUsage.getEstimatedCost ( )

Definition at line 711 of file RequiredUsage.java.

711  {
713  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEstimatedDuration()

double org.turro.erp.entity.RequiredUsage.getEstimatedDuration ( )

Definition at line 637 of file RequiredUsage.java.

637  {
638  double q = 0.0;
639  if(isHumanResourceType()/* || representHours*/) {
640  q += getUnits();
641  }
642  return q;
643  }
Here is the call graph for this function:

◆ getEstimatedPrice()

double org.turro.erp.entity.RequiredUsage.getEstimatedPrice ( )

Definition at line 770 of file RequiredUsage.java.

770  {
771  return getEstimatedUnits() * getUnitPrice();
772  }
Here is the call graph for this function:

◆ getEstimatedUnitCost()

double org.turro.erp.entity.RequiredUsage.getEstimatedUnitCost ( )

Definition at line 704 of file RequiredUsage.java.

704  {
705  if(Zero.near(cost, 2)) {
706  return getCalculatedUnitCost();
707  }
708  return cost;
709  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEstimatedUnits()

double org.turro.erp.entity.RequiredUsage.getEstimatedUnits ( )

Definition at line 691 of file RequiredUsage.java.

691  {
692  if(isHumanResourceType()) {
693  return (units * dedication) + (
694  hasResource() ? units : 0);
695  } else {
696  return units;
697  }
698  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getExpectedCost()

double org.turro.erp.entity.RequiredUsage.getExpectedCost ( )

Definition at line 730 of file RequiredUsage.java.

730  {
731  double q = 0.0d;
732  for(OrderItem oi : getOrderItems()) {
733  q += oi.getAmount();
734  if(oi.getRelated() != null) {
735  q += oi.getRelated().getAmount();
736  }
737  }
738  return q;
739  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getExpectedDedication()

double org.turro.erp.entity.RequiredUsage.getExpectedDedication ( )

Definition at line 667 of file RequiredUsage.java.

667  {
668  double q = 0.0d, d = 0.0d;
669  if(isHumanResourceType()) {
670  for(OrderItem oi : getOrderItems()) {
671  q += oi.getUnits();
672  d += oi.getUnits() * oi.getDedication();
673  }
674  }
675  return q != 0.0d ? d / q : 1.0d;
676  }
Here is the call graph for this function:

◆ getExpectedDuration()

double org.turro.erp.entity.RequiredUsage.getExpectedDuration ( )

Definition at line 645 of file RequiredUsage.java.

645  {
646  double q = 0.0;
647  if(isHumanResourceType()) {
648  for(OrderItem oi : getOrderItems()) {
649  q += oi.getUnits();
650  }
651  }
652  return q;
653  }
Here is the call graph for this function:

◆ getExpectedUnitCost()

double org.turro.erp.entity.RequiredUsage.getExpectedUnitCost ( )

Definition at line 726 of file RequiredUsage.java.

Here is the call graph for this function:

◆ getExpectedUnits()

double org.turro.erp.entity.RequiredUsage.getExpectedUnits ( )

Definition at line 715 of file RequiredUsage.java.

715  {
716  double q = 0.0d;
717  for(OrderItem oi : getOrderItems()) {
718  q += oi.getUnits() * oi.getDedication();
719  if(oi.getRelated() != null) {
720  q += oi.getRelated().getUnits() * oi.getRelated().getDedication();
721  }
722  }
723  return q;
724  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHumanResource()

HumanResource org.turro.erp.entity.RequiredUsage.getHumanResource ( )

Definition at line 158 of file RequiredUsage.java.

158  {
159  return humanResource;
160  }
Here is the caller graph for this function:

◆ getHumanResourceAptitude()

HumanResourceAptitude org.turro.erp.entity.RequiredUsage.getHumanResourceAptitude ( )

Definition at line 504 of file RequiredUsage.java.

504  {
505  return new HumanResourceAptitude(humanResource, canChange, aptitudeDegree);
506  }
Here is the caller graph for this function:

◆ getHumanResourceAptitudeAssest()

HumanResourceAptitude org.turro.erp.entity.RequiredUsage.getHumanResourceAptitudeAssest ( )

Definition at line 513 of file RequiredUsage.java.

513  {
514  return new HumanResourceAptitude(humanResource, canChange,
515  aptitudeAssesment == null ? aptitudeDegree : aptitudeAssesment);
516  }

◆ getId()

long org.turro.erp.entity.RequiredUsage.getId ( )

Definition at line 126 of file RequiredUsage.java.

126  {
127  return id;
128  }
Here is the caller graph for this function:

◆ getIProduct()

IProduct org.turro.erp.entity.RequiredUsage.getIProduct ( )

Definition at line 356 of file RequiredUsage.java.

356  {
357  return ProductFactory.getProduct(productId, providerId, providerProductId, productDescription);
358  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLineType()

LineType org.turro.erp.entity.RequiredUsage.getLineType ( )

Definition at line 400 of file RequiredUsage.java.

400  {
401  LineType lt = lineType.getEntity(lineTypeId);
402  lt.setContractPreference(null);
403  return lt;
404  }
Here is the call graph for this function:

◆ getLineTypeId()

long org.turro.erp.entity.RequiredUsage.getLineTypeId ( )

Definition at line 238 of file RequiredUsage.java.

238  {
239  return lineTypeId;
240  }
Here is the caller graph for this function:

◆ getMostRealCost()

double org.turro.erp.entity.RequiredUsage.getMostRealCost ( )

Definition at line 789 of file RequiredUsage.java.

789  {
790  double mostRealCost = getRealCost();
791  if(mostRealCost == 0.0) {
792  mostRealCost = getExpectedCost();
793  }
794  if(mostRealCost == 0.0) {
795  mostRealCost = getEstimatedCost();
796  }
797  return mostRealCost;
798  }
Here is the call graph for this function:

◆ getName()

String org.turro.erp.entity.RequiredUsage.getName ( )

Definition at line 470 of file RequiredUsage.java.

470  {
471  if(isHumanResourceType()) {
472  return getHumanResourceAptitude().getName() +
473  (hasResource() ?
474  " - " + getResource().getName() :
475  "");
476  } else if(isProductType()) {
477  PhraseBuilder pb = new PhraseBuilder();
478  IProduct p = getIProduct();
479  if(p != null) {
480  p.setProductByContractor(getProviderProduct());
481  pb.addWord(p.getProductString());
482  }
483  if(!p.isUncoded()) {
484  pb.addWord(getDescription());
485  }
486  String ltype = new LineTypeDescription(lineTypeId, contractPreferenceId).getDescription();
487  if(ltype != null) {
488  pb.addWord("(" + ltype + ")");
489  }
490  return pb.toString();
491  }
492  return null;
493  }
ProductByContractor getProviderProduct()
HumanResourceAptitude getHumanResourceAptitude()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrderItems()

Set<OrderItem> org.turro.erp.entity.RequiredUsage.getOrderItems ( )

Definition at line 166 of file RequiredUsage.java.

166  {
167  Dao dao = new ErpPU();
168  if(id > 0 && dao.isNotLoaded(orderItems)) {
169  orderItems = dao.lazyLoader(RequiredUsage.class, this, "orderItems").orderItems;
170  }
171  return orderItems;
172  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrderUnits()

double org.turro.erp.entity.RequiredUsage.getOrderUnits ( )

Definition at line 542 of file RequiredUsage.java.

542  {
543  return orderUnits;
544  }

◆ getPrice()

double org.turro.erp.entity.RequiredUsage.getPrice ( )

Definition at line 186 of file RequiredUsage.java.

186  {
187  return price;
188  }
Here is the caller graph for this function:

◆ getProduct()

Product org.turro.erp.entity.RequiredUsage.getProduct ( )

Definition at line 348 of file RequiredUsage.java.

348  {
349  return product.getEntity(productId);
350  }

◆ getProductDescription()

String org.turro.erp.entity.RequiredUsage.getProductDescription ( )

Definition at line 194 of file RequiredUsage.java.

194  {
195  return productDescription;
196  }
Here is the caller graph for this function:

◆ getProductId()

long org.turro.erp.entity.RequiredUsage.getProductId ( )

Definition at line 202 of file RequiredUsage.java.

202  {
203  return productId;
204  }
Here is the caller graph for this function:

◆ getProposedPrice()

double org.turro.erp.entity.RequiredUsage.getProposedPrice ( )

Definition at line 774 of file RequiredUsage.java.

774  {
775  return getRealUnits() * getUnitPrice();
776  }
Here is the call graph for this function:

◆ getProvider()

Contract org.turro.erp.entity.RequiredUsage.getProvider ( )

Definition at line 332 of file RequiredUsage.java.

332  {
333  return provider.getEntity(providerId);
334  }
Here is the caller graph for this function:

◆ getProviderId()

long org.turro.erp.entity.RequiredUsage.getProviderId ( )

Definition at line 218 of file RequiredUsage.java.

218  {
219  return providerId;
220  }
Here is the caller graph for this function:

◆ getProviderProduct()

ProductByContractor org.turro.erp.entity.RequiredUsage.getProviderProduct ( )

Definition at line 384 of file RequiredUsage.java.

384  {
385  return providerProduct.getEntity(providerProductId);
386  }
Here is the caller graph for this function:

◆ getProviderProductId()

long org.turro.erp.entity.RequiredUsage.getProviderProductId ( )

Definition at line 226 of file RequiredUsage.java.

226  {
227  return providerProductId;
228  }
Here is the caller graph for this function:

◆ getPurchaseDate()

Date org.turro.erp.entity.RequiredUsage.getPurchaseDate ( )

Definition at line 234 of file RequiredUsage.java.

234  {
235  return purchaseDate;
236  }
Here is the caller graph for this function:

◆ getPurchaseLag()

double org.turro.erp.entity.RequiredUsage.getPurchaseLag ( )

Definition at line 258 of file RequiredUsage.java.

258  {
259  return purchaseLag;
260  }
Here is the caller graph for this function:

◆ getPurchaseMode()

PurchaseMode org.turro.erp.entity.RequiredUsage.getPurchaseMode ( )

Definition at line 266 of file RequiredUsage.java.

266  {
267  return purchaseMode;
268  }
Here is the caller graph for this function:

◆ getPurchaseTask()

Task org.turro.erp.entity.RequiredUsage.getPurchaseTask ( )

Definition at line 274 of file RequiredUsage.java.

274  {
275  return purchaseTask;
276  }
Here is the caller graph for this function:

◆ getRealCost()

double org.turro.erp.entity.RequiredUsage.getRealCost ( )

Definition at line 759 of file RequiredUsage.java.

759  {
760  double q = 0.0d;
761  for(OrderItem oi : getOrderItems()) {
762  q += oi.getRealAmount();
763  if(oi.getRelated() != null) {
764  q += oi.getRelated().getRealAmount();
765  }
766  }
767  return q;
768  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealDedication()

double org.turro.erp.entity.RequiredUsage.getRealDedication ( )

Definition at line 678 of file RequiredUsage.java.

678  {
679  double q = 0.0d, d = 0.0d;
680  if(isHumanResourceType()) {
681  for(OrderItem oi : getOrderItems()) {
682  for(ReceiptItem ri : oi.getReceiptItems()) {
683  q += ri.getUnits();
684  d += ri.getUnits() * ri.getDedication();
685  }
686  }
687  }
688  return q != 0.0d ? d / q : 1.0d;
689  }
Here is the call graph for this function:

◆ getRealDuration()

double org.turro.erp.entity.RequiredUsage.getRealDuration ( )

Definition at line 655 of file RequiredUsage.java.

655  {
656  double q = 0.0;
657  if(isHumanResourceType()) {
658  for(OrderItem oi : getOrderItems()) {
659  for(ReceiptItem ri : oi.getReceiptItems()) {
660  q += ri.getUnits();
661  }
662  }
663  }
664  return q;
665  }
Here is the call graph for this function:

◆ getRealUnitCost()

double org.turro.erp.entity.RequiredUsage.getRealUnitCost ( )

Definition at line 752 of file RequiredUsage.java.

752  {
753  double rc = getRealCost(),
754  ru = getRealUnits(),
755  result = rc / ru;
756  return Double.isNaN(result) ? 0.0d : result;
757  }
Here is the call graph for this function:

◆ getRealUnits()

double org.turro.erp.entity.RequiredUsage.getRealUnits ( )

Definition at line 741 of file RequiredUsage.java.

741  {
742  double q = 0.0d;
743  for(OrderItem oi : getOrderItems()) {
744  q += oi.getRealUnits();
745  if(oi.getRelated() != null) {
746  q += oi.getRelated().getRealUnits();
747  }
748  }
749  return q;
750  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getResource()

Resource org.turro.erp.entity.RequiredUsage.getResource ( )

Definition at line 290 of file RequiredUsage.java.

290  {
291  return resource;
292  }
Here is the caller graph for this function:

◆ getResourceAptitude()

ResourceAptitude org.turro.erp.entity.RequiredUsage.getResourceAptitude ( )

Definition at line 518 of file RequiredUsage.java.

518  {
519  return new ResourceAptitude(resource, aptitudeDegree);
520  }

◆ getResourceId()

long org.turro.erp.entity.RequiredUsage.getResourceId ( )

Definition at line 628 of file RequiredUsage.java.

628  {
629  if(isHumanResourceType()) {
630  return getHumanResource().getId();
631  } else if(isProductType()) {
632  return getProductId();
633  }
634  return 0;
635  }
Here is the call graph for this function:

◆ getStatus()

UsageStatus org.turro.erp.entity.RequiredUsage.getStatus ( )

Definition at line 605 of file RequiredUsage.java.

605  {
606  double estimatedUnits = getEstimatedUnits(),
607  expectedUnits = getExpectedUnits(),
608  realUnits = getRealUnits();
609  if(realUnits == 0.0d) {
610  if(expectedUnits != 0.0d) {
611  return UsageStatus.USAGE_PENDING;
612  } else {
613  return UsageStatus.USAGE_READY;
614  }
615  } else {
616  if(realUnits >= estimatedUnits) {
617  if(EnumSet.of(TaskStatus.TASK_FINISHED, TaskStatus.TASK_ONWORK).contains(getTask().getStatus())) {
618  return UsageStatus.USAGE_PROCESSED;
619  } else {
620  return UsageStatus.USAGE_RECEIVED;
621  }
622  } else {
623  return UsageStatus.USAGE_RECEIVED_PARTIALLY;
624  }
625  }
626  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTask()

Task org.turro.erp.entity.RequiredUsage.getTask ( )

Definition at line 298 of file RequiredUsage.java.

298  {
299  return task;
300  }
Here is the caller graph for this function:

◆ getType()

String org.turro.erp.entity.RequiredUsage.getType ( )

Definition at line 495 of file RequiredUsage.java.

495  {
496  if(isHumanResourceType()) {
497  return "operator";
498  } else if(isProductType()) {
499  return "product";
500  }
501  return null;
502  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnitPrice()

double org.turro.erp.entity.RequiredUsage.getUnitPrice ( )

Definition at line 778 of file RequiredUsage.java.

778  {
779  if(Zero.near(price, 2)) {
780  return new UsageValuation(this).getUnitPrice();
781  }
782  return price;
783  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnits()

double org.turro.erp.entity.RequiredUsage.getUnits ( )

Definition at line 306 of file RequiredUsage.java.

306  {
307  return units;
308  }
Here is the caller graph for this function:

◆ getUpdatedOrderItems()

Set<OrderItem> org.turro.erp.entity.RequiredUsage.getUpdatedOrderItems ( )

Definition at line 174 of file RequiredUsage.java.

174  {
175  Dao dao = new ErpPU();
176  if(id > 0) {
177  orderItems = dao.lazyLoader(RequiredUsage.class, this, "orderItems").orderItems;
178  }
179  return orderItems;
180  }

◆ getView()

RegisterView org.turro.erp.entity.RequiredUsage.getView ( )

Definition at line 418 of file RequiredUsage.java.

418  {
419  return view.getEntity(viewId);
420  }
Here is the caller graph for this function:

◆ getViewId()

long org.turro.erp.entity.RequiredUsage.getViewId ( )

Definition at line 314 of file RequiredUsage.java.

314  {
315  return viewId;
316  }
Here is the caller graph for this function:

◆ hasResource()

boolean org.turro.erp.entity.RequiredUsage.hasResource ( )

Definition at line 439 of file RequiredUsage.java.

439  {
440  return isHumanResourceType() && resource != null;
441  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCanChange()

boolean org.turro.erp.entity.RequiredUsage.isCanChange ( )

Definition at line 150 of file RequiredUsage.java.

150  {
151  return canChange;
152  }
Here is the caller graph for this function:

◆ isCostMaximum()

boolean org.turro.erp.entity.RequiredUsage.isCostMaximum ( )

Definition at line 102 of file RequiredUsage.java.

102  {
103  return costMaximum;
104  }
Here is the caller graph for this function:

◆ isEmpty()

boolean org.turro.erp.entity.RequiredUsage.isEmpty ( )

Definition at line 461 of file RequiredUsage.java.

461  {
462  clearEmptyLines();
463  preparedType = 0;
464  return (!isHumanResourceType() && !isProductType()) || units == 0.0d;
465  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isHumanResourceType()

boolean org.turro.erp.entity.RequiredUsage.isHumanResourceType ( )

Definition at line 435 of file RequiredUsage.java.

435  {
436  return (humanResource != null && aptitudeDegree != null) || preparedType == 1;
437  }
Here is the caller graph for this function:

◆ isInternal()

boolean org.turro.erp.entity.RequiredUsage.isInternal ( )

Definition at line 535 of file RequiredUsage.java.

535  {
536  return (humanResource != null && humanResource.isInternal()) ||
537  (resource != null && resource.isInternal());
538  }
Here is the call graph for this function:

◆ isProductType()

boolean org.turro.erp.entity.RequiredUsage.isProductType ( )

Definition at line 430 of file RequiredUsage.java.

430  {
431  return ((providerProductId > 0 || productId > 0) ||
432  !Strings.isEmpty(productDescription)) || preparedType == 2;
433  }
Here is the caller graph for this function:

◆ isProviderFixed()

boolean org.turro.erp.entity.RequiredUsage.isProviderFixed ( )

Definition at line 210 of file RequiredUsage.java.

210  {
211  return providerFixed;
212  }
Here is the caller graph for this function:

◆ isRepresentHours()

boolean org.turro.erp.entity.RequiredUsage.isRepresentHours ( )

Definition at line 282 of file RequiredUsage.java.

282  {
283  return representHours;
284  }
Here is the caller graph for this function:

◆ prepareHumanResource()

void org.turro.erp.entity.RequiredUsage.prepareHumanResource ( )

Definition at line 443 of file RequiredUsage.java.

443  {
444  providerProductId = 0;
445  productId = 0;
446  description = null;
447  dedication = 1;
448  preparedType = 1;
449  }
Here is the caller graph for this function:

◆ prepareProduct()

void org.turro.erp.entity.RequiredUsage.prepareProduct ( )

Definition at line 451 of file RequiredUsage.java.

451  {
452  humanResource = null;
453  aptitudeDegree = null;
454  resource = null;
455  dedication = 1;
456  preparedType = 2;
457  }
Here is the caller graph for this function:

◆ setAptitudeAssesment()

void org.turro.erp.entity.RequiredUsage.setAptitudeAssesment ( AptitudeDegree  aptitudeAssesment)

Definition at line 146 of file RequiredUsage.java.

146  {
147  this.aptitudeAssesment = aptitudeAssesment;
148  }
Here is the caller graph for this function:

◆ setAptitudeDegree()

void org.turro.erp.entity.RequiredUsage.setAptitudeDegree ( AptitudeDegree  aptitudeDegree)

Definition at line 138 of file RequiredUsage.java.

138  {
139  this.aptitudeDegree = aptitudeDegree;
140  }
Here is the caller graph for this function:

◆ setCanChange()

void org.turro.erp.entity.RequiredUsage.setCanChange ( boolean  canChange)

Definition at line 154 of file RequiredUsage.java.

154  {
155  this.canChange = canChange;
156  }
Here is the caller graph for this function:

◆ setContractPreferenceId()

void org.turro.erp.entity.RequiredUsage.setContractPreferenceId ( long  contractPreferenceId)

Definition at line 250 of file RequiredUsage.java.

250  {
251  this.contractPreferenceId = contractPreferenceId;
252  }
Here is the caller graph for this function:

◆ setCost()

void org.turro.erp.entity.RequiredUsage.setCost ( double  cost)

Definition at line 98 of file RequiredUsage.java.

98  {
99  this.cost = cost;
100  }
Here is the caller graph for this function:

◆ setCostMaximum()

void org.turro.erp.entity.RequiredUsage.setCostMaximum ( boolean  costMaximum)

Definition at line 106 of file RequiredUsage.java.

106  {
107  this.costMaximum = costMaximum;
108  }
Here is the caller graph for this function:

◆ setDedication()

void org.turro.erp.entity.RequiredUsage.setDedication ( double  dedication)

Definition at line 114 of file RequiredUsage.java.

114  {
115  this.dedication = dedication;
116  }
Here is the caller graph for this function:

◆ setDescription()

void org.turro.erp.entity.RequiredUsage.setDescription ( String  description)

Definition at line 122 of file RequiredUsage.java.

122  {
123  this.description = description;
124  }
Here is the caller graph for this function:

◆ setHumanResource()

void org.turro.erp.entity.RequiredUsage.setHumanResource ( HumanResource  resource)

Definition at line 162 of file RequiredUsage.java.

162  {
163  this.humanResource = resource;
164  }
Here is the caller graph for this function:

◆ setHumanResourceAptitude()

void org.turro.erp.entity.RequiredUsage.setHumanResourceAptitude ( HumanResourceAptitude  hro)

Definition at line 508 of file RequiredUsage.java.

508  {
509  humanResource = hro.getHumanResource();
510  aptitudeDegree = hro.getAptitudeDegree();
511  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setId()

void org.turro.erp.entity.RequiredUsage.setId ( long  id)

Definition at line 130 of file RequiredUsage.java.

130  {
131  this.id = id;
132  }

◆ setIProduct()

void org.turro.erp.entity.RequiredUsage.setIProduct ( IProduct  product)

Definition at line 360 of file RequiredUsage.java.

360  {
361  if(product != null) {
362  if(product.isUncoded()) {
363  productId = 0;
364  productDescription = product.getProductCodeStr();
365  } else {
366  productId = ((Product) product).getId();
367  if(product.getProductByContractor() != null) {
368  setProviderProduct(product.getProductByContractor());
369  }
370  }
371  } else {
372  productId = 0;
373  }
374  }
void setProviderProduct(ProductByContractor providerProduct)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLineType()

void org.turro.erp.entity.RequiredUsage.setLineType ( LineType  lineType)

Definition at line 406 of file RequiredUsage.java.

406  {
407  lineTypeId = this.lineType.setEntity(lineType);
408  }

◆ setLineTypeId()

void org.turro.erp.entity.RequiredUsage.setLineTypeId ( long  lineTypeId)

Definition at line 242 of file RequiredUsage.java.

242  {
243  this.lineTypeId = lineTypeId;
244  }
Here is the caller graph for this function:

◆ setOrderItems()

void org.turro.erp.entity.RequiredUsage.setOrderItems ( Set< OrderItem orderItems)

Definition at line 182 of file RequiredUsage.java.

182  {
183  this.orderItems = orderItems;
184  }

◆ setOrderUnits()

void org.turro.erp.entity.RequiredUsage.setOrderUnits ( double  orderUnits)

Definition at line 546 of file RequiredUsage.java.

546  {
547  this.orderUnits = orderUnits;
548  }

◆ setPrice()

void org.turro.erp.entity.RequiredUsage.setPrice ( double  price)

Definition at line 190 of file RequiredUsage.java.

190  {
191  this.price = price;
192  }
Here is the caller graph for this function:

◆ setProduct()

void org.turro.erp.entity.RequiredUsage.setProduct ( Product  product)

Definition at line 352 of file RequiredUsage.java.

352  {
353  productId = this.product.setEntity(product);
354  }

◆ setProductDescription()

void org.turro.erp.entity.RequiredUsage.setProductDescription ( String  productDescription)

Definition at line 198 of file RequiredUsage.java.

198  {
199  this.productDescription = productDescription;
200  }
Here is the caller graph for this function:

◆ setProductId()

void org.turro.erp.entity.RequiredUsage.setProductId ( long  productId)

Definition at line 206 of file RequiredUsage.java.

206  {
207  this.productId = productId;
208  }
Here is the caller graph for this function:

◆ setProvider()

void org.turro.erp.entity.RequiredUsage.setProvider ( Contract  provider)

Definition at line 336 of file RequiredUsage.java.

336  {
337  providerId = this.provider.setEntity(provider);
338  }
Here is the caller graph for this function:

◆ setProviderFixed()

void org.turro.erp.entity.RequiredUsage.setProviderFixed ( boolean  providerFixed)

Definition at line 214 of file RequiredUsage.java.

214  {
215  this.providerFixed = providerFixed;
216  }
Here is the caller graph for this function:

◆ setProviderId()

void org.turro.erp.entity.RequiredUsage.setProviderId ( long  providerId)

Definition at line 222 of file RequiredUsage.java.

222  {
223  this.providerId = providerId;
224  }
Here is the caller graph for this function:

◆ setProviderProduct()

void org.turro.erp.entity.RequiredUsage.setProviderProduct ( ProductByContractor  providerProduct)

Definition at line 388 of file RequiredUsage.java.

388  {
389  providerProductId = this.providerProduct.setEntity(providerProduct);
390  }
Here is the caller graph for this function:

◆ setProviderProductId()

void org.turro.erp.entity.RequiredUsage.setProviderProductId ( long  providerProductId)

Definition at line 230 of file RequiredUsage.java.

230  {
231  this.providerProductId = providerProductId;
232  }
Here is the caller graph for this function:

◆ setPurchaseDate()

void org.turro.erp.entity.RequiredUsage.setPurchaseDate ( Date  purchaseDate)

Definition at line 254 of file RequiredUsage.java.

254  {
255  this.purchaseDate = purchaseDate;
256  }
Here is the caller graph for this function:

◆ setPurchaseLag()

void org.turro.erp.entity.RequiredUsage.setPurchaseLag ( double  purchaseLag)

Definition at line 262 of file RequiredUsage.java.

262  {
263  this.purchaseLag = purchaseLag;
264  }
Here is the caller graph for this function:

◆ setPurchaseMode()

void org.turro.erp.entity.RequiredUsage.setPurchaseMode ( PurchaseMode  purchaseMode)

Definition at line 270 of file RequiredUsage.java.

270  {
271  this.purchaseMode = purchaseMode;
272  }
Here is the caller graph for this function:

◆ setPurchaseTask()

void org.turro.erp.entity.RequiredUsage.setPurchaseTask ( Task  purchaseTask)

Definition at line 278 of file RequiredUsage.java.

278  {
279  this.purchaseTask = purchaseTask;
280  }
Here is the caller graph for this function:

◆ setRepresentHours()

void org.turro.erp.entity.RequiredUsage.setRepresentHours ( boolean  representHours)

Definition at line 286 of file RequiredUsage.java.

286  {
287  this.representHours = representHours;
288  }
Here is the caller graph for this function:

◆ setResource()

void org.turro.erp.entity.RequiredUsage.setResource ( Resource  resource)

Definition at line 294 of file RequiredUsage.java.

294  {
295  this.resource = resource;
296  }
Here is the caller graph for this function:

◆ setResourceAptitude()

void org.turro.erp.entity.RequiredUsage.setResourceAptitude ( ResourceAptitude  ro)

Definition at line 522 of file RequiredUsage.java.

522  {
523  if(ro != null) {
524  resource = ro.getResource();
525  aptitudeDegree = ro.getAptitudeDegree();
526  }
527  }
Here is the call graph for this function:

◆ setTask()

void org.turro.erp.entity.RequiredUsage.setTask ( Task  task)

Definition at line 302 of file RequiredUsage.java.

302  {
303  this.task = task;
304  }
Here is the caller graph for this function:

◆ setUnits()

void org.turro.erp.entity.RequiredUsage.setUnits ( double  units)

Definition at line 310 of file RequiredUsage.java.

310  {
311  this.units = units;
312  }
Here is the caller graph for this function:

◆ setView()

void org.turro.erp.entity.RequiredUsage.setView ( RegisterView  view)

Definition at line 422 of file RequiredUsage.java.

422  {
423  viewId = this.view.setEntity(view);
424  }

◆ setViewId()

void org.turro.erp.entity.RequiredUsage.setViewId ( long  viewId)

Definition at line 318 of file RequiredUsage.java.

318  {
319  this.viewId = viewId;
320  }
Here is the caller graph for this function:

◆ startOrder() [1/2]

OrderItem org.turro.erp.entity.RequiredUsage.startOrder ( )

Definition at line 550 of file RequiredUsage.java.

550  {
551  return startOrder(orderUnits == 0.0d ? getUnits() : orderUnits);
552  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startOrder() [2/2]

OrderItem org.turro.erp.entity.RequiredUsage.startOrder ( double  orderUnits)

Definition at line 554 of file RequiredUsage.java.

554  {
555  OrderItem oi = new OrderItem();
556  oi.setSent(false);
557  oi.setDocumentDate(null);
558  oi.setDocumentNumber("");
559  oi.setRequiredUsage(this);
560  oi.setUnits(orderUnits);
561  oi.setDelivery(task.getDelivery());
562  oi.setDescription(description);
563  if(isHumanResourceType()) {
564  oi.setHumanResource(humanResource);
565  oi.setProviderId(humanResource.getIdContract());
566  oi.setDedication(dedication);
567  oi.setCost(getHumanResourceAptitude().getCost());
568  oi.setTax(0);
569  oi.setProviderFixed(true);
570  if(hasResource()) {
571  OrderItem oir = new OrderItem();
572  oir.setSent(false);
573  oir.setDocumentDate(null);
574  oir.setDocumentNumber("");
575  oir.setRequiredUsage(null);
576  oir.setResource(resource);
577  oir.setProviderId(resource.getIdContract());
578  oir.setUnits(orderUnits);
579  oir.setDelivery(task.getDelivery());
580  oir.setDedication(1.0d);
581  oir.setCost(resource.getCostHour());
582  oir.setTax(0);
583  oir.setProviderFixed(true);
584  oi.setRelated(oir);
585  }
586  } else if(isProductType()) {
587  oi.setProductId(productId);
588  oi.setProviderProductId(providerProductId);
589  oi.setProviderId(providerId);
590  oi.setProviderFixed(providerFixed);
591  oi.setProductDescription(productDescription);
592  oi.setDedication(1.0d);
593  oi.setCost(cost);
594  oi.setCostMaximum(costMaximum);
595  if(isCostMaximum()) {
596  oi.setMaxCost(cost);
597  }
598  oi.setTax(0);
599  }
600  return oi;
601  }
Here is the call graph for this function:

Member Data Documentation

◆ preparedType

transient int org.turro.erp.entity.RequiredUsage.preparedType = 0
protected

Definition at line 428 of file RequiredUsage.java.


The documentation for this class was generated from the following file: