You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2009/08/13 17:20:31 UTC
svn commit: r803928 - in /ofbiz/branches/executioncontext20090812:
applications/accounting/config/ applications/accounting/data/
applications/accounting/entitydef/
applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/serv...
Author: adrianc
Date: Thu Aug 13 15:20:30 2009
New Revision: 803928
URL: http://svn.apache.org/viewvc?rev=803928&view=rev
Log:
Synchronized branch with trunk, plus a bug fix.
I will be bringing over the changes from David's branch - so his work won't be lost.
Modified:
ofbiz/branches/executioncontext20090812/applications/accounting/config/AccountingUiLabels.xml
ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoFinAccountData.xml
ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoGlSetupData.xml
ofbiz/branches/executioncontext20090812/applications/accounting/data/PaymentsInvoices.xml
ofbiz/branches/executioncontext20090812/applications/accounting/entitydef/entitymodel.xml
ofbiz/branches/executioncontext20090812/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
ofbiz/branches/executioncontext20090812/applications/accounting/servicedef/services_ledger.xml
ofbiz/branches/executioncontext20090812/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy
ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy
ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/invoices/CommissionReport.ftl
ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl
ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryForms.xml
ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryScreens.xml
ofbiz/branches/executioncontext20090812/applications/product/webapp/facility/facility/FacilityForms.xml
ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml
ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
ofbiz/branches/executioncontext20090812/framework/widget/templates/foFormMacroLibrary.ftl
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/config/AccountingUiLabels.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/config/AccountingUiLabels.xml Thu Aug 13 15:20:30 2009
@@ -3111,6 +3111,10 @@
<value xml:lang="th">Error: à¸à¸§à¸²à¸¡à¸à¸´à¸à¸à¸¥à¸²à¸! à¹à¸à¸à¸²à¸£à¸ªà¸£à¹à¸²à¸à¹à¸à¹à¸ªà¸£à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸·à¹à¸à¸ªà¸´à¸à¸à¹à¸²à¸à¸²à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸·à¹à¸</value>
<value xml:lang="zh">ä»å®åå建å®åæç»è´¦åæ¶åºé</value>
</property>
+ <property key="AccountingExpences">
+ <value xml:lagn="en">Expences</value>
+ <value xml:lagn="hi_IN">वà¥à¤¯à¤¯</value>
+ </property>
<property key="AccountingExpEndOfLifeIsEmpty">
<value xml:lang="de">Das Feld erwartetes End of Life bei den Anlage-Daten ist leer.</value>
<value xml:lang="en">Field expectedEndOfLife is empty in FixedAsset data.</value>
@@ -4484,6 +4488,10 @@
<value xml:lang="th">สà¹à¸à¸à¹à¸²à¸à¸´à¸à¸à¸¶à¸à¸à¸²à¸£à¸ªà¸£à¹à¸²à¸ invoice servic</value>
<value xml:lang="zh">ä¼ éç»æ°å»ºå票æå¡çæ°å¼éæ³</value>
</property>
+ <property key="AccountingIncome">
+ <value xml:lagn="en">Income</value>
+ <value xml:lagn="hi_IN">à¤à¤¯</value>
+ </property>
<property key="AccountingIncomeStatement">
<value xml:lang="ar">ØªØµØ±Ø¨Ø Ø§ÙدخÙ</value>
<value xml:lang="de">Ertragsrechnung</value>
@@ -13392,5 +13400,5 @@
<property key="PageTitleBatchPayments">
<value xml:lang="en">Batch Payments</value>
<value xml:lang="hi_IN">à¤à¥à¤à¤¤à¤¾à¤¨ à¤à¤¾ बà¥à¤</value>
- </property>
+ </property>
</resource>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoFinAccountData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoFinAccountData.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoFinAccountData.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoFinAccountData.xml Thu Aug 13 15:20:30 2009
@@ -20,17 +20,19 @@
<entity-engine-xml>
<FinAccount finAccountId="9000" finAccountTypeId="BANK_ACCOUNT" statusId="FNACT_ACTIVE" finAccountName="Standard Chartered" finAccountCode="1247854852147" finAccountPin="1234"
- currencyUomId="USD" organizationPartyId="Company" ownerPartyId="Company" postToGlAccountId="111000" isRefundable="Y" replenishLevel="0.00" actualBalance="0.00" availableBalance="0.00"/>
+ currencyUomId="USD" organizationPartyId="Company" ownerPartyId="Company" postToGlAccountId="111100" isRefundable="Y" replenishLevel="0.00" actualBalance="0.00" availableBalance="0.00"/>
<FinAccountStatus finAccountId="9000" statusId="FNACT_ACTIVE" statusDate="2009-04-01 00:00:01.000"/>
<FinAccountTrans finAccountTransId="9100" finAccountTransTypeId="DEPOSIT" finAccountId="9000" amount="50000.00"
partyId="Company" transactionDate="2009-04-01 00:00:01.000" entryDate="2009-04-01 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_APPROVED"/>
<FinAccount finAccountId="9001" finAccountTypeId="BANK_ACCOUNT" statusId="FNACT_ACTIVE" finAccountName="ABN AMRO" finAccountCode="6577852521447" finAccountPin="1234" currencyUomId="USD"
- organizationPartyId="Company" ownerPartyId="Company" postToGlAccountId="111000" isRefundable="Y" replenishLevel="0.00" actualBalance="0.00" availableBalance="0.00"/>
+ organizationPartyId="Company" ownerPartyId="Company" postToGlAccountId="111100" isRefundable="Y" replenishLevel="0.00" actualBalance="0.00" availableBalance="0.00"/>
<FinAccountStatus finAccountId="9001" statusId="FNACT_ACTIVE" statusDate="2009-04-01 00:00:01.000"/>
<FinAccountTrans finAccountTransId="9101" finAccountTransTypeId="DEPOSIT" finAccountId="9001" amount="75000.00"
partyId="Company" glReconciliationId="9000" transactionDate="2009-04-01 00:00:01.000" entryDate="2009-04-01 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_APPROVED"/>
<FinAccountTrans finAccountTransId="9102" finAccountTransTypeId="DEPOSIT" finAccountId="9001" amount="500.00"
partyId="Company" transactionDate="2009-07-18 00:00:01.000" entryDate="2009-07-18 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_CREATED" paymentId="8001"/>
<Payment paymentId="8001" finAccountTransId="9102"/>
+ <FinAccountTrans finAccountTransId="9103" finAccountTransTypeId="DEPOSIT" finAccountId="9001" partyId="Company" transactionDate="2009-08-12 16:34:33.306" entryDate="2009-08-12 16:34:33.306" amount="20.00" paymentId="8003" statusId="FINACT_TRNS_CREATED"/>
+ <Payment paymentId="8003" finAccountTransId="9103"/>
</entity-engine-xml>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoGlSetupData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoGlSetupData.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoGlSetupData.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/data/DemoGlSetupData.xml Thu Aug 13 15:20:30 2009
@@ -401,6 +401,7 @@
<!-- Gl Reconciliation -->
<GlReconciliation glReconciliationId="9000" glReconciliationName="demoGlReconciliation" glAccountId="111000" organizationPartyId="Company" reconciledBalance="75000.00" reconciledDate="2009-08-08 20:03:14.000"/>
+ <GlReconciliation glReconciliationId="9001" glReconciliationName="testGlReconciliation" glAccountId="111000" organizationPartyId="Company" reconciledDate="2009-08-12 20:03:14.000"/>
<GlAccountCategoryMember glAccountId="112000" glAccountCategoryId="9301" fromDate="2009-07-08 11:54:03.8" amountPercentage="50"/>
<GlAccountCategoryMember glAccountId="112000" glAccountCategoryId="9302" fromDate="2009-07-08 11:54:03.8" amountPercentage="20"/>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/data/PaymentsInvoices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/data/PaymentsInvoices.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/data/PaymentsInvoices.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/data/PaymentsInvoices.xml Thu Aug 13 15:20:30 2009
@@ -205,4 +205,11 @@
<AcctgTrans acctgTransId="8013" acctgTransTypeId="PURCHASE_INVOICE" transactionDate="2009-07-10 00:00:00.000" isPosted="Y" postedDate="2009-07-11 00:00:00.000" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8007"/>
<AcctgTransEntry acctgTransId="8013" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" productId="WG-1111" glAccountId="214000" organizationPartyId="Company" amount="100" currencyUomId="USD" origAmount="100" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/>
<AcctgTransEntry acctgTransId="8013" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="100" currencyUomId="USD" origAmount="100" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/>
+
+ <!--Data for Batch Payments-->
+ <Payment paymentId="8003" paymentTypeId="CUSTOMER_PAYMENT" paymentMethodTypeId="COMPANY_CHECK" partyIdFrom="AcctBuyer" partyIdTo="Company" statusId="PMNT_RECEIVED" effectiveDate="2009-08-12 16:33:34.922" amount="20.00" currencyUomId="USD" actualCurrencyAmount="20.00" actualCurrencyUomId="USD"/>
+ <AcctgTrans acctgTransId="8014" acctgTransTypeId="INCOMING_PAYMENT" transactionDate="2009-08-13 10:51:37.47" isPosted="Y" postedDate="2009-08-13 10:51:38.159" glFiscalTypeId="ACTUAL" partyId="AcctBuyer" roleTypeId="BILL_TO_CUSTOMER" paymentId="8003"/>
+ <AcctgTransEntry acctgTransId="8014" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" glAccountId="112000" organizationPartyId="Company" amount="20.00" currencyUomId="USD" origAmount="20.00" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED" />
+ <AcctgTransEntry acctgTransId="8014" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" glAccountTypeId="ACCOUNTS_RECEIVABLE" glAccountId="120000" organizationPartyId="Company" amount="20.00" currencyUomId="USD" origAmount="20.00" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/>
+
</entity-engine-xml>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/entitydef/entitymodel.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/entitydef/entitymodel.xml Thu Aug 13 15:20:30 2009
@@ -1571,16 +1571,22 @@
</view-link>
</view-entity>
- <view-entity entity-name="InvoiceItemAndAssoc" package-name="org.ofbiz.accounting.invoice">
- <member-entity entity-alias="INT" entity-name="InvoiceItem"/>
+ <view-entity entity-name="InvoiceItemAndAssocProduct" package-name="org.ofbiz.accounting.invoice">
+ <member-entity entity-alias="INTM" entity-name="InvoiceItem"/>
<member-entity entity-alias="IIA" entity-name="InvoiceItemAssoc"/>
- <alias-all entity-alias="INT"/>
+ <member-entity entity-alias="PROD" entity-name="Product"/>
<alias-all entity-alias="IIA"/>
<alias name="termAmount" field="amount" entity-alias="IIA"/>
- <view-link entity-alias="INT" rel-entity-alias="IIA" rel-optional="false">
+ <alias name="productId" entity-alias="PROD"/>
+ <alias name="productName" entity-alias="PROD"/>
+ <alias name="amount" entity-alias="INTM"/>
+ <view-link entity-alias="INTM" rel-entity-alias="IIA" rel-optional="false">
<key-map field-name="invoiceId" rel-field-name="invoiceIdFrom"/>
<key-map field-name="invoiceItemSeqId" rel-field-name="invoiceItemSeqIdFrom"/>
</view-link>
+ <view-link entity-alias="INTM" rel-entity-alias="PROD" rel-optional="false">
+ <key-map field-name="productId"/>
+ </view-link>
</view-entity>
<!-- ========================================================= -->
<!-- org.ofbiz.accounting.ledger -->
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Thu Aug 13 15:20:30 2009
@@ -996,8 +996,9 @@
<calcop operator="get" field="totalOfCurrentFiscalPeriod"/>
</calculate>
<set field="glAccountTotalMap.totalOfCurrentFiscalPeriod" from-field="totalOfCurrentFiscalPeriod" type="BigDecimal"/>
- <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/>
+ <set field="glAccountIncomeList[]" from-field="glAccountTotalMap"/>
</iterate-map>
+ <set field="glAccountTotalsMap.income" from-field="glAccountIncomeList"/>
<iterate-map map="glAccountTotalsExpenseMap" key="glAccountId" value="totalAmount">
<clear-field field="glAccountTotalMap"/>
<set field="glAccountTotalMap.glAccountId" from-field="glAccountId"/>
@@ -1012,11 +1013,11 @@
<calcop operator="get" field="totalOfCurrentFiscalPeriod"/>
</calculate>
<set field="glAccountTotalMap.totalOfCurrentFiscalPeriod" from-field="totalOfCurrentFiscalPeriod" type="BigDecimal"/>
- <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/>
+ <set field="glAccountExpenseList[]" from-field="glAccountTotalMap"/>
</iterate-map>
-
+ <set field="glAccountTotalsMap.expenses" from-field="glAccountExpenseList"/>
<field-to-result field="totalNetIncome" result-name="totalNetIncome"/>
- <field-to-result field="glAccountTotalsList" result-name="glAccountTotalsList"/>
+ <field-to-result field="glAccountTotalsMap" result-name="glAccountTotalsMap"/>
</simple-method>
<simple-method method-name="prepareBalanceSheet" short-description="Prepare data for the Balance Sheet">
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/servicedef/services_ledger.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/servicedef/services_ledger.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/servicedef/services_ledger.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/servicedef/services_ledger.xml Thu Aug 13 15:20:30 2009
@@ -303,7 +303,7 @@
<attribute name="thruDate" type="Timestamp" mode="IN" optional="false"/>
<attribute name="glFiscalTypeId" type="String" mode="IN" optional="false"/>
<attribute name="totalNetIncome" type="BigDecimal" mode="OUT" optional="false"/>
- <attribute name="glAccountTotalsList" type="List" mode="OUT" optional="true"/>
+ <attribute name="glAccountTotalsMap" type="Map" mode="OUT" optional="true"/>
</service>
<service name="prepareBalanceSheet" engine="simple"
location="component://accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="prepareBalanceSheet" auth="true">
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java Thu Aug 13 15:20:30 2009
@@ -18,7 +18,6 @@
*******************************************************************************/
package org.ofbiz.accounting.thirdparty.paypal;
-import java.io.BufferedReader;
import java.io.IOException;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
@@ -32,14 +31,17 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.transaction.Transaction;
import javolution.util.FastMap;
+import org.apache.commons.lang.StringUtils;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
@@ -49,6 +51,8 @@
import org.ofbiz.entity.condition.EntityComparisonOperator;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityFunction;
+import org.ofbiz.entity.transaction.GenericTransactionException;
+import org.ofbiz.entity.transaction.TransactionUtil;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.CartItemModifyException;
@@ -84,7 +88,7 @@
// is a weak reference to the ShoppingCart itself. Entries will be removed as carts are removed from the
// session (i.e. on cart clear or successful checkout) or when the session is destroyed
private static Map<TokenWrapper, WeakReference<ShoppingCart>> tokenCartMap = new WeakHashMap<TokenWrapper, WeakReference<ShoppingCart>>();
-
+
public static Map<String, Object> setExpressCheckout(DispatchContext dctx, Map<String, ? extends Object> context) {
ShoppingCart cart = (ShoppingCart) context.get("cart");
Locale locale = cart.getLocale();
@@ -97,9 +101,9 @@
return ServiceUtil.returnError("Couldn't retrieve a PaymentGatewayConfigPayPal record for Express Checkout, cannot continue.");
}
-
+
NVPEncoder encoder = new NVPEncoder();
-
+
// Set Express Checkout Request Parameters
encoder.add("METHOD", "SetExpressCheckout");
String token = (String) cart.getAttribute("payPalCheckoutToken");
@@ -118,16 +122,14 @@
encoder.add("REQCONFIRMSHIPPING", reqConfirmShipping);
// Default shipment method
encoder.add("L_SHIPPINGOPTIONISDEFAULT0", "true");
- encoder.add("L_SHIPPINGOPTIONNAME0", "NO_SHIPPING@_NA_");
- //TODO: This isn't working
- encoder.add("L_SHIPINGPOPTIONLABEL0", "Calculated Offline");
+ encoder.add("L_SHIPPINGOPTIONNAME0", "Calculated Offline");
encoder.add("L_SHIPPINGOPTIONAMOUNT0", "0.00");
}
encoder.add("ALLOWNOTE", "1");
encoder.add("INSURANCEOPTIONOFFERED", "false");
if (UtilValidate.isNotEmpty(payPalConfig.getString("imageUrl")));
encoder.add("PAYMENTACTION", "Order");
-
+
// Cart information
try {
addCartDetails(encoder, cart);
@@ -143,7 +145,7 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
Map<String, String> errorMessages = getErrorMessageMap(decoder);
if (UtilValidate.isNotEmpty(errorMessages)) {
if (errorMessages.containsKey("10411")) {
@@ -156,135 +158,136 @@
token = decoder.get("TOKEN");
cart.setAttribute("payPalCheckoutToken", token);
- cart.setAttribute("payPalCheckoutTokenObj", new TokenWrapper(token));
- //PayPalServices.tokenCartMap.put(token, new ShoppingCartWrapper(cart));
+ TokenWrapper tokenWrapper = new TokenWrapper(token);
+ cart.setAttribute("payPalCheckoutTokenObj", tokenWrapper);
+ PayPalServices.tokenCartMap.put(tokenWrapper, new WeakReference<ShoppingCart>(cart));
return ServiceUtil.returnSuccess();
}
- public static Map<String, Object> payPalCheckoutUpdate(DispatchContext dctx, Map context) {
+ public static Map<String, Object> payPalCheckoutUpdate(DispatchContext dctx, Map<String, Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericDelegator delegator = dctx.getDelegator();
HttpServletRequest request = (HttpServletRequest) context.get("request");
HttpServletResponse response = (HttpServletResponse) context.get("response");
-// String remoteHost = request.getRemoteHost();
-// if (!remoteHost.endsWith(".paypal.com")) {
-// try {
-// response.sendError(HttpServletResponse.SC_FORBIDDEN);
-// Debug.logError("An Express Checkout Update request was received from a host other than *.paypal.com, responded with 403 Forbidden", module);
-// } catch (IOException e) {
-// Debug.logError(e, module);
-// }
-// return ServiceUtil.returnSuccess();
-// }
-
- String requestMessage = null;
- try {
- BufferedReader reader = request.getReader();
- requestMessage = reader.readLine();
- reader.close();
- } catch (IOException e) {
- Debug.logError(e, module);
+
+ Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
+
+ String token = (String)paramMap.get("TOKEN");
+ WeakReference<ShoppingCart> weakCart = tokenCartMap.get(new TokenWrapper(token));
+ ShoppingCart cart = null;
+ if (weakCart != null) {
+ cart = weakCart.get();
}
- if (requestMessage == null) {
+ if (cart == null) {
+ Debug.logError("Could locate the ShoppingCart for token " + token, module);
return ServiceUtil.returnSuccess();
}
-
- NVPDecoder decoder = new NVPDecoder();
+ // Since most if not all of the shipping estimate codes requires a persisted contactMechId we'll create one and
+ // then delete once we're done, now is not the time to worry about updating everything
+ String contactMechId = null;
+ Map<String, Object> inMap = FastMap.newInstance();
+ inMap.put("address1", paramMap.get("SHIPTOSTREET"));
+ inMap.put("address2", paramMap.get("SHIPTOSTREET2"));
+ inMap.put("city", paramMap.get("SHIPTOCITY"));
+ inMap.put("stateProvinceGeoId", paramMap.get("SHIPTOSTATE"));
+ inMap.put("postalCode", paramMap.get("SHIPTOZIP"));
+ String countryGeoCode = (String) paramMap.get("SHIPTOCOUNTRY");
+ String countryGeoId = PayPalServices.getCountryGeoIdFromGeoCode(countryGeoCode, delegator);
+ if (countryGeoId == null) {
+ return ServiceUtil.returnSuccess();
+ }
+ inMap.put("countryGeoId", countryGeoId);
+
try {
- decoder.decode(requestMessage);
- } catch (PayPalException e) {
+ GenericValue userLogin = delegator.findOne("UserLogin", true, UtilMisc.toMap("userLoginId", "system"));
+ inMap.put("userLogin", userLogin);
+ } catch (GenericEntityException e) {
Debug.logError(e, module);
+ }
+ boolean beganTransaction = false;
+ Transaction parentTransaction = null;
+ try {
+ parentTransaction = TransactionUtil.suspend();
+ beganTransaction = TransactionUtil.begin();
+ } catch (GenericTransactionException e1) {
+ Debug.logError(e1, module);
+ }
+ try {
+ Map<String, Object> outMap = dispatcher.runSync("createPostalAddress", inMap);
+ contactMechId = (String) outMap.get("contactMechId");
+ } catch (GenericServiceException e) {
+ Debug.logError(e.getMessage(), module);
return ServiceUtil.returnSuccess();
}
+ try {
+ TransactionUtil.commit(beganTransaction);
+ if (parentTransaction != null) TransactionUtil.resume(parentTransaction);
+ } catch (GenericTransactionException e) {
+ Debug.logError(e, module);
+ }
+ // clone the cart so we can modify it temporarily
+ CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart);
+ String oldShipAddress = cart.getShippingContactMechId();
+ coh.setCheckOutShippingAddress(contactMechId);
+ ShippingEstimateWrapper estWrapper = new ShippingEstimateWrapper(dispatcher, cart, 0);
+ int line = 0;
+ NVPEncoder encoder = new NVPEncoder();
+ encoder.add("METHOD", "CallbackResponse");
- String token = decoder.get("TOKEN");
- WeakReference<ShoppingCart> weakCart = tokenCartMap.get(new TokenWrapper(token));
- ShoppingCart customerCart = weakCart.get();
- if (customerCart != null) {
- // Since most if not all of the shipping estimate codes requires a persisted contactMechId we'll create one and
- // then delete once we're done, now is not the time to worry about updating everything
- GenericValue shipAddress = delegator.makeValue("PostalAddress");
- String contactMechId = delegator.getNextSeqId("ContactMech");
- shipAddress.put("contactMechId", contactMechId);
- shipAddress.put("address1", decoder.get("SHIPTOSTREET"));
- shipAddress.put("address2", decoder.get("SHIPTOSTREET2"));
- shipAddress.put("city", decoder.get("SHIPTOCITY"));
- shipAddress.put("stateProvinceGeoId", decoder.get("SHIPTOSTATE"));
- shipAddress.put("postalCode", decoder.get("SHIPTOZIP"));
- String countryGeoCode = decoder.get("SHIPTOCOUNTRY"); // PayPal says it is required so I'm not going to check
- try {
- String countryGeoId = PayPalServices.getCountryGeoIdFromGeoCode(countryGeoCode, delegator);
- if (countryGeoId == null) {
- return ServiceUtil.returnSuccess();
- }
- shipAddress.put("countryGeoId", countryGeoId);
- shipAddress.create();
- } catch (GenericEntityException e) {
- Debug.logError(e, module);
- }
- // clone the cart so we can modify it temporarily
- ShoppingCart cart = new ShoppingCart(customerCart);
- CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart);
- coh.setCheckOutShippingAddress(contactMechId);
- ShippingEstimateWrapper estWrapper = new ShippingEstimateWrapper(dispatcher, cart, 0);
- int line = 0;
- NVPEncoder encoder = new NVPEncoder();
- encoder.add("METHOD", "CallbackResponse");
-
- for (GenericValue shipMethod : estWrapper.getShippingMethods()) {
- BigDecimal estimate = estWrapper.getShippingEstimate(shipMethod);
- //Check that we have a valid estimate (allowing zero value estimates for now)
- if (estimate == null || estimate.compareTo(BigDecimal.ZERO) < 0) {
- continue;
- }
- cart.setShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
- cart.setCarrierPartyId(shipMethod.getString("partyId"));
- try {
- coh.calcAndAddTax();
- } catch (GeneralException e) {
- Debug.logError(e, module);
- continue;
- }
- String estimateName = shipMethod.getString("shipmentMethodTypeId") + "@" + shipMethod.getString("partyId");
- encoder.add("L_SHIPPINGOPTIONLABEL" + line, estimateName);
- String estimateLabel = shipMethod.getString("partyId") + " " + shipMethod.getString("description");
- encoder.add("L_SHIPPINGOPTIONNAME" + line, estimateLabel);
- encoder.add("L_SHIPPINGOPTIONAMOUNT" + line, estimate.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
- // Just make this first one default for now
- encoder.add("L_SHIPPINGOPTIONISDEFAULT" + line, line == 0 ? "true" : "false");
- encoder.add("L_TAXAMT" + line, cart.getTotalSalesTax().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
- line++;
- }
- String responseMsg = null;
+ for (GenericValue shipMethod : estWrapper.getShippingMethods()) {
+ BigDecimal estimate = estWrapper.getShippingEstimate(shipMethod);
+ //Check that we have a valid estimate (allowing zero value estimates for now)
+ if (estimate == null || estimate.compareTo(BigDecimal.ZERO) < 0) {
+ continue;
+ }
+ cart.setShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
+ cart.setCarrierPartyId(shipMethod.getString("partyId"));
+ try {
+ coh.calcAndAddTax();
+ } catch (GeneralException e) {
+ Debug.logError(e, module);
+ continue;
+ }
+ String estimateLabel = shipMethod.getString("partyId") + " - " + shipMethod.getString("description");
+ encoder.add("L_SHIPINGPOPTIONLABEL" + line, estimateLabel);
+ encoder.add("L_SHIPPINGOPTIONAMOUNT" + line, estimate.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
+ // Just make this first one default for now
+ encoder.add("L_SHIPPINGOPTIONISDEFAULT" + line, line == 0 ? "true" : "false");
+ encoder.add("L_TAXAMT" + line, cart.getTotalSalesTax().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
+ line++;
+ }
+ String responseMsg = null;
+ try {
+ responseMsg = encoder.encode();
+ } catch (PayPalException e) {
+ Debug.logError(e, module);
+ }
+ if (responseMsg != null) {
try {
- responseMsg = encoder.encode();
- } catch (PayPalException e) {
+ response.setContentLength(responseMsg.getBytes("UTF-8").length);
+ } catch (UnsupportedEncodingException e) {
Debug.logError(e, module);
}
- if (responseMsg != null) {
- try {
- response.setContentLength(responseMsg.getBytes("UTF-8").length);
- } catch (UnsupportedEncodingException e) {
- Debug.logError(e, module);
- }
-
- try {
- Writer writer = response.getWriter();
- writer.write(responseMsg);
- writer.close();
- } catch (IOException e) {
- Debug.logError(e, module);
- }
- }
- // Remove the temporary ship address
try {
- shipAddress.remove();
- } catch (GenericEntityException e) {
+ Writer writer = response.getWriter();
+ writer.write(responseMsg);
+ writer.close();
+ } catch (IOException e) {
Debug.logError(e, module);
}
}
+ // Remove the temporary ship address
+ try {
+ GenericValue postalAddress = delegator.findOne("PostalAddress", false, UtilMisc.toMap("contactMechId", contactMechId));
+ postalAddress.remove();
+ GenericValue contactMech = delegator.findOne("ContactMech", false, UtilMisc.toMap("contactMechId", contactMechId));
+ contactMech.remove();
+ } catch (GenericEntityException e) {
+ Debug.logError(e, module);
+ }
+ coh.setCheckOutShippingAddress(oldShipAddress);
return ServiceUtil.returnSuccess();
}
@@ -337,7 +340,7 @@
//NOTE: The docs say this is optional but then won't work without it
encoder.add("MAXAMT", cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());
}
-
+
public static Map<String, Object> getExpressCheckout(DispatchContext dctx, Map<String, Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericDelegator delegator = dctx.getDelegator();
@@ -356,7 +359,7 @@
} else {
return ServiceUtil.returnError("Express Checkout token not present in cart, cannot get checkout details.");
}
-
+
NVPDecoder decoder;
try {
decoder = sendNVPRequest(payPalConfig, encoder);
@@ -368,7 +371,7 @@
if (UtilValidate.isNotEmpty(decoder.get("NOTE"))) {
cart.addOrderNote(decoder.get("NOTE"));
}
-
+
if (cart.getUserLogin() == null) {
try {
GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", "anonymous");
@@ -576,12 +579,27 @@
Debug.log(e.getMessage());
}
}
-
- // Load the selected shipping method
+
+ // Load the selected shipping method - thanks to PayPal's less than sane API all we've to work with is the shipping option label
+ // that was shown to the customer
String shipMethod = decoder.get("SHIPPINGOPTIONNAME");
- String[] shipMethodSplit = shipMethod.split("@");
- cart.setShipmentMethodTypeId(shipMethodSplit[0]);
- cart.setCarrierPartyId(shipMethodSplit[1]);
+ if ("Calculated Offline".equals(shipMethod)) {
+ cart.setCarrierPartyId("_NA_");
+ cart.setShipmentMethodTypeId("NO_SHIPPING");
+ } else {
+ String[] shipMethodSplit = shipMethod.split(" - ");
+ cart.setCarrierPartyId(shipMethodSplit[0]);
+ String shippingMethodTypeDesc = StringUtils.join(shipMethodSplit, " - ", 1, shipMethodSplit.length);
+ try {
+ EntityCondition cond = EntityCondition.makeCondition(
+ UtilMisc.toMap("productStoreId", cart.getProductStoreId(), "partyId", shipMethodSplit[0], "roleTypeId", "CARRIER", "description", shippingMethodTypeDesc)
+ );
+ GenericValue shipmentMethod = EntityUtil.getFirst(delegator.findList("ProductStoreShipmentMethView", cond, null, null, null, false));
+ cart.setShipmentMethodTypeId(shipmentMethod.getString("shipmentMethodTypeId"));
+ } catch (GenericEntityException e1) {
+ Debug.logError(e1, module);
+ }
+ }
//Get rid of any excess ship groups
List<CartShipInfo> shipGroups = cart.getShipGroups();
for (int i = 1; i < shipGroups.size(); i++) {
@@ -609,7 +627,7 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
// Create the PayPal payment method
inMap.clear();
inMap.put("userLogin", cart.getUserLogin());
@@ -627,11 +645,11 @@
return ServiceUtil.returnError(e.getMessage());
}
String paymentMethodId = (String) outMap.get("paymentMethodId");
-
+
cart.clearPayments();
BigDecimal maxAmount = cart.getGrandTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
cart.addPaymentAmount(paymentMethodId, maxAmount, true);
-
+
return ServiceUtil.returnSuccess();
}
@@ -672,7 +690,7 @@
encoder.add("ITEMAMT", subTotal.toPlainString());
encoder.add("SHIPPINGAMT", shippingTotal.toPlainString());
encoder.add("TAXAMT", taxTotal.toPlainString());
-
+
NVPDecoder decoder = null;
try {
decoder = sendNVPRequest(payPalPaymentSetting, encoder);
@@ -702,7 +720,7 @@
inMap.put("userLogin", userLogin);
inMap.put("paymentMethodId", payPalPaymentMethod.get("paymentMethodId"));
inMap.put("transactionId", decoder.get("TRANSACTIONID"));
-
+
Map<String, Object> outMap = null;
try {
outMap = dispatcher.runSync("updatePayPalPaymentMethod", inMap);
@@ -724,7 +742,7 @@
GenericValue payPalPaymentMethod = (GenericValue) context.get("payPalPaymentMethod");
OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
GenericValue payPalConfig = getPaymentMethodGatewayPayPal(dctx, context, PaymentGatewayServices.AUTH_SERVICE_TYPE);
-
+
NVPEncoder encoder = new NVPEncoder();
encoder.add("METHOD", "DoAuthorization");
encoder.add("TRANSACTIONID", payPalPaymentMethod.getString("transactionId"));
@@ -743,11 +761,11 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
if (decoder == null) {
return ServiceUtil.returnError("An unknown error occurred while contacting PayPal");
}
-
+
Map<String, Object> result = ServiceUtil.returnSuccess();
Map<String, String> errors = getErrorMessageMap(decoder);
if (UtilValidate.isNotEmpty(errors)) {
@@ -777,14 +795,14 @@
if (authTrans == null) {
authTrans = PaymentGatewayServices.getAuthTransaction(paymentPref);
}
-
+
NVPEncoder encoder = new NVPEncoder();
encoder.add("METHOD", "DoCapture");
encoder.add("AUTHORIZATIONID", authTrans.getString("referenceNum"));
encoder.add("AMT", captureAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
encoder.add("CURRENCYCODE", authTrans.getString("currencyUomId"));
encoder.add("COMPLETETYPE", "NotComplete");
-
+
NVPDecoder decoder = null;
try {
decoder = sendNVPRequest(payPalConfig, encoder);
@@ -792,11 +810,11 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
if (decoder == null) {
return ServiceUtil.returnError("An unknown error occurred while contacting PayPal");
}
-
+
Map<String, Object> result = ServiceUtil.returnSuccess();
Map<String, String> errors = getErrorMessageMap(decoder);
if (UtilValidate.isNotEmpty(errors)) {
@@ -835,7 +853,7 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
if (decoder == null) {
return ServiceUtil.returnError("An unknown error occurred while contacting PayPal");
}
@@ -883,7 +901,7 @@
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
if (decoder == null) {
return ServiceUtil.returnError("An unknown error occurred while contacting PayPal");
}
@@ -934,7 +952,7 @@
}
if (paymentGatewayConfigId != null) {
try {
- payPalGatewayConfig = delegator.findOne("PaymentGatewayPayPal", true, "paymentGatewayConfigId", paymentGatewayConfigId);
+ payPalGatewayConfig = delegator.findOne("PaymentGatewayPayPal", true, "paymentGatewayConfigId", paymentGatewayConfigId);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
@@ -966,7 +984,7 @@
return decoder;
}
-
+
private static String getCountryGeoIdFromGeoCode(String geoCode, GenericDelegator delegator) {
String geoId = null;
try {
@@ -986,10 +1004,13 @@
public TokenWrapper(String theString) {
this.theString = theString;
}
-
+
@Override
public boolean equals(Object o) {
- return theString.equals(o);
+ if (o == null) return false;
+ if (!(o instanceof TokenWrapper)) return false;
+ TokenWrapper other = (TokenWrapper) o;
+ return theString.equals(other.theString);
}
@Override
public int hashCode() {
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy Thu Aug 13 15:20:30 2009
@@ -65,8 +65,12 @@
if (parameters.isIncomeStatement) {
prepareIncomeStatement = dispatcher.runSync("prepareIncomeStatement",
[fromDate : fromDate, thruDate : thruDate, organizationPartyId : organizationPartyId, glFiscalTypeId : parameters.glFiscalTypeId, userLogin : userLogin]);
- context.glAccountTotalsList = prepareIncomeStatement.glAccountTotalsList;
- context.totalNetIncome = prepareIncomeStatement.totalNetIncome;
+ glAccountTotalsMap = prepareIncomeStatement.glAccountTotalsMap;
+ if (glAccountTotalsMap) {
+ context.glAccountIncomeList = glAccountTotalsMap.income;
+ context.glAccountExpenseList = glAccountTotalsMap.expenses;
+ context.totalNetIncome = prepareIncomeStatement.totalNetIncome;
+ }
}
}
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy Thu Aug 13 15:20:30 2009
@@ -41,7 +41,7 @@
invoiceItemAndAssocCond.add(EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO, Timestamp.valueOf(thruDate)));
}
invoiceItemAndAssocList = [];
- invoiceItemAndAssocList = delegator.findList("InvoiceItemAndAssoc", EntityCondition.makeCondition(invoiceItemAndAssocCond, EntityOperator.AND), null, null, null, false);
+ invoiceItemAndAssocList = delegator.findList("InvoiceItemAndAssocProduct", EntityCondition.makeCondition(invoiceItemAndAssocCond, EntityOperator.AND), null, null, null, false);
//filtering invoiceItemAndAssocList for each productId with updating quantity, commission amount and number of order which generated sales invoices.
totalQuantity = BigDecimal.ZERO;
@@ -57,6 +57,7 @@
termAmount = BigDecimal.ZERO;
invoiceItemProductAmount = BigDecimal.ZERO;
assocProductId = null;
+ productName = null;
commissionReportMap = [:];
salesAgentAndTermAmtMap = [:];
salesInvoiceIds = [];
@@ -65,6 +66,7 @@
partyIdTermAmountMap = [:];
partyIdTermAmountKey = null;
assocProductId = invoiceItemAndAssoc.productId;
+ productName = invoiceItemAndAssoc.productName;
quantity = quantity.add(invoiceItemAndAssoc.quantity);
commissionAmount = commissionAmount.add(invoiceItemAndAssoc.termAmount.multiply(invoiceItemAndAssoc.quantity));
termAmount = termAmount.add(invoiceItemAndAssoc.termAmount);
@@ -79,6 +81,7 @@
}
}
commissionReportMap.productId = assocProductId;
+ commissionReportMap.productName = productName;
commissionReportMap.quantity = quantity;
commissionReportMap.salesAgentAndTermAmtMap = salesAgentAndTermAmtMap;
commissionReportMap.commissionAmount = commissionAmount;
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/invoices/CommissionReport.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/invoices/CommissionReport.ftl?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/invoices/CommissionReport.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/invoices/CommissionReport.ftl Thu Aug 13 15:20:30 2009
@@ -18,7 +18,6 @@
-->
<#if commissionReportList?has_content>
- <form name="CommissionReport" id="CommissionReport">
<div>
<a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.AccountingInvoicePDF}</a>
</div>
@@ -36,13 +35,15 @@
<#assign alt_row = false>
<#list commissionReportList as commissionReport>
<tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
- <td><a href="/catalog/control/EditProduct?productId=${commissionReport.productId!}">${commissionReport.productId!}</a></td>
+ <td><a href="/catalog/control/EditProduct?productId=${commissionReport.productId!}">${commissionReport.productName!}</a></td>
<td>${commissionReport.quantity!}</td>
<td>
${commissionReport.numberOfOrders!} /
- <#list commissionReport.salesInvoiceIds as salesInvoiceId>
- [<a href="/ap/control/invoiceOverview?invoiceId=${salesInvoiceId!}">${salesInvoiceId!}</a>]
- </#list>
+ <#if commissionReport.salesInvoiceIds?has_content>
+ <#list commissionReport.salesInvoiceIds as salesInvoiceId>
+ [<a href="/ap/control/invoiceOverview?invoiceId=${salesInvoiceId!}">${salesInvoiceId!}</a>]
+ </#list>
+ </#if>
</td>
<td><@ofbizCurrency amount = commissionReport.commissionAmount!/></td>
<td><@ofbizCurrency amount = commissionReport.netSale!/></td>
@@ -72,7 +73,6 @@
<li class="label">${uiLabelMap.AccountingTotalNumberOfOrders} : ${totalNumberOfOrders!}</li>
</ul>
</div>
- </form>
<#else>
<td colspan='4'><h3>${uiLabelMap.AccountingNoRecordFound}</h3></td>
</#if>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl Thu Aug 13 15:20:30 2009
@@ -54,7 +54,7 @@
<#list commissionReportList as commissionReport>
<fo:table-row height="14px">
<fo:table-cell>
- <fo:block>${commissionReport.productId!}</fo:block>
+ <fo:block>${commissionReport.productName!}</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>${commissionReport.quantity!}</fo:block>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryForms.xml Thu Aug 13 15:20:30 2009
@@ -129,7 +129,26 @@
<field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit" tooltip="Please enter From and Thru date in fields above"><submit button-type="button"/></field>
</form>
- <form name="IncomeStatementList" type="list" list-name="glAccountTotalsList"
+ <form name="IncomeStatementList" type="list" list-name="glAccountIncomeList"
+ odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+ <row-actions>
+ <entity-one entity-name="GlAccount" value-field="glAccount">
+ <field-map field-name="glAccountId" from-field="glAccountId"/>
+ </entity-one>
+ </row-actions>
+ <field name="glAccountId" use-when="isPdf != true">
+ <hyperlink target="FindAcctgTransEntries" description="${glAccountId}">
+ <parameter param-name="glAccountId"/>
+ <parameter param-name="organizationPartyId"/>
+ </hyperlink>
+ </field>
+ <field name="glAccountId" use-when="isPdf == true"><display description="${glAccountId}"/></field>
+ <field name="accountName"><display description="${glAccount.accountName}"/></field>
+ <field name="totalAmount"><display type="currency" currency="${currencyUomId}"/></field>
+ <field name="totalOfCurrentFiscalPeriod"><display type="currency" currency="${currencyUomId}"/></field>
+ </form>
+
+ <form name="ExpenseStatementList" type="list" list-name="glAccountExpenseList"
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
<row-actions>
<entity-one entity-name="GlAccount" value-field="glAccount">
@@ -294,7 +313,18 @@
<field name="debit"><display type="currency" currency="${currencyUomId}"/></field>
<field name="credit"><display type="currency" currency="${currencyUomId}"/></field>
</form>
- <form name="IncomeStatementListCsv" type="list" list-name="glAccountTotalsList" view-size="99999">
+
+ <form name="IncomeStatementListCsv" type="list" list-name="glAccountIncomeList" view-size="99999">
+ <row-actions>
+ <entity-one entity-name="GlAccount" value-field="glAccount"/>
+ </row-actions>
+ <field name="glAccountId"><display description="${glAccountId}"/></field>
+ <field name="glAccountName"><display description="${glAccount.accountName}"/></field>
+ <field name="totalAmount"><display type="currency" currency="${currencyUomId}"/></field>
+ <field name="totalOfCurrentFiscalPeriod"><display type="currency" currency="${currencyUomId}"/></field>
+ </form>
+
+ <form name="ExpenseStatementListCsv" type="list" list-name="glAccountExpenseList" view-size="99999">
<row-actions>
<entity-one entity-name="GlAccount" value-field="glAccount"/>
</row-actions>
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/ReportFinancialSummaryScreens.xml Thu Aug 13 15:20:30 2009
@@ -373,12 +373,15 @@
<parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
<parameter param-name="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/>
</link>
+ <container style="h3"><label text="${uiLabelMap.AccountingIncome}"/></container>
<include-form name="IncomeStatementList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
- <container>
- <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/>
- </container>
+ <container style="h3"><label text="${uiLabelMap.AccountingExpences}"/></container>
+ <include-form name="ExpenseStatementList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
</container>
</container>
+ <container>
+ <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/>
+ </container>
</widgets>
</section>
</decorator-section>
@@ -692,10 +695,11 @@
<widgets>
<decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="body">
+ <container style="h3"><label text="${uiLabelMap.AccountingIncome}"/></container>
<include-form name="IncomeStatementList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
- <container>
- <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/>
- </container>
+ <container style="h3"><label text="${uiLabelMap.AccountingExpences}"/></container>
+ <include-form name="ExpenseStatementList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+ <container><label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/></container>
</decorator-section>
</decorator-screen>
</widgets>
@@ -710,10 +714,11 @@
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/>
</actions>
<widgets>
+ <container><label text="${uiLabelMap.AccountingIncome}"/></container>
<include-form name="IncomeStatementListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
- <container>
- <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/>
- </container>
+ <container><label text="${uiLabelMap.AccountingExpences}"/></container>
+ <include-form name="ExpenseStatementListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+ <container><label text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/></container>
</widgets>
</section>
</screen>
Modified: ofbiz/branches/executioncontext20090812/applications/product/webapp/facility/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/product/webapp/facility/facility/FacilityForms.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/product/webapp/facility/facility/FacilityForms.xml Thu Aug 13 15:20:30 2009
@@ -70,6 +70,16 @@
<field name="productId"><text-find/></field>
<field name="internalName"><text-find/></field>
<field name="inventoryItemId"><text-find/></field>
+ <field name="statusId">
+ <drop-down allow-empty="true">
+ <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+ <entity-constraint name="statusTypeId" operator="equals" value="INV_NON_SER_STTS"/>
+ </entity-options>
+ <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+ <entity-constraint name="statusTypeId" operator="equals" value="INV_SERIALIZED_STTS"/>
+ </entity-options>
+ </drop-down>
+ </field>
<field name="serialNumber"><text-find/></field>
<field name="softIdentifier"><text/></field>
<field name="manufacturerPartyId">
Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleScreens.xml Thu Aug 13 15:20:30 2009
@@ -39,7 +39,7 @@
<widgets>
<!-- Uncomment this section to see the ExecutionContext in action
<container style="button-bar"><label text="Execution path for this screen: ${executionContext}"/></container>
- <container style="button-bar"><label text="What is contains: root/application/screen/screen/decorator/decorator"/></container>
+ <container style="button-bar"><label text="What it contains: root/application/screen/screen/decorator/decorator"/></container>
-->
<decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="menu-bar">
Modified: ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Thu Aug 13 15:20:30 2009
@@ -677,7 +677,7 @@
for (ModelParam modelParam: modelService.getInModelParamList()) {
// skip auto params that the service engine populates...
- if ("userLogin".equals(modelParam.name) || "locale".equals(modelParam.name) || "timeZone".equals(modelParam.name)) {
+ if (modelParam.internal) {
continue;
}
if (modelParam.formDisplay) {
Modified: ofbiz/branches/executioncontext20090812/framework/widget/templates/foFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/widget/templates/foFormMacroLibrary.ftl?rev=803928&r1=803927&r2=803928&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/widget/templates/foFormMacroLibrary.ftl Thu Aug 13 15:20:30 2009
@@ -33,7 +33,7 @@
<#assign foStyle = foStyles[style]?default("")/>
${foStyle?default("")}
</#macro>
-<#macro makeBlock style text><fo:block<#if style?has_content> <@getFoStyle style/></#if>><#if text?exists>${text?xml}</#if></fo:block></#macro>
+<#macro makeBlock style text><fo:block<#if style?has_content> <@getFoStyle style/></#if>><#if text?exists>${text}</#if></fo:block></#macro>
<#macro renderField text><#if text?exists>${text}</#if></#macro>