svn commit: r1767764 [2/33] - in /ofbiz/trunk: applications/accounting/groovyScripts/admin/ applications/accounting/groovyScripts/ap/invoices/ applications/accounting/groovyScripts/ar/ applications/accounting/groovyScripts/chartofaccounts/ applications...

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

svn commit: r1767764 [2/33] - in /ofbiz/trunk: applications/accounting/groovyScripts/admin/ applications/accounting/groovyScripts/ap/invoices/ applications/accounting/groovyScripts/ar/ applications/accounting/groovyScripts/chartofaccounts/ applications...

Arun Patidar-4
Modified: ofbiz/trunk/applications/accounting/groovyScripts/invoice/InvoiceReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/invoice/InvoiceReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/invoice/InvoiceReport.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/invoice/InvoiceReport.groovy Wed Nov  2 19:09:13 2016
@@ -21,7 +21,7 @@
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.entity.condition.EntityConditionBuilder
 
-exprBldr = new org.apache.ofbiz.entity.condition.EntityConditionBuilder();
+exprBldr = new org.apache.ofbiz.entity.condition.EntityConditionBuilder()
 
 if (invoiceTypeId) {
     expr = exprBldr.AND() {
@@ -33,29 +33,29 @@ if (invoiceTypeId) {
     } else if ("SALES_INVOICE".equals(invoiceTypeId)) {
         invoiceStatusesCondition = exprBldr.IN(statusId: ["INVOICE_SENT", "INVOICE_APPROVED", "INVOICE_READY"])
     }
-    expr = exprBldr.AND([expr, invoiceStatusesCondition]);
+    expr = exprBldr.AND([expr, invoiceStatusesCondition])
 
-    PastDueInvoices = from("Invoice").where(expr).orderBy("dueDate DESC").queryList();
+    PastDueInvoices = from("Invoice").where(expr).orderBy("dueDate DESC").queryList()
     if (PastDueInvoices) {
-        invoiceIds = PastDueInvoices.invoiceId;
-        totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId]);
+        invoiceIds = PastDueInvoices.invoiceId
+        totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId])
         if (totalAmount) {
-            context.PastDueInvoicestotalAmount = totalAmount.invoiceRunningTotal;
+            context.PastDueInvoicestotalAmount = totalAmount.invoiceRunningTotal
         }
-        context.PastDueInvoices = PastDueInvoices;
+        context.PastDueInvoices = PastDueInvoices
     }
 
     invoicesCond = exprBldr.AND(invoiceStatusesCondition) {
         EQUALS(invoiceTypeId: invoiceTypeId)
         GREATER_THAN_EQUAL_TO(dueDate: UtilDateTime.nowTimestamp())
     }
-    InvoicesDueSoon = from("Invoice").where(invoicesCond).orderBy("dueDate ASC").maxRows(10).queryList();
+    InvoicesDueSoon = from("Invoice").where(invoicesCond).orderBy("dueDate ASC").maxRows(10).queryList()
     if (InvoicesDueSoon) {
-        invoiceIds = InvoicesDueSoon.invoiceId;
-        totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId]);
+        invoiceIds = InvoicesDueSoon.invoiceId
+        totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId])
         if (totalAmount) {
-            context.InvoicesDueSoonTotalAmount = totalAmount.invoiceRunningTotal;
+            context.InvoicesDueSoonTotalAmount = totalAmount.invoiceRunningTotal
         }
-        context.InvoicesDueSoon = InvoicesDueSoon;
+        context.InvoicesDueSoon = InvoicesDueSoon
     }
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/invoice/ListNotAppliedPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/invoice/ListNotAppliedPayments.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/invoice/ListNotAppliedPayments.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/invoice/ListNotAppliedPayments.groovy Wed Nov  2 19:09:13 2016
@@ -23,13 +23,13 @@ import org.apache.ofbiz.accounting.payme
 import org.apache.ofbiz.base.util.UtilNumber
 import org.apache.ofbiz.entity.condition.EntityConditionBuilder
 
-invoiceId = parameters.invoiceId;
-invoice = from("Invoice").where(invoiceId : invoiceId).queryOne();
+invoiceId = parameters.invoiceId
+invoice = from("Invoice").where(invoiceId : invoiceId).queryOne()
 
-decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
-rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
+decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
+rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
 
-exprBldr = new EntityConditionBuilder();
+exprBldr = new EntityConditionBuilder()
 preCurrencyCond = exprBldr.AND() {
     EQUALS(partyIdTo: invoice.partyIdFrom)
     EQUALS(partyIdFrom: invoice.partyId)
@@ -44,40 +44,40 @@ topCondActual = exprBldr.AND(preCurrency
     EQUALS(actualCurrencyUomId: invoice.currencyUomId)
 }
 
-payments = from("Payment").where(topCond).orderBy("effectiveDate").queryList();
-context.payments = getPayments(payments, false);
-payments = from("Payment").where(topCondActual).orderBy("effectiveDate").queryList();
-context.paymentsActualCurrency = getPayments(payments, true);
+payments = from("Payment").where(topCond).orderBy("effectiveDate").queryList()
+context.payments = getPayments(payments, false)
+payments = from("Payment").where(topCondActual).orderBy("effectiveDate").queryList()
+context.paymentsActualCurrency = getPayments(payments, true)
 
 List getPayments(List payments, boolean actual) {
     if (payments)    {
-        paymentList = [];  // to pass back to the screeen list of unapplied payments
-        invoiceApplied = InvoiceWorker.getInvoiceApplied(invoice);
-        invoiceAmount = InvoiceWorker.getInvoiceTotal(invoice);
-        invoiceToApply = InvoiceWorker.getInvoiceNotApplied(invoice);
+        paymentList = [] // to pass back to the screeen list of unapplied payments
+        invoiceApplied = InvoiceWorker.getInvoiceApplied(invoice)
+        invoiceAmount = InvoiceWorker.getInvoiceTotal(invoice)
+        invoiceToApply = InvoiceWorker.getInvoiceNotApplied(invoice)
         payments.each { payment ->
-            paymentMap = [:];
-            paymentApplied = PaymentWorker.getPaymentApplied(payment, true);
+            paymentMap = [:]
+            paymentApplied = PaymentWorker.getPaymentApplied(payment, true)
             if (actual) {
-                paymentMap.amount = payment.actualCurrencyAmount;
-                paymentMap.currencyUomId = payment.actualCurrencyUomId;
-                paymentToApply = payment.getBigDecimal("actualCurrencyAmount")?.setScale(decimals,rounding)?.subtract(paymentApplied);
+                paymentMap.amount = payment.actualCurrencyAmount
+                paymentMap.currencyUomId = payment.actualCurrencyUomId
+                paymentToApply = payment.getBigDecimal("actualCurrencyAmount")?.setScale(decimals,rounding)?.subtract(paymentApplied)
             } else {
-                paymentMap.amount = payment.amount;
-                paymentMap.currencyUomId = payment.currencyUomId;
-                paymentToApply = payment.getBigDecimal("amount")?.setScale(decimals,rounding)?.subtract(paymentApplied);
+                paymentMap.amount = payment.amount
+                paymentMap.currencyUomId = payment.currencyUomId
+                paymentToApply = payment.getBigDecimal("amount")?.setScale(decimals,rounding)?.subtract(paymentApplied)
             }
             if (paymentToApply?.signum() == 1) {
-                paymentMap.paymentId = payment.paymentId;
-                paymentMap.effectiveDate = payment.effectiveDate;
+                paymentMap.paymentId = payment.paymentId
+                paymentMap.effectiveDate = payment.effectiveDate
                 if (paymentToApply.compareTo(invoiceToApply) < 0 ) {
-                    paymentMap.amountToApply = paymentToApply;
+                    paymentMap.amountToApply = paymentToApply
                 } else {
-                    paymentMap.amountToApply = invoiceToApply;
+                    paymentMap.amountToApply = invoiceToApply
                 }
-                paymentList.add(paymentMap);
+                paymentList.add(paymentMap)
             }
         }
-        return paymentList;
+        return paymentList
     }
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/invoice/PrintInvoices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/invoice/PrintInvoices.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/invoice/PrintInvoices.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/invoice/PrintInvoices.groovy Wed Nov  2 19:09:13 2016
@@ -23,111 +23,111 @@ import org.apache.ofbiz.base.util.UtilNu
 
 import java.text.DateFormat
 
-invoiceDetailList = [];
+invoiceDetailList = []
 invoiceIds.each { invoiceId ->
-    invoicesMap = [:];
-    invoice = from("Invoice").where('invoiceId', invoiceId).queryOne();
-    invoicesMap.invoice = invoice;
-    
-    currency = parameters.currency;  // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency
-    BigDecimal conversionRate = new BigDecimal("1");
-    ZERO = BigDecimal.ZERO;
-    decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
-    rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
+    invoicesMap = [:]
+    invoice = from("Invoice").where('invoiceId', invoiceId).queryOne()
+    invoicesMap.invoice = invoice
+    
+    currency = parameters.currency // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency
+    BigDecimal conversionRate = new BigDecimal("1")
+    ZERO = BigDecimal.ZERO
+    decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
+    rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
     
     if (invoice) {
         if (currency && !invoice.getString("currencyUomId").equals(currency)) {
-            conversionRate = InvoiceWorker.getInvoiceCurrencyConversionRate(invoice);
-            invoice.currencyUomId = currency;
-            invoice.invoiceMessage = " converted from original with a rate of: " + conversionRate.setScale(8, rounding);
+            conversionRate = InvoiceWorker.getInvoiceCurrencyConversionRate(invoice)
+            invoice.currencyUomId = currency
+            invoice.invoiceMessage = " converted from original with a rate of: " + conversionRate.setScale(8, rounding)
         }
     
-        invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false);
-        invoiceItemsConv = [];
+        invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false)
+        invoiceItemsConv = []
         invoiceItems.each { invoiceItem ->
           if (invoiceItem.amount) {
-              invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding);
-              invoiceItemsConv.add(invoiceItem);
+              invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding)
+              invoiceItemsConv.add(invoiceItem)
           }
         }
     
-        invoicesMap.invoiceItems = invoiceItemsConv;
+        invoicesMap.invoiceItems = invoiceItemsConv
     
-        invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding);
-        invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding);
-        invoicesMap.invoiceTotal = invoiceTotal;
-        invoicesMap.invoiceNoTaxTotal = invoiceNoTaxTotal;
+        invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+        invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+        invoicesMap.invoiceTotal = invoiceTotal
+        invoicesMap.invoiceNoTaxTotal = invoiceNoTaxTotal
     
         if ("PURCHASE_INVOICE".equals(invoice.invoiceTypeId)) {
-            billingAddress = InvoiceWorker.getSendFromAddress(invoice);
+            billingAddress = InvoiceWorker.getSendFromAddress(invoice)
         } else {
-            billingAddress = InvoiceWorker.getBillToAddress(invoice);
+            billingAddress = InvoiceWorker.getBillToAddress(invoice)
         }
         if (billingAddress) {
-            invoicesMap.billingAddress = billingAddress;
+            invoicesMap.billingAddress = billingAddress
         }
-        billToParty = InvoiceWorker.getBillToParty(invoice);
-        invoicesMap.billToParty = billToParty;
-        sendingParty = InvoiceWorker.getSendFromParty(invoice);
-        invoicesMap.sendingParty = sendingParty;
+        billToParty = InvoiceWorker.getBillToParty(invoice)
+        invoicesMap.billToParty = billToParty
+        sendingParty = InvoiceWorker.getSendFromParty(invoice)
+        invoicesMap.sendingParty = sendingParty
 
         // This snippet was added for adding Tax ID in invoice header if needed
-        sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo", null, null, false);
-        billingTaxInfos = billToParty.getRelated("PartyTaxAuthInfo", null, null, false);
-        sendingPartyTaxId = null;
-        billToPartyTaxId = null;
+        sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo", null, null, false)
+        billingTaxInfos = billToParty.getRelated("PartyTaxAuthInfo", null, null, false)
+        sendingPartyTaxId = null
+        billToPartyTaxId = null
 
         if (billingAddress) {
             sendingTaxInfos.eachWithIndex { sendingTaxInfo, i ->
                 if (sendingTaxInfo.taxAuthGeoId.equals(billingAddress.countryGeoId)) {
-                     sendingPartyTaxId = sendingTaxInfos[i-1].partyTaxId;
+                     sendingPartyTaxId = sendingTaxInfos[i-1].partyTaxId
                 }
             }
             billingTaxInfos.eachWithIndex { billingTaxInfo, i ->
                 if (billingTaxInfo.taxAuthGeoId.equals(billingAddress.countryGeoId)) {
-                     billToPartyTaxId = billingTaxInfos[i-1].partyTaxId;
+                     billToPartyTaxId = billingTaxInfos[i-1].partyTaxId
                 }
             }
         }
         if (sendingPartyTaxId) {
-            invoicesMap.sendingPartyTaxId = sendingPartyTaxId;
+            invoicesMap.sendingPartyTaxId = sendingPartyTaxId
         }
         if (billToPartyTaxId) {
-            invoicesMap.billToPartyTaxId = billToPartyTaxId;
+            invoicesMap.billToPartyTaxId = billToPartyTaxId
         }
     
-        terms = invoice.getRelated("InvoiceTerm", null, null, false);
-        invoicesMap.terms = terms;
+        terms = invoice.getRelated("InvoiceTerm", null, null, false)
+        invoicesMap.terms = terms
     
-        paymentAppls = from("PaymentApplication").where('invoiceId', invoiceId).queryList();
-        invoicesMap.payments = paymentAppls;
+        paymentAppls = from("PaymentApplication").where('invoiceId', invoiceId).queryList()
+        invoicesMap.payments = paymentAppls
     
-        orderItemBillings = from("OrderItemBilling").where('invoiceId', invoiceId).orderBy("orderId").queryList();
-        orders = new LinkedHashSet();
+        orderItemBillings = from("OrderItemBilling").where('invoiceId', invoiceId).orderBy("orderId").queryList()
+        orders = new LinkedHashSet()
         orderItemBillings.each { orderIb ->
-            orders.add(orderIb.orderId);
+            orders.add(orderIb.orderId)
         }
-        invoicesMap.orders = orders;
+        invoicesMap.orders = orders
     
-        invoiceStatus = invoice.getRelatedOne("StatusItem", false);
-        invoicesMap.invoiceStatus = invoiceStatus;
+        invoiceStatus = invoice.getRelatedOne("StatusItem", false)
+        invoicesMap.invoiceStatus = invoiceStatus
     
-        edit = parameters.editInvoice;
+        edit = parameters.editInvoice
         if ("true".equalsIgnoreCase(edit)) {
-            invoiceItemTypes = from("InvoiceItemType").queryList();
-            invoicesMap.invoiceItemTypes = invoiceItemTypes;
-            invoicesMap.editInvoice = true;
+            invoiceItemTypes = from("InvoiceItemType").queryList()
+            invoicesMap.invoiceItemTypes = invoiceItemTypes
+            invoicesMap.editInvoice = true
         }
     
         // format the date
         if (invoice.invoiceDate) {
-            invoiceDate = DateFormat.getDateInstance(DateFormat.LONG).format(invoice.invoiceDate);
-            invoicesMap.invoiceDate = invoiceDate;
+            invoiceDate = DateFormat.getDateInstance(DateFormat.LONG).format(invoice.invoiceDate)
+            invoicesMap.invoiceDate = invoiceDate
         } else {
-            invoicesMap.invoiceDate = "N/A";
+            invoicesMap.invoiceDate = "N/A"
         }
     }
-    invoiceDetailList.add(invoicesMap);
+    invoiceDetailList.add(invoicesMap)
 }
 
-context.invoiceDetailList = invoiceDetailList;
+context.invoiceDetailList = invoiceDetailList

Modified: ofbiz/trunk/applications/accounting/groovyScripts/order/BillingAccountOrders.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/order/BillingAccountOrders.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/order/BillingAccountOrders.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/order/BillingAccountOrders.groovy Wed Nov  2 19:09:13 2016
@@ -18,20 +18,20 @@
  */
 
 if (billingAccountId) {
-    orderPaymentPreferencesList = [];
-    orderList = from("OrderHeader").where('billingAccountId', billingAccountId).queryList();
+    orderPaymentPreferencesList = []
+    orderList = from("OrderHeader").where('billingAccountId', billingAccountId).queryList()
     if (orderList) {
         orderList.each { orderHeader ->
-            orderId = orderHeader.orderId;
-            orderBillingAcc = from("OrderHeaderAndPaymentPref").where("orderId", orderId).queryFirst();
-            orderBillingAccMap = [:];
+            orderId = orderHeader.orderId
+            orderBillingAcc = from("OrderHeaderAndPaymentPref").where("orderId", orderId).queryFirst()
+            orderBillingAccMap = [:]
             if (orderBillingAcc.paymentMethodTypeId.equals("EXT_BILLACT") && orderBillingAcc.paymentStatusId.equals("PAYMENT_NOT_RECEIVED")) {
-                orderBillingAccMap.putAll(orderBillingAcc);
-                orderId = orderBillingAcc.orderId;
-                orderBillingAccMap.orderId = orderId;
+                orderBillingAccMap.putAll(orderBillingAcc)
+                orderId = orderBillingAcc.orderId
+                orderBillingAccMap.orderId = orderId
             }
-            orderPaymentPreferencesList.add(orderBillingAccMap);
+            orderPaymentPreferencesList.add(orderBillingAccMap)
         }
-        context.orderPaymentPreferencesList = orderPaymentPreferencesList;
+        context.orderPaymentPreferencesList = orderPaymentPreferencesList
     }
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/BillingAccounts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/BillingAccounts.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/BillingAccounts.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/BillingAccounts.groovy Wed Nov  2 19:09:13 2016
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-import org.apache.ofbiz.accounting.payment.BillingAccountWorker;
+import org.apache.ofbiz.accounting.payment.BillingAccountWorker
 
-partyId = parameters.partyId;
-currencyUomId = null;
-billingAccounts = [];
+partyId = parameters.partyId
+currencyUomId = null
+billingAccounts = []
 if (partyId) {
     billingAccountAndRoles = from("BillingAccountAndRole").where('partyId', partyId).queryList()
-    if (billingAccountAndRoles) currencyUomId = billingAccountAndRoles.first().accountCurrencyUomId;
-    if (currencyUomId) billingAccounts = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher);
+    if (billingAccountAndRoles) currencyUomId = billingAccountAndRoles.first().accountCurrencyUomId
+    if (currencyUomId) billingAccounts = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher)
 }
-context.billingAccounts = billingAccounts;
+context.billingAccounts = billingAccounts

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/DepositWithdrawPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/DepositWithdrawPayments.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/DepositWithdrawPayments.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/DepositWithdrawPayments.groovy Wed Nov  2 19:09:13 2016
@@ -23,47 +23,47 @@ import org.apache.ofbiz.entity.condition
 import org.apache.ofbiz.entity.util.EntityUtil
 
 if ("Y".equals(parameters.noConditionFind)) {
-    List exprListForParameters = [];
+    List exprListForParameters = []
     
-    finAccountRoles = from("FinAccountRole").where("finAccountId", finAccountId, "roleTypeId", "DIVISION").filterByDate().queryList();
-    finAccountPartyIds = EntityUtil.getFieldListFromEntityList(finAccountRoles, "partyId", true);
-    finAccountPartyIds.add(organizationPartyId);
+    finAccountRoles = from("FinAccountRole").where("finAccountId", finAccountId, "roleTypeId", "DIVISION").filterByDate().queryList()
+    finAccountPartyIds = EntityUtil.getFieldListFromEntityList(finAccountRoles, "partyId", true)
+    finAccountPartyIds.add(organizationPartyId)
     partyCond = EntityCondition.makeCondition([EntityCondition.makeCondition("partyIdTo", EntityOperator.IN, finAccountPartyIds),
-                                               EntityCondition.makeCondition("partyIdFrom", EntityOperator.IN, finAccountPartyIds)], EntityOperator.OR);
+                                               EntityCondition.makeCondition("partyIdFrom", EntityOperator.IN, finAccountPartyIds)], EntityOperator.OR)
     statusCond = EntityCondition.makeCondition([EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_RECEIVED"),
-                                                EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_SENT")], EntityOperator.OR);
+                                                EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PMNT_SENT")], EntityOperator.OR)
 
     if (paymentMethodTypeId) {
-    exprListForParameters.add(EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId));
+    exprListForParameters.add(EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId))
     }
     if (fromDate) {
-        exprListForParameters.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
+        exprListForParameters.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
     }
     if (thruDate) {
-        exprListForParameters.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
+        exprListForParameters.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
     }
     if (partyIdFrom) {
-        exprListForParameters.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom));
+        exprListForParameters.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom))
     }
-    exprListForParameters.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.EQUALS, null));
-    paramCond = EntityCondition.makeCondition(exprListForParameters, EntityOperator.AND);
-    combinedPaymentCond = EntityCondition.makeCondition([partyCond, statusCond, paramCond], EntityOperator.AND);
-    payments = from("PaymentAndTypePartyNameView").where(combinedPaymentCond).queryList();
-    paymentListWithCreditCard = [];
-    paymentListWithoutCreditCard = [];
+    exprListForParameters.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.EQUALS, null))
+    paramCond = EntityCondition.makeCondition(exprListForParameters, EntityOperator.AND)
+    combinedPaymentCond = EntityCondition.makeCondition([partyCond, statusCond, paramCond], EntityOperator.AND)
+    payments = from("PaymentAndTypePartyNameView").where(combinedPaymentCond).queryList()
+    paymentListWithCreditCard = []
+    paymentListWithoutCreditCard = []
     payments.each { payment ->
         if (cardType && payment.paymentMethodId) {
-            creditCard = from("CreditCard").where('paymentMethodId', payment.paymentMethodId).queryOne();
+            creditCard = from("CreditCard").where('paymentMethodId', payment.paymentMethodId).queryOne()
             if (creditCard.cardType == cardType) {
-                paymentListWithCreditCard.add(payment);
+                paymentListWithCreditCard.add(payment)
             }
         } else if (UtilValidate.isEmpty(cardType)) {
-            paymentListWithoutCreditCard.add(payment);
+            paymentListWithoutCreditCard.add(payment)
         }
     }
     if (paymentListWithCreditCard) {
-        context.paymentList = paymentListWithCreditCard;
+        context.paymentList = paymentListWithCreditCard
     } else {
-        context.paymentList = paymentListWithoutCreditCard;
+        context.paymentList = paymentListWithoutCreditCard
     }
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy Wed Nov  2 19:09:13 2016
@@ -20,7 +20,7 @@
 context.invoicePaymentInfoList = []
 
 if (parameters.invoiceTypeId) { // it's not the initialisation but a real search request
-    serviceCtx = dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", "IN", parameters);
+    serviceCtx = dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", "IN", parameters)
     result = runService("getInvoicePaymentInfoListByDueDateOffset", serviceCtx)
     context.invoicePaymentInfoList = result.invoicePaymentInfoList
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedInvoices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedInvoices.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedInvoices.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedInvoices.groovy Wed Nov  2 19:09:13 2016
@@ -25,69 +25,69 @@ import org.apache.ofbiz.base.util.collec
 import org.apache.ofbiz.entity.condition.EntityCondition
 import org.apache.ofbiz.entity.condition.EntityOperator
 
-paymentId = parameters.paymentId;
-payment = from("Payment").where("paymentId", paymentId).queryOne();
+paymentId = parameters.paymentId
+payment = from("Payment").where("paymentId", paymentId).queryOne()
 
-decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
-rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
+decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
+rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
 
 exprList = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, payment.partyIdFrom),
-            EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, payment.partyIdTo)];
-partyCond = EntityCondition.makeCondition(exprList, EntityOperator.AND);
+            EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, payment.partyIdTo)]
+partyCond = EntityCondition.makeCondition(exprList, EntityOperator.AND)
 
 exprList1 = [EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "INVOICE_APPROVED"),
              EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "INVOICE_SENT"),
              EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "INVOICE_READY"),
-             EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "INVOICE_RECEIVED")];
-statusCond = EntityCondition.makeCondition(exprList1, EntityOperator.OR);
+             EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "INVOICE_RECEIVED")]
+statusCond = EntityCondition.makeCondition(exprList1, EntityOperator.OR)
 
-currCond = EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, payment.currencyUomId);
-actualCurrCond = EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, payment.actualCurrencyUomId);
+currCond = EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, payment.currencyUomId)
+actualCurrCond = EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, payment.actualCurrencyUomId)
 
-topCond = EntityCondition.makeCondition([partyCond, statusCond, currCond], EntityOperator.AND);
-topCondActual = EntityCondition.makeCondition([partyCond, statusCond, actualCurrCond], EntityOperator.AND);
+topCond = EntityCondition.makeCondition([partyCond, statusCond, currCond], EntityOperator.AND)
+topCondActual = EntityCondition.makeCondition([partyCond, statusCond, actualCurrCond], EntityOperator.AND)
 
 //retrieve invoices for the related parties which have not been (fully) applied yet and which have the same currency as the payment
 invoices = select("invoiceId", "invoiceTypeId", "currencyUomId", "description", "invoiceDate")
                 .from("Invoice")
                 .where(topCond)
                 .orderBy("invoiceDate")
-                .queryList();
-context.invoices = getInvoices(invoices, false);
+                .queryList()
+context.invoices = getInvoices(invoices, false)
 //retrieve invoices for the related parties which have not been (fully) applied yet and which have the same originalCurrency as the payment
 invoices = select("invoiceId", "invoiceTypeId", "currencyUomId", "description", "invoiceDate")
                 .from("Invoice")
                 .where(topCondActual)
                 .orderBy("invoiceDate")
-                .queryList();
-context.invoicesOtherCurrency = getInvoices(invoices, true);
+                .queryList()
+context.invoicesOtherCurrency = getInvoices(invoices, true)
 
 List getInvoices(List invoices, boolean actual) {
     if (invoices) {
-        invoicesList = [];  // to pass back to the screeen list of unapplied invoices
-        paymentApplied = PaymentWorker.getPaymentApplied(payment);
-        paymentToApply = payment.getBigDecimal("amount").setScale(decimals,rounding).subtract(paymentApplied);
+        invoicesList = [] // to pass back to the screeen list of unapplied invoices
+        paymentApplied = PaymentWorker.getPaymentApplied(payment)
+        paymentToApply = payment.getBigDecimal("amount").setScale(decimals,rounding).subtract(paymentApplied)
         if (actual && payment.actualCurrencyAmount) {
-            paymentToApply = payment.getBigDecimal("actualCurrencyAmount").setScale(decimals,rounding).subtract(paymentApplied);
+            paymentToApply = payment.getBigDecimal("actualCurrencyAmount").setScale(decimals,rounding).subtract(paymentApplied)
         }
         invoices.each { invoice ->
-            invoiceAmount = InvoiceWorker.getInvoiceTotal(invoice).setScale(decimals,rounding);
-            invoiceApplied = InvoiceWorker.getInvoiceApplied(invoice).setScale(decimals,rounding);
-            invoiceToApply = invoiceAmount.subtract(invoiceApplied);
+            invoiceAmount = InvoiceWorker.getInvoiceTotal(invoice).setScale(decimals,rounding)
+            invoiceApplied = InvoiceWorker.getInvoiceApplied(invoice).setScale(decimals,rounding)
+            invoiceToApply = invoiceAmount.subtract(invoiceApplied)
             if (invoiceToApply.signum() == 1) {
-                invoiceMap = [:];
-                invoiceMap.putAll(invoice);
-                invoiceMap.amount = invoiceAmount;
-                invoiceMap.description = invoice.description;
-                invoiceMap.amountApplied = invoiceApplied;
+                invoiceMap = [:]
+                invoiceMap.putAll(invoice)
+                invoiceMap.amount = invoiceAmount
+                invoiceMap.description = invoice.description
+                invoiceMap.amountApplied = invoiceApplied
                 if (paymentToApply.compareTo(invoiceToApply) < 0 ) {
-                    invoiceMap.amountToApply = paymentToApply;
+                    invoiceMap.amountToApply = paymentToApply
                 } else {
-                    invoiceMap.amountToApply = invoiceToApply;
+                    invoiceMap.amountToApply = invoiceToApply
                 }
-                invoicesList.add(invoiceMap);
+                invoicesList.add(invoiceMap)
             }
         }
-        return invoicesList;
+        return invoicesList
     }
 }

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedPayments.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedPayments.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/ListNotAppliedPayments.groovy Wed Nov  2 19:09:13 2016
@@ -23,59 +23,59 @@ import org.apache.ofbiz.base.util.UtilNu
 import org.apache.ofbiz.entity.condition.EntityCondition
 import org.apache.ofbiz.entity.condition.EntityOperator
 
-basePaymentId = parameters.paymentId;
-basePayment = from("Payment").where("paymentId", basePaymentId).queryOne();
+basePaymentId = parameters.paymentId
+basePayment = from("Payment").where("paymentId", basePaymentId).queryOne()
 
-decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
-rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
+decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
+rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
 
-paymentsMapList = [];  // to pass back to the screeen list of unapplied payments
+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;
-exprList = [];
-expr = EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, basePayment.getString("partyIdFrom"));
-exprList.add(expr);
-expr = EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, basePayment.getString("partyIdTo"));
-exprList.add(expr);
-expr = EntityCondition.makeCondition("paymentId", EntityOperator.NOT_EQUAL, basePayment.getString("paymentId"));
-exprList.add(expr);
+List payments = null
+exprList = []
+expr = EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, basePayment.getString("partyIdFrom"))
+exprList.add(expr)
+expr = EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, basePayment.getString("partyIdTo"))
+exprList.add(expr)
+expr = EntityCondition.makeCondition("paymentId", EntityOperator.NOT_EQUAL, basePayment.getString("paymentId"))
+exprList.add(expr)
 
 // only payments with received and sent
-exprListStatus = [];
-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);
+exprListStatus = []
+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);
+topCond = EntityCondition.makeCondition(exprList, EntityOperator.AND)
 
 payments = from("Payment").where(topCond).orderBy("effectiveDate").queryList()
 
 if (payments)    {
-    basePaymentApplied = PaymentWorker.getPaymentApplied(basePayment);
-    basePaymentAmount = basePayment.getBigDecimal("amount");
-    basePaymentToApply = basePaymentAmount.subtract(basePaymentApplied);
+    basePaymentApplied = PaymentWorker.getPaymentApplied(basePayment)
+    basePaymentAmount = basePayment.getBigDecimal("amount")
+    basePaymentToApply = basePaymentAmount.subtract(basePaymentApplied)
     payments.each { payment ->
         if (PaymentWorker.getPaymentNotApplied(payment).signum() == 1) {  // positiv not applied amount?
            // yes, put in the map
-           paymentMap = [:];
-           paymentMap.paymentId = basePaymentId;
-           paymentMap.toPaymentId = payment.paymentId;
-           paymentMap.currencyUomId = payment.currencyUomId;
-           paymentMap.effectiveDate = payment.effectiveDate.toString().substring(0,10); // list as YYYY-MM-DD
-           paymentMap.amount = payment.getBigDecimal("amount");
-           paymentMap.amountApplied = PaymentWorker.getPaymentApplied(payment);
-           paymentToApply = PaymentWorker.getPaymentNotApplied(payment);
+           paymentMap = [:]
+           paymentMap.paymentId = basePaymentId
+           paymentMap.toPaymentId = payment.paymentId
+           paymentMap.currencyUomId = payment.currencyUomId
+           paymentMap.effectiveDate = payment.effectiveDate.toString().substring(0,10) // list as YYYY-MM-DD
+           paymentMap.amount = payment.getBigDecimal("amount")
+           paymentMap.amountApplied = PaymentWorker.getPaymentApplied(payment)
+           paymentToApply = PaymentWorker.getPaymentNotApplied(payment)
            if (paymentToApply.compareTo(basePaymentToApply) < 0 ) {
-                paymentMap.amountToApply = paymentToApply;
+                paymentMap.amountToApply = paymentToApply
            } else {
-                paymentMap.amountToApply = basePaymentToApply;
+                paymentMap.amountToApply = basePaymentToApply
            }
-           paymentsMapList.add(paymentMap);
+           paymentsMapList.add(paymentMap)
         }
     }
 }
-context.payments = paymentsMapList;
+context.payments = paymentsMapList

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/ManualTx.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/ManualTx.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/ManualTx.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/ManualTx.groovy Wed Nov  2 19:09:13 2016
@@ -18,71 +18,71 @@
  */
 
 // stores
-productStores = from("ProductStore").orderBy("storeName").cache(true).queryList();
-context.productStores = productStores;
+productStores = from("ProductStore").orderBy("storeName").cache(true).queryList()
+context.productStores = productStores
 
 // current store
-productStoreId = parameters.productStoreId;
+productStoreId = parameters.productStoreId
 if (productStoreId) {
-    productStore = from("ProductStore").where("productStoreId", productStoreId).queryOne();
-    context.currentStore = productStore;
+    productStore = from("ProductStore").where("productStoreId", productStoreId).queryOne()
+    context.currentStore = productStore
 }
 
 // payment settings
-paymentSettings = from("Enumeration").where("enumTypeId", "PRDS_PAYSVC").orderBy("sequenceId").queryList();
-context.paymentSettings = paymentSettings;
+paymentSettings = from("Enumeration").where("enumTypeId", "PRDS_PAYSVC").orderBy("sequenceId").queryList()
+context.paymentSettings = paymentSettings
 
 // payment method (for auto-fill)
-paymentMethodId = parameters.paymentMethodId;
-context.paymentMethodId = paymentMethodId;
+paymentMethodId = parameters.paymentMethodId
+context.paymentMethodId = paymentMethodId
 
 // payment method type
-paymentMethodTypeId = parameters.paymentMethodTypeId;
-context.paymentMethodTypeId = paymentMethodTypeId;
+paymentMethodTypeId = parameters.paymentMethodTypeId
+context.paymentMethodTypeId = paymentMethodTypeId
 
 // service type (transaction type)
-txType = parameters.transactionType;
-context.txType = txType;
+txType = parameters.transactionType
+context.txType = txType
 if (txType) {
-    currentTx = from("Enumeration").where("enumId", txType).queryOne();
-    context.currentTx = currentTx;
+    currentTx = from("Enumeration").where("enumId", txType).queryOne()
+    context.currentTx = currentTx
 }
 
 if (paymentMethodId) {
-    paymentMethod = from("PaymentMethod").where("paymentMethodId", paymentMethodId).queryOne();
+    paymentMethod = from("PaymentMethod").where("paymentMethodId", paymentMethodId).queryOne()
     if (paymentMethod) {
         // payment method type
-        paymentMethodTypeId = paymentMethod.paymentMethodTypeId;
+        paymentMethodTypeId = paymentMethod.paymentMethodTypeId
 
         // party information
-        party = paymentMethod.getRelatedOne("Party", false);
+        party = paymentMethod.getRelatedOne("Party", false)
         if (party && "PERSON".equals(party.partyTypeId)) {
-            person = party.getRelatedOne("Person", false);
-            context.person = person;
+            person = party.getRelatedOne("Person", false)
+            context.person = person
         } else if (party && "PARTY_GROUP".equals(party.partyTypeId)) {
-            partyGroup = party.getRelatedOne("PartyGroup", false);
-            context.partyGroup = partyGroup;
+            partyGroup = party.getRelatedOne("PartyGroup", false)
+            context.partyGroup = partyGroup
         }
 
         // method info + address
-        creditCard = paymentMethod.getRelatedOne("CreditCard", false);
-        context.put("creditCard", creditCard);
+        creditCard = paymentMethod.getRelatedOne("CreditCard", false)
+        context.put("creditCard", creditCard)
         if (creditCard) {
-            postalAddress = creditCard.getRelatedOne("PostalAddress", false);
-            context.postalFields = postalAddress;
+            postalAddress = creditCard.getRelatedOne("PostalAddress", false)
+            context.postalFields = postalAddress
         }
 
-        giftCard = paymentMethod.getRelatedOne("GiftCard", false);
-        context.giftCard = giftCard;
+        giftCard = paymentMethod.getRelatedOne("GiftCard", false)
+        context.giftCard = giftCard
 
         // todo add support for eft account
     }
 }
 
 if (paymentMethodTypeId) {
-    paymentMethodType = from("PaymentMethodType").where("paymentMethodTypeId", paymentMethodTypeId).queryOne();
-    context.paymentMethodType = paymentMethodType;
-    context.paymentMethodTypeId = paymentMethodTypeId;
+    paymentMethodType = from("PaymentMethodType").where("paymentMethodTypeId", paymentMethodTypeId).queryOne()
+    context.paymentMethodType = paymentMethodType
+    context.paymentMethodTypeId = paymentMethodTypeId
 }
 
-context.showToolTip = "true";
+context.showToolTip = "true"

Modified: ofbiz/trunk/applications/accounting/groovyScripts/payment/PrintChecks.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/payment/PrintChecks.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/payment/PrintChecks.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/payment/PrintChecks.groovy Wed Nov  2 19:09:13 2016
@@ -22,42 +22,42 @@ import org.apache.ofbiz.base.util.UtilHt
 import org.apache.ofbiz.base.util.UtilNumber
 
 // rounding mode
-decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
-rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
-context.decimals = decimals;
-context.rounding = rounding;
+decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
+rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
+context.decimals = decimals
+context.rounding = rounding
 
 // list of payments
-payments = [];
+payments = []
 
 // first ensure ability to print
-security = request.getAttribute("security");
-context.put("security", security);
+security = request.getAttribute("security")
+context.put("security", security)
 if (!security.hasEntityPermission("ACCOUNTING", "_PRINT_CHECKS", session)) {
-    context.payments = payments; // if no permission, just pass an empty list for now
-    return;
+    context.payments = payments // if no permission, just pass an empty list for now
+    return
 }
 
 // in the case of a single payment, the paymentId will be supplied
-paymentId = context.paymentId;
+paymentId = context.paymentId
 if (paymentId) {
-    payment = from("Payment").where("paymentId", paymentId).queryOne();
-    if (payment) payments.add(payment);
-    context.payments = payments;
-    return;
+    payment = from("Payment").where("paymentId", paymentId).queryOne()
+    if (payment) payments.add(payment)
+    context.payments = payments
+    return
 }
 
 // in the case of a multi form, parse the multi data and get all of the selected payments
-selected = UtilHttp.parseMultiFormData(parameters);
+selected = UtilHttp.parseMultiFormData(parameters)
 selected.each { row ->
-    payment = from("Payment").where("paymentId", row.paymentId).queryOne();
+    payment = from("Payment").where("paymentId", row.paymentId).queryOne()
     if (payment) {
-        payments.add(payment);
+        payments.add(payment)
     }
 }
-paymentGroupMembers = from("PaymentGroupMember").where("paymentGroupId", parameters.paymentGroupId).filterByDate().queryList();
+paymentGroupMembers = from("PaymentGroupMember").where("paymentGroupId", parameters.paymentGroupId).filterByDate().queryList()
 //in the case of a multiple payments, paymentId List is supplied.
 paymentGroupMembers.each { paymentGropupMember->
-    payments.add(paymentGropupMember.getRelatedOne("Payment", false));
+    payments.add(paymentGropupMember.getRelatedOne("Payment", false))
 }
-context.payments = payments;
+context.payments = payments

Modified: ofbiz/trunk/applications/accounting/groovyScripts/period/EditCustomTimePeriod.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/period/EditCustomTimePeriod.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/groovyScripts/period/EditCustomTimePeriod.groovy (original)
+++ ofbiz/trunk/applications/accounting/groovyScripts/period/EditCustomTimePeriod.groovy Wed Nov  2 19:09:13 2016
@@ -17,54 +17,54 @@
  * under the License.
  */
 
-findOrganizationPartyId = parameters.findOrganizationPartyId;
+findOrganizationPartyId = parameters.findOrganizationPartyId
 if (findOrganizationPartyId) {
-    context.findOrganizationPartyId = findOrganizationPartyId;
+    context.findOrganizationPartyId = findOrganizationPartyId
 }
 
-currentCustomTimePeriodId = parameters.currentCustomTimePeriodId;
+currentCustomTimePeriodId = parameters.currentCustomTimePeriodId
 if (currentCustomTimePeriodId) {
-    context.currentCustomTimePeriodId = currentCustomTimePeriodId;
+    context.currentCustomTimePeriodId = currentCustomTimePeriodId
 }
 
-currentCustomTimePeriod = currentCustomTimePeriodId ? from("CustomTimePeriod").where("customTimePeriodId", currentCustomTimePeriodId).queryOne() : null;
+currentCustomTimePeriod = currentCustomTimePeriodId ? from("CustomTimePeriod").where("customTimePeriodId", currentCustomTimePeriodId).queryOne() : null
 if (currentCustomTimePeriod) {
-    context.currentCustomTimePeriod = currentCustomTimePeriod;
+    context.currentCustomTimePeriod = currentCustomTimePeriod
 }
 
-currentPeriodType = currentCustomTimePeriod ? currentCustomTimePeriod.getRelatedOne("PeriodType", true) : null;
+currentPeriodType = currentCustomTimePeriod ? currentCustomTimePeriod.getRelatedOne("PeriodType", true) : null
 if (currentPeriodType) {
-    context.currentPeriodType = currentPeriodType;
+    context.currentPeriodType = currentPeriodType
 }
 
-findMap = [ : ];
-if (findOrganizationPartyId) findMap.organizationPartyId = findOrganizationPartyId;
-if (currentCustomTimePeriodId) findMap.parentPeriodId = currentCustomTimePeriodId;
+findMap = [ : ]
+if (findOrganizationPartyId) findMap.organizationPartyId = findOrganizationPartyId
+if (currentCustomTimePeriodId) findMap.parentPeriodId = currentCustomTimePeriodId
 
-customTimePeriods = from("CustomTimePeriod").where(findMap).orderBy(["periodTypeId", "periodNum", "fromDate"]).queryList();
-context.customTimePeriods = customTimePeriods;
+customTimePeriods = from("CustomTimePeriod").where(findMap).orderBy(["periodTypeId", "periodNum", "fromDate"]).queryList()
+context.customTimePeriods = customTimePeriods
 
-allCustomTimePeriods = from("CustomTimePeriod").orderBy(["organizationPartyId", "parentPeriodId", "periodTypeId", "periodNum", "fromDate"]).queryList();
-context.allCustomTimePeriods = allCustomTimePeriods;
+allCustomTimePeriods = from("CustomTimePeriod").orderBy(["organizationPartyId", "parentPeriodId", "periodTypeId", "periodNum", "fromDate"]).queryList()
+context.allCustomTimePeriods = allCustomTimePeriods
 
-periodTypes = from("PeriodType").orderBy("description").cache(true).queryList();
-context.periodTypes = periodTypes;
+periodTypes = from("PeriodType").orderBy("description").cache(true).queryList()
+context.periodTypes = periodTypes
 
-newPeriodTypeId = "FISCAL_YEAR";
+newPeriodTypeId = "FISCAL_YEAR"
 if ("FISCAL_YEAR".equals(currentCustomTimePeriod?.periodTypeId)) {
-    newPeriodTypeId = "FISCAL_QUARTER";
+    newPeriodTypeId = "FISCAL_QUARTER"
 }
 if ("FISCAL_QUARTER".equals(currentCustomTimePeriod?.periodTypeId)) {
-    newPeriodTypeId = "FISCAL_MONTH";
+    newPeriodTypeId = "FISCAL_MONTH"
 }
 if ("FISCAL_MONTH".equals(currentCustomTimePeriod?.periodTypeId)) {
-    newPeriodTypeId = "FISCAL_WEEK";
+    newPeriodTypeId = "FISCAL_WEEK"
 }
 if ("FISCAL_BIWEEK".equals(currentCustomTimePeriod?.periodTypeId)) {
-    newPeriodTypeId = "FISCAL_WEEK";
+    newPeriodTypeId = "FISCAL_WEEK"
 }
 if ("FISCAL_WEEK".equals(currentCustomTimePeriod?.periodTypeId)) {
-    newPeriodTypeId = "";
+    newPeriodTypeId = ""
 }
 
-context.newPeriodTypeId = newPeriodTypeId;
+context.newPeriodTypeId = newPeriodTypeId