Author: jaz
Date: Thu Mar 29 12:51:21 2007 New Revision: 523819 URL: http://svn.apache.org/viewvc?view=rev&rev=523819 Log: applied tracking code updates patch from Anil Patel Modified: ofbiz/trunk/applications/marketing/entitydef/entitygroup.xml ofbiz/trunk/applications/marketing/entitydef/entitymodel.xml ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml ofbiz/trunk/applications/marketing/servicedef/services.xml ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java ofbiz/trunk/applications/order/servicedef/secas.xml Modified: ofbiz/trunk/applications/marketing/entitydef/entitygroup.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/entitydef/entitygroup.xml?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/marketing/entitydef/entitygroup.xml (original) +++ ofbiz/trunk/applications/marketing/entitydef/entitygroup.xml Thu Mar 29 12:51:21 2007 @@ -59,6 +59,7 @@ <entity-group group="org.ofbiz" entity="TrackingCode" /> <entity-group group="org.ofbiz" entity="TrackingCodeOrder" /> + <entity-group group="org.ofbiz" entity="TrackingCodeOrderReturn"/> <entity-group group="org.ofbiz" entity="TrackingCodeType" /> <entity-group group="org.ofbiz" entity="TrackingCodeVisit" /> @@ -68,7 +69,8 @@ <entity-group group="org.ofbiz" entity="TrackingCodeAndVisit"/> <entity-group group="org.ofbiz" entity="TrackingCodeAndOrderHeader"/> + <entity-group group="org.ofbiz" entity="TrackingCodeOrderAndOrderHeader"/> + <entity-group group="org.ofbiz" entity="TrackingCodeOrderReturnAndReturnHeader"/> <entity-group group="org.ofbiz" entity="MarketingCampaignAndVisit"/> <entity-group group="org.ofbiz" entity="MarketingCampaignAndOrderHeader"/> - </entitygroup> Modified: ofbiz/trunk/applications/marketing/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/entitydef/entitymodel.xml?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/marketing/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/marketing/entitydef/entitymodel.xml Thu Mar 29 12:51:21 2007 @@ -435,6 +435,9 @@ <field name="trackingCodeTypeId" type="id-ne"></field> <field name="trackingCodeId" type="id-ne"></field> <field name="isBillable" type="indicator"></field> + <field name="siteId" type="long-varchar"></field> + <field name="hasExported" type="indicator"></field> + <field name="affiliateReferredTimeStamp" type="date-time"></field> <prim-key field="orderId"/> <prim-key field="trackingCodeTypeId"/> <relation type="one" fk-name="TKNG_CODODR_ODR" rel-entity-name="OrderHeader"> @@ -447,6 +450,34 @@ <key-map field-name="trackingCodeTypeId"/> </relation> </entity> + <entity entity-name="TrackingCodeOrderReturn" + package-name="org.ofbiz.marketing.tracking" + title="Tracking Code And Order Return"> + <field name="returnId" type="id-ne"></field> + <field name="orderId" type="id-ne"></field> + <field name="orderItemSeqId" type="id-ne"></field> + <field name="trackingCodeTypeId" type="id-ne"></field> + <field name="trackingCodeId" type="id-ne"></field> + <field name="isBillable" type="indicator"></field> + <field name="siteId" type="long-varchar"></field> + <field name="hasExported" type="indicator"></field> + <field name="affiliateReferredTimeStamp" type="date-time"></field> + <prim-key field="returnId"/> + <prim-key field="orderId"/> + <prim-key field="trackingCodeTypeId"/> + <relation type="one" fk-name="TKNG_CODODR_ODRTN" rel-entity-name="ReturnHeader"> + <key-map field-name="returnId"/> + </relation> + <relation type="one" fk-name="TKNG_CODODR_ODRTN" rel-entity-name="OrderHeader"> + <key-map field-name="orderId"/> + </relation> + <relation type="one" fk-name="TKNG_CODODR_TKCD" rel-entity-name="TrackingCode"> + <key-map field-name="trackingCodeId"/> + </relation> + <relation type="one" fk-name="TKNG_CODODR_TYP" rel-entity-name="TrackingCodeType"> + <key-map field-name="trackingCodeTypeId"/> + </relation> + </entity> <entity entity-name="TrackingCodeType" package-name="org.ofbiz.marketing.tracking" default-resource-name="MarketingEntityLabels" @@ -480,8 +511,9 @@ <!-- org.ofbiz.marketing.reports --> <!-- ========================================================= --> - <view-entity entity-name="TrackingCodeAndVisit" package-name="org.ofbiz.marketing.reports" - title="View entity for reporting number of visits for a tracking code"> + <view-entity entity-name="TrackingCodeAndVisit" + package-name="org.ofbiz.marketing.reports" + title="View entity for reporting number of visits for a tracking code"> <member-entity entity-alias="TC" entity-name="TrackingCode"/> <member-entity entity-alias="TCV" entity-name="TrackingCodeVisit"/> <alias entity-alias="TC" name="trackingCodeId" group-by="true"/> @@ -495,8 +527,9 @@ <key-map field-name="trackingCodeId"/> </view-link> </view-entity> - <view-entity entity-name="TrackingCodeAndOrderHeader" package-name="org.ofibz.marketing.reports" - title="View entity for reporting number of orders and total order amounts"> + <view-entity entity-name="TrackingCodeAndOrderHeader" + package-name="org.ofibz.marketing.reports" + title="View entity for reporting number of orders and total order amounts"> <member-entity entity-alias="TCO" entity-name="TrackingCodeOrder"/> <member-entity entity-alias="OH" entity-name="OrderHeader"/> <alias entity-alias="OH" name="grandTotal" function="sum"/> @@ -507,8 +540,49 @@ <key-map field-name="orderId"/> </view-link> </view-entity> - <view-entity entity-name="MarketingCampaignAndVisit" package-name="org.ofbiz.marketing.reports" - title="View entity for reporting number of visits for a marketing campaign. Note that because + <view-entity entity-name="TrackingCodeOrderAndOrderHeader" + package-name="org.ofibz.marketing.reports" + never-cache="true" + title="Order Header And Tracking Code Order View Entity"> + <member-entity entity-alias="TCO" entity-name="TrackingCodeOrder"/> + <member-entity entity-alias="OH" entity-name="OrderHeader"/> + <alias entity-alias="TCO" name="orderId"/> + <alias entity-alias="TCO" name="trackingCodeId"/> + <alias entity-alias="TCO" name="siteId"/> + <alias entity-alias="TCO" name="hasExported"/> + <alias entity-alias="TCO" name="affiliateReferredTimeStamp"/> + <alias entity-alias="OH" name="statusId"/> + <view-link entity-alias="TCO" rel-entity-alias="OH"> + <key-map field-name="orderId"/> + </view-link> + <relation type="one" rel-entity-name="OrderHeader"> + <key-map field-name="orderId"/> + </relation> + </view-entity> + <view-entity entity-name="TrackingCodeOrderReturnAndReturnHeader" + package-name="org.ofibz.marketing.reports" + never-cache="true" + title="Return Header And Tracking Code Order Return View Entity"> + <member-entity entity-alias="TCO" entity-name="TrackingCodeOrderReturn"/> + <member-entity entity-alias="RH" entity-name="ReturnHeader"/> + <alias entity-alias="TCO" name="returnId"/> + <alias entity-alias="TCO" name="orderId"/> + <alias entity-alias="TCO" name="orderItemSeqId"/> + <alias entity-alias="TCO" name="trackingCodeId"/> + <alias entity-alias="TCO" name="siteId"/> + <alias entity-alias="TCO" name="hasExported"/> + <alias entity-alias="TCO" name="affiliateReferredTimeStamp"/> + <alias entity-alias="RH" name="statusId"/> + <view-link entity-alias="TCO" rel-entity-alias="RH"> + <key-map field-name="returnId"/> + </view-link> + <relation type="one" rel-entity-name="ReturnHeader"> + <key-map field-name="returnId"/> + </relation> + </view-entity> + <view-entity entity-name="MarketingCampaignAndVisit" + package-name="org.ofbiz.marketing.reports" + title="View entity for reporting number of visits for a marketing campaign. Note that because marketingCampaignId is a field of TrackingCode, this is really very similar to TrackingCodeAndVisit, except the group-by is with marketingCampaignId instead of trackingCodeId"> <member-entity entity-alias="TC" entity-name="TrackingCode"/> @@ -520,8 +594,9 @@ <key-map field-name="trackingCodeId"/> </view-link> </view-entity> - <view-entity entity-name="MarketingCampaignAndOrderHeader" package-name="org.ofibz.marketing.reports" - title="View entity for reporting number of orders and total order amounts"> + <view-entity entity-name="MarketingCampaignAndOrderHeader" + package-name="org.ofibz.marketing.reports" + title="View entity for reporting number of orders and total order amounts"> <member-entity entity-alias="TC" entity-name="TrackingCode"/> <member-entity entity-alias="TCO" entity-name="TrackingCodeOrder"/> <member-entity entity-alias="OH" entity-name="OrderHeader"/> Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml (original) +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml Thu Mar 29 12:51:21 2007 @@ -103,4 +103,65 @@ <find-by-primary-key entity-name="TrackingCodeType" map-name="lookupPKMap" value-name="lookedUpValue"/> <remove-value value-name="lookedUpValue"/> </simple-method> + + <!-- add service for tracking code return --> + <simple-method method-name="createTrackingCodeOrderReturn" short-description="Create an TrackingCodeOrderReturn"> + <now-timestamp-to-env env-name="nowStamp"/> + <make-value value-name="newEntity" entity-name="TrackingCodeOrderReturn"/> + <set-nonpk-fields map-name="parameters" value-name="newEntity"/> + <set-pk-fields map-name="parameters" value-name="newEntity"/> + + <!-- set the history/audit info --> + <set from-field="nowStamp" field="newEntity.createdStamp"/> + + <create-value value-name="newEntity"/> + </simple-method> + + <simple-method method-name="createTrackingCodeOrderReturns" short-description="Create TrackingCodeOrderReturn for all the Return Items with Orders that have trackingCodeOrder entry"> + <if-not-empty field-name="returnId" map-name="parameters"> + <set field="returnHeaderFindContext.returnId" from-field="parameters.returnId" /> + <find-by-primary-key entity-name="ReturnHeader" value-name="returnHeader" map-name="returnHeaderFindContext"/> + <get-related list-name="returnItems" relation-name="ReturnItem" value-name="returnHeader"/> + <log level="info" message="Return items lists are : ${returnItems}"/> + <iterate list-name="returnItems" entry-name="returnItem"> + <get-related-one relation-name="OrderHeader" value-name="returnItem" to-value-name="orderHeader"/> + <set field="trackingCodeOrderFindContext.orderId" from-field="orderHeader.orderId"/> + <!-- set field="trackingCodeOrderFindContext.trackingCodeTypeId" value="PARTNER_MGD"/--> + <!-- get the siteId ,trackingCodeId from TrackingCodeOrder --> + <log level="info" message="Find Tracking Code Order For ${trackingCodeOrderFindContext}"/> + <find-by-and entity-name="TrackingCodeOrder" list-name="trackingCodeOrders" map-name="trackingCodeOrderFindContext"/> + <set field="trackingCodeOrder" from-field="trackingCodeOrders[0]"/> + <log level="info" message="Create Tracking Code Order Return For ${trackingCodeOrder}"/> + <if-not-empty field-name="trackingCodeOrder"> + <set-service-fields to-map-name="trackingCodeOrderReturnContext" service-name="createTrackingCodeOrderReturn" map-name="trackingCodeOrder"/> + <set field="trackingCodeOrderReturnContext.returnId" from-field="parameters.returnId"/> + <set field="trackingCodeOrderReturnContext.orderId" from-field="trackingCodeOrder.orderId"/> + <set field="trackingCodeOrderReturnContext.trackingCodeTypeId" value="PARTNER_MGD"/> + <set field="trackingCodeOrderReturnContext.hasExported" value="N"/> + <set field="trackingCodeOrderReturnContext.affiliateReferredTimeStamp" from-field="nowTimestamp"/> + <call-service service-name="createTrackingCodeOrderReturn" in-map-name="trackingCodeOrderReturnContext"/> + </if-not-empty> + </iterate> + </if-not-empty> + </simple-method> + <simple-method method-name="updateTrackingCodeOrderReturn" short-description="update an TrackingCodeOrderReturn"> + <now-timestamp-to-env env-name="nowStamp"/> + + <make-value entity-name="TrackingCodeOrderReturn" value-name="lookupPKMap"/> + <set-pk-fields map-name="parameters" value-name="lookupPKMap"/> + <find-by-primary-key entity-name="TrackingCodeOrderReturn" map-name="lookupPKMap" value-name="lookedUpValue"/> + <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/> + + <!-- set the history/audit info --> + <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/> + <set from-field="lastModifiedDate" field="newEntity.createdDate"/> + <store-value value-name="lookedUpValue"/> + </simple-method> + <simple-method method-name="deleteTrackingCodeOrderReturn" short-description="delete an TrackingCodeOrderReturn"> + <make-value entity-name="TrackingCodeOrderReturn" value-name="lookupPKMap"/> + <set-pk-fields map-name="parameters" value-name="lookupPKMap"/> + <find-by-primary-key entity-name="TrackingCodeOrderReturn" map-name="lookupPKMap" value-name="lookedUpValue"/> + <remove-value value-name="lookedUpValue"/> + </simple-method> + </simple-methods> Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/marketing/servicedef/services.xml (original) +++ ofbiz/trunk/applications/marketing/servicedef/services.xml Thu Mar 29 12:51:21 2007 @@ -20,7 +20,7 @@ <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd"> - <description>Common Application Components Order Services</description> + <description>Marketing Component Services</description> <vendor>OFBiz</vendor> <version>1.0</version> @@ -28,18 +28,21 @@ <service name="createMarketingCampaign" default-entity-name="MarketingCampaign" engine="simple" location="org/ofbiz/marketing/campaign/CampaignServices.xml" invoke="createMarketingCampaign" auth="true"> <description>Create a MarketingCampaign record</description> + <permission-service service-name="marketingPermissionService" main-action="CREATE"/> <auto-attributes include="pk" mode="OUT" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="updateMarketingCampaign" default-entity-name="MarketingCampaign" engine="simple" location="org/ofbiz/marketing/campaign/CampaignServices.xml" invoke="updateMarketingCampaign" auth="true"> <description>Update a MarketingCampaign record</description> + <permission-service service-name="marketingPermissionService" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="deleteMarketingCampaign" default-entity-name="MarketingCampaign" engine="simple" location="org/ofbiz/marketing/campaign/CampaignServices.xml" invoke="deleteMarketingCampaign" auth="true"> <description>Remove a MarketingCampaign record</description> + <permission-service service-name="marketingPermissionService" main-action="DELETE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> @@ -306,4 +309,40 @@ <attribute name="areRelated" type="String" mode="OUT" optional="false"><!-- will be Y or N --></attribute> </service> + <!-- Tracking Code Order return --> + <service name="createTrackingCodeOrderReturn" default-entity-name="TrackingCodeOrderReturn" engine="simple" + location="org/ofbiz/marketing/tracking/TrackingCodeServices.xml" invoke="createTrackingCodeOrderReturn"> + <description>Create a TrackingCodeOrderReturn record</description> + <permission-service service-name="marketingPermissionService" main-action="CREATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + <service name="updateTrackingCodeOrderReturn" default-entity-name="TrackingCodeOrderReturn" engine="simple" + location="org/ofbiz/marketing/tracking/TrackingCodeServices.xml" invoke="updateTrackingCodeOrderReturn"> + <description>Update a TrackingCode record</description> + <permission-service service-name="marketingPermissionService" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + <service name="deleteTrackingCodeOrderReturn" default-entity-name="TrackingCodeOrderReturn" engine="simple" + location="org/ofbiz/marketing/tracking/TrackingCodeServices.xml" invoke="deleteTrackingCodeOrderReturn"> + <description>Update a TrackingCode record</description> + <permission-service service-name="marketingPermissionService" main-action="DELETE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> + + <service name="createTrackingCodeOrderReturns" engine="simple" + location="org/ofbiz/marketing/tracking/TrackingCodeServices.xml" invoke="createTrackingCodeOrderReturns"> + <description>Create TrackingCodeOrderReturn for all the Return Items with Orders that have trackingCodeOrder entry</description> + <permission-service service-name="marketingPermissionService" main-action="CREATE"/> + <attribute type="String" mode="IN" name="returnId" optional="false"/> + </service> + + <!-- marketing permission service --> + <service name="marketingPermissionService" engine="simple" + location="org/ofbiz/common/permission/CommonPermissionServices.xml" invoke="genericBasePermissionCheck"> + <implements service="permissionInterface"/> + <attribute name="primaryPermission" type="String" mode="IN" optional="false" default-value="MARKETING"/> + <attribute name="altPermission" type="String" mode="IN" optional="true"/> + </service> </services> Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original) +++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Thu Mar 29 12:51:21 2007 @@ -57,7 +57,7 @@ if (UtilValidate.isNotEmpty(trackingCodeId)) { //tracking code is specified on the request, get the TrackingCode value and handle accordingly GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); - GenericValue trackingCode = null; + GenericValue trackingCode; try { trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); } catch (GenericEntityException e) { @@ -94,7 +94,7 @@ if (UtilValidate.isNotEmpty(trackingCodeId)) { //partner managed tracking code is specified on the request GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); - GenericValue trackingCode = null; + GenericValue trackingCode; try { trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); } catch (GenericEntityException e) { @@ -119,7 +119,7 @@ if (defaultTrackingCode != null) { defaultTrackingCode.set("trackingCodeId", trackingCodeId); - defaultTrackingCode.set("trackingCodeTypeId", "PARTNER_MGD"); + defaultTrackingCode.set("trackingCodeTypeId", "PARTNER_MGD"); //null out userLogin fields, no use tracking to customer, or is there?; set dates to current defaultTrackingCode.set("createdDate", UtilDateTime.nowTimestamp()); defaultTrackingCode.set("createdByUserLogin", null); @@ -243,6 +243,42 @@ if (cookieDomain.length() > 0) billableCookie.setDomain(cookieDomain); response.addCookie(billableCookie); } + + // if site id exist in cookies then not req to create it if exist with diffrent site then create it + int siteIdCookieAge = (60 * 60 * 24 * 365); // should this be configurable? + String siteId = request.getParameter("siteId"); + if (siteId != null && siteId.length() > 0) { + String visitorSiteIdCookieName = "Ofbiz.TKCD.SiteId"; + String visitorSiteId = null; + // first try to get the current ID from the visitor cookie + javax.servlet.http.Cookie[] cookies = request.getCookies(); + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + if (cookies[i].getName().equals(visitorSiteIdCookieName)) { + visitorSiteId = cookies[i].getValue(); + break; + } + } + } + + if ( visitorSiteId == null || (visitorSiteId != null && !visitorSiteId.equals(siteId)) ) { + // if trackingCode.siteId is not null write a trackable cookie with name in the form: Ofbiz.TKCSiteId and timeout will be 60 * 60 * 24 * 365 + Cookie siteIdCookie = new Cookie("Ofbiz.TKCD.SiteId" ,siteId); + siteIdCookie.setMaxAge(siteIdCookieAge); + siteIdCookie.setPath("/"); + siteIdCookie.setVersion(1); + if (cookieDomain.length() > 0) siteIdCookie.setDomain(cookieDomain); + response.addCookie(siteIdCookie); + + // if trackingCode.siteId is not null write a trackable cookie with name in the form: Ofbiz.TKCSiteId and timeout will be 60 * 60 * 24 * 365 + Cookie updatedTimeStampCookie = new Cookie("Ofbiz.TKCD.UpdatedTimeStamp" ,UtilDateTime.nowTimestamp().toString()); + updatedTimeStampCookie.setMaxAge(siteIdCookieAge); + updatedTimeStampCookie.setPath("/"); + updatedTimeStampCookie.setVersion(1); + if (cookieDomain.length() > 0) updatedTimeStampCookie.setDomain(cookieDomain); + response.addCookie(updatedTimeStampCookie); + } + } // if we have overridden logo, css and/or catalogId set some session attributes HttpSession session = request.getSession(); @@ -289,7 +325,7 @@ for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().startsWith("TKCDT_")) { String trackingCodeId = cookies[i].getValue(); - GenericValue trackingCode = null; + GenericValue trackingCode; try { trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); } catch (GenericEntityException e) { @@ -339,13 +375,26 @@ List trackingCodeOrders = new LinkedList(); Cookie[] cookies = request.getCookies(); + String affiliateReferredTimeStamp = null; + String siteId = null; + if (cookies != null && cookies.length > 0) { for (int i = 0; i < cookies.length; i++) { + String cookieName = cookies[i].getName(); + + // find the siteId cookie if it exists + if ("Ofbiz.TKCD.siteId".equals(cookieName)) { + siteId = cookies[i].getValue(); + } + + // find the referred timestamp cookie if it exists + if ("Ofbiz.TKCD.UpdatedTimeStamp".equals(cookieName)) { + affiliateReferredTimeStamp = cookies[i].getValue(); + } + // find any that start with TKCDB_ for billable tracking code cookies with isBillable=Y // also and for each TKCDT_ cookie that doesn't have a corresponding billable code add it to the list with isBillable=N - String isBillable = null; - String cookieName = cookies[i].getName(); if (cookieName.startsWith("TKCDB_")) { isBillable = "Y"; } else if (cookieName.startsWith("TKCDT_")) { @@ -354,7 +403,7 @@ if (isBillable != null) { String trackingCodeId = cookies[i].getValue(); - GenericValue trackingCode = null; + GenericValue trackingCode; try { trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); } catch (GenericEntityException e) { @@ -391,7 +440,8 @@ // this will have everything except the orderId set, that will be set by the createOrder service GenericValue trackingCodeOrder = delegator.makeValue("TrackingCodeOrder", UtilMisc.toMap("trackingCodeTypeId", trackingCode.get("trackingCodeTypeId"), - "trackingCodeId", trackingCodeId, "isBillable", isBillable)); + "trackingCodeId", trackingCodeId, "isBillable", isBillable, "siteId", siteId, + "hasExported", "N", "affiliateReferredTimeStamp", affiliateReferredTimeStamp)); trackingCodeOrders.add(trackingCodeOrder); } Modified: ofbiz/trunk/applications/order/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?view=diff&rev=523819&r1=523818&r2=523819 ============================================================================== --- ofbiz/trunk/applications/order/servicedef/secas.xml (original) +++ ofbiz/trunk/applications/order/servicedef/secas.xml Thu Mar 29 12:51:21 2007 @@ -138,6 +138,7 @@ <eca service="updateReturnHeader" event="commit"> <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/> <condition field-name="currentStatusId" operator="not-equals" value="RETURN_ACCEPTED"/> + <action service="createTrackingCodeOrderReturns" mode="sync"/> <action service="sendReturnAcceptNotification" mode="async" persist="true"/> </eca> <eca service="updateReturnHeader" event="commit"> |
Free forum by Nabble | Edit this page |