U sestavy "Objednávka" lze nyní nastavit, jestli se bude tisknout s

cenami, nebo bez cen.
closes #151
multitenant
Josef Rokos 10 years ago
parent 6e62ea2070
commit 8fbfb51c0a

@ -114,7 +114,7 @@ public class Constants {
new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresa", "address", false, true)),
new ReportMapping(MOD_TRIPBILL, new Report("Žádost", "tripRequirement", false, true)),
new ReportMapping(MOD_TRIPBILL, new Report("Vyúčtování", "tripBill", false, true)),
new ReportMapping(MOD_ORDER, new Report("Objednávka", "order", false, true))
new ReportMapping(MOD_ORDER, new Report("Objednávka", "order", true, true))
};
public final static String REQTYPE_ORDER = "ORDER";

@ -1,5 +1,8 @@
package info.bukova.isspst.reporting;
import java.util.HashMap;
import java.util.Map;
import info.bukova.isspst.data.AuthItem;
import info.bukova.isspst.data.Order;
import info.bukova.isspst.data.TripBill;
@ -30,7 +33,15 @@ public class ParamFiller {
return;
}
Map<String, Object> params = new HashMap<String, Object>();
for (String paramKey : definition.getParams().keySet()) {
if (paramKey.startsWith("SET_")) {
params.put(paramKey, definition.getParam(paramKey));
}
}
definition.getParams().clear();
definition.getParams().putAll(params);
if ((definition.getDataSet().get(0) instanceof TripBill)
&& definition.getReport().isSingleRecord()) {

@ -0,0 +1,29 @@
package info.bukova.isspst.ui.reporting;
import info.bukova.isspst.reporting.ReportDefinition;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class OrderOptionsVM {
private boolean printPrices;
@WireVariable
private ReportDefinition reportDefinition;
@Init
public void init() {
printPrices = true;
reportDefinition.setParam("SET_PRICES", true);
}
public boolean isPrintPrices() {
return printPrices;
}
public void setPrintPrices(boolean printPrices) {
this.printPrices = printPrices;
reportDefinition.setParam("SET_PRICES", printPrices);
}
}

@ -327,6 +327,7 @@ OrderFormOrdered=Objednáno
OrderFormDeliveredDate=Dodáno dne
OrderFormInvoiceNumber=Číslo faktury
OrderFormInvoiceTotal=Částka faktury
OrderPrintPrices=Tisknout ceny
HandleComboKeyFilter=#del
HandleComboKey=$#del

@ -7,6 +7,9 @@
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
</parameter>
<parameter name="P_STAMP" class="java.lang.String"/>
<parameter name="SET_PRICES" class="java.lang.Boolean">
<defaultValueExpression><![CDATA[true]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
@ -265,6 +268,9 @@
<band height="63" splitType="Stretch">
<subreport>
<reportElement uuid="f584d121-262a-4149-bd05-b8c6bb15d93a" x="-1" y="0" width="574" height="63"/>
<subreportParameter name="SET_PRICES">
<subreportParameterExpression><![CDATA[$P{SET_PRICES}]]></subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{items})]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "orderItems.jasper"]]></subreportExpression>
</subreport>

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="orderItems" pageWidth="572" pageHeight="752" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="232c2ae2-9163-4417-91b4-28c74f8bc41f">
<property name="ireport.zoom" value="2.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.zoom" value="4.0"/>
<property name="ireport.x" value="160"/>
<property name="ireport.y" value="0"/>
<parameter name="SET_PRICES" class="java.lang.Boolean">
<defaultValueExpression><![CDATA[true]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
@ -36,12 +39,16 @@
<text><![CDATA[Mn.]]></text>
</staticText>
<staticText>
<reportElement uuid="ee72ef7d-dadc-4e94-8846-250981ff4e63" x="80" y="0" width="65" height="20"/>
<reportElement uuid="ee72ef7d-dadc-4e94-8846-250981ff4e63" x="80" y="0" width="65" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Cena za j.]]></text>
</staticText>
<staticText>
<reportElement uuid="2b06065f-5628-4a1e-9f3a-ca458ade7299" x="145" y="0" width="65" height="20"/>
<reportElement uuid="2b06065f-5628-4a1e-9f3a-ca458ade7299" x="145" y="0" width="65" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Odhad ceny]]></text>
</staticText>
@ -78,7 +85,9 @@
<reportElement uuid="67cabd9c-747d-432d-b922-75d72953a877" x="79" y="0" width="1" height="19"/>
</line>
<line>
<reportElement uuid="812bb1e0-fd64-4387-99cb-a158422c3eb2" x="145" y="0" width="1" height="19"/>
<reportElement uuid="812bb1e0-fd64-4387-99cb-a158422c3eb2" x="145" y="0" width="1" height="19">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="13d5bc47-3500-42c4-994b-20bf68db7281" x="209" y="0" width="1" height="19"/>
@ -107,14 +116,18 @@
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="d3c2c155-3cf9-4a5f-afc0-2353aa2ea2f5" x="80" y="0" width="65" height="25"/>
<reportElement uuid="d3c2c155-3cf9-4a5f-afc0-2353aa2ea2f5" x="80" y="0" width="65" height="25">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<paragraph rightIndent="3"/>
</textElement>
<textFieldExpression><![CDATA[$F{unitPrice}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="7dc10ede-575b-44e1-90dd-9edb5cc861d7" x="145" y="0" width="65" height="25"/>
<reportElement uuid="7dc10ede-575b-44e1-90dd-9edb5cc861d7" x="145" y="0" width="65" height="25">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<paragraph rightIndent="3"/>
</textElement>
@ -160,7 +173,9 @@
<reportElement uuid="d6655b1c-9e79-4ed0-b356-0959c660631b" x="209" y="0" width="1" height="25"/>
</line>
<line>
<reportElement uuid="d21f27bd-7dba-4db4-bf10-c61b3f09bafa" x="145" y="0" width="1" height="25"/>
<reportElement uuid="d21f27bd-7dba-4db4-bf10-c61b3f09bafa" x="145" y="0" width="1" height="25">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="38311c93-86f7-4904-aace-07f09b1dd0ef" x="236" y="0" width="1" height="25"/>
@ -176,30 +191,42 @@
<summary>
<band height="21" splitType="Stretch">
<textField pattern="#,##0.00 ¤" isBlankWhenNull="true">
<reportElement uuid="36f46c1d-603e-466e-849a-7cd1fcb66e9c" x="41" y="0" width="168" height="20"/>
<reportElement uuid="36f46c1d-603e-466e-849a-7cd1fcb66e9c" x="41" y="0" width="168" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<paragraph rightIndent="3"/>
</textElement>
<textFieldExpression><![CDATA[$V{total_1}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="4263f8a4-6a87-4191-a742-384229c4ab70" x="210" y="0" width="173" height="20"/>
<reportElement uuid="4263f8a4-6a87-4191-a742-384229c4ab70" x="210" y="0" width="173" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<paragraph leftIndent="3"/>
</textElement>
<text><![CDATA[Odhadovaná cena za objednávku]]></text>
</staticText>
<line>
<reportElement uuid="5dc5af3c-46bf-41a7-a673-cfd2823de547" x="40" y="20" width="343" height="1"/>
<reportElement uuid="5dc5af3c-46bf-41a7-a673-cfd2823de547" x="40" y="20" width="343" height="1">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="699e76f2-635f-40f9-a479-4aea007ffb94" x="40" y="0" width="1" height="20"/>
<reportElement uuid="699e76f2-635f-40f9-a479-4aea007ffb94" x="40" y="0" width="1" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="523d41a3-0b2b-4edc-b74c-91ce30aada9a" x="209" y="0" width="1" height="20"/>
<reportElement uuid="523d41a3-0b2b-4edc-b74c-91ce30aada9a" x="209" y="0" width="1" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="3bdb17d3-12df-4885-aba6-ef84c6e7023a" x="382" y="0" width="1" height="20"/>
<reportElement uuid="3bdb17d3-12df-4885-aba6-ef84c6e7023a" x="382" y="0" width="1" height="20">
<printWhenExpression><![CDATA[$P{SET_PRICES}]]></printWhenExpression>
</reportElement>
</line>
<line>
<reportElement uuid="19a87388-8b81-48fb-b60b-ef3fe1facdc1" x="0" y="0" width="1" height="21"/>

@ -0,0 +1,8 @@
<?page title="order" contentType="text/html;charset=UTF-8"?>
<zk>
<groupbox mold="3d" closable="false" width="270px" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vmOpt') @init('info.bukova.isspst.ui.reporting.OrderOptionsVM')">
<caption label="${labels.ReportOptions}"></caption>
<checkbox label="${labels.OrderPrintPrices}" checked="@bind(vmOpt.printPrices)"/>
</groupbox>
</zk>
Loading…
Cancel
Save