U požadavků se nyní zobrazuje fakturovaná částka.

Opraveno mazání objednávek- pokud je mazaná objednávka označená jako
objednaná, musíme z položek smazat číslo objednávky, aby se nabídly pro
další objednávku.
closes #193
Verze_1.0 1.3
Josef Rokos 10 years ago
parent d9fd26bbad
commit 4e2b00a957

@ -200,4 +200,22 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
super.update(order);
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())")
public void delete(Order order) {
for (OrderItem item : order.getItems())
{
RequirementItem rItem = item.getReqItem();
if (rItem != null)
{
rItem.setOrderNum(null);
requirementItemDao.modify(rItem);
}
}
super.delete(order);
}
}

@ -26,4 +26,6 @@ public interface RequirementService extends RequirementBaseService<Requirement>
public RequirementItem calcItemValuesFromItemTotal(RequirementItem item);
public BigDecimal calcSumTotalFromItems(List<RequirementItem> items);
public BigDecimal getInvoicedAmount(Requirement req);
}

@ -16,6 +16,7 @@ import java.util.Date;
import java.util.List;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@ -240,4 +241,15 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
invoicingService.add(inv);
}
}
@Override
@Transactional
public BigDecimal getInvoicedAmount(Requirement req) {
Query query = dao.getQuery("select invoice from Invoicing invoice join invoice.requirement rq where rq.id = :reqId");
query.setParameter("reqId", req.getId());
Invoicing inv = (Invoicing) query.uniqueResult();
return inv != null ? inv.getTotalInvoiced() : null;
}
}

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectAll", null);
}
public BigDecimal getInvoicedAmount() {
if (getDataBean() != null) {
return requirementService.getInvoicedAmount(getDataBean());
} else {
return null;
}
}
@Override
@NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" })
public void setDataBean(Requirement data) {
super.setDataBean(data);
}
}

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectCentre", null);
}
public BigDecimal getInvoicedAmount() {
if (getDataBean() != null) {
return requirementService.getInvoicedAmount(getDataBean());
} else {
return null;
}
}
@Override
@NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" })
public void setDataBean(Requirement data) {
super.setDataBean(data);
}
}

@ -7,6 +7,7 @@ import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -64,4 +65,18 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null);
}
public BigDecimal getInvoicedAmount() {
if (getDataBean() != null) {
return requirementService.getInvoicedAmount(getDataBean());
} else {
return null;
}
}
@Override
@NotifyChange({ "dataBean", "ableToDelete", "canApprove", "invoicedAmount" })
public void setDataBean(Requirement data) {
super.setDataBean(data);
}
}

@ -40,6 +40,8 @@ RequirementItemUnitPrice=Jedn. cena
RequirementItemTotal=Celkem
RequirementItemDescription=Poznámka
RequirementInvoicedAmount=Fakturovaná částka:
AgendaMyOrders=Aktuální
AgendaOrdersHistory=Ukončené

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<include src="/main/approveStatus.zul" />
<vbox>
<include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div>
</hbox>

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<include src="/main/approveStatus.zul" />
<vbox>
<include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div>
</hbox>

@ -188,6 +188,14 @@
</template>
</listbox>
<div hflex="3">
<include src="/main/approveStatus.zul" />
<vbox>
<include src="/main/approveStatus.zul" />
<hbox visible="@load(not empty vm.invoicedAmount)">
<label value="${labels.RequirementInvoicedAmount}"/>
<label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
</hbox>
</vbox>
</div>
</hbox>

Loading…
Cancel
Save