You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2009/04/22 19:11:23 UTC
svn commit: r767590 [1/2] - in /ofbiz/branches/release09.04/applications:
accounting/config/ accounting/servicedef/
accounting/src/org/ofbiz/accounting/invoice/ order/config/ product/config/
product/servicedef/ product/src/org/ofbiz/shipment/packing/ p...
Author: mor
Date: Wed Apr 22 17:11:22 2009
New Revision: 767590
URL: http://svn.apache.org/viewvc?rev=767590&view=rev
Log:
Reverted r767449 and r767544 after David's suggestion, as these changes were not really a bug fix
Modified:
ofbiz/branches/release09.04/applications/accounting/config/AccountingUiLabels.xml
ofbiz/branches/release09.04/applications/accounting/servicedef/services_invoice.xml
ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
ofbiz/branches/release09.04/applications/order/config/OrderErrorUiLabels.xml
ofbiz/branches/release09.04/applications/product/config/ProductErrorUiLabels.xml
ofbiz/branches/release09.04/applications/product/servicedef/services_shipment.xml
ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java
ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java
ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy
ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
ofbiz/branches/release09.04/applications/product/webapp/facility/shipment/PackOrder.ftl
Modified: ofbiz/branches/release09.04/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/accounting/config/AccountingUiLabels.xml?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/branches/release09.04/applications/accounting/config/AccountingUiLabels.xml Wed Apr 22 17:11:22 2009
@@ -6390,9 +6390,6 @@
<value xml:lang="th">à¸à¸±à¸à¸«à¸²à¸¡à¸µà¸à¸¥à¸à¹à¸à¹à¸à¸£à¹à¸à¸£à¸¡à¸à¸£à¸°à¸¢à¸¸à¸à¸à¹à¹à¸à¹à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸£à¸«à¸±à¸ªà¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸ [${invoiceId}]</value>
<value xml:lang="zh">为å票ç¼å·[${invoiceId}]è·å¾æ¯ä»åºç¨æ¶åºé</value>
</property>
- <property key="AccountingProblemGettingShipmentItemBilling">
- <value xml:lang="en">Problem getting ShipmentItemBilling records</value>
- </property>
<property key="AccountingProblemLookingUpOrderItemBilling">
<value xml:lang="en">Problem looking up OrderItemBilling records for ${billFields}</value>
<value xml:lang="es">Problema buscando Elemento de orden de facturación para ${billFields}</value>
Modified: ofbiz/branches/release09.04/applications/accounting/servicedef/services_invoice.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/accounting/servicedef/services_invoice.xml?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/accounting/servicedef/services_invoice.xml (original)
+++ ofbiz/branches/release09.04/applications/accounting/servicedef/services_invoice.xml Wed Apr 22 17:11:22 2009
@@ -152,7 +152,7 @@
</description>
<attribute name="orderId" type="String" mode="IN" optional="false"/>
<attribute name="billItems" type="List" mode="IN" optional="false"/>
- <attribute name="invoiceId" type="String" mode="INOUT" optional="true"/>
+ <attribute name="invoiceId" type="String" mode="OUT" optional="true"/>
<attribute name="invoiceTypeId" type="String" mode="OUT" optional="true"/>
</service>
<service name="createInvoiceFromReturn" engine="java"
Modified: ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Wed Apr 22 17:11:22 2009
@@ -151,7 +151,6 @@
String orderId = (String) context.get("orderId");
List billItems = (List) context.get("billItems");
- String invoiceId = (String) context.get("invoiceId");
boolean previousInvoiceFound = false;
if (billItems == null || billItems.size() == 0) {
@@ -242,29 +241,27 @@
}
// create the invoice record
- if (UtilValidate.isEmpty(invoiceId)) {
- Map createInvoiceContext = FastMap.newInstance();
- createInvoiceContext.put("partyId", billToCustomerPartyId);
- createInvoiceContext.put("partyIdFrom", billFromVendorPartyId);
- createInvoiceContext.put("billingAccountId", billingAccountId);
- createInvoiceContext.put("invoiceDate", invoiceDate);
- createInvoiceContext.put("dueDate", dueDate);
- createInvoiceContext.put("invoiceTypeId", invoiceType);
- // start with INVOICE_IN_PROCESS, in the INVOICE_READY we can't change the invoice (or shouldn't be able to...)
- createInvoiceContext.put("statusId", "INVOICE_IN_PROCESS");
- createInvoiceContext.put("currencyUomId", orderHeader.getString("currencyUom"));
- createInvoiceContext.put("userLogin", userLogin);
-
- // store the invoice first
- Map createInvoiceResult = dispatcher.runSync("createInvoice", createInvoiceContext);
- if (ServiceUtil.isError(createInvoiceResult)) {
- return ServiceUtil.returnError(UtilProperties.getMessage(resource,"AccountingErrorCreatingInvoiceFromOrder",locale), null, null, createInvoiceResult);
- }
-
- // call service, not direct entity op: delegator.create(invoice);
- invoiceId = (String) createInvoiceResult.get("invoiceId");
+ Map createInvoiceContext = FastMap.newInstance();
+ createInvoiceContext.put("partyId", billToCustomerPartyId);
+ createInvoiceContext.put("partyIdFrom", billFromVendorPartyId);
+ createInvoiceContext.put("billingAccountId", billingAccountId);
+ createInvoiceContext.put("invoiceDate", invoiceDate);
+ createInvoiceContext.put("dueDate", dueDate);
+ createInvoiceContext.put("invoiceTypeId", invoiceType);
+ // start with INVOICE_IN_PROCESS, in the INVOICE_READY we can't change the invoice (or shouldn't be able to...)
+ createInvoiceContext.put("statusId", "INVOICE_IN_PROCESS");
+ createInvoiceContext.put("currencyUomId", orderHeader.getString("currencyUom"));
+ createInvoiceContext.put("userLogin", userLogin);
+
+ // store the invoice first
+ Map createInvoiceResult = dispatcher.runSync("createInvoice", createInvoiceContext);
+ if (ServiceUtil.isError(createInvoiceResult)) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,"AccountingErrorCreatingInvoiceFromOrder",locale), null, null, createInvoiceResult);
}
+ // call service, not direct entity op: delegator.create(invoice);
+ String invoiceId = (String) createInvoiceResult.get("invoiceId");
+
// order roles to invoice roles
List orderRoles = orderHeader.getRelated("OrderRole");
if (orderRoles != null) {
@@ -494,15 +491,12 @@
}
if ("ItemIssuance".equals(currentValue.getEntityName())) {
- List<GenericValue> shipmentItemBillings = delegator.findByAnd("ShipmentItemBilling", UtilMisc.toMap("shipmentId", currentValue.get("shipmentId")));
- if (UtilValidate.isEmpty(shipmentItemBillings)) {
- // create the ShipmentItemBilling record
- GenericValue shipmentItemBilling = delegator.makeValue("ShipmentItemBilling", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId));
- shipmentItemBilling.put("shipmentId", currentValue.get("shipmentId"));
- shipmentItemBilling.put("shipmentItemSeqId", currentValue.get("shipmentItemSeqId"));
- shipmentItemBilling.create();
- }
+ // create the ShipmentItemBilling record
+ GenericValue shipmentItemBilling = delegator.makeValue("ShipmentItemBilling", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId));
+ shipmentItemBilling.put("shipmentId", currentValue.get("shipmentId"));
+ shipmentItemBilling.put("shipmentItemSeqId", currentValue.get("shipmentItemSeqId"));
+ shipmentItemBilling.create();
}
String parentInvoiceItemSeqId = invoiceItemSeqId;
@@ -1544,22 +1538,8 @@
Debug.logInfo(UtilProperties.getMessage(resource, "AccountingIgnoringAdditionalShipCharges", productStore.getAllFields(), locale), module);
}
- String invoiceId = null;
- List<GenericValue> shipmentItemBillings = null;
- String shipmentId = (String) shipmentIds.get(0);
- try {
- shipmentItemBillings = delegator.findByAnd("ShipmentItemBilling", UtilMisc.toMap("shipmentId", shipmentId));
- } catch ( GenericEntityException e ) {
- String errMsg = UtilProperties.getMessage(resource, "AccountingProblemGettingShipmentItemBilling", locale);
- return ServiceUtil.returnError(errMsg);
- }
- if (UtilValidate.isNotEmpty(shipmentItemBillings)) {
- GenericValue shipmentItemBilling = EntityUtil.getFirst(shipmentItemBillings);
- invoiceId = shipmentItemBilling.getString("invoiceId");
- }
-
// call the createInvoiceForOrder service for each order
- Map serviceContext = UtilMisc.toMap("orderId", orderId, "billItems", toBillItems, "invoiceId", invoiceId, "userLogin", context.get("userLogin"));
+ Map serviceContext = UtilMisc.toMap("orderId", orderId, "billItems", toBillItems, "userLogin", context.get("userLogin"));
try {
Map result = dispatcher.runSync("createInvoiceForOrder", serviceContext);
invoicesCreated.add(result.get("invoiceId"));
Modified: ofbiz/branches/release09.04/applications/order/config/OrderErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/config/OrderErrorUiLabels.xml?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/branches/release09.04/applications/order/config/OrderErrorUiLabels.xml Wed Apr 22 17:11:22 2009
@@ -334,9 +334,6 @@
<value xml:lang="th">ERROR : à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸ !</value>
<value xml:lang="zh">é误ï¼</value>
</property>
- <property key="OrderErrorAllItemsOfOrderAreAlreadyVerified">
- <value xml:lang="en">ERROR: All items of order #${orderId} are already verified</value>
- </property>
<property key="OrderErrorCallingCountProductQuantityOrderedService">
<value xml:lang="en">Error calling countProductQuantityOrdered service : </value>
<value xml:lang="es">Error al llamar al servicio countProductQuantityOrdered:</value>
@@ -688,12 +685,6 @@
<value xml:lang="ru">ÐШÐÐÐÐ: ÐозиÑÐ¸Ñ Ð·Ð°ÐºÐ°Ð·Ð° Ñ ÐºÐ¾Ð´Ð¾Ð¼ [${orderId}] и orderItemSeqId [${orderItemSeqId}] не найденÑ</value>
<value xml:lang="th">ERROR : à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸ ! รายà¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸·à¹à¸à¸à¹à¸§à¸¢à¸£à¸«à¸±à¸ª [${orderId}] à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸·à¹à¸[${orderItemSeqId}] à¹à¸¡à¹à¸à¸</value>
</property>
- <property key="OrderErrorOrderNotApprovedForPacking">
- <value xml:lang="en">ERROR: Order #${orderId} is not approved for packing</value>
- </property>
- <property key="OrderErrorOrderNotApprovedForPicking">
- <value xml:lang="en">ERROR: Order #${orderId} is not approved for picking</value>
- </property>
<property key="OrderErrorOrderNotPurchaseOrder">
<value xml:lang="en">Order ${orderId} is not a Purchase Order</value>
<value xml:lang="es">El pedido ${orderId} no es un pedido de compra</value>
@@ -702,9 +693,6 @@
<value xml:lang="ru">Ðаказ ${orderId} не ÑвлÑеÑÑÑ Ð·Ð°ÐºÑпоÑнÑм заказом</value>
<value xml:lang="th">à¹à¸à¸ªà¸±à¹à¸à¸à¸·à¹à¸à¸ªà¸´à¸à¸à¹à¸² ${orderId} à¹à¸¡à¹à¹à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸·à¹à¸</value>
</property>
- <property key="OrderErrorOrderNotVerifiedForPacking">
- <value xml:lang="en">ERROR: Order #${orderId} is not verified for packing</value>
- </property>
<property key="OrderErrorOrderTypeLookupFailed">
<value xml:lang="en">ERROR : OrderType lookup failed : </value>
<value xml:lang="es">ERROR: La búsqueda ha fallado :</value>
Modified: ofbiz/branches/release09.04/applications/product/config/ProductErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/config/ProductErrorUiLabels.xml?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/config/ProductErrorUiLabels.xml (original)
+++ ofbiz/branches/release09.04/applications/product/config/ProductErrorUiLabels.xml Wed Apr 22 17:11:22 2009
@@ -55,9 +55,6 @@
<value xml:lang="en">Error Inventory Item Label Id Not Found</value>
<value xml:lang="it">Errore riga etichetta inventario non trovata</value>
</property>
- <property key="ProductErrorNoShipGroupSequenceIdFoundCannotProcess">
- <value xml:lang="en">ERROR: No ship group sequence Id found cannot process</value>
- </property>
<property key="ProductFeatureTypeIdMustContainsLettersAndDigits">
<value xml:lang="de">Die Produktmerkmal Typ ID darf nur Buchstaben, Zahlen und _ enthalten. Bitte erneut eingeben.</value>
<value xml:lang="en">The Product Feature TypeId must contains only letters, underscore and digits. Please re-enter</value>
Modified: ofbiz/branches/release09.04/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/servicedef/services_shipment.xml?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/branches/release09.04/applications/product/servicedef/services_shipment.xml Wed Apr 22 17:11:22 2009
@@ -562,9 +562,6 @@
location="org.ofbiz.shipment.packing.PackingServices" invoke="completePack" auth="true">
<description>Complete the packging set the shipment to PACKED</description>
<attribute name="packingSession" type="org.ofbiz.shipment.packing.PackingSession" mode="IN" optional="false"/>
- <attribute name="orderId" type="String" mode="IN" optional="true"/>
- <attribute name="invoiceId" type="String" mode="IN" optional="true"/>
- <attribute name="shipmentId" type="String" mode="IN" optional="true"/>
<attribute name="handlingInstructions" type="String" mode="IN" optional="true"/>
<attribute name="pickerPartyId" type="String" mode="IN" optional="true"/>
<attribute name="additionalShippingCharge" type="BigDecimal" mode="IN" optional="true"/>
Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java (original)
+++ ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java Wed Apr 22 17:11:22 2009
@@ -271,16 +271,11 @@
PackingSession session = (PackingSession) context.get("packingSession");
// set the instructions -- will clear out previous if now null
- String orderId = (String) context.get("orderId");
- String shipmentId = (String) context.get("shipmentId");
- String invoiceId = (String) context.get("invoiceId");
String instructions = (String) context.get("handlingInstructions");
String pickerPartyId = (String) context.get("pickerPartyId");
BigDecimal additionalShippingCharge = (BigDecimal) context.get("additionalShippingCharge");
Map<String, String> packageWeights = UtilGenerics.checkMap(context.get("packageWeights"));
String weightUomId = (String) context.get("weightUomId");
- session.setShipmentId(shipmentId);
- session.setInvoiceId(invoiceId);
session.setHandlingInstructions(instructions);
session.setPickerPartyId(pickerPartyId);
session.setAdditionalShippingCharge(additionalShippingCharge);
@@ -292,8 +287,9 @@
force = Boolean.FALSE;
}
+ String shipmentId = null;
try {
- shipmentId = session.complete(force, orderId);
+ shipmentId = session.complete(force);
} catch (GeneralException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage(), e.getMessageList());
Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Wed Apr 22 17:11:22 2009
@@ -60,7 +60,6 @@
protected String shipmentId = null;
protected String instructions = null;
protected String weightUomId = null;
- protected String invoiceId = null;
protected BigDecimal additionalShippingCharge = null;
protected Map<Integer, BigDecimal> packageWeights = null;
protected List<PackingEvent> packEvents = null;
@@ -368,18 +367,6 @@
return this.shipmentId;
}
- public void setShipmentId(String shipmentId) {
- this.shipmentId = shipmentId;
- }
-
- public String getInvoiceId() {
- return this.invoiceId;
- }
-
- public void setInvoiceId(String invoiceId) {
- this.invoiceId = invoiceId;
- }
-
public List<PackingSessionLine> getLines() {
return this.packLines;
}
@@ -626,7 +613,7 @@
this.runEvents(PackingEvent.EVENT_CODE_CLEAR);
}
- public String complete(boolean force, String orderId) throws GeneralException {
+ public String complete(boolean force) throws GeneralException {
// clear out empty lines
// this.checkEmptyLines(); // removing, this seems to be causeing issues - mja
@@ -635,16 +622,12 @@
return "EMPTY";
}
- this.checkPackedQty(orderId);
// check for errors
this.checkReservations(force);
// set the status to 0
this.status = 0;
// create the shipment
- String shipmentId = this.getShipmentId();
- if (UtilValidate.isEmpty(shipmentId)) {
- this.createShipment();
- }
+ this.createShipment();
// create the packages
this.createPackages();
// issue the items
@@ -663,27 +646,6 @@
return this.shipmentId;
}
- protected void checkPackedQty(String orderId) throws GeneralException {
- int counter = 0;
- List<GenericValue> orderItems = null;
- for (PackingSessionLine line : this.getLines()) {
- orderItems = this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
- for (GenericValue orderItem : orderItems) {
- if (orderId.equals(line.getOrderId())) {
- if ((orderItem.get("orderItemSeqId")).equals(line.getOrderItemSeqId())) {
- BigDecimal packedQty = this.getPackedQuantity(line.getOrderId(), line.getOrderItemSeqId(), line.getShipGroupSeqId(), line.getProductId());
- if ((packedQty.compareTo(orderItem.getBigDecimal("quantity"))) == 0 ) {
- counter++;
- }
- }
- }
- }
- }
- if (((this.getLines().size()) != (orderItems.size())) || (counter != (orderItems.size()))) {
- throw new GeneralException("All order items are not packed");
- }
- }
-
protected void checkReservations(boolean ignore) throws GeneralException {
List<String> errors = FastList.newInstance();
for (PackingSessionLine line: this.getLines()) {
Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (original)
+++ ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java Wed Apr 22 17:11:22 2009
@@ -140,11 +140,14 @@
}
public String complete(String orderId) throws GeneralException {
+ String shipmentId = null;
String shipmentItemSeqId = null;
String invoiceId = null;
String invoiceItemSeqId = null;
- this.checkVerifiedQty(orderId);
- String shipmentId = this.createShipment((this.getPickRows(orderId)).get(0));
+ for (VerifyPickSessionRow line: this.getPickRows(orderId)) {
+ shipmentId = this.createShipment(line);
+ break;
+ }
for (VerifyPickSessionRow line: this.getPickRows(orderId)) {
shipmentItemSeqId = this.createShipmentItem(line,shipmentId);
line.setShipmentItemSeqId(shipmentItemSeqId);
@@ -157,24 +160,6 @@
return shipmentId;
}
- protected void checkVerifiedQty(String orderId) throws GeneralException {
- int counter = 0;
- List<GenericValue> orderItems = null;
- for (VerifyPickSessionRow line : this.getPickRows(orderId)) {
- orderItems = this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
- for (GenericValue orderItem : orderItems) {
- if ((orderItem.get("orderItemSeqId")).equals(line.getOrderSeqId())) {
- if (((line.getReadyToVerifyQty()).compareTo(orderItem.getBigDecimal("quantity"))) == 0 ) {
- counter++;
- }
- }
- }
- }
- if (counter != (orderItems.size())) {
- throw new GeneralException("All order items are not verified");
- }
- }
-
protected String createShipment(VerifyPickSessionRow line) throws GeneralException {
Map<String, Object> newShipment = FastMap.newInstance();
newShipment.put("originFacilityId", line.getFacilityId());
@@ -217,17 +202,11 @@
}
protected String createInvoice(String orderId) throws GeneralException {
- GenericDelegator delegator = this.getDelegator();
Map createInvoiceContext = FastMap.newInstance();
- GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
- GenericValue billingAccount = orderHeader.getRelatedOne("BillingAccount");
- String billingAccountId = billingAccount != null ? billingAccount.getString("billingAccountId") : null;
- createInvoiceContext.put("partyId", (EntityUtil.getFirst(delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_TO_CUSTOMER")))).getString("partyId"));
- createInvoiceContext.put("partyIdFrom", (EntityUtil.getFirst(delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR")))).getString("partyId"));
- createInvoiceContext.put("billingAccountId", billingAccountId);
+ createInvoiceContext.put("partyId", (EntityUtil.getFirst(this.getDelegator().findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_TO_CUSTOMER")))).getString("partyId"));
+ createInvoiceContext.put("partyIdFrom", (EntityUtil.getFirst(this.getDelegator().findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR")))).getString("partyId"));
createInvoiceContext.put("invoiceTypeId", "SALES_INVOICE");
createInvoiceContext.put("statusId", "INVOICE_IN_PROCESS");
- createInvoiceContext.put("currencyUomId", orderHeader.getString("currencyUom"));
createInvoiceContext.put("userLogin", this.getUserLogin());
Map createInvoiceResult = this.getDispatcher().runSync("createInvoice", createInvoiceContext);
if (ServiceUtil.isError(createInvoiceResult)) {
Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java (original)
+++ ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java Wed Apr 22 17:11:22 2009
@@ -50,7 +50,6 @@
this.orderItem = orderItem;
this.rowItem = rowItem;
this.shipmentItemSeqId = null;
- this.invoiceItemSeqId = null;
}
public String getOrderId() {
Modified: ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy (original)
+++ ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Wed Apr 22 17:11:22 2009
@@ -115,16 +115,6 @@
context.shipGroupSeqId = shipGroupSeqId;
context.picklistBinId = picklistBinId;
-shipment = EntityUtil.getFirst(delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"]));
-context.shipment = shipment;
-
-if (shipment) {
- invoice = EntityUtil.getFirst(delegator.findByAnd("ShipmentItemBilling", [shipmentId : shipment.shipmentId]));
- context.invoice = invoice;
-} else {
- context.invoice = null;
-}
-
// grab the order information
if (orderId) {
orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
@@ -138,34 +128,30 @@
if ("ORDER_APPROVED".equals(orderHeader.statusId)) {
if (shipGroupSeqId) {
- if (shipment) {
-
- // Generate the shipment cost estimate for the ship group
- productStoreId = orh.getProductStoreId();
- shippableItemInfo = orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId);
- shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false);
- shippableTotal = new Double(orh.getShippableTotal(shipGroupSeqId).doubleValue());
- shippableWeight = new Double(orh.getShippableWeight(shipGroupSeqId).doubleValue());
- shippableQuantity = new Double(orh.getShippableQuantity(shipGroupSeqId).doubleValue());
- shipmentCostEstimate = packSession.getShipmentCostEstimate(orderItemShipGroup, productStoreId, shippableItemInfo, shippableTotal, shippableWeight, shippableQuantity);
- context.shipmentCostEstimateForShipGroup = shipmentCostEstimate;
- context.productStoreId = productStoreId;
- if (!picklistBinId) {
- packSession.addItemInfo(shippableItems);
- //context.put("itemInfos", shippableItemInfo);
- }
- } else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderNotVerifiedForPacking", [orderId : orderId], locale));
+ // Generate the shipment cost estimate for the ship group
+ productStoreId = orh.getProductStoreId();
+ shippableItemInfo = orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId);
+ shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false);
+ shippableTotal = new Double(orh.getShippableTotal(shipGroupSeqId).doubleValue());
+ shippableWeight = new Double(orh.getShippableWeight(shipGroupSeqId).doubleValue());
+ shippableQuantity = new Double(orh.getShippableQuantity(shipGroupSeqId).doubleValue());
+ shipmentCostEstimate = packSession.getShipmentCostEstimate(orderItemShipGroup, productStoreId, shippableItemInfo, shippableTotal, shippableWeight, shippableQuantity);
+ context.shipmentCostEstimateForShipGroup = shipmentCostEstimate;
+ context.productStoreId = productStoreId;
+
+ if (!picklistBinId) {
+ packSession.addItemInfo(shippableItems);
+ //context.put("itemInfos", shippableItemInfo);
}
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("ProductErrorUiLabels", "ProductErrorNoShipGroupSequenceIdFoundCannotProcess", locale));
+ request.setAttribute("errorMessageList", ['No ship group sequence ID. Cannot process.']);
}
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderNotApprovedForPacking", [orderId : orderId], locale));
+ request.setAttribute("errorMessageList", ["Order #" + orderId + " is not approved for packing."]);
}
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderIdNotFound", [orderId : orderId], locale));
+ request.setAttribute("errorMessageList", ["Order #" + orderId + " cannot be found."]);
}
}
Modified: ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy?rev=767590&r1=767589&r2=767590&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy (original)
+++ ofbiz/branches/release09.04/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy Wed Apr 22 17:11:22 2009
@@ -17,10 +17,9 @@
* under the License.
*/
-import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.entity.condition.EntityCondition;
-import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.shipment.verify.VerifyPickSession;
verifyPickSession = session.getAttribute("verifyPickSession");
@@ -43,7 +42,6 @@
invoiceIds = EntityUtil.getFieldListFromEntityList(shipmentItemBillingList, "invoiceId", true);
if (invoiceIds) {
context.invoiceIds = invoiceIds;
- parameters.orderId = null;
}
}
}
@@ -92,18 +90,14 @@
if (shipGroupSeqId) {
productStoreId = orh.getProductStoreId();
context.productStoreId = productStoreId;
- shipments = delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"]);
- if (shipments) {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorAllItemsOfOrderAreAlreadyVerified", [orderId : orderId], locale));
- }
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("ProductErrorUiLabels", "ProductErrorNoShipGroupSequenceIdFoundCannotProcess", locale));
+ request.setAttribute("errorMessageList", ['No ship group sequence ID. Cannot process.']);
}
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderNotApprovedForPicking", [orderId : orderId], locale));
+ request.setAttribute("errorMessageList", ["Order #" + orderId + " is not approved for picking."]);
}
} else {
- request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderIdNotFound", [orderId : orderId], locale));
+ request.setAttribute("errorMessageList", ["Order #" + orderId + " cannot be found."]);
}
}
context.verifyPickSession = verifyPickSession;
\ No newline at end of file