|
|
|
@ -180,16 +180,14 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|
|
|
|
return sumTotal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
|
|
|
|
|
public void updateApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
|
protected void setApprovedItems(Order order, boolean orderedChanged)
|
|
|
|
|
{
|
|
|
|
|
if (orderedChanged)
|
|
|
|
|
{
|
|
|
|
|
for (OrderItem item : order.getItems())
|
|
|
|
|
{
|
|
|
|
|
RequirementItem rItem = item.getReqItem();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rItem != 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|