|
|
@ -180,16 +180,14 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|
|
|
return sumTotal;
|
|
|
|
return sumTotal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
protected void setApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
|
|
|
|
|
|
|
|
public void updateApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (orderedChanged)
|
|
|
|
if (orderedChanged)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (OrderItem item : order.getItems())
|
|
|
|
for (OrderItem item : order.getItems())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RequirementItem rItem = item.getReqItem();
|
|
|
|
RequirementItem rItem = item.getReqItem();
|
|
|
|
|
|
|
|
|
|
|
|
if (rItem != null)
|
|
|
|
if (rItem != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rItem.setOrderNum(order.isOrdered() ? order.getNumser() : null);
|
|
|
|
rItem.setOrderNum(order.isOrdered() ? order.getNumser() : null);
|
|
|
@ -197,7 +195,23 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
|
|
|
|
|
|
|
public void addApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.add(order);
|
|
|
|
|
|
|
|
this.setApprovedItems(order, orderedChanged);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
|
|
|
|
|
|
|
|
public void updateApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.setApprovedItems(order, orderedChanged);
|
|
|
|
super.update(order);
|
|
|
|
super.update(order);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|