Changes the "General data" tab about subcontracting module.
Include a field called Project Type to the "Customer information area" and add a new column to specify which is the current delivery date, and set the Deadline of the project to read-only mode. FEA: ItEr75S32AnA15S04UpdateDeliveringDateInSubcontracting
This commit is contained in:
parent
1d95d90c2e
commit
d15a75d1db
3 changed files with 54 additions and 11 deletions
|
|
@ -27,6 +27,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedSet;
|
||||
|
|
@ -96,6 +97,7 @@ import org.zkoss.zul.Label;
|
|||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Row;
|
||||
import org.zkoss.zul.RowRenderer;
|
||||
import org.zkoss.zul.Rows;
|
||||
import org.zkoss.zul.SimpleListModel;
|
||||
import org.zkoss.zul.Tab;
|
||||
import org.zkoss.zul.Tabbox;
|
||||
|
|
@ -248,7 +250,6 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
|
||||
checkCreationPermissions();
|
||||
setupGlobalButtons();
|
||||
|
||||
}
|
||||
|
||||
private void setupGlobalButtons() {
|
||||
|
|
@ -1535,4 +1536,36 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isSubcontractedProject() {
|
||||
return (getOrder() != null) ? (getOrder().getExternalCode() != null)
|
||||
: false;
|
||||
}
|
||||
|
||||
public String getProjectType() {
|
||||
return (isSubcontractedProject()) ? "Subcontracted by client"
|
||||
: "Regular project";
|
||||
}
|
||||
|
||||
public void setCurrentDeliveryDate(Grid listDeliveryDates) {
|
||||
if (getOrder() != null && getOrder().getDeliveringDates() != null
|
||||
&& !getOrder().getDeliveringDates().isEmpty()) {
|
||||
DeadlineCommunication lastDeliveryDate = getOrder()
|
||||
.getDeliveringDates().first();
|
||||
if (listDeliveryDates != null) {
|
||||
listDeliveryDates.renderAll();
|
||||
final Rows rows = listDeliveryDates.getRows();
|
||||
for (Iterator i = rows.getChildren().iterator(); i.hasNext();) {
|
||||
final Row row = (Row) i.next();
|
||||
final DeadlineCommunication deliveryDate = (DeadlineCommunication) row
|
||||
.getValue();
|
||||
if (deliveryDate.equals(lastDeliveryDate)) {
|
||||
row.setSclass("current-delivery-date");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1892,3 +1892,5 @@ select {
|
|||
}
|
||||
|
||||
.communication-not-reviewed div.z-row-cnt .z-label{ font-weight: bold; }
|
||||
|
||||
.current-delivery-date div.z-row-cnt .z-label{ font-weight: bold; }
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@
|
|||
<row>
|
||||
<label value="${i18n:_('Deadline')}" />
|
||||
<datebox id="deadline"
|
||||
value="@{controller.order.deadline}" />
|
||||
value="@{controller.order.deadline}"
|
||||
disabled="@{controller.subcontractedProject}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Calendar')}" />
|
||||
|
|
@ -199,31 +200,38 @@
|
|||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${i18n:_('Project type')}" />
|
||||
<label value="@{controller.projectType}" width="350px"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('External code')}" />
|
||||
<textbox value="@{controller.order.externalCode}"
|
||||
width="350px" disabled="true"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Customer')}" />
|
||||
<bandboxSearch id="bdExternalCompanies" widthBandbox="465px" widthListbox="480px"
|
||||
finder="ExternalCompanyBandboxFinder"
|
||||
model="@{controller.externalCompaniesAreClient}"
|
||||
selectedElement="@{controller.order.customer}"/>
|
||||
<label value="${i18n:_('Customer')}" />
|
||||
<bandboxSearch id="bdExternalCompanies" widthBandbox="465px" widthListbox="480px"
|
||||
finder="ExternalCompanyBandboxFinder"
|
||||
model="@{controller.externalCompaniesAreClient}"
|
||||
selectedElement="@{controller.order.customer}"
|
||||
disabled="@{controller.subcontractedProject}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Customer reference')}" />
|
||||
<textbox value="@{controller.order.customerReference}" width="465px"/>
|
||||
<textbox value="@{controller.order.customerReference}" width="465px"
|
||||
disabled="@{controller.subcontractedProject}"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<separator spacing="20px"/>
|
||||
|
||||
<grid id="gridDeliverDate"
|
||||
<grid id="gridDeliveryDates"
|
||||
model="@{controller.deliverDates}"
|
||||
mold="paging" pageSize="4" fixedLayout="true" width="400px">
|
||||
mold="paging" pageSize="4" fixedLayout="true" width="400px"
|
||||
onInitRender="controller.setCurrentDeliveryDate(self);">
|
||||
<columns>
|
||||
<column label="${i18n:_('Deliver date')}" align="center" width="200px"/>
|
||||
<column label="${i18n:_('Delivery date')}" align="center" width="200px"/>
|
||||
<column label="${i18n:_('Communication date')}" align="center"/>
|
||||
</columns>
|
||||
<rows>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue