Modified the Shipment Manifest report to use the common decorator for FOP reports. This also fixes some of the issues that were affecting the report: for example the validation error happening with shipments with no items/packages.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@647084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2008-04-11 09:09:32 +00:00
parent afe2e97dfd
commit fc896386fb
2 changed files with 37 additions and 43 deletions
@@ -17,40 +17,11 @@ specific language governing permissions and limitations
under the License.
-->
<#escape x as x?xml>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="main" page-height="11in" page-width="8.5in"
margin-top="0.5in" margin-bottom="1in" margin-left="1in" margin-right="1in">
<fo:region-body margin-top="1in"/>
<fo:region-before extent="1in"/>
<fo:region-after extent="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<#if hasPermission>
<#list shipmentPackageDatas as shipmentPackageData>
<#assign shipmentRouteSegment = shipmentPackageData.get("shipmentRouteSegment")>
<#assign shipmentPackage = shipmentPackageData.get("shipmentPackage")>
<#assign shipmentItemsDatas = shipmentPackageData.get("shipmentItemsDatas")>
<fo:page-sequence master-reference="main">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="right" line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">
${uiLabelMap.CommonPage} <fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="Helvetica">
<fo:block>
${screens.render("component://order/widget/ordermgr/OrderPrintScreens.xml#CompanyLogo")}
</fo:block>
<fo:block text-align="right">
<fo:instream-foreign-object>
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
message="${shipment.shipmentId}">
<barcode:code39>
<barcode:height>8mm</barcode:height>
</barcode:code39>
</barcode:barcode>
</fo:instream-foreign-object>
</fo:block>
<#assign shipmentItemsDatas = shipmentPackageData.get("shipmentItemsDatas")>
<fo:block><fo:leader/></fo:block>
<fo:block font-size="14pt">${uiLabelMap.ProductShipmentManifest} #${shipmentId}</fo:block>
<fo:block><fo:leader/></fo:block>
@@ -110,7 +81,7 @@ under the License.
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table>
</fo:block>
<fo:block space-after.optimum="10pt" font-size="10pt">
<fo:table>
@@ -118,18 +89,18 @@ under the License.
<fo:table-column column-width="225pt"/>
<fo:table-body>
<fo:table-row font-weight="bold">
<fo:table-cell padding="2pt" background-color="#D4D0C8">
<fo:table-cell padding="2pt" background-color="#D4D0C8">
<fo:block>${uiLabelMap.FormFieldTitle_shipmentPackageSeqId}: ${shipmentPackage.shipmentPackageSeqId}</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" background-color="#D4D0C8">
<#if shipmentPackage.weight?has_content && shipmentPackage.weightUomId?has_content>
<#assign weightUom = shipmentPackage.getRelatedOne("WeightUom")>
<fo:block text-align="center">${uiLabelMap.ProductWeight}: ${shipmentPackage.weight} ${weightUom.get("description",locale)}</fo:block>
<fo:block text-align="center">${uiLabelMap.ProductWeight}: ${shipmentPackage.weight} ${weightUom.get("description",locale)}</fo:block>
</#if>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table>
</fo:block>
<fo:table>
<fo:table-column column-width="180pt"/>
@@ -158,9 +129,9 @@ under the License.
</fo:table-header>
<fo:table-body>
<#list shipmentItemsDatas as shipmentItemsData>
<#assign shipmentItem = shipmentItemsData.get("shipmentItem")>
<#assign shippedQuantity = shipmentItemsData.get("shippedQuantity")>
<#assign packageQuantity = shipmentItemsData.get("packageQuantity")>
<#assign shipmentItem = shipmentItemsData.get("shipmentItem")>
<#assign shippedQuantity = shipmentItemsData.get("shippedQuantity")>
<#assign packageQuantity = shipmentItemsData.get("packageQuantity")>
<#assign product = shipmentItem.getRelatedOne("Product")>
<#assign itemIssuances = shipmentItem.getRelated("ItemIssuance")>
<fo:table-row>
@@ -196,13 +167,10 @@ under the License.
</#list>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</#list>
<#else>
<fo:block font-size="14pt">
${uiLabelMap.ProductFacilityViewPermissionError}
</fo:block>
</#if>
</fo:root>
</#escape>
@@ -351,9 +351,35 @@ under the License.
<script location="component://product/webapp/facility/WEB-INF/actions/shipment/ShipmentManifest.bsh"/>
</actions>
<widgets>
<platform-specific>
<html><html-template location="component://product/webapp/facility/shipment/ShipmentManifest.fo.ftl"/></html>
</platform-specific>
<decorator-screen name="FoReportDecorator" location="component://common/widget/CommonScreens.xml">
<!-- at the top left of every page we put the logo and company information -->
<decorator-section name="topLeft">
<section>
<widgets>
<include-screen name="CompanyLogo" location="component://order/widget/ordermgr/OrderPrintScreens.xml"/>
</widgets>
</section>
</decorator-section>
<!-- at the top right of every page we put the order information -->
<decorator-section name="topRight">
<section>
<widgets>
<platform-specific>
<html><html-template location="component://product/webapp/facility/shipment/PackingSlipShipmentBarCode.fo.ftl"/></html>
</platform-specific>
</widgets>
</section>
</decorator-section>
<decorator-section name="body">
<section>
<widgets>
<platform-specific>
<html><html-template location="component://product/webapp/facility/shipment/ShipmentManifest.fo.ftl"/></html>
</platform-specific>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>