Author: jaz
Date: Thu Sep 6 15:39:26 2007 New Revision: 573405 URL: http://svn.apache.org/viewvc?rev=573405&view=rev Log: added reason codes to general Financal Account transactions (inital deposit, replenishment, purchase) Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=573405&r1=573404&r2=573405&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original) +++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Thu Sep 6 15:39:26 2007 @@ -96,6 +96,13 @@ <StatusValidChange condition="" statusId="FNACT_NEGPENDREPL" statusIdTo="FNACT_CANCELLED" transitionName="Cancel"/> <StatusValidChange condition="" statusId="FNACT_MANFROZEN" statusIdTo="FNACT_ACTIVE" transitionName="Re-activate"/> <StatusValidChange condition="" statusId="FNACT_MANFROZEN" statusIdTo="FNACT_CANCELLED" transitionName="Cancel"/> + + <!-- FinAccount Reasons for Purchase & Replenish --> + <EnumerationType description="Service Debit Reasons" enumTypeId="FINACCT_TRANS_REASON" parentTypeId="" hasTable="N"/> + <Enumeration description="Purchase" enumId="FATR_PURCHASE" enumCode="PURCHASE" enumTypeId="FINACCT_TRANS_REASON" sequenceId="01"/> + <Enumeration description="Initial Deposit" enumId="FATR_IDEPOSIT" enumCode="IDEPOSIT" enumTypeId="FINACCT_TRANS_REASON" sequenceId="02"/> + <Enumeration description="Replenishment" enumId="FATR_REPLENISH" enumCode="REPLENISH" enumTypeId="FINACCT_TRANS_REASON" sequenceId="03"/> + <Enumeration description="Refund" enumId="FATR_REFUND" enumCode="REFUND" enumTypeId="FINACCT_TRANS_REASON" sequenceId="04"/> <FixedAssetType description="Equipment" fixedAssetTypeId="EQUIPMENT" hasTable="N" parentTypeId=""/> <FixedAssetType description="The fixed asset used in the operation-routing definition" fixedAssetTypeId="PRODUCTION_EQUIPMENT" hasTable="N" parentTypeId=""/> Modified: ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml?rev=573405&r1=573404&r2=573405&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Thu Sep 6 15:39:26 2007 @@ -144,6 +144,7 @@ <attribute name="partyId" type="String" mode="IN" optional="true"/> <attribute name="orderId" type="String" mode="IN" optional="true"/> <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/> + <attribute name="reasonEnumId" type="String" mode="IN" optional="true"/> <attribute name="amount" type="Double" mode="INOUT" optional="false"/> <attribute name="balance" type="Double" mode="OUT" optional="false"/> <attribute name="previousBalance" type="Double" mode="OUT" optional="true"/> @@ -161,6 +162,7 @@ <attribute name="partyId" type="String" mode="IN" optional="true"/> <attribute name="orderId" type="String" mode="IN" optional="true"/> <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/> + <attribute name="reasonEnumId" type="String" mode="IN" optional="true"/> <attribute name="amount" type="Double" mode="INOUT" optional="false"/> <attribute name="balance" type="Double" mode="OUT" optional="false"/> <attribute name="previousBalance" type="Double" mode="OUT" optional="true"/> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java?rev=573405&r1=573404&r2=573405&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java Thu Sep 6 15:39:26 2007 @@ -387,6 +387,7 @@ withdrawCtx.put("partyId", partyId); withdrawCtx.put("orderId", orderId); withdrawCtx.put("amount", amount); + withdrawCtx.put("reasonEnumId", "FATR_PURCHASE"); withdrawCtx.put("requireBalance", Boolean.FALSE); // for captures; if auth passed, allow withdrawCtx.put("userLogin", userLogin); @@ -459,6 +460,7 @@ depositCtx.put("partyId", partyId); depositCtx.put("orderId", orderId); depositCtx.put("amount", amount); + depositCtx.put("reasonEnumId", "FATR_REFUND"); depositCtx.put("userLogin", userLogin); Map depositResp; @@ -495,6 +497,7 @@ String productStoreId = (String) context.get("productStoreId"); String finAccountId = (String) context.get("finAccountId"); String orderItemSeqId = (String) context.get("orderItemSeqId"); + String reasonEnumId = (String) context.get("reasonEnumId"); String orderId = (String) context.get("orderId"); Boolean requireBalance = (Boolean) context.get("requireBalance"); Double amount = (Double) context.get("amount"); @@ -550,7 +553,7 @@ } else { try { refNum = FinAccountPaymentServices.createFinAcctPaymentTransaction(delegator, dispatcher, userLogin, amount, - productStoreId, partyId, orderId, orderItemSeqId, currencyUom, WITHDRAWAL, finAccountId); + productStoreId, partyId, orderId, orderItemSeqId, currencyUom, WITHDRAWAL, finAccountId, reasonEnumId); finAccount.refresh(); balance = finAccount.getBigDecimal("actualBalance"); procResult = Boolean.TRUE; @@ -583,6 +586,7 @@ String productStoreId = (String) context.get("productStoreId"); String finAccountId = (String) context.get("finAccountId"); String orderItemSeqId = (String) context.get("orderItemSeqId"); + String reasonEnumId = (String) context.get("reasonEnumId"); String orderId = (String) context.get("orderId"); Boolean isRefund = (Boolean) context.get("isRefund"); Double amount = (Double) context.get("amount"); @@ -628,7 +632,7 @@ String refNum; try { refNum = FinAccountPaymentServices.createFinAcctPaymentTransaction(delegator, dispatcher, userLogin, amount, - productStoreId, partyId, orderId, orderItemSeqId, currencyUom, DEPOSIT, finAccountId); + productStoreId, partyId, orderId, orderItemSeqId, currencyUom, DEPOSIT, finAccountId, reasonEnumId); finAccount.refresh(); actualBalance = finAccount.getBigDecimal("actualBalance"); } catch (GeneralException e) { @@ -817,6 +821,7 @@ depositCtx.put("orderId", orderId); depositCtx.put("orderItemSeqId", "00001"); // always one item on a replish order depositCtx.put("amount", new Double(depositAmount.doubleValue())); + depositCtx.put("reasonEnumId", "FATR_REPLENISH"); depositCtx.put("userLogin", userLogin); try { Map depositResp = dispatcher.runSync("finAccountDeposit", depositCtx); @@ -882,7 +887,7 @@ } private static String createFinAcctPaymentTransaction(GenericDelegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, Double amount, - String productStoreId, String partyId, String orderId, String orderItemSeqId, String currencyUom, String txType, String finAccountId) throws GeneralException { + String productStoreId, String partyId, String orderId, String orderItemSeqId, String currencyUom, String txType, String finAccountId, String reasonEnumId) throws GeneralException { final String coParty = ProductStoreWorker.getProductStorePayToPartyId(productStoreId, delegator); final String paymentMethodType = "FIN_ACCOUNT"; @@ -957,6 +962,7 @@ transCtx.put("partyId", partyId); transCtx.put("orderId", orderId); transCtx.put("orderItemSeqId", orderItemSeqId); + transCtx.put("reasonEnumId", reasonEnumId); transCtx.put("amount", amount); transCtx.put("userLogin", userLogin); transCtx.put("paymentId", paymentId); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java?rev=573405&r1=573404&r2=573405&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java Thu Sep 6 15:39:26 2007 @@ -240,6 +240,7 @@ depositCtx.put("orderId", orderId); depositCtx.put("orderItemSeqId", orderItemSeqId); depositCtx.put("amount", new Double(deposit.doubleValue())); + depositCtx.put("reasonEnumId", "FATR_IDEPOSIT"); depositCtx.put("userLogin", userLogin); Map depositResp; |
Free forum by Nabble | Edit this page |