BrightSide Workbench Full Report + Source Code
org.turro.erp.task.usage.UsageEdit Class Reference
Inheritance diagram for org.turro.erp.task.usage.UsageEdit:
Collaboration diagram for org.turro.erp.task.usage.UsageEdit:

Public Member Functions

void onUser (Event event)
 
void onOK ()
 
void onSave ()
 
void onCancel ()
 
void onSelect $task ()
 
void onChange $hghumanres ()
 
void onChange $hgresource ()
 
void onChange $pgprovider ()
 
void onChange $pgproduct ()
 
void onSelect $purchaseMode ()
 

Detailed Description

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

Definition at line 51 of file UsageEdit.java.

Member Function Documentation

◆ $hghumanres()

void onChange org.turro.erp.task.usage.UsageEdit.$hghumanres ( )

Definition at line 174 of file UsageEdit.java.

174  {
175  onChange$hgresource();
176  }
Here is the call graph for this function:

◆ $hgresource()

void onChange org.turro.erp.task.usage.UsageEdit.$hgresource ( )

Definition at line 178 of file UsageEdit.java.

178  {
179  HumanResourceAptitude hra = hghumanres.getObjectValue();
180  Resource ra = hgresource.getObjectValue();
181  wrongapt.setVisible(false);
182  if(hra != null && hra.getAptitudeDegree() != null &&
183  ra != null && ra.getAptitudeDegrees() != null) {
184  wrongapt.setVisible(!hra.getAptitudeDegree().isIn(ra.getAptitudeDegrees()));
185  }
186  if(hra != null) {
187  ResourceUsageValuation ruv = new ResourceUsageValuation(
188  hra.getHumanResource(), ra, hra.getAptitudeDegree(),
189  assesment.getObjectValue(), hgdedication.getValue());
190  cost.setValue(ruv.getUnitCost());
191  cost.setEstimated(ruv.getUnitCost());
192  cost.updateStatus();
193  price.setValue(ruv.getUnitPrice());
194  price.setEstimated(ruv.getUnitPrice());
195  price.updateStatus();
196  }
197  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ $pgproduct()

void onChange org.turro.erp.task.usage.UsageEdit.$pgproduct ( )

Definition at line 207 of file UsageEdit.java.

207  {
208  IProduct product = pgproduct.getObjectValue();
209  movbutton.setIProduct(product);
210  if(product != null) {
211  if(product.getProductByContractor() != null) {
212  Contract ctc = product.getProductByContractor().getContract();
213  pgprovider.setObjectValue(ctc);
214  }
215  ProductUsageValuation puv = new ProductUsageValuation(product);
216  cost.setValue(puv.getUnitCost());
217  cost.setEstimated(puv.getUnitCost());
218  cost.updateStatus();
219  price.setValue(puv.getUnitPrice());
220  price.setEstimated(puv.getUnitPrice());
221  price.updateStatus();
222  }
223  }
Here is the call graph for this function:

◆ $pgprovider()

void onChange org.turro.erp.task.usage.UsageEdit.$pgprovider ( )

Definition at line 199 of file UsageEdit.java.

199  {
200  Contract ctc = pgprovider.getObjectValue();
201  if(ctc != null) {
202  pgproduct.setContractorId(ctc.getId());
203  pgtype.setData(ctc, 0, 0);
204  }
205  }
void setData(Contract contract, long lineTypeId, long contractPreferenceId)
Here is the call graph for this function:

◆ $purchaseMode()

void onSelect org.turro.erp.task.usage.UsageEdit.$purchaseMode ( )

Definition at line 225 of file UsageEdit.java.

225  {
226  purchaseDate.setVisible(purchaseMode.getObjectValue().equals(PurchaseMode.PURCHASE_ON_DATE));
227  purchaseTask.setVisible(purchaseMode.getObjectValue().equals(PurchaseMode.PURCHASE_ON_TASK_START));
228  }
Here is the caller graph for this function:

◆ $task()

void onSelect org.turro.erp.task.usage.UsageEdit.$task ( )

Definition at line 170 of file UsageEdit.java.

Here is the call graph for this function:

◆ onCancel()

void org.turro.erp.task.usage.UsageEdit.onCancel ( )

Definition at line 166 of file UsageEdit.java.

166  {
167  usageForm.detach();
168  }

◆ onOK()

void org.turro.erp.task.usage.UsageEdit.onOK ( )

Definition at line 122 of file UsageEdit.java.

122  {
123  onSave();
124  }
Here is the call graph for this function:

◆ onSave()

void org.turro.erp.task.usage.UsageEdit.onSave ( )

Definition at line 126 of file UsageEdit.java.

126  {
127  if(object instanceof RequiredUsage) {
128  RequiredUsage ru = (RequiredUsage) object;
129  ru.setTask(task.getObjectValue());
130  ru.setPurchaseMode(purchaseMode.getObjectValue());
131  ru.setPurchaseDate(purchaseDate.getValue());
132  ru.setPurchaseTask(purchaseTask.getObjectValue());
133  ru.setPurchaseLag(((Number) lag.getNumber()).doubleValue());
134  ru.setDescription(description.getValue());
135  if(ru.isHumanResourceType()) {
136  ru.setHumanResourceAptitude(hghumanres.getObjectValue());
137  ru.setResource(hgresource.getObjectValue());
138  ru.setAptitudeAssesment(assesment.getObjectValue());
139  ru.setUnits(((Number) hghours.getNumber()).doubleValue());
140  ru.setDedication(hgdedication.getValue());
141  ru.setCanChange(hgvariable.isChecked());
142  } else if(ru.isProductType()) {
143  ru.setUnits(((Number) pgquantity.getNumber()).doubleValue());
144  ru.setProvider(pgprovider.getObjectValue());
145  ru.setIProduct(pgproduct.getObjectValue());
146  ru.setProviderFixed(fixed.isChecked());
147  if(pgtype.getObjectValue() != null) {
148  ru.setLineTypeId(pgtype.getObjectValue().getId());
149  ru.setContractPreferenceId(pgtype.getObjectValue().getContractPreference().getId());
150  } else {
151  ru.setLineTypeId(0L);
152  ru.setContractPreferenceId(0L);
153  }
154  }
155  if(!cost.isCalculated() || maximum.isChecked()) {
156  ru.setCost(cost.getValue());
157  ru.setCostMaximum(maximum.isChecked());
158  }
159  if(!price.isCalculated()) {
160  ru.setPrice(price.getValue());
161  }
162  }
163  usageForm.detach();
164  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onUser()

void org.turro.erp.task.usage.UsageEdit.onUser ( Event  event)

Definition at line 74 of file UsageEdit.java.

74  {
75  object = event.getData();
76  if(object instanceof RequiredUsage) {
77  RequiredUsage ru = (RequiredUsage) object;
78  task.setWorkOrder(ru.getTask().getOrderReference().getWorkOrder(), ru.getTask());
79  task.setObjectValue(ru.getTask());
80  purchaseMode.setObjectValue(ru.getPurchaseMode());
81  purchaseDate.setValue(ru.getPurchaseDate());
82  purchaseTask.setWorkOrder(ru.getTask().getOrderReference().getWorkOrder());
83  purchaseTask.setObjectValue(ru.getPurchaseTask());
84  lag.setValue(ru.getPurchaseLag());
85  description.setValue(ru.getDescription());
86  if(ru.isHumanResourceType()) {
87  hghumanres.setTask(ru.getTask());
88  hghumanres.setObjectValue(ru.getHumanResourceAptitude());
89  hgresource.setObjectValue(ru.getResource());
90  assesment.setObjectValue(ru.getAptitudeAssesment());
91  hghours.setValue(ru.getUnits());
92  hgdedication.setValue(ru.getDedication());
93  hgvariable.setChecked(ru.isCanChange());
94  } else if(ru.isProductType()) {
95  pgquantity.setValue(ru.getUnits());
96  pgprovider.setObjectValue(ru.getProvider());
97  pgproduct.setContractorId(ru.getProviderId());
98  pgproduct.setObjectValue(ru.getIProduct());
99  fixed.setChecked(ru.isProviderFixed());
100  movbutton.setIProduct(ru.getIProduct());
101  pgtype.setData(ru.getProvider(), ru.getLineTypeId(), ru.getContractPreferenceId());
102  }
103  if(ru.getView() == null) {
104  view.setObjectValue(ru.getTask().getOrderReference().getWorkOrder().getView());
105  } else {
106  view.setObjectValue(ru.getView());
107  }
108  cost.setValue(ru.getCost());
109  cost.setEstimated(ru.getCalculatedUnitCost());
110  cost.updateStatus();
111  maximum.setChecked(ru.isCostMaximum());
112  price.setValue(ru.getPrice());
113  price.setEstimated(ru.getUnitPrice());
114  price.updateStatus();
115  humangroup.setVisible(ru.isHumanResourceType());
116  productgroup.setVisible(ru.isProductType());
117  }
118  onChange$hgresource();
119  onSelect$purchaseMode();
120  }
Here is the call graph for this function:

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