Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1  -->
  3. <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="pharmhub-manufacturer-income-all" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2fc23dba-c4b0-4693-bc9d-30176507bee3">
  4.     <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
  5.     <property name="com.jaspersoft.studio.data.defaultdataadapter" value="db4pharmhub"/>
  6.     <parameter name="manufacturer_single" class="java.lang.String"/>
  7.     <parameter name="manufacturers_goods" class="java.lang.String"/>
  8.     <parameter name="campaigns_endpoints_manual" class="java.lang.String"/>
  9.     <parameter name="start_date_required" class="java.sql.Date"/>
  10.     <parameter name="end_date_required" class="java.sql.Date">
  11.         <parameterDescription><![CDATA[]]></parameterDescription>
  12.     </parameter>
  13.     <parameter name="show_empty_endpoints" class="java.lang.Boolean">
  14.         <defaultValueExpression><![CDATA[false]]></defaultValueExpression>
  15.     </parameter>
  16.     <parameter name="show_empty_endpoints_sql" class="java.lang.Boolean" isForPrompting="false">
  17.         <defaultValueExpression><![CDATA[$P{show_empty_endpoints}.equals(true) ? "" : "WHERE union_turnovers.endpoint IS NOT NULL"]]></defaultValueExpression>
  18.     </parameter>
  19.     <parameter name="Parameter1" class="java.lang.Float" nestedType="java.lang.Float">
  20.         <parameterDescription><![CDATA[singlepackprice]]></parameterDescription>
  21.     </parameter>
  22.     <queryString language="SQL">
  23.         <![CDATA[WITH dates AS (
  24.   SELECT
  25.     $P{start_date_required}::TIMESTAMP - INTERVAL '3 hours' AS "begin", -- convert to MSK TZ
  26.     $P{end_date_required}::TIMESTAMP + INTERVAL '21 hours' AS "end"
  27. ),
  28.  
  29. -- точки продажи, по которым берутся данные
  30. endpoints AS (
  31.   SELECT e.id, e.client
  32.   FROM "Endpoints" e
  33.   JOIN "Clients" p ON p.id = e.client AND p.deleted = FALSE AND p.status = 'active'
  34.   WHERE e.deleted = FALSE
  35.     AND e.status = 'active'
  36.     AND (p.data ->> 'participatesInCampaigns') = 'true'
  37.     AND coalesce(coalesce(e.data, '{}'::JSONB) ->> 'excludedFromCampaigns', 'false') <> 'true'
  38.     AND ($P{campaigns_endpoints_manual} IS NULL OR $X{IN, lower(e.id::VARCHAR), campaigns_endpoints_manual})
  39. ),
  40.  
  41. -- Точки продажи, для которых данные берутся из заказов
  42. -- (не выгружают обороты или есть какие-то проблемы).
  43. manual_order_endpoints AS (
  44.   SELECT e.id
  45.   FROM endpoints e
  46.   WHERE NOT EXISTS(
  47.     SELECT 1
  48.     FROM dates
  49.     JOIN "NomenclatureTurnovers" nt ON nt.endpoint = e.id
  50.       AND nt."date" >= dates.begin AND nt."date" < dates.end
  51.   )
  52.       AND ($P{campaigns_endpoints_manual} IS NULL OR $X{IN, lower(e.id::VARCHAR), campaigns_endpoints_manual})
  53. ),
  54.  
  55. -- Точки продажи, для которых данные берутся из оборотов
  56. -- (все точки минус точки по заказам)
  57. turnover_endpoints AS (
  58.   SELECT
  59.     endpoints.*
  60.   FROM endpoints
  61.   WHERE NOT EXISTS(SELECT 1 FROM manual_order_endpoints WHERE manual_order_endpoints.id = endpoints.id)
  62. ),
  63.  
  64. -- Препараты производителя
  65. goods AS (
  66.     SELECT
  67.         ce."EAN",
  68.         max(coalesce(ce.title, rg.title)) AS title,
  69.         avg(ce.price)::NUMERIC(20, 2) AS price
  70.     FROM "CampaignEAN" ce
  71.     JOIN "CampaignGood" cg ON cg.id = ce.good
  72.     JOIN "Campaigns" c ON
  73.         c.id = cg.campaign AND
  74.         c.client = $P{manufacturer_single}::UUID AND
  75.         c."isActive" = TRUE AND
  76.         (NOW() AT TIME ZONE 'UTC') < c."endDate" AND
  77.         c.deleted = FALSE
  78.     LEFT JOIN "ResellerGoods" rg ON rg."EAN" = ce."EAN"
  79.     WHERE ce."EAN" NOT LIKE 'PH.%'
  80.       AND ($P{manufacturers_goods} IS NULL OR $X{IN, ce."EAN", manufacturers_goods})
  81.     GROUP BY ce."EAN"
  82. ),
  83.  
  84. turnovers_goods AS (
  85.     SELECT
  86.         nt.*,
  87.         goods."EAN" AS goods_ean,
  88.         goods.title AS goods_title,
  89.         goods.price AS goods_price
  90.     FROM turnover_endpoints e
  91.     JOIN goods ON TRUE
  92.     JOIN dates ON TRUE
  93.     JOIN "NomenclatureTurnovers" nt ON nt.endpoint = e.id
  94.       AND nt."EAN" = goods."EAN"
  95.       AND nt."date" >= dates.begin AND nt."date" < dates.END
  96.     UNION ALL
  97.     SELECT
  98.         nt.*,
  99.         goods."EAN" AS goods_ean,
  100.         goods.title AS goods_title,
  101.         goods.price AS goods_price
  102.     FROM turnover_endpoints e
  103.     JOIN goods ON TRUE
  104.     JOIN dates ON TRUE
  105.     JOIN "Nomenclatures" n ON n.client = e.client AND n."clientEAN" = goods."EAN"
  106.     JOIN "NomenclatureTurnovers" nt ON nt.endpoint = e.id
  107.       AND nt."nomenclatureCode" = n.nomenclature
  108.       AND nt."EAN" IS NULL
  109.       AND nt."date" >= dates.begin AND nt."date" < dates.END
  110. ),
  111.  
  112. turnovers AS (
  113.   SELECT
  114.     endpoint,
  115.     "date",
  116.     reseller,
  117.     "resellerCode",
  118.     "EAN",
  119.     "title",
  120.     "incomeQuantity",
  121.     income,
  122.     price
  123.   FROM (
  124.     SELECT
  125.         nt.price,
  126.         t.endpoint,
  127.         t."date",
  128.         r.title AS reseller,
  129.         ntr."resellerCode",
  130.         t.goods_ean AS "EAN",
  131.         t.goods_title AS title,
  132.         ntr."quantityDebit" AS "incomeQuantity",
  133.         ntr."quantityDebit" * coalesce(t.goods_price, ntr."priceDebit") AS income,
  134.         row_number() OVER (
  135.             PARTITION BY
  136.                 nt.price,
  137.                 t.endpoint,
  138.                 t."date",
  139.                 t."nomenclatureCode",
  140.                 t."EAN",
  141.                 t."quantityEnd",
  142.                 ntr."quantityDebit",
  143.                 ntr."resellerCode"
  144.         )
  145.     FROM turnovers_goods t
  146.     JOIN "NomenclatureTurnoversResellers" ntr ON ntr."nomenclatureTurnover" = t.id
  147.     JOIN "NomenclatureTurnoversSettings" nts ON nts.endpoint = t.endpoint AND nts."resellerCode" = ntr."resellerCode"
  148.     JOIN "Clients" r ON r.id = nts.reseller
  149.     JOIN "NomenclatureTurnovers" nt ON nt.endpoint = e.id
  150.         WHERE (
  151.             NOT EXISTS(
  152.                 SELECT 1
  153.                 FROM "ManufacturerResellers" mr
  154.                 WHERE mr.manufacturer = $P{manufacturer_single}::UUID
  155.             ) OR EXISTS(
  156.                 SELECT 1
  157.                 FROM "ManufacturerResellers" mr
  158.                 WHERE mr.manufacturer = $P{manufacturer_single}::UUID AND mr.reseller = nts.reseller
  159.             )
  160.         )
  161.   ) turnovers_with_duplicates
  162.   WHERE row_number = 1
  163. ),
  164.  
  165. -- Данные по заказам
  166. order_endpoints AS (
  167.   SELECT
  168.     manual_order_endpoints.id AS endpoint,
  169.     r.id AS reseller
  170.   FROM manual_order_endpoints
  171.   JOIN "Contracts" c ON c."buyerEndpoint" = manual_order_endpoints.id AND (c.status = 'approved' OR c.status = 'paused') AND c."resellerType" = 'reseller'
  172.   JOIN "Clients" r ON r.id = c.seller
  173.   GROUP BY manual_order_endpoints.id, r.id
  174. ),
  175.  
  176. orders AS (
  177.   SELECT
  178.     o.id,
  179.     o.endpoint
  180.   FROM dates
  181.   JOIN "Orders" o ON o."dateSent" >= dates."begin" AND o."dateSent" < dates."end" AND o.status = 'sent'
  182.   JOIN order_endpoints ON o.endpoint = order_endpoints.endpoint
  183.   GROUP BY o.id, o.endpoint
  184. ),
  185.  
  186. order_turnovers as (
  187.   SELECT
  188.     orders.endpoint,
  189.     oi."date",
  190.     r.title AS reseller,
  191.     goods."EAN",
  192.     goods.title,
  193.     oi.quantity AS "incomeQuantity",
  194.     oi.quantity * goods.price AS income,
  195.     nt.price
  196.   FROM "OrderItems" oi
  197.   JOIN "OrderResellers" ors ON oi."orderReseller" = ors.id
  198.   JOIN "Clients" r ON r.id = ors.reseller
  199.   JOIN orders ON orders.id = ors."order"
  200.   JOIN goods ON goods."EAN" = coalesce(oi.offer ->> 'EAN', oi.offer ->> 'ean')
  201.   JOIN "Endpoints" e ON "Clients".id = e.client
  202.   JOIN "NomenclatureTurnovers" nt ON e.id = "NomenclatureTurnovers".endpoint
  203.   WHERE oi.type = 'order'
  204.       AND (
  205.             NOT EXISTS(
  206.                 SELECT 1
  207.                 FROM "ManufacturerResellers" mr
  208.                 WHERE mr.manufacturer = $P{manufacturer_single}::UUID
  209.             ) OR EXISTS(
  210.                     SELECT 1
  211.                     FROM "ManufacturerResellers" mr
  212.                     WHERE mr.manufacturer = $P{manufacturer_single}::UUID AND mr.reseller = r.id
  213.             )
  214.         )
  215. ),
  216.  
  217. union_turnovers as (
  218.   SELECT
  219.     turnovers.endpoint,
  220.     turnovers."date",
  221.     turnovers.reseller,
  222.     turnovers."resellerCode",
  223.     turnovers."title",
  224.     turnovers."EAN",
  225.     turnovers."incomeQuantity",
  226.     turnovers.income
  227.   FROM turnovers
  228.   UNION ALL
  229.   SELECT
  230.     order_turnovers.endpoint,
  231.     order_turnovers."date",
  232.     order_turnovers.reseller,
  233.     'По нашим заказам' AS "resellerCode",
  234.     order_turnovers."title",
  235.     order_turnovers."EAN",
  236.     order_turnovers."incomeQuantity",
  237.     order_turnovers.income,
  238.     order_turnovers.price
  239.   FROM order_turnovers
  240. )
  241.  
  242. SELECT
  243.   union_turnovers.price as "pack",
  244.   m.title AS manufacturer,
  245.   union_turnovers."EAN",
  246.   union_turnovers.title,
  247.   p.title AS client,
  248.   e."legalTitle" || ', ' || e.incorporation AS endpoint,
  249.   e.inn,
  250.   e."physicalAddress" AS address,
  251.   sum(union_turnovers."incomeQuantity") AS "incomeQuantity",
  252.   sum(union_turnovers.income)::NUMERIC(20, 2) AS income,
  253.   union_turnovers.reseller,
  254.   union_turnovers."resellerCode",
  255.   to_char(union_turnovers."date" + INTERVAL '3 hours', 'MM.YYYY') AS "month"
  256. FROM endpoints
  257. LEFT JOIN union_turnovers ON union_turnovers.endpoint = endpoints.id
  258. JOIN "Endpoints" e ON e.id = endpoints.id
  259. JOIN "Clients" p ON p.id = e.client
  260. JOIN "Clients" m ON m.id = $P{manufacturer_single}::UUID
  261.  
  262. $P!{show_empty_endpoints_sql}
  263. GROUP BY
  264.   m.id,
  265.   p.id,
  266.   e.id,
  267.   union_turnovers."EAN",
  268.   union_turnovers.title,
  269.   union_turnovers.reseller,
  270.   union_turnovers."resellerCode",
  271.   to_char(union_turnovers."date" + INTERVAL '3 hours', 'MM.YYYY')
  272. ORDER BY title, client, endpoint, address, "month";]]>
  273.     </queryString>
  274.     <field name="manufacturer" class="java.lang.String"/>
  275.     <field name="EAN" class="java.lang.String"/>
  276.     <field name="title" class="java.lang.String"/>
  277.     <field name="client" class="java.lang.String"/>
  278.     <field name="endpoint" class="java.lang.String"/>
  279.     <field name="inn" class="java.lang.String"/>
  280.     <field name="address" class="java.lang.String"/>
  281.     <field name="incomeQuantity" class="java.lang.Float"/>
  282.     <field name="income" class="java.math.BigDecimal"/>
  283.     <field name="reseller" class="java.lang.String"/>
  284.     <field name="resellerCode" class="java.lang.String"/>
  285.     <field name="month" class="java.lang.String"/>
  286.     <field name="pack" class="java.lang.Float"/>
  287.     <variable name="incomeQuantityTotal" class="java.lang.Float" calculation="Sum">
  288.         <variableExpression><![CDATA[$F{incomeQuantity}]]></variableExpression>
  289.         <initialValueExpression><![CDATA[0]]></initialValueExpression>
  290.     </variable>
  291.     <variable name="incomeTotal" class="java.math.BigDecimal" calculation="Sum">
  292.         <variableExpression><![CDATA[$F{income}]]></variableExpression>
  293.         <initialValueExpression><![CDATA[0]]></initialValueExpression>
  294.     </variable>
  295.     <variable name="manufacturer" class="java.lang.String" calculation="First">
  296.         <variableExpression><![CDATA[$F{manufacturer}]]></variableExpression>
  297.         <initialValueExpression><![CDATA[$F{manufacturer}]]></initialValueExpression>
  298.     </variable>
  299.     <group name="incomeQuantityGroup">
  300.         <groupExpression><![CDATA[$F{incomeQuantity}]]></groupExpression>
  301.     </group>
  302.     <background>
  303.         <band splitType="Stretch"/>
  304.     </background>
  305.     <title>
  306.         <band height="30">
  307.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  308.                 <reportElement x="0" y="0" width="802" height="30" uuid="b8fcd19d-e922-462b-a422-ff10844a4541"/>
  309.                 <textElement verticalAlignment="Middle">
  310.                     <font isBold="true"/>
  311.                 </textElement>
  312.                 <textFieldExpression><![CDATA["Отчет по приходам (все аптеки) за " + $P{start_date_required} + " - " + $P{end_date_required} + " по производителю " + $V{manufacturer} + ". Дата создания отчета: " + DATEFORMAT(TODAY(),"yyyy-MM-dd HH:mm:ss")]]></textFieldExpression>
  313.             </textField>
  314.         </band>
  315.     </title>
  316.     <columnHeader>
  317.         <band height="35" splitType="Stretch">
  318.             <staticText>
  319.                 <reportElement x="0" y="0" width="82" height="30" uuid="aeb2a1fd-eda8-4a2f-9fdc-585c97ba920d"/>
  320.                 <box padding="4">
  321.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  322.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  323.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  324.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  325.                 </box>
  326.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  327.                 <text><![CDATA[EAN]]></text>
  328.             </staticText>
  329.             <staticText>
  330.                 <reportElement stretchType="RelativeToBandHeight" x="82" y="0" width="80" height="30" uuid="38ebc45d-2447-412b-8d12-813bee933f51"/>
  331.                 <box>
  332.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  333.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  334.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  335.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  336.                 </box>
  337.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  338.                 <text><![CDATA[Название]]></text>
  339.             </staticText>
  340.             <staticText>
  341.                 <reportElement stretchType="RelativeToBandHeight" x="162" y="0" width="80" height="30" uuid="75bda337-80d7-4551-9e0e-48b1648a2bfd"/>
  342.                 <box>
  343.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  344.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  345.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  346.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  347.                 </box>
  348.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  349.                 <text><![CDATA[Аптека]]></text>
  350.             </staticText>
  351.             <staticText>
  352.                 <reportElement stretchType="RelativeToBandHeight" x="242" y="0" width="80" height="30" uuid="7f91dd8a-6445-43d5-8a57-14b5b9d9298f"/>
  353.                 <box>
  354.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  355.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  356.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  357.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  358.                 </box>
  359.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  360.                 <text><![CDATA[Юр. название]]></text>
  361.             </staticText>
  362.             <staticText>
  363.                 <reportElement stretchType="RelativeToBandHeight" x="322" y="0" width="68" height="30" uuid="d66e8b2c-ce41-4953-8243-a5e7bfcc62fc"/>
  364.                 <box>
  365.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  366.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  367.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  368.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  369.                 </box>
  370.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  371.                 <text><![CDATA[ИНН]]></text>
  372.             </staticText>
  373.             <staticText>
  374.                 <reportElement stretchType="RelativeToBandHeight" x="390" y="0" width="80" height="30" uuid="96dbd76b-a5e1-4333-8da0-e41dbe31d8ef"/>
  375.                 <box>
  376.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  377.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  378.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  379.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  380.                 </box>
  381.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  382.                 <text><![CDATA[Физический адрес]]></text>
  383.             </staticText>
  384.             <staticText>
  385.                 <reportElement stretchType="RelativeToBandHeight" x="470" y="0" width="68" height="30" uuid="ec420bbc-26e3-476e-bb7a-d655e7c5a130"/>
  386.                 <box>
  387.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  388.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  389.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  390.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  391.                 </box>
  392.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  393.                 <text><![CDATA[Приход, шт.]]></text>
  394.             </staticText>
  395.             <staticText>
  396.                 <reportElement stretchType="RelativeToBandHeight" x="538" y="0" width="70" height="30" uuid="f82e7cfb-aa7a-4ced-b582-6b432df8667c"/>
  397.                 <box>
  398.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  399.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  400.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  401.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  402.                 </box>
  403.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  404.                 <text><![CDATA[Приход, руб.]]></text>
  405.             </staticText>
  406.             <staticText>
  407.                 <reportElement stretchType="RelativeToBandHeight" x="608" y="0" width="70" height="30" uuid="a36b3baa-7231-43ae-b9de-fe4d038f98f5"/>
  408.                 <box>
  409.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  410.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  411.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  412.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  413.                 </box>
  414.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  415.                 <text><![CDATA[Поставщик]]></text>
  416.             </staticText>
  417.             <staticText>
  418.                 <reportElement stretchType="RelativeToBandHeight" x="678" y="0" width="60" height="30" uuid="69af0c5c-3b0d-491d-81be-f296b54757e2"/>
  419.                 <box>
  420.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  421.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  422.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  423.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  424.                 </box>
  425.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  426.                 <text><![CDATA[Код поставщика]]></text>
  427.             </staticText>
  428.             <staticText>
  429.                 <reportElement stretchType="RelativeToBandHeight" x="738" y="0" width="64" height="30" uuid="c980d822-22e3-466a-badc-b3779f92a1b3"/>
  430.                 <box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
  431.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  432.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  433.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  434.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  435.                 </box>
  436.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  437.                 <text><![CDATA[Месяц]]></text>
  438.             </staticText>
  439.             <staticText>
  440.                 <reportElement stretchType="RelativeToBandHeight" x="802" y="2" width="64" height="30" uuid="51fdc6be-3a3c-4758-a221-b38542c5dbd5"/>
  441.                 <box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
  442.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  443.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  444.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  445.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  446.                 </box>
  447.                 <textElement textAlignment="Center" verticalAlignment="Middle"/>
  448.                 <text><![CDATA[Цена за 1 упаковку]]></text>
  449.             </staticText>
  450.         </band>
  451.     </columnHeader>
  452.     <detail>
  453.         <band height="35" splitType="Stretch">
  454.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  455.                 <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="82" height="30" uuid="c406c798-6ee1-4b1a-8315-6e0cb2952063"/>
  456.                 <box padding="4">
  457.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  458.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  459.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  460.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  461.                 </box>
  462.                 <textFieldExpression><![CDATA[$F{EAN}]]></textFieldExpression>
  463.             </textField>
  464.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  465.                 <reportElement stretchType="RelativeToBandHeight" x="82" y="0" width="80" height="30" uuid="e9b8ab3e-89bd-414a-8528-064494d918dc"/>
  466.                 <box padding="4">
  467.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  468.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  469.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  470.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  471.                 </box>
  472.                 <textFieldExpression><![CDATA[$F{title}]]></textFieldExpression>
  473.             </textField>
  474.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  475.                 <reportElement stretchType="RelativeToBandHeight" x="162" y="0" width="80" height="30" uuid="e6bbf811-80a1-419e-8408-4fbc820fc5b7"/>
  476.                 <box padding="4">
  477.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  478.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  479.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  480.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  481.                 </box>
  482.                 <textFieldExpression><![CDATA[$F{client}]]></textFieldExpression>
  483.             </textField>
  484.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  485.                 <reportElement stretchType="RelativeToBandHeight" x="242" y="0" width="80" height="30" uuid="ff0daa50-7353-4096-b3e6-e4fd7cc45e9f"/>
  486.                 <box padding="4">
  487.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  488.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  489.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  490.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  491.                 </box>
  492.                 <textFieldExpression><![CDATA[$F{endpoint}]]></textFieldExpression>
  493.             </textField>
  494.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  495.                 <reportElement stretchType="RelativeToBandHeight" x="322" y="0" width="68" height="30" uuid="5124cb2d-7a64-468c-b54d-ff51f22b8db6"/>
  496.                 <box padding="4">
  497.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  498.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  499.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  500.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  501.                 </box>
  502.                 <textFieldExpression><![CDATA[$F{inn}]]></textFieldExpression>
  503.             </textField>
  504.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  505.                 <reportElement stretchType="RelativeToBandHeight" x="390" y="0" width="80" height="30" uuid="7fafb004-8c5f-44e4-9b42-cb3263c96899"/>
  506.                 <box padding="4">
  507.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  508.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  509.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  510.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  511.                 </box>
  512.                 <textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
  513.             </textField>
  514.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  515.                 <reportElement stretchType="RelativeToBandHeight" x="470" y="0" width="68" height="30" uuid="072ef7c3-1f58-4de9-8fbd-ae36654431c1"/>
  516.                 <box padding="4">
  517.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  518.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  519.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  520.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  521.                 </box>
  522.                 <textFieldExpression><![CDATA[$F{incomeQuantity}]]></textFieldExpression>
  523.             </textField>
  524.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  525.                 <reportElement stretchType="RelativeToBandHeight" x="538" y="0" width="70" height="30" uuid="11bfa3e4-f258-4959-b1e9-5ec0db492e88"/>
  526.                 <box padding="4">
  527.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  528.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  529.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  530.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  531.                 </box>
  532.                 <textFieldExpression><![CDATA[$F{income}]]></textFieldExpression>
  533.             </textField>
  534.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  535.                 <reportElement stretchType="RelativeToBandHeight" x="608" y="0" width="70" height="30" uuid="c3ae7b18-9a06-435c-8d98-259b02b1ef2a"/>
  536.                 <box padding="4">
  537.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  538.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  539.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  540.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  541.                 </box>
  542.                 <textFieldExpression><![CDATA[$F{reseller}]]></textFieldExpression>
  543.             </textField>
  544.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  545.                 <reportElement stretchType="RelativeToBandHeight" x="678" y="0" width="60" height="30" uuid="c316faa7-49d4-4d1c-b743-78edc6a4f193"/>
  546.                 <box padding="4">
  547.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  548.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  549.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  550.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  551.                 </box>
  552.                 <textFieldExpression><![CDATA[$F{resellerCode}]]></textFieldExpression>
  553.             </textField>
  554.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  555.                 <reportElement stretchType="RelativeToBandHeight" x="738" y="0" width="64" height="30" uuid="9e1a1fb8-17e9-4d2a-9374-7881cf4aabf4"/>
  556.                 <box padding="4">
  557.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  558.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  559.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  560.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  561.                 </box>
  562.                 <textFieldExpression><![CDATA[$F{month}]]></textFieldExpression>
  563.             </textField>
  564.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  565.                 <reportElement stretchType="RelativeToBandHeight" x="800" y="0" width="64" height="30" uuid="e48060b7-7ebd-45c6-8059-fd97cf722673"/>
  566.                 <box padding="4">
  567.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  568.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  569.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  570.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  571.                 </box>
  572.                 <textFieldExpression><![CDATA[$F{pack}]]></textFieldExpression>
  573.             </textField>
  574.         </band>
  575.     </detail>
  576.     <summary>
  577.         <band height="30" splitType="Stretch">
  578.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  579.                 <reportElement stretchType="RelativeToBandHeight" x="470" y="0" width="68" height="30" uuid="2cec5580-3df7-4e02-8b96-f56216a1c14b"/>
  580.                 <box padding="4">
  581.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  582.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  583.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  584.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  585.                 </box>
  586.                 <textElement>
  587.                     <font isBold="true"/>
  588.                 </textElement>
  589.                 <textFieldExpression><![CDATA[$V{incomeQuantityTotal}]]></textFieldExpression>
  590.             </textField>
  591.             <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  592.                 <reportElement stretchType="RelativeToBandHeight" x="538" y="0" width="70" height="30" uuid="e4ca408c-ac00-4e41-9411-af4e6015bafd"/>
  593.                 <box padding="4">
  594.                     <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  595.                     <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  596.                     <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  597.                     <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  598.                 </box>
  599.                 <textElement>
  600.                     <font isBold="true"/>
  601.                 </textElement>
  602.                 <textFieldExpression><![CDATA[$V{incomeTotal}]]></textFieldExpression>
  603.             </textField>
  604.         </band>
  605.     </summary>
  606. </jasperReport>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement