svn commit: r806581 [2/4] - in /ofbiz/branches/executioncontext20090812: ./ applications/accounting/config/ applications/accounting/script/org/ofbiz/accounting/finaccount/ applications/accounting/script/org/ofbiz/accounting/ledger/ applications/account...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r806581 [2/4] - in /ofbiz/branches/executioncontext20090812: ./ applications/accounting/config/ applications/accounting/script/org/ofbiz/accounting/finaccount/ applications/accounting/script/org/ofbiz/accounting/ledger/ applications/account...

adrianc
Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl Fri Aug 21 14:59:16 2009
@@ -95,6 +95,9 @@
             <th>${uiLabelMap.FormFieldTitle_paymentMethodTypeId}</th>
             <th>${uiLabelMap.CommonStatus}</th>
             <th>${uiLabelMap.CommonComments}</th>
+            <#if FinAccountTranstions?has_content>
+              <th>${uiLabelMap.AccountingRemoveFromGlReconciliation}</th>
+            </#if>
           </tr>
           <#assign alt_row = false/>
           <#list finAccountTransList as finAccountTrans>
@@ -139,6 +142,11 @@
               <td><#if paymentMethodType?has_content>${paymentMethodType.description?if_exists}</#if></td>
               <td><#if status?has_content>${status.description?if_exists}</#if></td>
               <td>${finAccountTrans.comments?if_exists}</td>
+              <#if finAccountTrans.statusId == "FINACT_TRNS_CREATED">
+                <td align="center"><a href="javascript:document.reomveFinAccountTransAssociation_${finAccountTrans.finAccountTransId}.submit();" class="buttontext">${uiLabelMap.CommonRemove}</a></td>
+              <#else>
+                <td/>
+              </#if>
             </tr>
             <#assign alt_row = !alt_row/>
           </#list>
@@ -153,3 +161,10 @@
     </div>
   </div>
 </form>
+<#list finAccountTransList as finAccountTrans>
+  <form name="reomveFinAccountTransAssociation_${finAccountTrans.finAccountTransId}" method="post" action="<@ofbizUrl>reomveFinAccountTransAssociation</@ofbizUrl>">
+    <input name="finAccountTransId" type="hidden" value="${finAccountTrans.finAccountTransId}"/>
+    <input name="finAccountId" type="hidden" value="${finAccountTrans.finAccountId}"/>
+    <input name="glReconciliationId" type="hidden" value="${glReconciliationId}"/>
+  </form>
+</#list>
\ No newline at end of file

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/ledger/CostCenters.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/ledger/CostCenters.ftl?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/ledger/CostCenters.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/ledger/CostCenters.ftl Fri Aug 21 14:59:16 2009
@@ -19,8 +19,7 @@
 -->
 <#if glAcctgAndAmountPercentageList?has_content && glAccountCategories?has_content>
 
-  <form name="costCenters" id="costCenters" method="post" action="<@ofbizUrl>createGlAcctCatMemFromCostCenters</@ofbizUrl>">
-    <input type="hidden" name="_useRowSubmit" value="Y">
+  <form name="costCenters" id="costCenters" method="post">
     <table class="basic-table hover-bar" cellspacing="0">
       <tr class="header-row">
         <th>${uiLabelMap.FormFieldTitle_glAccountId}</th>
@@ -30,30 +29,31 @@
           <th>${glAccountCategory.description!}</th>
         </#list>
       </tr>
-      
+
       <#list glAcctgAndAmountPercentageList as glAcctgAndAmountPercentage>
         <tr>
-          <#assign glAccountOrganizationIndex = glAcctgAndAmountPercentage_index + 1/>
           <td>${glAcctgAndAmountPercentage.glAccountId}</td>
           <td>${glAcctgAndAmountPercentage.accountCode!}</td>
           <td>${glAcctgAndAmountPercentage.accountName!}</td>
           <#list glAccountCategories as glAccountCategory>
             <td>
-              <input type="hidden" id="glAccountId_${glAcctgAndAmountPercentage.glAccountId}" name="glAccountId_o_${glAccountOrganizationIndex}${glAccountCategory_index}" value="${glAcctgAndAmountPercentage.glAccountId!}"/>
-              <input type="hidden" id="glAccountCategoryId_${glAccountCategory.glAccountCategoryId}_${glAcctgAndAmountPercentage.glAccountId}" name="glAccountCategoryId_o_${glAccountOrganizationIndex}${glAccountCategory_index}" value="${(glAccountCategory.glAccountCategoryId!)}"/>
-              
+              <input type="hidden" id="glAccountId_${glAcctgAndAmountPercentage.glAccountId}" name="glAccountId_${glAcctgAndAmountPercentage.glAccountId!}" value="${glAcctgAndAmountPercentage.glAccountId!}"/>
+              <input type="hidden" id="glAccountCategoryId_${glAccountCategory.glAccountCategoryId!}_${glAcctgAndAmountPercentage.glAccountId!}" name="glAccountCategoryId_${glAccountCategory.glAccountCategoryId!}_${glAcctgAndAmountPercentage.glAccountId!}" value="${(glAccountCategory.glAccountCategoryId!)}"/>
+              <#assign id = "amountPercentage_" + glAcctgAndAmountPercentage.glAccountId + "_" + glAccountCategory.glAccountCategoryId/>
               <#if (glAcctgAndAmountPercentage[glAccountCategory.glAccountCategoryId!])??>
-                <input type="text" id="amountPercentage_${glAccountCategory.glAccountCategoryId}_${glAcctgAndAmountPercentage.glAccountId}" name="amountPercentage_o_${glAccountOrganizationIndex}${glAccountCategory_index}" value="${(glAcctgAndAmountPercentage[glAccountCategory.glAccountCategoryId!])!}"/>
+                <input type="text" id="${id}" name="${id}" value="${(glAcctgAndAmountPercentage[glAccountCategory.glAccountCategoryId!])!}" onchange="javascript:changeAmountPercentage(id);"/>
               <#else>
-                <input type="text" id="amountPercentage_${glAccountCategory.glAccountCategoryId}_${glAcctgAndAmountPercentage.glAccountId}" name="amountPercentage_o_${glAccountOrganizationIndex}${glAccountCategory_index}" value=""/>
+                <input type="text" id="${id}" name="${id}" value="" onchange="javascript:changeAmountPercentage(id);"/>
               </#if>
-              <input name="_rowSubmit_o_${glAccountOrganizationIndex}${glAccountCategory_index}" type="hidden" value="Y"/>
             </td>
           </#list>
+          <td>
+            <span id="notValidTotal_${glAcctgAndAmountPercentage.glAccountId}" style="display:none">${uiLabelMap.FormFieldTitle_notValidTotal}</span>
+            <span id="validTotal_${glAcctgAndAmountPercentage.glAccountId}" style="display:none">${uiLabelMap.FormFieldTitle_validTotal}</span>
+          </td>
         </tr>
       </#list>
     </table>
-    <div align="right"><input type="submit" id="costCentersSubmit" value="${uiLabelMap.CommonSubmit}"/></div>
   </form>
 <#else>
   <label>${uiLabelMap.AccountingNoRecordFound}</label>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/payment/PaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/payment/PaymentForms.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/payment/PaymentForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/accounting/payment/PaymentForms.xml Fri Aug 21 14:59:16 2009
@@ -124,6 +124,15 @@
         <field name="overrideGlAccountId" position="2"><lookup target-form-name="LookupGlAccount"/></field>
         <field name="amount" position="1"><text/></field>
         <field name="comments" position="2"><text size="70"/></field>
+        <field name="finAccountId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="FinAccount" description="${finAccountName} [${finAccountId}]" filter-by-date="true">
+                    <entity-constraint name="finAccountTypeId" value="BANK_ACCOUNT"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="isDepositWithDrawPayment"><hidden value="Y"/></field>
+        <field name="finAccountTransTypeId"><hidden value="WITHDRAWAL"/></field>
         <field position="1" name="createButton" widget-style="smallSubmit">
             <submit button-type="button"/>
         </field>
@@ -159,6 +168,15 @@
         <field name="overrideGlAccountId" position="2"><lookup target-form-name="LookupGlAccount"/></field>
         <field name="amount" position="1"><text/></field>
         <field name="comments" position="2"><text size="70"/></field>
+        <field name="finAccountId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="FinAccount" description="${finAccountName} [${finAccountId}]" filter-by-date="true">
+                    <entity-constraint name="finAccountTypeId" value="BANK_ACCOUNT"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="isDepositWithDrawPayment"><hidden value="Y"/></field>
+        <field name="finAccountTransTypeId"><hidden value="DEPOSIT"/></field>
         <field position="1" name="createButton" widget-style="smallSubmit">
             <submit button-type="button"/>
         </field>
@@ -415,8 +433,7 @@
         <field name="effectiveDate" position="1"><display type="date"/></field>
         <field name="comments" position="2"><display/></field>
         <!--field name="paymentGatewayResponseId" title="Paym Gatw Resp." position="2"><display/></field-->
-        <field name="finAccountTransId" position="1"><display/></field>
-        <field name="overrideGlAccountId" position="2"><display/></field>
+        <field name="overrideGlAccountId" position="1"><display/></field>
     </form>
 
     <form name="paymentApplications" type="list" list-name="paymentApplications"
@@ -551,4 +568,17 @@
         <field name="paidAmount"><display/></field>
         <field name="outstandingAmount"><display/></field>
     </form>
+    <form name="FinAccountTransAssociatedWithPayment" type="single" default-map-name="finAccountTrans" odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <field name="finAccountTransId" position="1"><display/></field>
+        <field name="finAccountTransTypeId" title="${uiLabelMap.FormFieldTitle_finAccountTransType}" position="2"><display-entity entity-name="FinAccountTransType" description="${description}"/></field>
+        <field name="amount" position="3"><display type="currency" currency="${payment.currencyUomId}"/></field>
+        <field name="glReconciliationId" position="1">
+            <hyperlink target="ViewGlReconciliationWithTransaction" description="${finAccountTrans.glReconciliationId}">
+                <parameter param-name="glReconciliationId" from-field="finAccountTrans.glReconciliationId"/>
+                <parameter param-name="finAccountId" from-field="finAccountTrans.finAccountId"/>
+            </hyperlink>
+        </field>
+        <field name="transactionDate" position="2"><display/></field>
+        <field name="statusId"  position="3" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/></field>
+    </form>
 </forms>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/controller.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/controller.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ap/WEB-INF/controller.xml Fri Aug 21 14:59:16 2009
@@ -83,7 +83,7 @@
     </request-map>
     <request-map uri="createPayment">
         <security https="true" auth="true"/>
-        <event type="service" invoke="createPayment"/>
+        <event type="service" invoke="createPaymentAndFinAccountTrans"/>
         <response name="success" type="view" value="editPayment"/>
         <response name="error" type="view" value="NewOutgoingPayment"/>
     </request-map>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy Fri Aug 21 14:59:16 2009
@@ -24,6 +24,12 @@
 import org.ofbiz.entity.condition.EntityOperator;
 if ("Y".equals(parameters.noConditionFind)) {
     List paymentCond = [];
+    payments = [];
+    finAccountId = parameters.finAccountId;
+    context.finAccountId = parameters.finAccountId;
+    paymentStatusCond = EntityCondition.makeCondition([EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_RECEIVED"),
+                                EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_SENT")], EntityOperator.OR);
+    paymentCond.add(paymentStatusCond);
     if (paymentMethodTypeId) {
         paymentCond.add(EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId));
     }
@@ -41,11 +47,12 @@
         if (finAccountTransList) {
             finAccountTransIds = EntityUtil.getFieldListFromEntityList(finAccountTransList, "finAccountTransId", true);
             paymentCond.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.IN, finAccountTransIds));
+            payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
         }
     } else {
-        paymentCond.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.NOT_EQUAL, null));
+        paymentCond.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.EQUALS, null));
+        payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
     }
-    payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
     paymentListWithCreditCard = [];
     paymentListWithoutCreditCard = [];
     if (payments) {

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/controller.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/controller.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/WEB-INF/controller.xml Fri Aug 21 14:59:16 2009
@@ -43,7 +43,7 @@
     </request-map>
     <request-map uri="createPaymentBatch">
         <security https="true" auth="true"/>
-        <event type="service" invoke="checkAndCreateBatchForValidPayments"/>
+        <event type="service" invoke="depositWithdrawPayments"/>
         <response name="success" type="view" value="PaymentGroupOverview"/>
         <response name="error" type="view" value="BatchPayments"/>
     </request-map>
@@ -53,7 +53,7 @@
     </request-map>
     <request-map uri="createPayment">
         <security https="true" auth="true"/>
-        <event type="service" invoke="createPayment"/>
+        <event type="service" invoke="createPaymentAndFinAccountTrans"/>
         <response name="success" type="view" value="editPayment"/>
         <response name="error" type="view" value="NewIncomingPayment"/>
     </request-map>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/payment/batchPayments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/payment/batchPayments.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/webapp/ar/payment/batchPayments.ftl Fri Aug 21 14:59:16 2009
@@ -72,11 +72,12 @@
         <form id="paymentBatchForm" name="paymentBatchForm" method="post" action="<@ofbizUrl>createPaymentBatch</@ofbizUrl>">
             <#if paymentList?has_content>
                 <div>
-                    <span class="label">${uiLabelMap.AccountingPayment} ${uiLabelMap.PartyPartyGroupName}</span>
-                    <input type="text" size='25' id="paymentGroupName" name='paymentGroupName'>
                     <input type="hidden" name='organizationPartyId' value="${organizationPartyId?if_exists}">
                     <input type="hidden" name='paymentGroupTypeId' value="BATCH_PAYMENT">
-                    <input type="hidden" name='finAccountId' value="${finAccountId?if_exists}">
+                    <input type="hidden" name="groupInOneTransaction" value="Y"/>
+                    <#if finAccountId?has_content>
+                        <input type="hidden" name='finAccountId' value="${finAccountId?if_exists}">
+                    </#if>
                     <input type="hidden" name='paymentMethodTypeId' value="${paymentMethodTypeId?if_exists}">
                     <input type="hidden" name='cardType' value="${cardType?if_exists}">
                     <input type="hidden" name='partyIdFrom' value="${partyIdFrom?if_exists}">
@@ -117,6 +118,16 @@
                         </tr>
                     </#list>
                     <div align="right">
+                        <span class="label">${uiLabelMap.AccountingPaymentGroupName}</span>
+                        <input type="text" size='25' id="paymentGroupName" name='paymentGroupName'>
+                        <#if finAccounts?has_content>
+                            <span class="label">${uiLabelMap.AccountingBankAccount}</span>
+                            <select name="finAccountId">
+                                <#list finAccounts as finAccount>
+                                    <option value="${finAccount.get("finAccountId")}">${finAccount.get("finAccountName")} [${finAccount.get("finAccountId")}]</option>
+                                </#list>
+                            </select>
+                        </#if>
                         <input id="submitButton" type="submit" value="${uiLabelMap.AccountingCreateBatch}"/>
                     <div>
                 </table>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountForms.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountForms.xml Fri Aug 21 14:59:16 2009
@@ -45,7 +45,7 @@
             <service service-name="performFind" result-map="result" result-map-list="listIt">
                 <field-map field-name="inputFields" from-field="parameters"/>
                 <field-map field-name="entityName" value="FinAccount"/>
-                <field-map field-name="orderBy" value="fromDate"/>
+                <field-map field-name="orderBy" value="finAccountId"/>
             </service>
         </actions>
         <auto-fields-entity entity-name="FinAccount" default-field-type="display"/>
@@ -131,7 +131,8 @@
         <field name="isRefundable">
             <drop-down no-current-selected-key="Y"><option key="Y" description="${uiLabelMap.CommonY}"/><option key="N" description="${uiLabelMap.CommonN}"/></drop-down>
         </field>
-        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="submitButton" use-when="finAccountId==null" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="submitButton" use-when="finAccountId!=null" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
         <field name="actualBalance"><display/></field>
         <field name="availableBalance"><display/></field>
     </form>
@@ -200,6 +201,14 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="glAccountId" title="${uiLabelMap.AccountingGlAccount}">
+            <drop-down>
+                <entity-options entity-name="GlAccountOrganizationAndClass" description="${accountCode} - ${accountName} [${glAccountId}]" key-field-name="glAccountId">
+                    <entity-constraint name="organizationPartyId" operator="equals" env-name="defaultOrganizationPartyId"/>
+                    <entity-order-by field-name="glAccountId"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountScreens.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/FinAccountScreens.xml Fri Aug 21 14:59:16 2009
@@ -116,26 +116,26 @@
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
+                            <condition>
+                                <not><if-empty field="finAccountId"/></not>
+                            </condition>
                             <widgets>
-                                <container style="screenlet">
-                                    <container style="screenlet-title-bar">
-                                        <container style="h3">
-                                            <label text="${uiLabelMap.AccountingEditFinAccount}"/>
-                                        </container>
-                                    </container>
-                                    <container style="screenlet-body">
-                                        <section>
-                                            <condition><not><if-empty field="finAccountId"/></not></condition>
-                                            <widgets>
-                                                <container style="button-bar">
-                                                    <link target="EditFinAccount" text="${uiLabelMap.AccountingCreateNewFinAccount}" style="buttontext"/>
-                                                </container>
-                                            </widgets>
-                                        </section>
-                                        <include-form name="EditFinAccount" location="component://accounting/widget/FinAccountForms.xml"/>
-                                    </container>
+                                <container style="h1">
+                                    <label text="${uiLabelMap.AccountingEditFinAccount}"/>
                                 </container>
+                                <screenlet id="EditFinAccountPanel" collapsible="true">
+                                    <link target="EditFinAccount" text="${uiLabelMap.AccountingCreateNewFinAccount}" style="buttontext"/>
+                                    <include-form name="EditFinAccount" location="component://accounting/widget/FinAccountForms.xml"/>
+                                </screenlet>
                             </widgets>
+                            <fail-widgets>
+                                <container style="h1">
+                                    <label text="${uiLabelMap.AccountingCreateNewFinAccount}"/>
+                                </container>
+                                <screenlet id="CreateFinAccountPanel" collapsible="true">
+                                    <include-form name="EditFinAccount" location="component://accounting/widget/FinAccountForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
                         </section>
                     </decorator-section>
                 </decorator-screen>
@@ -157,7 +157,10 @@
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet id="FinAccountRolePanel" title="${uiLabelMap.AccountingEditFinAccountRoleFor}" collapsible="true">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingEditFinAccountRoleFor}"/>
+                        </container>
+                        <screenlet id="FinAccountRolePanel" collapsible="true">
                             <include-form name="AddFinAccountRole" location="component://accounting/widget/FinAccountForms.xml"/>
                         </screenlet>
                         <include-form name="ListFinAccountRoles" location="component://accounting/widget/FinAccountForms.xml"/>
@@ -179,7 +182,10 @@
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet id="FinAccountTransPanel" title="${uiLabelMap.AccountingEditFinAccountTransactionFor}" collapsible="true">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingEditFinAccountTransactionFor}"/>
+                        </container>
+                        <screenlet id="FinAccountTransPanel" collapsible="true">
                             <include-form name="AddFinAccountTrans" location="component://accounting/widget/FinAccountForms.xml"/>
                         </screenlet>
                     </decorator-section>
@@ -222,6 +228,7 @@
                 <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
                 <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
                 <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
                 <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy"/>
             </actions>
             <widgets>
@@ -298,6 +305,7 @@
                 <set field="titleProperty" value="AccountingFindDepositSlip"/>
                 <set field="tabButtonItem" value="findDepositSlips"/>
                 <set field="finAccountId" from-field="parameters.finAccountId"/>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
@@ -373,12 +381,12 @@
                 <set field="finAccountId" from-field="parameters.finAccountId"/>
                 <set field="headerItem" value="FindFinAccount"/>
                 <set field="paymentMethodTypeId" from-field="parameters.paymentMethodTypeId"/>
-                <set field="finAccountId" from-field="parameters.finAccountId"/>
                 <set field="cardType" from-field="parameters.cardType"/>
                 <set field="fromDate" type="Timestamp" from-field="parameters.fromDate"/>
                 <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
                 <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
                 <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
                 <script location="component://accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy"/>
             </actions>
             <widgets>
@@ -442,12 +450,16 @@
                                 </link>
                             </widgets>
                         </section>
-                        <screenlet id="FinAccountTransPanel" collapsible="true">
-                            <include-form name="FindFinAccountTransactions" location="component://accounting/widget/FinAccountForms.xml"/>
-                        </screenlet>
-                        <platform-specific>
-                            <html><html-template location="component://accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl"/></html>
-                        </platform-specific>
+                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                            <decorator-section name="search-options">
+                                <include-form name="FindFinAccountTransactions" location="component://accounting/widget/FinAccountForms.xml"/>
+                            </decorator-section>
+                            <decorator-section name="search-results">
+                                <platform-specific>
+                                    <html><html-template location="component://accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl"/></html>
+                                </platform-specific>
+                            </decorator-section>
+                        </decorator-screen>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -469,6 +481,9 @@
                         <link target="EditFinAccountTrans" text="${uiLabelMap.CommonCreateNew}" style="buttontext">
                             <parameter param-name="finAccountId" from-field="finAccountId"/>
                         </link>
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingReconcileFinAccountTransFor}"/>
+                        </container>
                         <section>
                             <condition>
                                 <not>
@@ -528,11 +543,15 @@
                 <set field="statusId" value="PMNT_RECEIVED"/>
                 <set field="parentTypeId" value="RECEIPT"/>
                 <set field="finAccountTransTypeId" value="DEPOSIT"/>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet title="${uiLabelMap.AccountingCreateNewDepositPayment}">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingCreateNewDepositPaymentFor}"/>
+                        </container>
+                        <screenlet id="EditDepositPaymentPanel" collapsible="true">
                             <include-form name="EditDepositPayment" location="component://accounting/widget/FinAccountForms.xml"/>
                         </screenlet>
                     </decorator-section>
@@ -548,11 +567,15 @@
                 <set field="statusId" value="PMNT_SENT"/>
                 <set field="parentTypeId" value="DISBURSEMENT"/>
                 <set field="finAccountTransTypeId" value="WITHDRAWAL"/>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet title="${uiLabelMap.AccountingCreateNewWithdrawalPayment}">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingCreateNewWithdrawalPaymentFor}"/>
+                        </container>
+                        <screenlet id="EditWithdrawalPaymentPanel" collapsible="true">
                             <include-form name="EditWithdrawalPayment" location="component://accounting/widget/FinAccountForms.xml"/>
                         </screenlet>
                     </decorator-section>
@@ -572,11 +595,15 @@
                     <field-map field-name="glAccountId" from-field="finAccount.postToGlAccountId"/>
                     <order-by field-name="reconciledDate DESC"/>
                 </entity-and>
+                <entity-one entity-name="FinAccount" value-field="finAccount"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet id="FinAccountReconciliationPanel" title="${uiLabelMap.AccountingEditFinAccountReconciliations}" collapsible="true">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingEditFinAccountReconciliations}"/>
+                        </container>
+                        <screenlet id="FinAccountReconciliationPanel" collapsible="true">
                             <include-form name="EditFinAccountReconciliation" location="component://accounting/widget/FinAccountForms.xml"/>
                         </screenlet>
                         <include-form name="ListFinAccountReconciliations" location="component://accounting/widget/FinAccountForms.xml"/>
@@ -603,10 +630,20 @@
                 </entity-condition>
                 <service service-name="getFinAccountTransListAndTotals" result-map="transactionTotalAmount"/>
                 <set field="finAccountTransList" from-field="transactionTotalAmount.finAccountTransList" type="List"/>
+                <set field="finAccountTransIds" value="${groovy:org.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(finAccountTransList, 'finAccountTransId', true);}" type="List"/>
+                <entity-condition entity-name="FinAccountTrans" list="FinAccountTranstions">
+                    <condition-list>
+                        <condition-expr field-name="finAccountTransId" operator="in" from-field="finAccountTransIds"/>
+                        <condition-expr field-name="statusId" value="FINACT_TRNS_CREATED"/>
+                    </condition-list>
+                </entity-condition>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">
                     <decorator-section name="body">
+                        <container style="h1">
+                            <label text="${uiLabelMap.AccountingGlReconciliationFor}"></label>
+                        </container>
                         <platform-specific>
                             <html><html-template location="component://accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl"/></html>
                         </platform-specific>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/GlobalGlAccountsScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/GlobalGlAccountsScreens.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/GlobalGlAccountsScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/GlobalGlAccountsScreens.xml Fri Aug 21 14:59:16 2009
@@ -468,6 +468,7 @@
                 <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="titleProperty" value="FormFieldTitle_costCenters"/>
                 <set field="tabButtonItem" value="CostCenters"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/accounting/images/costCenters.js" global="true"/>
             </actions>
             <widgets>
                <decorator-screen name="GlobalGLSettingsDecorator" location="${parameters.mainDecoratorLocation}">

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/Menus.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/Menus.xml Fri Aug 21 14:59:16 2009
@@ -38,7 +38,7 @@
             <link target="FindPaymentGatewayConfig"/>
         </menu-item>
         <menu-item name="billingaccount" title="${uiLabelMap.AccountingBillingMenu}"><link target="FindBillingAccount"/></menu-item>
-        <menu-item name="FindFinAccount" title="${uiLabelMap.AccountingFinAccount}"><link target="FindFinAccount"/></menu-item>
+        <menu-item name="FindFinAccount" title="${uiLabelMap.AccountingFinAccount}"><link target="FinAccountMain"/></menu-item>
         <menu-item name="TaxAuthorities" title="${uiLabelMap.AccountingTaxAuthorities}"><link target="FindTaxAuthority"/></menu-item>
         <menu-item name="agreements" title="${uiLabelMap.AccountingAgreements}"><link target="FindAgreement"/></menu-item>
         <menu-item name="ListFixedAssets" title="${uiLabelMap.AccountingFixedAssets}"><link target="ListFixedAssets"/></menu-item>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentGroupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentGroupForms.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentGroupForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentGroupForms.xml Fri Aug 21 14:59:16 2009
@@ -91,13 +91,33 @@
     
     <!-- Payment Group Member -->
     <form name="ListPaymentGroupMember" type="list" list-name="paymentGroupMembers" target="updatePaymentGroupMember">
-        <auto-fields-service service-name="updatePaymentGroupMember"/>
+        <row-actions>
+            <entity-one entity-name="Payment" value-field="payment"/>
+            <set field="paymentTypeId" from-field="payment.paymentTypeId"/>
+            <set field="partyIdFrom" from-field="payment.partyIdFrom"/>
+            <set field="partyIdTo" from-field="payment.partyIdTo"/>
+        </row-actions>
         <field name="paymentGroupId"><hidden/></field>
         <field name="paymentId">
             <hyperlink target="paymentOverview" description="${paymentId}">
                 <parameter param-name="paymentId"/>
             </hyperlink>
         </field>
+        <field name="partyIdFrom" title="${uiLabelMap.AccountingFromParty}">
+            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${lastName} ${firstName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdFrom}]" >
+                    <parameter param-name="partyId" from-field="partyIdFrom"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="partyIdTo" title="${uiLabelMap.AccountingToParty}">
+            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${lastName} ${firstName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdTo}]" >
+                    <parameter param-name="partyId" from-field="partyIdTo"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="paymentTypeId" title="${uiLabelMap.OrderPaymentType}"><display-entity entity-name="PaymentType" description="${description}"/></field>
         <field name="fromDate"><display/></field>
         <field name="thruDate"><date-time/></field>
         <field name="deleteLink" title="" widget-style="buttontext">
@@ -124,15 +144,31 @@
             <set field="statusId" from-field="payment.statusId"/>
             <set field="amount" from-field="payment.amount"/>
             <set field="paymentTypeId" from-field="payment.paymentTypeId"/>
+            <set field="partyIdFrom" from-field="payment.partyIdFrom"/>
+            <set field="partyIdTo" from-field="payment.partyIdTo"/>
         </row-actions>
         <field name="paymentId">
             <hyperlink target="paymentOverview" description="${paymentId}">
                 <parameter param-name="paymentId"/>
             </hyperlink>
         </field>
+        <field name="partyIdFrom" title="${uiLabelMap.AccountingFromParty}">
+            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${lastName} ${firstName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdFrom}]" >
+                    <parameter param-name="partyId" from-field="partyIdFrom"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="partyIdTo" title="${uiLabelMap.AccountingToParty}">
+            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${lastName} ${firstName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdTo}]" >
+                    <parameter param-name="partyId" from-field="partyIdTo"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
         <field name="paymentTypeId" title="${uiLabelMap.OrderPaymentType}"><display-entity entity-name="PaymentType" description="${description}"/></field>
         <field name="statusId" title="${uiLabelMap.AccountingPaymentStatus}"><display-entity entity-name="StatusItem"/></field>
-        <field name="amount"><display also-hidden="false" type="currency" currency="${currencyUomId}"/></field>
+        <field name="amount"><display also-hidden="false" type="currency" currency="${payment.currencyUomId}"/></field>
         <field name="fromDate"><display/></field>
         <field name="thruDate"><display/></field>
     </form>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentScreens.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/PaymentScreens.xml Fri Aug 21 14:59:16 2009
@@ -325,10 +325,13 @@
                 <set field="labelTitleProperty" value="PageTitlePaymentOverview"/>
                 <set field="paymentId" from-field="parameters.paymentId"/>
                 <entity-one entity-name="Payment" value-field="payment"/>
+                <set field="finAccountTransId" from-field="payment.finAccountTransId"/>
+                <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
                 <set field="appliedAmount" value="${bsh:org.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment).toString()}"/>
                 <set field="notAppliedAmount" value="${bsh:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment).toString()}"/>
                 <entity-condition entity-name="AcctgTransAndEntries" list="AcctgTransAndEntries">
                     <condition-expr field-name="paymentId" from-field="paymentId"/>
+                    <order-by field-name="acctgTransId"/>
                     <order-by field-name="acctgTransEntrySeqId"/>
                 </entity-condition>
             </actions>
@@ -355,6 +358,16 @@
                                         </link>
                                         <include-form name="paymentApplications" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
                                     </screenlet>
+                                    <section>
+                                        <condition>
+                                            <not><if-empty field="finAccountTransId"/></not>
+                                        </condition>
+                                        <widgets>
+                                            <screenlet title="${uiLabelMap.AccountingFinAccountTransaction}">
+                                                <include-form name="FinAccountTransAssociatedWithPayment" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                                            </screenlet>
+                                        </widgets>
+                                    </section>
                                 </container>
                                 <container style="clear"/>
                                 <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
@@ -371,6 +384,16 @@
                                     <screenlet title="${uiLabelMap.AccountingPaymentsApplied} ${appliedAmount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingOpenPayments} ${notAppliedAmount?currency(${payment.currencyUomId})}">
                                         <include-form name="paymentApplications" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
                                     </screenlet>
+                                        <section>
+                                            <condition>
+                                                <not><if-empty field="finAccountTransId"/></not>
+                                            </condition>
+                                            <widgets>
+                                                <screenlet title="${uiLabelMap.AccountingFinAccountTransaction}">
+                                                    <include-form name="FinAccountTransAssociatedWithPayment" location="component://accounting/webapp/accounting/payment/PaymentForms.xml"/>
+                                                </screenlet>
+                                            </widgets>
+                                        </section>
                                 </container>
                                 <container style="clear"/>
                                 <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
@@ -563,4 +586,4 @@
             </widgets>
         </section>
     </screen>
-</screens>
\ No newline at end of file
+</screens>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArMenus.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArMenus.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArMenus.xml Fri Aug 21 14:59:16 2009
@@ -30,8 +30,8 @@
         <menu-item name="findPayments" title="${uiLabelMap.PageTitleFindPayment}">
             <link target="findPayments"/>
         </menu-item>
-        <menu-item name="batchPayments" title="Batch Payments">
+        <menu-item name="batchPayments" title="${uiLabelMap.PageTitleBatchPayments}">
             <link target="batchPayments"/>
         </menu-item>
     </menu>
-</menus>
\ No newline at end of file
+</menus>

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArPaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArPaymentScreens.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArPaymentScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/ArPaymentScreens.xml Fri Aug 21 14:59:16 2009
@@ -55,17 +55,19 @@
     <screen name="BatchPayments">
         <section>
             <actions>
-                <set field="titleProperty" value="PageTitleBatchPayments"/>
+                <set field="titleProperty" value="PageTitleDepositPaymentsAndCreateBatch"/>
                 <set field="headerItem" value="payments"/>
                 <set field="tabButtonItem" value="batchPayments"/>
                 <set field="paymentMethodTypeId" from-field="parameters.paymentMethodTypeId"/>
-                <set field="finAccountId" from-field="parameters.finAccountId"/>
                 <set field="cardType" from-field="parameters.cardType"/>
                 <set field="fromDate" type="Timestamp" from-field="parameters.fromDate"/>
                 <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
                 <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
                 <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
                 <script location="component://accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy"/>
+                <entity-and entity-name="FinAccount" list="finAccounts">
+                    <field-map field-name="finAccountTypeId" value="BANK_ACCOUNT"/>
+                </entity-and>
             </actions>
             <widgets>
                 <decorator-screen name="CommonArPaymentDecorator" location="component://accounting/widget/ar/CommonScreens.xml">

Modified: ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/forms/ArPaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/forms/ArPaymentForms.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/forms/ArPaymentForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/accounting/widget/ar/forms/ArPaymentForms.xml Fri Aug 21 14:59:16 2009
@@ -26,13 +26,6 @@
             <set field="organizationPartyId" from-field="organizationPartyId" default-value="${defaultOrganizationPartyId}"/>
             <set field="noConditionFind" value="Y"/>
         </actions>
-        <field name="finAccountId">
-            <drop-down allow-empty="true">
-                <entity-options entity-name="FinAccount" description="${finAccountName} [${finAccountId}]" filter-by-date="true">
-                    <entity-constraint name="finAccountTypeId" value="BANK_ACCOUNT"/>
-                </entity-options>
-            </drop-down>
-        </field>
         <field name="paymentMethodTypeId" title="${uiLabelMap.FormFieldTitle_paymentMethodTypeId}">
             <drop-down allow-empty="true">
                 <entity-options entity-name="PaymentMethodType" description="${description}">
@@ -58,7 +51,7 @@
         <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
     <form name="FindBatchPaymentsForDepositSlip" target="NewDepositSlip" extends="FindBatchPayments" extends-resource="component://accounting/widget/ar/forms/ArPaymentForms.xml">
-        <field name="finAccountId"><display description="${finAccountId}"/></field>
+        <field name="finAccountId"><hidden value="${finAccountId}"/></field>
     </form>
     <form name="FindArPayments" type="single" target="findPayments" extends="FindPayments" extends-resource="component://accounting/webapp/accounting/payment/PaymentForms.xml">
         <field name="parentTypeId"><hidden value="RECEIPT"/></field>

Modified: ofbiz/branches/executioncontext20090812/applications/content/config/forum.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/content/config/forum.properties?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/content/config/forum.properties (original)
+++ ofbiz/branches/executioncontext20090812/applications/content/config/forum.properties Fri Aug 21 14:59:16 2009
@@ -1 +1,19 @@
-descriptLen=80
\ No newline at end of file
+###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+###############################################################################
+descriptLen=80

Modified: ofbiz/branches/executioncontext20090812/applications/content/template/email/servicenotification.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/content/template/email/servicenotification.ftl?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/content/template/email/servicenotification.ftl (original)
+++ ofbiz/branches/executioncontext20090812/applications/content/template/email/servicenotification.ftl Fri Aug 21 14:59:16 2009
@@ -1,3 +1,21 @@
+<#--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
 
 <pre>
 The service : ${service.name}

Modified: ofbiz/branches/executioncontext20090812/applications/humanres/config/HumanResUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/humanres/config/HumanResUiLabels.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/humanres/config/HumanResUiLabels.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/humanres/config/HumanResUiLabels.xml Fri Aug 21 14:59:16 2009
@@ -617,7 +617,7 @@
         <value xml:lang="zh">预算项目编号</value>
     </property>
     <property key="HumanResCompanyName">
-        <value xml:lang="en">OFBiz: HumanRes Manager</value>
+        <value xml:lang="en">OFBiz: Human Resources Manager</value>
         <value xml:lang="fr">OFBiz : gestion de ressources humaines</value>
         <value xml:lang="it">OFBiz: Gestione Risorse Umane</value>
         <value xml:lang="th">OFBiz: การจัดการบุคคล</value>
@@ -1179,7 +1179,7 @@
     </property>
     <property key="HumanResManagerApplication">
         <value xml:lang="de">Personalverwaltung</value>
-        <value xml:lang="en">HumanRes Manager Application</value>
+        <value xml:lang="en">Human Resources Application</value>
         <value xml:lang="fr">Application de gestion des ressources humaines</value>
         <value xml:lang="it">Applicazione Gestione Risorse Umane</value>
         <value xml:lang="th">โปรแกรมประยุกต์ใช้การจัดการบุคคล</value>

Modified: ofbiz/branches/executioncontext20090812/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/order/servicedef/services.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/order/servicedef/services.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/order/servicedef/services.xml Fri Aug 21 14:59:16 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/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/OrderManagerEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/OrderManagerEvents.java?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/OrderManagerEvents.java (original)
+++ ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/OrderManagerEvents.java Fri Aug 21 14:59:16 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/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/executioncontext20090812/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Aug 21 14:59:16 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/branches/executioncontext20090812/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Fri Aug 21 14:59:16 2009
@@ -228,6 +228,21 @@
             <set field="commRole.statusId" value="COM_ROLE_COMPLETED"/>
             <call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="commRole"/>
         </if-not-empty>
+        
+        <!-- Check Attach File For Forward Email-->
+        <if-compare field="parameters.action" value="FORWARD" operator="equals">
+            <entity-and entity-name="CommEventContentAssoc" list="commEventContentAssoc">
+                <field-map field-name="communicationEventId" from-field="parameters.origCommEventId"/>
+            </entity-and>
+            <iterate entry="createcommEventContentAssoc" list="commEventContentAssoc">
+                <if-not-empty field="createcommEventContentAssoc">              
+                    <!-- Create communication event and content association -->
+                    <set field="contentAssoc.contentId" from-field="createcommEventContentAssoc.contentId"/>
+                    <set field="contentAssoc.communicationEventId" from-field="newEntity.communicationEventId"/>
+                    <call-service service-name="createCommEventContentAssoc" in-map-name="contentAssoc"></call-service>
+                </if-not-empty>
+            </iterate>
+        </if-compare>  
     </simple-method>
 
     <simple-method method-name="updateCommunicationEvent"

Modified: ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Fri Aug 21 14:59:16 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/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Fri Aug 21 14:59:16 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/branches/executioncontext20090812/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/product/servicedef/services_shipment.xml?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/branches/executioncontext20090812/applications/product/servicedef/services_shipment.xml Fri Aug 21 14:59:16 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>

Modified: ofbiz/branches/executioncontext20090812/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy?rev=806581&r1=806580&r2=806581&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy (original)
+++ ofbiz/branches/executioncontext20090812/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy Fri Aug 21 14:59:16 2009
@@ -20,142 +20,144 @@
 import org.ofbiz.entity.condition.*
 import org.ofbiz.product.inventory.InventoryWorker
 
-//If product is virtual gather summary data from variants
-if (product.isVirtual && "Y".equals(product.isVirtual)) {
-    //Get the virtual product feature types
-    result = dispatcher.runSync("getProductFeaturesByType", [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']);
-    featureTypeIds = result.productFeatureTypes;
-
-    //Get the variants
-    result = dispatcher.runSync("getAllProductVariants", [productId : productId]);
-    variants = result.assocProducts;
-    variantIterator = variants.iterator();
-    variantInventorySummaries = [];
-    while (variantIterator) {
-        variant = variantIterator.next();
-
-        //create a map of each variant id and inventory summary (all facilities)
-        inventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", [productId : variant.productIdTo]);
-
-        variantInventorySummary = [productId : variant.productIdTo,
-                                   availableToPromiseTotal : inventoryAvailable.availableToPromiseTotal,
-                                   quantityOnHandTotal : inventoryAvailable.quantityOnHandTotal];
-
-        //add the applicable features to the map
-        featureTypeIdsIterator = featureTypeIds.iterator();
-        while (featureTypeIdsIterator) {
-            featureTypeId = featureTypeIdsIterator.next();
-            result = dispatcher.runSync("getProductFeatures", [productId : variant.productIdTo, type : 'STANDARD_FEATURE', distinct : featureTypeId]);
-            variantFeatures = result.productFeatures;
-            if (variantFeatures) {
-                //there should only be one result in this collection
-                variantInventorySummary.put(featureTypeId, variantFeatures.get(0));
+if (product) {
+    //If product is virtual gather summary data from variants
+    if (product.isVirtual && "Y".equals(product.isVirtual)) {
+        //Get the virtual product feature types
+        result = dispatcher.runSync("getProductFeaturesByType", [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']);
+        featureTypeIds = result.productFeatureTypes;
+    
+        //Get the variants
+        result = dispatcher.runSync("getAllProductVariants", [productId : productId]);
+        variants = result.assocProducts;
+        variantIterator = variants.iterator();
+        variantInventorySummaries = [];
+        while (variantIterator) {
+            variant = variantIterator.next();
+    
+            //create a map of each variant id and inventory summary (all facilities)
+            inventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", [productId : variant.productIdTo]);
+    
+            variantInventorySummary = [productId : variant.productIdTo,
+                                       availableToPromiseTotal : inventoryAvailable.availableToPromiseTotal,
+                                       quantityOnHandTotal : inventoryAvailable.quantityOnHandTotal];
+    
+            //add the applicable features to the map
+            featureTypeIdsIterator = featureTypeIds.iterator();
+            while (featureTypeIdsIterator) {
+                featureTypeId = featureTypeIdsIterator.next();
+                result = dispatcher.runSync("getProductFeatures", [productId : variant.productIdTo, type : 'STANDARD_FEATURE', distinct : featureTypeId]);
+                variantFeatures = result.productFeatures;
+                if (variantFeatures) {
+                    //there should only be one result in this collection
+                    variantInventorySummary.put(featureTypeId, variantFeatures.get(0));
+                }
             }
+            variantInventorySummaries.add(variantInventorySummary);
         }
-        variantInventorySummaries.add(variantInventorySummary);
-    }
-    context.featureTypeIds = featureTypeIds;
-    context.variantInventorySummaries = variantInventorySummaries;
-} else { //Gather information for a non virtual product
-    quantitySummaryByFacility = [:];
-    manufacturingInQuantitySummaryByFacility = [:];
-    manufacturingOutQuantitySummaryByFacility = [:];
-    // The warehouse list is selected
-    showAllFacilities = parameters.showAllFacilities;
-    if (showAllFacilities && "Y".equals(showAllFacilities)) {
-        facilityList = delegator.findList("Facility", null, null, null, null, false);
-    } else {
-        facilityList = delegator.findList("ProductFacility", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId), null, null, null, false);
-    }
-    facilityIterator = facilityList.iterator();
-    dispatcher = request.getAttribute("dispatcher");
-    Map contextInput = null;
-    Map resultOutput = null;
-
-    // inventory quantity summary by facility: For every warehouse the product's atp and qoh
-    // are obtained (calling the "getInventoryAvailableByFacility" service)
-    while (facilityIterator) {
-        facility = facilityIterator.next();
-        resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : productId, facilityId : facility.facilityId]);
-
-        quantitySummary = [:];
-        quantitySummary.facilityId = facility.facilityId;
-        quantitySummary.totalQuantityOnHand = resultOutput.quantityOnHandTotal;
-        quantitySummary.totalAvailableToPromise = resultOutput.availableToPromiseTotal;
-
-        // if the product is a MARKETING_PKG_AUTO/PICK, then also get the quantity which can be produced from components
-        if ("MARKETING_PKG_AUTO".equals(product.productTypeId) ||
-            "MARKETING_PKG_PICK".equals(product.productTypeId)) {
-            resultOutput = dispatcher.runSync("getMktgPackagesAvailable", [productId : productId, facilityId : facility.facilityId]);
-            quantitySummary.mktgPkgQOH = resultOutput.quantityOnHandTotal;
-            quantitySummary.mktgPkgATP = resultOutput.availableToPromiseTotal;
+        context.featureTypeIds = featureTypeIds;
+        context.variantInventorySummaries = variantInventorySummaries;
+    } else { //Gather information for a non virtual product
+        quantitySummaryByFacility = [:];
+        manufacturingInQuantitySummaryByFacility = [:];
+        manufacturingOutQuantitySummaryByFacility = [:];
+        // The warehouse list is selected
+        showAllFacilities = parameters.showAllFacilities;
+        if (showAllFacilities && "Y".equals(showAllFacilities)) {
+            facilityList = delegator.findList("Facility", null, null, null, null, false);
+        } else {
+            facilityList = delegator.findList("ProductFacility", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId), null, null, null, false);
         }
-
-        quantitySummaryByFacility.put(facility.facilityId, quantitySummary);
-    }
-
-    productInventoryItems = delegator.findByAnd("InventoryItem",
-            [productId : productId],
-            ['facilityId', '-datetimeReceived', '-inventoryItemId']);
-
-    // TODO: get all incoming shipments not yet arrived coming into each facility that this product is in, use a view entity with ShipmentAndItem
-    findIncomingShipmentsConds = [];
-
-    findIncomingShipmentsConds.add(EntityCondition.makeCondition('productId', EntityOperator.EQUALS, productId));
-
-    findIncomingShipmentsTypeConds = [];
-    findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "INCOMING_SHIPMENT"));
-    findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "PURCHASE_SHIPMENT"));
-    findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "SALES_RETURN"));
-    findIncomingShipmentsConds.add(EntityCondition.makeCondition(findIncomingShipmentsTypeConds, EntityOperator.OR));
-
-    findIncomingShipmentsStatusConds = [];
-    findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_DELIVERED"));
-    findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED"));
-    findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PURCH_SHIP_RECEIVED"));
-    findIncomingShipmentsConds.add(EntityCondition.makeCondition(findIncomingShipmentsStatusConds, EntityOperator.AND));
-
-    findIncomingShipmentsStatusCondition = EntityCondition.makeCondition(findIncomingShipmentsConds, EntityOperator.AND);
-    incomingShipmentAndItems = delegator.findList("ShipmentAndItem", findIncomingShipmentsStatusCondition, null, ['-estimatedArrivalDate'], null, false);
-    incomingShipmentAndItemIter = incomingShipmentAndItems.iterator();
-    while (incomingShipmentAndItemIter) {
-        incomingShipmentAndItem = incomingShipmentAndItemIter.next();
-        facilityId = incomingShipmentAndItem.destinationFacilityId;
-
-        quantitySummary = quantitySummaryByFacility.get(facilityId);
-        if (!quantitySummary) {
+        facilityIterator = facilityList.iterator();
+        dispatcher = request.getAttribute("dispatcher");
+        Map contextInput = null;
+        Map resultOutput = null;
+    
+        // inventory quantity summary by facility: For every warehouse the product's atp and qoh
+        // are obtained (calling the "getInventoryAvailableByFacility" service)
+        while (facilityIterator) {
+            facility = facilityIterator.next();
+            resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : productId, facilityId : facility.facilityId]);
+    
             quantitySummary = [:];
-            quantitySummary.facilityId = facilityId;
-            quantitySummaryByFacility.facilityId = quantitySummary;
+            quantitySummary.facilityId = facility.facilityId;
+            quantitySummary.totalQuantityOnHand = resultOutput.quantityOnHandTotal;
+            quantitySummary.totalAvailableToPromise = resultOutput.availableToPromiseTotal;
+    
+            // if the product is a MARKETING_PKG_AUTO/PICK, then also get the quantity which can be produced from components
+            if ("MARKETING_PKG_AUTO".equals(product.productTypeId) ||
+                "MARKETING_PKG_PICK".equals(product.productTypeId)) {
+                resultOutput = dispatcher.runSync("getMktgPackagesAvailable", [productId : productId, facilityId : facility.facilityId]);
+                quantitySummary.mktgPkgQOH = resultOutput.quantityOnHandTotal;
+                quantitySummary.mktgPkgATP = resultOutput.availableToPromiseTotal;
+            }
+    
+            quantitySummaryByFacility.put(facility.facilityId, quantitySummary);
         }
-
-        incomingShipmentAndItemList = quantitySummary.incomingShipmentAndItemList;
-        if (!incomingShipmentAndItemList) {
-            incomingShipmentAndItemList = [];
-            quantitySummary.incomingShipmentAndItemList = incomingShipmentAndItemList;
+    
+        productInventoryItems = delegator.findByAnd("InventoryItem",
+                [productId : productId],
+                ['facilityId', '-datetimeReceived', '-inventoryItemId']);
+    
+        // TODO: get all incoming shipments not yet arrived coming into each facility that this product is in, use a view entity with ShipmentAndItem
+        findIncomingShipmentsConds = [];
+    
+        findIncomingShipmentsConds.add(EntityCondition.makeCondition('productId', EntityOperator.EQUALS, productId));
+    
+        findIncomingShipmentsTypeConds = [];
+        findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "INCOMING_SHIPMENT"));
+        findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "PURCHASE_SHIPMENT"));
+        findIncomingShipmentsTypeConds.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "SALES_RETURN"));
+        findIncomingShipmentsConds.add(EntityCondition.makeCondition(findIncomingShipmentsTypeConds, EntityOperator.OR));
+    
+        findIncomingShipmentsStatusConds = [];
+        findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_DELIVERED"));
+        findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED"));
+        findIncomingShipmentsStatusConds.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PURCH_SHIP_RECEIVED"));
+        findIncomingShipmentsConds.add(EntityCondition.makeCondition(findIncomingShipmentsStatusConds, EntityOperator.AND));
+    
+        findIncomingShipmentsStatusCondition = EntityCondition.makeCondition(findIncomingShipmentsConds, EntityOperator.AND);
+        incomingShipmentAndItems = delegator.findList("ShipmentAndItem", findIncomingShipmentsStatusCondition, null, ['-estimatedArrivalDate'], null, false);
+        incomingShipmentAndItemIter = incomingShipmentAndItems.iterator();
+        while (incomingShipmentAndItemIter) {
+            incomingShipmentAndItem = incomingShipmentAndItemIter.next();
+            facilityId = incomingShipmentAndItem.destinationFacilityId;
+    
+            quantitySummary = quantitySummaryByFacility.get(facilityId);
+            if (!quantitySummary) {
+                quantitySummary = [:];
+                quantitySummary.facilityId = facilityId;
+                quantitySummaryByFacility.facilityId = quantitySummary;
+            }
+    
+            incomingShipmentAndItemList = quantitySummary.incomingShipmentAndItemList;
+            if (!incomingShipmentAndItemList) {
+                incomingShipmentAndItemList = [];
+                quantitySummary.incomingShipmentAndItemList = incomingShipmentAndItemList;
+            }
+    
+            incomingShipmentAndItemList.add(incomingShipmentAndItem);
         }
-
-        incomingShipmentAndItemList.add(incomingShipmentAndItem);
+    
+        // --------------------
+        // Production Runs
+        resultOutput = dispatcher.runSync("getProductManufacturingSummaryByFacility",
+                       [productId : productId, userLogin : userLogin]);
+        // incoming products
+        manufacturingInQuantitySummaryByFacility = resultOutput.summaryInByFacility;
+        // outgoing products (materials)
+        manufacturingOutQuantitySummaryByFacility = resultOutput.summaryOutByFacility;
+    
+        showEmpty = "true".equals(request.getParameter("showEmpty"));
+    
+        // Find oustanding purchase orders for this item.
+        purchaseOrders = InventoryWorker.getOutstandingPurchaseOrders(productId, delegator);
+    
+        context.productInventoryItems = productInventoryItems;
+        context.quantitySummaryByFacility = quantitySummaryByFacility;
+        context.manufacturingInQuantitySummaryByFacility = manufacturingInQuantitySummaryByFacility;
+        context.manufacturingOutQuantitySummaryByFacility = manufacturingOutQuantitySummaryByFacility;
+        context.showEmpty = showEmpty;
+        context.purchaseOrders = purchaseOrders;
     }
-
-    // --------------------
-    // Production Runs
-    resultOutput = dispatcher.runSync("getProductManufacturingSummaryByFacility",
-                   [productId : productId, userLogin : userLogin]);
-    // incoming products
-    manufacturingInQuantitySummaryByFacility = resultOutput.summaryInByFacility;
-    // outgoing products (materials)
-    manufacturingOutQuantitySummaryByFacility = resultOutput.summaryOutByFacility;
-
-    showEmpty = "true".equals(request.getParameter("showEmpty"));
-
-    // Find oustanding purchase orders for this item.
-    purchaseOrders = InventoryWorker.getOutstandingPurchaseOrders(productId, delegator);
-
-    context.productInventoryItems = productInventoryItems;
-    context.quantitySummaryByFacility = quantitySummaryByFacility;
-    context.manufacturingInQuantitySummaryByFacility = manufacturingInQuantitySummaryByFacility;
-    context.manufacturingOutQuantitySummaryByFacility = manufacturingOutQuantitySummaryByFacility;
-    context.showEmpty = showEmpty;
-    context.purchaseOrders = purchaseOrders;
 }
\ No newline at end of file