Author: jacopoc
Date: Thu Aug 20 10:00:52 2009 New Revision: 806102 URL: http://svn.apache.org/viewvc?rev=806102&view=rev Log: Added ability to specify an issuedDateTime for item issuances and an effective date for payments. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml ofbiz/trunk/applications/order/servicedef/services.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml ofbiz/trunk/applications/product/servicedef/services_shipment.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Thu Aug 20 10:00:52 2009 @@ -1361,6 +1361,7 @@ <set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/> <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="SALES_SHIPMENT"/> <set field="createAcctgTransAndEntriesInMap.shipmentId" from-field="itemIssuance.shipmentId"/> + <set field="createAcctgTransAndEntriesInMap.transactionDate" from-field="itemIssuance.issuedDateTime"/> <set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/> <call-service service-name="createAcctgTransAndEntries" in-map-name="createAcctgTransAndEntriesInMap"> <result-to-field result-name="acctgTransId"/> @@ -1941,6 +1942,7 @@ <set field="createAcctgTransAndEntriesInMap.roleTypeId" value="BILL_TO_CUSTOMER"/> <set field="createAcctgTransAndEntriesInMap.paymentId" from-field="paymentId"/> <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="INCOMING_PAYMENT"/> + <set field="createAcctgTransAndEntriesInMap.transactionDate" from-field="payment.effectiveDate"/> <set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/> <call-service service-name="createAcctgTransAndEntries" in-map-name="createAcctgTransAndEntriesInMap"> <result-to-field result-name="acctgTransId"/> Modified: ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Aug 20 10:00:52 2009 @@ -219,6 +219,7 @@ <attribute name="paymentFromId" type="String" mode="IN" optional="true"/> <attribute name="paymentRefNum" type="String" mode="IN" optional="true"/> <attribute name="comments" type="String" mode="IN" optional="true"/> + <attribute name="eventDate" type="Timestamp" mode="IN" optional="true"/> <attribute name="paymentId" type="String" mode="OUT" optional="false"/> </service> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java Thu Aug 20 10:00:52 2009 @@ -57,6 +57,7 @@ public static final String module = OrderManagerEvents.class.getName(); public static final String resource_error = "OrderErrorUiLabels"; + // FIXME: this event doesn't seem to be used; we may want to remove it public static String processOfflinePayments(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Aug 20 10:00:52 2009 @@ -4165,6 +4165,10 @@ String paymentRefNum = (String) context.get("paymentRefNum"); String paymentFromId = (String) context.get("paymentFromId"); String comments = (String) context.get("comments"); + Timestamp eventDate = (Timestamp) context.get("eventDate"); + if (UtilValidate.isEmpty(eventDate)) { + eventDate = UtilDateTime.nowTimestamp(); + } try { // get the order payment preference GenericValue orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId)); @@ -4210,7 +4214,7 @@ paymentParams.put("paymentPreferenceId", orderPaymentPreference.getString("orderPaymentPreferenceId")); paymentParams.put("amount", maxAmount); paymentParams.put("statusId", "PMNT_RECEIVED"); - paymentParams.put("effectiveDate", UtilDateTime.nowTimestamp()); + paymentParams.put("effectiveDate", eventDate); paymentParams.put("partyIdFrom", paymentFromId); paymentParams.put("currencyUomId", productStore.getString("defaultCurrencyUomId")); paymentParams.put("partyIdTo", payToPartyId); Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Thu Aug 20 10:00:52 2009 @@ -33,7 +33,9 @@ <sequenced-id sequence-name="ItemIssuance" field="newEntity.itemIssuanceId"/> <field-to-result field="newEntity.itemIssuanceId" result-name="itemIssuanceId"/> <set-nonpk-fields map="parameters" value-field="newEntity"/> - <now-timestamp field="newEntity.issuedDateTime"/> + <if-empty field="newEntity.issuedDateTime"> + <now-timestamp field="newEntity.issuedDateTime"/> + </if-empty> <create-value value-field="newEntity"/> @@ -228,6 +230,7 @@ </if-compare> <!--<call-simple-method method-name="findCreateIssueShipmentItem"/>--> + <set field="eventDate" from-field="parameters.eventDate"/> <call-simple-method method-name="findCreateItemIssuance"/> <call-simple-method method-name="associateIssueRoles"/> @@ -334,6 +337,7 @@ <set from-field="shipmentItem.shipmentItemSeqId" field="itemIssuanceCreate.shipmentItemSeqId"/> <set from-field="orderItem.orderId" field="itemIssuanceCreate.orderId"/> <set from-field="orderItem.orderItemSeqId" field="itemIssuanceCreate.orderItemSeqId"/> + <set from-field="eventDate" field="itemIssuanceCreate.issuedDateTime"/> <if-not-empty field="orderItemShipGrpInvRes"> <!-- if this is coming from an OrderItem issue instead of an OrderItemShipGrpInvRes issue, we won't have this info --> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Thu Aug 20 10:00:52 2009 @@ -1538,6 +1538,7 @@ <set from-field="itemRes.shipGroupSeqId" field="issueContext.shipGroupSeqId"/> <set from-field="itemRes.inventoryItemId" field="issueContext.inventoryItemId"/> <set from-field="itemRes.quantity" field="issueContext.quantity"/> + <set from-field="eventDate" field="issueContext.eventDate"/> <call-service service-name="issueOrderItemShipGrpInvResToShipment" in-map-name="issueContext"/> </iterate> </iterate> Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=806102&r1=806101&r2=806102&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Thu Aug 20 10:00:52 2009 @@ -362,17 +362,13 @@ location="component://product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml" invoke="createItemIssuance" auth="true"> <description>Create ItemIssuance</description> <auto-attributes include="pk" mode="OUT" optional="false"/> - <auto-attributes include="nonpk" mode="IN" optional="true"> - <exclude field-name="issuedDateTime"/> - </auto-attributes> + <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="updateItemIssuance" default-entity-name="ItemIssuance" engine="simple" location="component://product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml" invoke="updateItemIssuance" auth="true"> <description>Update ItemIssuance</description> <auto-attributes include="pk" mode="IN" optional="false"/> - <auto-attributes include="nonpk" mode="IN" optional="true"> - <exclude field-name="issuedDateTime"/> - </auto-attributes> + <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="deleteItemIssuance" default-entity-name="ItemIssuance" engine="simple" location="component://product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml" invoke="deleteItemIssuance" auth="true"> @@ -407,6 +403,7 @@ <auto-attributes entity-name="Shipment" include="pk" mode="IN" optional="false"/> <auto-attributes entity-name="OrderItemShipGrpInvRes" include="pk" mode="IN" optional="false"/> <attribute name="quantity" type="BigDecimal" mode="IN" optional="false"/> + <attribute name="eventDate" type="Timestamp" mode="IN" optional="true"/> <attribute name="shipmentItemSeqId" type="String" mode="OUT" optional="false"/> <attribute name="itemIssuanceId" type="String" mode="OUT" optional="false"/> </service> |
Free forum by Nabble | Edit this page |