Limit komise se nyní počítá z vyfakturované částky zadané ve fakturaci

požadavků.
closes #167
Verze_1.0
Josef Rokos 10 years ago
parent 6ccd2a91a3
commit 8f248de094

@ -9,15 +9,20 @@ import info.bukova.isspst.services.LazyLoader;
import java.math.BigDecimal;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.springframework.transaction.annotation.Transactional;
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
InvoicingService {
@Override
@Transactional
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup) {
// TODO Auto-generated method stub
return null;
Query q = dao.getQuery("select sum(inv.totalInvoiced) "
+ "from Invoicing inv join inv.requirement rq join rq.workgroup w "
+ "where w = :workgroup ");
q.setParameter("workgroup", workgroup);
return (BigDecimal) q.uniqueResult();
}
@Override

@ -72,7 +72,7 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
if (entity.getWorkgroup() != null && entity.getWorkgroup().getLimit() != null && entity.getWorkgroup().getLimit().compareTo(BigDecimal.ZERO) != 0)
{
BigDecimal total = null;//orderService.totalOrderedForWorkgroup(entity.getWorkgroup());
BigDecimal total = invoicingService.totalInvoicedForWorkgroup(entity.getWorkgroup());
if (total == null)
{

@ -3,7 +3,7 @@ package info.bukova.isspst.ui.dashboard;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.orders.OrderService;
import info.bukova.isspst.services.invoicing.InvoicingService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.DocumentViewModel;
@ -24,7 +24,7 @@ public class DashBoardVM extends DocumentViewModel {
@WireVariable
private UserService userService;
@WireVariable
private OrderService orderService;
private InvoicingService invoicingService;
private User user;
private Map<Workgroup, List<Role>> groupRoles;
private Map<Workgroup, BigDecimal> workgroupSpent;
@ -47,7 +47,7 @@ public class DashBoardVM extends DocumentViewModel {
for (Workgroup w : wg) {
List<Role> r = workgroupService.getUserWorkgroupRoles(w, user);
groupRoles.put(w, r);
workgroupSpent.put(w, orderService.totalOrderedForWorkgroup(w));
workgroupSpent.put(w, invoicingService.totalInvoicedForWorkgroup(w));
}
}

@ -20,7 +20,7 @@ public class InvoicingForm extends FormViewModel<Invoicing> {
@Init(superclass = true)
public void init() {
selectedIndex = -1;
}
private void selectItem(InvoicingItem item) {

Loading…
Cancel
Save