Misc fixes for the manufacturing report:

* small improvements to labels
* added a few comments to code
* fixed a few bugs in one of the old shipment plan reports; still a lot to fix here, but at least it renders without errors now



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908567 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2010-02-10 16:21:42 +00:00
parent b586aa4601
commit 2a5bc6b59e
5 changed files with 26 additions and 43 deletions
@@ -1487,6 +1487,10 @@
<value xml:lang="th">จากวันที่</value>
<value xml:lang="zh">开始日期</value>
</property>
<property key="ManufacturingGenerateProductionRuns">
<value xml:lang="en">Generate Production Runs</value>
<value xml:lang="it">Genera ordini di produzione</value>
</property>
<property key="ManufacturingImplosion">
<value xml:lang="de">Zusammenfalten</value>
<value xml:lang="en">Implosion</value>
@@ -20,7 +20,10 @@ under the License.
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- Prerequisite data (available in demo data):
* PROD_MANUF and related manufacturing setup
* inventory for MAT_A_COST and MAT_B_COST
-->
<simple-method method-name="testProductionRunCreation" short-description="Test the creation of a production run" login-required="false">
<set field="productId" value="PROD_MANUF"/>
<set field="facilityId" value="WebStoreWarehouse"/>
@@ -27,7 +27,7 @@ shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]);
context.shipmentIdPar = shipment.shipmentId;
context.estimatedReadyDatePar = shipment.estimatedReadyDate;
context.estimatedShipDatePar = shipment.estimatedShipDate;
records = [];
if (shipment) {
shipmentPlans = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId]);
shipmentPlans.each { shipmentPlan ->
@@ -50,11 +50,10 @@ if (shipment) {
result = [:];
result = dispatcher.runSync("getNotAssembledComponents",inputPar);
if (result)
if (result) {
components = (List)result.get("notAssembledComponents");
componentsIt = components.iterator();
while (componentsIt) {
oneComponent = (org.ofbiz.manufacturing.bom.BOMNode)componentsIt.next();
}
components.each { oneComponent ->
record = new HashMap(recordGroup);
record.componentId = oneComponent.getProduct().productId;
record.componentName = oneComponent.getProduct().internalName;
@@ -66,11 +65,11 @@ if (shipment) {
serviceInput = [productId : oneComponent.getProduct().productId , facilityId : facilityId];
serviceOutput = dispatcher.runSync("getInventoryAvailableByFacility",serviceInput);
qha = serviceOutput.quantityOnHandTotal ?: 0.0;
inventoryStock.oneComponent.getProduct().productId = qha;
inventoryStock.put(oneComponent.getProduct().productId, qha);
}
qty = inventoryStock[oneComponent.getProduct().productId];
qty = qty - oneComponent.getQuantity();
inventoryStock.oneComponent.getProduct().productId = qty;
inventoryStock.put(oneComponent.getProduct().productId, qty);
}
record.componentOnHand = qty;
// Now we get the products qty already reserved by production runs
@@ -40,25 +40,11 @@ under the License.
<fo:block font-size="14pt">${uiLabelMap.ManufacturingComponentsOfShipmentPlan}</fo:block>
<fo:block><fo:leader/></fo:block>
<fo:block space-after.optimum="10pt" font-size="10pt"/>
<fo:table>
<fo:table-column column-width="200pt"/>
<fo:table-column column-width="200pt"/>
<fo:table-column column-width="200pt"/>
<fo:table-header>
<fo:table-row font-weight="bold">
<fo:table-cell padding="2pt">
<fo:block>${uiLabelMap.ManufacturingShipmentId}: ${shipmentIdPar}</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt">
<fo:block>${uiLabelMap.ManufacturingEstimatedCompletionDate}: <#if estimatedReadyDatePar?has_content>${estimatedReadyDatePar}</#if></fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt">
<fo:block>${uiLabelMap.ManufacturingEstimatedShipDate}: <#if estimatedShipDatePar?has_content>${estimatedShipDatePar}</#if></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body/>
</fo:table>
<fo:block>${uiLabelMap.ManufacturingShipmentId}: ${shipmentIdPar}</fo:block>
<fo:block>${uiLabelMap.ManufacturingEstimatedCompletionDate}: <#if estimatedReadyDatePar?has_content>${estimatedReadyDatePar}</#if></fo:block>
<fo:block>${uiLabelMap.ManufacturingEstimatedShipDate}: <#if estimatedShipDatePar?has_content>${estimatedShipDatePar}</#if></fo:block>
<fo:block space-after.optimum="10pt" font-size="10pt"/>
<fo:table>
<fo:table-column column-width="120pt"/>
@@ -81,21 +67,12 @@ under the License.
<fo:block>${uiLabelMap.ManufacturingNeedQuantity}</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" background-color="#D4D0C8">
<fo:block>${uiLabelMap.ManufacturingOnHandQuantity}</fo:block>
<fo:block>${uiLabelMap.ProductQoh}</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body/>
</fo:table>
<#list records as record>
<fo:table>
<fo:table-column column-width="120pt"/>
<fo:table-column column-width="120pt"/>
<fo:table-column column-width="120pt"/>
<fo:table-column column-width="120pt"/>
<fo:table-column column-width="120pt"/>
<fo:table-header/>
<fo:table-body>
<fo:table-body>
<#list records as record>
<fo:table-row>
<fo:table-cell padding="2pt">
<fo:block>
@@ -146,9 +123,9 @@ under the License.
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</#list>
</#list>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
<#else>
@@ -577,7 +577,7 @@ under the License.
</link>
</widgets>
<fail-widgets>
<link text="${uiLabelMap.ManufacturingCreateProductionRun}" style="buttontext" target="createProductionRunsForShipment">
<link text="${uiLabelMap.ManufacturingGenerateProductionRuns}" style="buttontext" target="createProductionRunsForShipment">
<parameter param-name="shipmentId" from-field="shipment.shipmentId"/>
</link>
<link text="${uiLabelMap.ManufacturingShipmentPlanStockReport}" style="buttontext" target="ShipmentPlanStockReport.pdf">