Capitalized the accounting script's names also switched a couple of screens to use the screenlet widget
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@664307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
-91
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import org.ofbiz.entity.*;
|
||||
import org.ofbiz.base.util.*;
|
||||
import org.ofbiz.base.util.collections.*;
|
||||
import org.ofbiz.accounting.invoice.*;
|
||||
import org.ofbiz.accounting.payment.*;
|
||||
import org.ofbiz.accounting.util.UtilAccounting;
|
||||
import java.text.DateFormat;
|
||||
import java.math.*;
|
||||
import org.ofbiz.entity.condition.EntityConditionList;
|
||||
import org.ofbiz.entity.condition.EntityExpr;
|
||||
import org.ofbiz.entity.condition.EntityOperator;
|
||||
import org.ofbiz.entity.model.*;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
invoiceId = parameters.invoiceId;
|
||||
invoice = delegator.findByPrimaryKey("Invoice", [invoiceId : invoiceId]);
|
||||
|
||||
decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
|
||||
rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
|
||||
|
||||
paymentsMapList = []; // to pass back to the screeen list of unapplied payments
|
||||
|
||||
// retrieve payments for the related parties which have not been (fully) applied yet
|
||||
List payments = null;
|
||||
GenericValue payment = null;
|
||||
exprList = [];
|
||||
expr = EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, invoice.partyIdFrom);
|
||||
exprList.add(expr);
|
||||
expr = EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, invoice.partyId);
|
||||
exprList.add(expr);
|
||||
|
||||
// only payments with received and sent and not paid
|
||||
exprListStatus = [];
|
||||
expr = EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_NOT_PAID");
|
||||
exprListStatus.add(expr);
|
||||
expr = EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_RECEIVED");
|
||||
exprListStatus.add(expr);
|
||||
expr = EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_SENT");
|
||||
exprListStatus.add(expr);
|
||||
orCond = EntityCondition.makeCondition(exprListStatus, EntityOperator.OR);
|
||||
exprList.add(orCond);
|
||||
|
||||
topCond = EntityCondition.makeCondition(exprList, EntityOperator.AND);
|
||||
|
||||
payments = delegator.findList("Payment", topCond, null, ["effectiveDate"], null, false);
|
||||
if (payments) {
|
||||
List paymentApplications = null;
|
||||
GenericValue paymentApplication = null;
|
||||
invoiceApplied = InvoiceWorker.getInvoiceAppliedBd(invoice);
|
||||
invoiceAmount = InvoiceWorker.getInvoiceTotalBd(invoice);
|
||||
invoiceToApply = InvoiceWorker.getInvoiceNotApplied(invoice);
|
||||
payments.each { payment ->
|
||||
if (PaymentWorker.getPaymentNotAppliedBd(payment).signum() == 1) {
|
||||
// put in the map
|
||||
Map paymentMap = [:];
|
||||
paymentMap.paymentId = payment.paymentId;
|
||||
paymentMap.effectiveDate = payment.effectiveDate.substring(0,10); // list as YYYY-MM-DD
|
||||
paymentMap.amount = payment.getBigDecimal("amount");
|
||||
paymentMap.currencyUomId = payment.currencyUomId;
|
||||
paymentMap.amountApplied = PaymentWorker.getPaymentAppliedBd(payment);
|
||||
BigDecimal paymentToApply = PaymentWorker.getPaymentNotAppliedBd(payment);
|
||||
if (paymentToApply.compareTo(invoiceToApply) < 0 ) {
|
||||
paymentMap.amountToApply = paymentToApply;
|
||||
} else {
|
||||
paymentMap.amountToApply = invoiceToApply;
|
||||
}
|
||||
paymentsMapList.add(paymentMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
context.payments = paymentsMapList;
|
||||
@@ -32,7 +32,7 @@ under the License.
|
||||
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
<set field="title" value="Invoice"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="FoReportDecorator" location="component://common/widget/CommonScreens.xml">
|
||||
|
||||
@@ -67,21 +67,10 @@ under the License.
|
||||
<entity-condition entity-name="BillingAccount" list-name="billingAccounts"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<container style="screenlet">
|
||||
<container style="screenlet-title-bar">
|
||||
<container style="h3">
|
||||
<label text="${uiLabelMap.PageTitleFindBillingAccount}"/>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet-body">
|
||||
<section>
|
||||
<widgets>
|
||||
<container><link target="EditBillingAccount" text="${uiLabelMap.CommonNew}" style="buttontext"/></container>
|
||||
<include-form name="ListBillingAccounts" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</container>
|
||||
</container>
|
||||
<screenlet title="${uiLabelMap.PageTitleFindBillingAccount}">
|
||||
<link target="EditBillingAccount" text="${uiLabelMap.CommonNew}" style="buttontext"/>
|
||||
<include-form name="ListBillingAccounts" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</screenlet>
|
||||
</widgets>
|
||||
</section>
|
||||
</widgets>
|
||||
@@ -93,21 +82,10 @@ under the License.
|
||||
</entity-condition>
|
||||
</actions>
|
||||
<widgets>
|
||||
<container style="screenlet">
|
||||
<container style="screenlet-title-bar">
|
||||
<container style="h3">
|
||||
<label text="${uiLabelMap.PageTitleFindBillingAccount}"/>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet-body">
|
||||
<section>
|
||||
<widgets>
|
||||
<container><link target="EditBillingAccount?partyId=${parameters.partyId}&roleTypeId=BILL_TO_CUSTOMER" text="${uiLabelMap.CommonNew} " style="buttontext"/></container>
|
||||
<include-form name="ListBillingAccountsByParty" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</container>
|
||||
</container>
|
||||
<screenlet title="${uiLabelMap.PageTitleFindBillingAccount}">
|
||||
<link target="EditBillingAccount?partyId=${parameters.partyId}&roleTypeId=BILL_TO_CUSTOMER" text="${uiLabelMap.CommonNew} " style="buttontext"/>
|
||||
<include-form name="ListBillingAccountsByParty" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</screenlet>
|
||||
</widgets>
|
||||
</section>
|
||||
</fail-widgets>
|
||||
@@ -132,20 +110,9 @@ under the License.
|
||||
<widgets>
|
||||
<decorator-screen name="CommonBillingAccountDecorator">
|
||||
<decorator-section name="body">
|
||||
<container style="screenlet">
|
||||
<container style="screenlet-title-bar">
|
||||
<container style="h3">
|
||||
<label text="${uiLabelMap.PageTitleEditBillingAccount}"/>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet-body">
|
||||
<section>
|
||||
<widgets>
|
||||
<include-form name="EditBillingAccount" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</container>
|
||||
</container>
|
||||
<screenlet title="${uiLabelMap.PageTitleEditBillingAccount}">
|
||||
<include-form name="EditBillingAccount" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</screenlet>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
@@ -164,34 +131,12 @@ under the License.
|
||||
<widgets>
|
||||
<decorator-screen name="CommonBillingAccountDecorator">
|
||||
<decorator-section name="body">
|
||||
<container style="screenlet">
|
||||
<container style="screenlet-title-bar">
|
||||
<container style="h3">
|
||||
<label text="${uiLabelMap.PageTitleEditBillingAccountRoles}"/>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet-body">
|
||||
<section>
|
||||
<widgets>
|
||||
<include-form name="ListBillingAccountRoles" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet">
|
||||
<container style="screenlet-title-bar">
|
||||
<container style="h3">
|
||||
<label text="${uiLabelMap.PageTitleAddBillingAccountRoles}"/>
|
||||
</container>
|
||||
</container>
|
||||
<container style="screenlet-body">
|
||||
<section>
|
||||
<widgets>
|
||||
<include-form name="AddBillingAccountRole" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</container>
|
||||
</container>
|
||||
<screenlet title="${uiLabelMap.PageTitleEditBillingAccountRoles}">
|
||||
<include-form name="ListBillingAccountRoles" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</screenlet>
|
||||
<screenlet title="${uiLabelMap.PageTitleAddBillingAccountRoles}">
|
||||
<include-form name="AddBillingAccountRole" location="component://accounting/widget/BillingAccountForms.xml"/>
|
||||
</screenlet>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
@@ -326,7 +271,7 @@ under the License.
|
||||
|
||||
<set field="billingAccountId" from-field="parameters.billingAccountId"/>
|
||||
<entity-one entity-name="BillingAccount" value-name="billingAccount"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/order/billingAccountOrders.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/order/OrderListInvoiceItem.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonBillingAccountDecorator">
|
||||
|
||||
@@ -216,7 +216,7 @@ under the License.
|
||||
<set field="tabButtonItem" value="FindAcctgTrans"/>
|
||||
<set field="organizationPartyId" from-field="parameters.organizationPartyId" global="true"/>
|
||||
<set field="acctgTransId" from-field="parameters.acctgTransId"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/EditGlJournalEntry.groovy"/>
|
||||
|
||||
<entity-one entity-name="AcctgTrans" value-name="acctgTrans"/>
|
||||
<entity-one entity-name="AcctgTransEntry" value-name="acctgTransEntry">
|
||||
@@ -388,7 +388,7 @@ under the License.
|
||||
</condition-list>
|
||||
<order-by field-name="effectiveDate"/>
|
||||
</entity-condition>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/filterOutReceipts.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/FilterOutReceipts.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonAdminChecksDecorator" location="${parameters.mainDecoratorLocation}">
|
||||
@@ -437,7 +437,7 @@ under the License.
|
||||
</condition-list>
|
||||
<order-by field-name="effectiveDate"/>
|
||||
</entity-condition>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/filterOutReceipts.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/FilterOutReceipts.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonAdminChecksDecorator" location="${parameters.mainDecoratorLocation}">
|
||||
|
||||
@@ -381,7 +381,7 @@ under the License.
|
||||
<form name="ListSalInvoiceItemTypeGlAssignments" type="list" list-name="invoiceItemTypes"
|
||||
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
|
||||
<actions>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/listInvoiceItemTypesGlAccount.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy"/>
|
||||
</actions>
|
||||
<field name="organizationPartyId"><hidden value="${organizationPartyId}"/></field>
|
||||
<field name="invoiceItemTypeId"><hidden/></field>
|
||||
@@ -427,7 +427,7 @@ under the License.
|
||||
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
|
||||
<actions>
|
||||
<set field="invItemTypePrefix" value="PINV"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/listInvoiceItemTypesGlAccount.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy"/>
|
||||
</actions>
|
||||
<field name="organizationPartyId"><hidden value="${organizationPartyId}"/></field>
|
||||
<field name="invoiceItemTypeId"><hidden/></field>
|
||||
|
||||
@@ -232,8 +232,8 @@ under the License.
|
||||
<field-map env-name="parameters.invoiceId" field-name="invoiceId"/>
|
||||
<order-by field-name="timeEntryId"/>
|
||||
</entity-and>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/OrderListInvoiceItem.groovy"/>
|
||||
<set field="invoiceAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotalBd(invoice)}"/>
|
||||
<set field="notAppliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
|
||||
<set field="appliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceAppliedBd(invoice)}"/>
|
||||
@@ -529,8 +529,8 @@ under the License.
|
||||
<set field="tabButtonItem" value="editInvoiceApplications"/>
|
||||
|
||||
<set field="invoiceId" from-field="parameters.invoiceId"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/listNotAppliedPayments.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy"/>
|
||||
<set field="invoiceAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotalBd(invoice)}"/>
|
||||
<set field="notAppliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
|
||||
<set field="appliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceAppliedBd(invoice)}"/>
|
||||
@@ -646,7 +646,7 @@ under the License.
|
||||
<field-map field-name="invoiceId" env-name="parameters.invoiceId"/>
|
||||
<order-by field-name="invoiceItemSeqId"/>
|
||||
</entity-and>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/getInvoiceItemTypes.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonInvoiceDecorator" location="${parameters.invoiceDecoratorLocation}">
|
||||
|
||||
@@ -169,8 +169,8 @@ under the License.
|
||||
<set field="notAppliedAmountStr" type="String" value="${bsh:
|
||||
import java.text.NumberFormat;
|
||||
return(NumberFormat.getCurrencyInstance(context.get("locale")).format(org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotAppliedBd(payment)));}"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedInvoices.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/listNotAppliedPayments.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy"/>
|
||||
<entity-one entity-name="PartyNameView" value-name="partyNameViewTo">
|
||||
<field-map field-name="partyId" env-name="payment.partyIdTo"/>
|
||||
</entity-one>
|
||||
@@ -470,7 +470,7 @@ under the License.
|
||||
<set field="titleProperty" value="AccountingManualTransaction"/>
|
||||
<set field="headerItem" value="transaction"/>
|
||||
<set field="tabButtonItem" value="manualtransactiontab"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/manualTx.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="GenericTransactionDecorator" location="component://accounting/widget/TransactionScreens.xml">
|
||||
@@ -523,7 +523,7 @@ under the License.
|
||||
<set field="paymentId" from-field="parameters.paymentId" />
|
||||
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/printChecks.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<platform-specific>
|
||||
|
||||
@@ -109,7 +109,7 @@ under the License.
|
||||
|
||||
<entity-one entity-name="PaymentGatewayResponse" value-name="paymentGatewayResponse" auto-field-map="true"/>
|
||||
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/viewGatewayResponse.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="GenericTransactionDecorator">
|
||||
@@ -163,7 +163,7 @@ under the License.
|
||||
</entity-one>
|
||||
<set field="paymentMethodTypeId" from-field="opp.paymentMethodTypeId"/>
|
||||
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/authorizeTransaction.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="GenericTransactionDecorator">
|
||||
@@ -203,7 +203,7 @@ under the License.
|
||||
</entity-one>
|
||||
<set field="paymentMethodTypeId" from-field="opp.paymentMethodTypeId"/>
|
||||
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/captureTransaction.groovy"/>
|
||||
<script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="GenericTransactionDecorator">
|
||||
|
||||
Reference in New Issue
Block a user