diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index d52178c8..bf312895 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -144,7 +144,8 @@ public class Constants { new ReportMapping(MOD_TRIPBILL, new Report(4, true, "Vyúčtování", "tripBill", false, true, true)), new ReportMapping(MOD_ORDER, new Report(5, false, "Objednávka", "order", true, true)), new ReportMapping(MOD_REQUIREMENTS, new Report(6, false, "Požadavky", "requirements")), - new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true)) + new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true)), + new ReportMapping(MOD_REQUIREMENTS, new Report(8, true, "Protokol o kontrole", "orderRequirement", false, true)) }; public final static String REQTYPE_ORDER = "ORDER"; diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java index 60f89199..a022da7a 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java @@ -475,6 +475,7 @@ public abstract class RequirementBaseServiceImpl exte } @Override + @Transactional public boolean prepareSignData(T entity, Date approveDate) { SignData data = new SignData(); sessionData.setProperty(Constants.KEY_SIGN_DATA, data); @@ -502,15 +503,23 @@ public abstract class RequirementBaseServiceImpl exte data.setSignDate(approveDate); data.setSigned(signedDocumentService.getItem(entityForSignReport(entity), report.getReportId()) != null); - if (entity.getState() == RequirementState.NEW) { - data.setAreaId(1); - } else { - loadAuthItems(entity); - data.setAreaId(entity.getAuthorization().size() + 1); - } + if (getNextWorkflow(entity).getCentre()) { // viditelné podpisy lze pouze na urovni strediska + if (entity.getState() == RequirementState.NEW) { + data.setAreaId(1); + } else { + loadAuthItems(entity); + int wgCount = 0; + for (Workflow wf : entity.getWorkflow()) { + if (!wf.getCentre()) { + ++wgCount; + } + } + data.setAreaId(entity.getAuthorization().size() - wgCount + 1); + } - if (userService.getUserSettings().getSignatureFile() != null) { - data.setSignImg(storage.fileData(userService.getUserSettings().getSignatureFile())); + if (userService.getUserSettings().getSignatureFile() != null) { + data.setSignImg(storage.fileData(userService.getUserSettings().getSignatureFile())); + } } return true; diff --git a/src/main/webapp/WEB-INF/reports/orderRequirement.jasper b/src/main/webapp/WEB-INF/reports/orderRequirement.jasper new file mode 100644 index 00000000..e31eb080 Binary files /dev/null and b/src/main/webapp/WEB-INF/reports/orderRequirement.jasper differ diff --git a/src/main/webapp/WEB-INF/reports/orderRequirement.jrxml b/src/main/webapp/WEB-INF/reports/orderRequirement.jrxml new file mode 100644 index 00000000..ebffad28 --- /dev/null +++ b/src/main/webapp/WEB-INF/reports/orderRequirement.jrxml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="54" splitType="Stretch"> + <image onErrorType="Blank"> + <reportElement uuid="692a2c5d-a058-4f16-8c03-dd0739d45ffb" x="0" y="0" width="100" height="54"> + <printWhenExpression><![CDATA[$P{P_LOGO} != null]]></printWhenExpression> + </reportElement> + <imageExpression><![CDATA[$P{P_LOGO}]]></imageExpression> + </image> + <textField isBlankWhenNull="true"> + <reportElement uuid="42aa4bd4-8b58-4e06-b7d9-ab3f1082b739" x="100" y="0" width="455" height="20"/> + <textElement textAlignment="Center"> + <font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250"/> + </textElement> + <textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression> + </textField> + <staticText> + <reportElement uuid="3672bded-2358-40b4-a0f3-037e7fc50fa3" x="100" y="20" width="455" height="20"/> + <textElement textAlignment="Center"> + <font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250"/> + </textElement> + <text><![CDATA[Protokol o předběžné kontrole]]></text> + </staticText> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/reports/orderRequirementItems.jasper b/src/main/webapp/WEB-INF/reports/orderRequirementItems.jasper new file mode 100644 index 00000000..14d2ed96 Binary files /dev/null and b/src/main/webapp/WEB-INF/reports/orderRequirementItems.jasper differ diff --git a/src/main/webapp/WEB-INF/reports/orderRequirementItems.jrxml b/src/main/webapp/WEB-INF/reports/orderRequirementItems.jrxml new file mode 100644 index 00000000..9e779ece --- /dev/null +++ b/src/main/webapp/WEB-INF/reports/orderRequirementItems.jrxml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +