Author: apatel
Date: Sun Nov 1 04:08:22 2009
New Revision: 831637
URL: http://svn.apache.org/viewvc?rev=831637&view=rev
Log:
Updated Check Run process to use PaymentMethod of paying organizationParty
instead of FinAccount. finAccountId is now fetched from PaymentMethod and
finAccount Transaction is created.
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=831637&r1=831636&r2=831637&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
(original)
+++
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
Sun Nov 1 04:08:22 2009
@@ -493,6 +493,9 @@
<clear-field field="invoices"/>
<iterate-map map="partyInvoices" key="partyId" value="invoices">
<set-service-fields
service-name="createPaymentAndApplicationForParty" map="parameters"
to-map="createPaymentAndApplicationForPartyMap"/>
+ <entity-one entity-name="PaymentMethod"
value-field="paymentMethod" auto-field-map="true"/>
+ <set
field="createPaymentAndApplicationForPartyMap.paymentMethodTypeId"
from-field="paymentMethod.paymentMethodTypeId"/>
+ <set field="createPaymentAndApplicationForPartyMap.finAccountId"
from-field="paymentMethod.finAccountId"/>
<set field="createPaymentAndApplicationForPartyMap.partyId"
from-field="partyId"/>
<set field="createPaymentAndApplicationForPartyMap.invoices"
from-field="invoices"/>
<if-not-empty field="parameters.checkStartNumber">
@@ -546,6 +549,7 @@
<set field="createPaymentMap.statusId" value="PMNT_SENT"/>
<set field="createPaymentMap.amount" type="BigDecimal"
from-field="paymentAmount"/>
<set field="createPaymentMap.paymentMethodTypeId"
from-field="parameters.paymentMethodTypeId"/>
+ <set field="createPaymentMap.paymentMethodId"
from-field="parameters.paymentMethodId"/>
<set field="createPaymentMap.paymentRefNum" type="String"
from-field="parameters.checkStartNumber"/>
<call-service service-name="createPayment"
in-map-name="createPaymentMap">
<result-to-field result-name="paymentId"/>
Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=831637&r1=831636&r2=831637&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Sun Nov
1 04:08:22 2009
@@ -168,8 +168,8 @@
<attribute name="organizationPartyId" type="String" mode="IN"
optional="false"/>
<attribute name="checkStartNumber" type="Long" mode="IN"
optional="true"/>
<attribute name="invoiceIds" type="List" mode="IN" optional="false"/>
- <attribute name="paymentMethodTypeId" type="String" mode="IN"
optional="false"/>
- <attribute name="finAccountId" type="String" mode="IN"
optional="true"/>
+ <attribute name="paymentMethodTypeId" type="String" mode="IN"
optional="true"/>
+ <attribute name="paymentMethodId" type="String" mode="IN"
optional="false"/>
<attribute name="paymentGroupId" type="String" mode="OUT"
optional="true"/>
<attribute name="errorMessage" type="String" optional="true"
mode="OUT"/>
</service>
@@ -179,7 +179,8 @@
<attribute name="organizationPartyId" type="String" mode="INOUT"
optional="true"/>
<attribute name="partyId" type="String" mode="IN" optional="false"/>
<attribute name="invoices" type="List" mode="IN" optional="false"/>
- <attribute name="paymentMethodTypeId" type="String" mode="IN"
optional="false"/>
+ <attribute name="paymentMethodTypeId" type="String" mode="IN"
optional="true"/>
+ <attribute name="paymentMethodId" type="String" mode="IN"
optional="false"/>
<attribute name="finAccountId" type="String" mode="INOUT"
optional="true"/>
<attribute name="checkStartNumber" type="Long" mode="IN"
optional="true"/>
<attribute name="paymentId" type="String" mode="OUT" optional="true"/>
Modified:
ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=831637&r1=831636&r2=831637&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
Sun Nov 1 04:08:22 2009
@@ -51,8 +51,6 @@
$('checkAllInvoices').checked = false;
}
if (!isSingle) {
- if ($('paymentMethodTypeId').value != "")
- $('submitButton').disabled = false;
new Ajax.Request('getInvoiceRunningTotal', {
asynchronous: false,
onSuccess: function(transport) {
@@ -60,6 +58,7 @@
$('showInvoiceRunningTotal').update(data.invoiceRunningTotal);
}, parameters: $('listPurchaseInvoices').serialize(),
requestHeaders: {Accept: 'application/json'}
});
+ $('submitButton').disabled = false;
} else {
$('submitButton').disabled = true;
$('showInvoiceRunningTotal').update("");
@@ -70,7 +69,7 @@
document.listPurchaseInvoices.action =
'<@ofbizUrl>'+selection.value+'</@ofbizUrl>';
showIssueChecks(selection);
$('submitButton').disabled = true;
- $('paymentMethodTypeId').value = ""
+ getInvoiceRunningTotal();
}
function runAction() {
@@ -92,14 +91,6 @@
Effect.BlindUp('issueChecks',{duration: 0.0});
}
}
-function enableSubmitButton() {
- if ($('paymentMethodTypeId').value == "") {
- $('submitButton').disabled = true;
- } else {
- $('submitButton').disabled = false;
- }
- getInvoiceRunningTotal();
-}
-->
</script>
@@ -115,7 +106,7 @@
<option value="">${uiLabelMap.AccountingSelectAction}</options>
<option
value="processMassCheckRun">${uiLabelMap.AccountingIssueCheck}</option>
</select>
- <input id="submitButton" type="button"
onclick="javascript:runAction();" value="${uiLabelMap.OrderRunAction}"
disabled/>
+ <input id="submitButton" type="button" onclick="javascript:runAction();"
value="${uiLabelMap.OrderRunAction}" disabled/>
</div>
<input type="hidden" name="organizationPartyId"
value="${organizationPartyId}"/>
<input type="hidden" name="partyIdFrom"
value="${parameters.partyIdFrom?if_exists}"/>
@@ -126,18 +117,10 @@
<input type="hidden" name="thruDueDate"
value="${parameters.thruDueDate?if_exists}"/>
<div id="issueChecks" style="display: none;" align="right">
<span class="label">${uiLabelMap.AccountingVendorPaymentMethod}</span>
- <select name="paymentMethodTypeId" id="paymentMethodTypeId"
onchange="javascript:enableSubmitButton();">
- <option value=""></option>
- <#if paymentMethodType?has_content>
- <option
value="${paymentMethodType.paymentMethodTypeId}">${paymentMethodType.description}</option>
- </#if>
- </select>
- <span class="label">${uiLabelMap.AccountingBankAccount}</span>
- <select name="finAccountId">
- <option value=""></option>
- <#if finAccounts?has_content>
- <#list finAccounts as finAccount>
- <option
value="${finAccount.get("finAccountId")}">${finAccount.get("finAccountName")}
[${finAccount.get("finAccountId")}]</option>
+ <select name="paymentMethodId">
+ <#if paymentMethods?has_content>
+ <#list paymentMethods as paymentMethod>
+ <option value="${paymentMethod.get("paymentMethodId")}"><#if
paymentMethod.get("description")?has_content>${paymentMethod.get("description")}</#if>[${paymentMethod.get("paymentMethodId")}]</option>
</#list>
</#if>
</select>
Modified: ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml?rev=831637&r1=831636&r2=831637&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml Sun Nov 1
04:08:22 2009
@@ -94,12 +94,9 @@
</condition-list>
<order-by field-name="partyIdFrom"/>
</entity-condition>
- <entity-one entity-name="PaymentMethodType"
value-field="paymentMethodType">
- <field-map field-name="paymentMethodTypeId"
value="COMPANY_CHECK"></field-map>
- </entity-one>
- <entity-and entity-name="FinAccount" list="finAccounts">
- <field-map field-name="finAccountTypeId"
value="BANK_ACCOUNT"/>
- <field-map field-name="statusId" value="FNACT_ACTIVE"/>
+ <set field="paymentPartyId"
from-field="parameters.partyIdFrom"
default-value="${parameters.organizationPartyId}"/>
+ <entity-and entity-name="PaymentMethod" list="paymentMethods">
+ <field-map field-name="partyId"
from-field="paymentPartyId"/>
</entity-and>
<set field="organizationPartyId"
from-field="parameters.organizationPartyId"/>
</actions>