Author: ashish
Date: Mon Sep 27 09:32:53 2010
New Revision: 1001644
URL: http://svn.apache.org/viewvc?rev=1001644&view=rev
Log:
OFBIZ-3958 - Save supplier information in inventory when receive product either
by purchase order or direct.
(1) Save supplier information in inventory when receive product either by
purchase order or direct.
(2) Shown suppler party id in searched inventory item results.
Thanks Akash for the contribution.
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy
ofbiz/trunk/applications/product/webapp/facility/inventory/receiveInventory.ftl
ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=1001644&r1=1001643&r2=1001644&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
(original)
+++
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
Mon Sep 27 09:32:53 2010
@@ -133,6 +133,18 @@ under the License.
<clear-field field="serviceInMap"/>
<clear-field field="currentInventoryItemId"/>
+ <!-- Set supplier partyId, if inventory received by purchase order
-->
+ <if-not-empty field="parameters.orderId">
+ <entity-and entity-name="OrderRole" list="orderRoles">
+ <field-map field-name="orderId"
from-field="parameters.orderId"/>
+ <field-map field-name="roleTypeId" value="SUPPLIER_AGENT"/>
+ </entity-and>
+ <if-not-empty field="orderRoles">
+ <first-from-list list="orderRoles" entry="orderRole"/>
+ <set field="parameters.partyId"
from-field="orderRole.partyId"/>
+ </if-not-empty>
+ </if-not-empty>
+
<if-empty field="parameters.currentInventoryItemId">
<set-service-fields service-name="createInventoryItem"
map="parameters" to-map="serviceInMap"/>
<call-service service-name="createInventoryItem"
in-map-name="serviceInMap">
Modified:
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy?rev=1001644&r1=1001643&r2=1001644&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy
(original)
+++
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy
Mon Sep 27 09:32:53 2010
@@ -17,6 +17,7 @@
* under the License.
*/
+import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.util.*
import org.ofbiz.entity.condition.*
import org.ofbiz.service.ServiceUtil
@@ -58,6 +59,7 @@ if (purchaseOrderId) {
product = null;
if (productId) {
product = delegator.findOne("Product", [productId : productId], false);
+ context.supplierPartyIds =
EntityUtil.getFieldListFromEntityList(EntityUtil.filterByDate(delegator.findList("SupplierProduct",
EntityCondition.makeCondition([productId : productId]), null, ["partyId"],
null, false), nowTimestamp, "availableFromDate", "availableThruDate", true),
"partyId", true);
}
shipments = null;
Modified:
ofbiz/trunk/applications/product/webapp/facility/inventory/receiveInventory.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/inventory/receiveInventory.ftl?rev=1001644&r1=1001643&r2=1001644&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/webapp/facility/inventory/receiveInventory.ftl
(original)
+++
ofbiz/trunk/applications/product/webapp/facility/inventory/receiveInventory.ftl
Mon Sep 27 09:32:53 2010
@@ -159,6 +159,23 @@ under the License.
</tr>
<tr>
<td width="14%"> </td>
+ <td width="6%" align="right" nowrap="nowrap"
class="label">${uiLabelMap.ProductSupplier}</td>
+ <td width="6%"> </td>
+ <td width="74%">
+ <select name="partyId">
+ <option value=""></option>
+ <#if supplierPartyIds?has_content>
+ <#list supplierPartyIds as supplierPartyId>
+ <option value="${supplierPartyId}" <#if
supplierPartyId == parameters.partyId?if_exists> selected="selected"</#if>>
+ [${supplierPartyId}]
${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator,
supplierPartyId, true)}
+ </option>
+ </#list>
+ </#if>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="14%"> </td>
<td width="6%" align="right" nowrap="nowrap"
class="label">${uiLabelMap.ProductDateReceived}</td>
<td width="6%"> </td>
<td width="74%">
Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1001644&r1=1001643&r2=1001644&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
(original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Mon Sep
27 09:32:53 2010
@@ -123,6 +123,7 @@ under the License.
</hyperlink>
</field>
<field name="internalName"><display/></field>
+ <field name="partyId"><display/></field>
<field name="locationSeqId" widget-style="buttontext">
<hyperlink target="EditFacilityLocation"
description="${areaId}:${aisleId}:${sectionId}:${levelId}:${positionId}
[${locationSeqId}]">
<parameter param-name="facilityId"/>