Issue 18343: Credit payment management enhanced
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Wed, 26 Oct 2011 19:11:17 +0200
changeset 14198 e033a8db491d
parent 14197 2c91b7756596
child 14199 84ad90a492a9
Issue 18343: Credit payment management enhanced
- A new table called FIN_PAYMENT_CREDIT is created. This table stores the
relationship between credit payments and payments that use credit. This table is
represented as a tab called Used Credit Source inside the Payment In and Payment
Out windows. When a payment has used one or more credit payments, it shows the
credit payments and amounts used. The user can also use the Linked item feature
to navigate from a credit payment to the payments that use it.

- When completing and invoice, if the invoice's business partner has credit
payments available, the system shows automatically a new popup just after
completing the invoice. This popup allows the user to select the credit
payments and the amount he wants to use of each one. By default, this popup
tries to give the user the best configuration possible, i.e. selecting by
default the oldest credit payments and the right amount to fully pay the
invoice. However, the user will have the opportunity to modify this
proposal. The popup will validate the user data to ensure it's OK (we don't
pay more than the invoice's grand total amount, we don't use more amount than
the available in the credit payment, etc.)

- A new flag called Include Payments Using Credit is added to the payment
report. This flag, which is checked by default, allows the user to
include/exclude in the report all the payments that are using credit payments.

- The description of the payment has also been added to the report: a new column
has been added in the spreadsheet format, and a new context message with the
payment's description is shown when the mouse is over the payment name in the
report's HTML format

- The invoice column shows also the invoices paid using a credit payment. An
asterisk in shown before the invoice number to reflect this invoice has been
paid using a credit payment. In case several invoices have been paid with the
same credit payment, two asterisks are shown before the list of invoice
document numbers.

- Fixed issues in multicurrency rounding

- Added payment date column from the 2.50 version report
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
src-db/database/model/tables/FIN_PAYMENT_CREDIT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid.srpt
src/org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid.xml
src/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html
src/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.xml
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Wed Oct 26 19:11:17 2011 +0200
@@ -21,7 +21,9 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
@@ -32,16 +34,19 @@
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
+import org.openbravo.advpaymentmngt.process.FIN_PaymentProcess;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
 import org.openbravo.data.FieldProvider;
 import org.openbravo.erpCommon.ad_actionButton.ActionButtonUtility;
 import org.openbravo.erpCommon.reference.PInstanceProcessData;
+import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.process.ProcessInstance;
@@ -60,10 +65,13 @@
 public class ProcessInvoice extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
 
+  private List<FIN_Payment> creditPayments = new ArrayList<FIN_Payment>();
+  private final AdvPaymentMngtDao dao = new AdvPaymentMngtDao();
+
   public void doPost(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
-    AdvPaymentMngtDao dao = new AdvPaymentMngtDao();
+
     if (vars.commandIn("DEFAULT")) {
       final String strWindowId = vars.getGlobalVariable("inpwindowId", "ProcessInvoice|Window_ID",
           IsIDFilter.instance);
@@ -105,6 +113,9 @@
       final String strC_Invoice_ID = vars.getGlobalVariable("inpKey",
           strWindowId + "|C_Invoice_ID", "");
       final String strdocaction = vars.getStringParameter("inpdocaction");
+      final String strOrg = vars.getGlobalVariable("inpadOrgId", "ProcessInvoice|Org_ID",
+          IsIDFilter.instance);
+
       OBError myMessage = null;
       try {
 
@@ -124,9 +135,27 @@
         final ProcessInstance pinstance = CallProcess.getInstance().call(process, strC_Invoice_ID,
             null);
 
-        // invoice = dao.getObject(Invoice.class, strC_Invoice_ID);
         OBDal.getInstance().getSession().refresh(invoice);
         invoice.setAPRMProcessinvoice(invoice.getDocumentAction());
+        // Remove invoice's used credit description
+        if ("RE".equals(strdocaction) && pinstance.getResult() != 0L) {
+          final String invDesc = invoice.getDescription();
+          if (invDesc != null) {
+            final String creditMsg = Utility.messageBD(this, "APRM_InvoiceDescUsedCredit",
+                vars.getLanguage());
+            if (creditMsg != null) {
+              final StringBuffer newDesc = new StringBuffer();
+              for (final String line : invDesc.split("\n")) {
+                if (!line.startsWith(creditMsg.substring(0, creditMsg.lastIndexOf("%s")))) {
+                  newDesc.append(line);
+                  if (!"".equals(line))
+                    newDesc.append("\n");
+                }
+              }
+              invoice.setDescription(newDesc.toString());
+            }
+          }
+        }
         OBDal.getInstance().save(invoice);
         OBDal.getInstance().flush();
         OBDal.getInstance().commitAndClose();
@@ -148,6 +177,32 @@
           OBContext.restorePreviousMode();
         }
 
+        if ("CO".equals(strdocaction)) {
+          // Need to refresh the invoice again from the db
+          invoice = dao.getObject(Invoice.class, strC_Invoice_ID);
+          final String invoiceDocCategory = invoice.getDocumentType().getDocumentCategory();
+          /*
+           * Print a grid popup in case of credit payment
+           */
+          // If the invoice grand total is ZERO or already has payments (due to
+          // payment method automation) or the business partner does not have a default financial
+          // account defined or invoice's payment method is not inside BP's financial
+          // account do not cancel credit
+          if (BigDecimal.ZERO.compareTo(invoice.getGrandTotalAmount()) != 0
+              && isPaymentMethodConfigured(invoice) && !isInvoiceWithPayments(invoice)
+              && ("API".equals(invoiceDocCategory) || "ARI".equals(invoiceDocCategory))) {
+            creditPayments = dao.getCustomerPaymentsWithCredit(invoice.getBusinessPartner(),
+                invoice.isSalesTransaction());
+            if (creditPayments != null && !creditPayments.isEmpty()) {
+              printPageCreditPaymentGrid(response, vars, strC_Invoice_ID, strdocaction, strTabId,
+                  strC_Invoice_ID, strdocaction, strWindowId, strTabId, invoice.getInvoiceDate(),
+                  strOrg);
+            }
+          }
+
+          executePayments(response, vars, strWindowId, strTabId, strC_Invoice_ID, strOrg);
+        }
+
       } catch (ServletException ex) {
         myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
         if (!myMessage.isConnectionAvailable()) {
@@ -157,80 +212,125 @@
           vars.setMessage(strTabId, myMessage);
       }
 
+    } else if (vars.commandIn("GRIDLIST")) {
+      final String strWindowId = vars.getGlobalVariable("inpwindowId", "ProcessInvoice|Window_ID",
+          IsIDFilter.instance);
+      final String strC_Invoice_ID = vars.getGlobalVariable("inpKey",
+          strWindowId + "|C_Invoice_ID", "", IsIDFilter.instance);
+
+      printGrid(response, vars, strC_Invoice_ID);
+    } else if (vars.commandIn("USECREDITPAYMENTS") || vars.commandIn("CANCEL_USECREDITPAYMENTS")) {
+      final String strWindowId = vars.getGlobalVariable("inpwindowId", "ProcessInvoice|Window_ID",
+          IsIDFilter.instance);
+      final String strTabId = vars.getGlobalVariable("inpTabId", "ProcessInvoice|Tab_ID",
+          IsIDFilter.instance);
+      final String strC_Invoice_ID = vars.getGlobalVariable("inpKey",
+          strWindowId + "|C_Invoice_ID", "");
+      final String strPaymentDate = vars.getRequiredStringParameter("inpPaymentDate");
+      final String strOrg = vars.getGlobalVariable("inpadOrgId", "ProcessInvoice|Org_ID",
+          IsIDFilter.instance);
+
+      final String strCreditPaymentIds;
+      if (vars.commandIn("CANCEL_USECREDITPAYMENTS")) {
+        strCreditPaymentIds = null;
+      } else {
+        strCreditPaymentIds = vars.getInParameter("inpCreditPaymentId", IsIDFilter.instance);
+      }
+
       /*
-       * Cancel credit (if any) for the invoice's bp
+       * Use credit logic
        */
-      if ("CO".equals(strdocaction)) {
+      if (strCreditPaymentIds != null && !strCreditPaymentIds.isEmpty()) {
+        List<FIN_Payment> selectedCreditPayment = FIN_Utility.getOBObjectList(FIN_Payment.class,
+            strCreditPaymentIds);
+        HashMap<String, BigDecimal> selectedCreditPaymentAmounts = FIN_AddPayment
+            .getSelectedBaseOBObjectAmount(vars, selectedCreditPayment, "inpPaymentAmount");
         try {
           OBContext.setAdminMode(true);
           final Invoice invoice = OBDal.getInstance().get(Invoice.class, strC_Invoice_ID);
-          final String invoiceDocCategory = invoice.getDocumentType().getDocumentCategory();
-          if ("API".equals(invoiceDocCategory) || "ARI".equals(invoiceDocCategory)) {
-            final FIN_Payment creditPayment = dao.getCreditPayment(invoice);
-            // If the invoice grand total is ZERO or already has payments (due to
-            // payment method automation) or the business partner does not have a default financial
-            // account defined or invoice's payment method is not inside BP's financial
-            // account do not cancel credit
-            if (creditPayment != null
-                && BigDecimal.ZERO.compareTo(invoice.getGrandTotalAmount()) != 0
-                && isPaymentMethodConfigured(invoice) && !isInvoiceWithPayments(invoice)) {
-              log4j.info("Detected credit payment: " + creditPayment.getIdentifier()
-                  + ", that matches the invoice: " + invoice.getIdentifier());
-              // Set Used Credit = Invoice's Grand Total Amount
-              creditPayment.setUsedCredit(invoice.getGrandTotalAmount());
-              final StringBuffer description = new StringBuffer();
-              if (creditPayment.getDescription() != null
-                  && !creditPayment.getDescription().equals(""))
-                description.append(creditPayment.getDescription()).append("\n");
-              description.append(String.format(
-                  Utility.messageBD(this, "APRM_CreditUsedinInvoice", vars.getLanguage()),
-                  invoice.getDocumentNo()));
-              creditPayment.setDescription(description.toString());
 
-              final List<FIN_PaymentScheduleDetail> paymentScheduleDetails = new ArrayList<FIN_PaymentScheduleDetail>();
-              final HashMap<String, BigDecimal> paymentScheduleDetailsAmounts = new HashMap<String, BigDecimal>();
-              for (final FIN_PaymentSchedule paymentSchedule : invoice.getFINPaymentScheduleList()) {
-                for (final FIN_PaymentScheduleDetail paymentScheduleDetail : paymentSchedule
-                    .getFINPaymentScheduleDetailInvoicePaymentScheduleList()) {
-                  paymentScheduleDetails.add(paymentScheduleDetail);
-                  paymentScheduleDetailsAmounts.put(paymentScheduleDetail.getId(),
-                      paymentScheduleDetail.getAmount());
-                }
+          final StringBuffer creditPaymentsIdentifiers = new StringBuffer();
+          BigDecimal totalUsedCreditAmt = BigDecimal.ZERO;
+          for (final FIN_Payment creditPayment : selectedCreditPayment) {
+            final BigDecimal usedCreditAmt = selectedCreditPaymentAmounts
+                .get(creditPayment.getId());
+            // Set Used Credit = Amount + Previous used credit introduced by the user
+            creditPayment.setUsedCredit(usedCreditAmt.add(creditPayment.getUsedCredit()));
+            final StringBuffer description = new StringBuffer();
+            if (creditPayment.getDescription() != null
+                && !creditPayment.getDescription().equals(""))
+              description.append(creditPayment.getDescription()).append("\n");
+            description.append(String.format(
+                Utility.messageBD(this, "APRM_CreditUsedinInvoice", vars.getLanguage()),
+                invoice.getDocumentNo()));
+            creditPayment.setDescription(description.toString());
+            totalUsedCreditAmt = totalUsedCreditAmt.add(usedCreditAmt);
+            creditPaymentsIdentifiers.append(creditPayment.getDocumentNo());
+            creditPaymentsIdentifiers.append(", ");
+          }
+          creditPaymentsIdentifiers.delete(creditPaymentsIdentifiers.length() - 2,
+              creditPaymentsIdentifiers.length());
+          creditPaymentsIdentifiers.append("\n");
+
+          final List<FIN_PaymentScheduleDetail> paymentScheduleDetails = new ArrayList<FIN_PaymentScheduleDetail>();
+          final HashMap<String, BigDecimal> paymentScheduleDetailsAmounts = new HashMap<String, BigDecimal>();
+          BigDecimal allocatedAmt = BigDecimal.ZERO;
+          for (final FIN_PaymentScheduleDetail paymentScheduleDetail : dao
+              .getInvoicePendingScheduledPaymentDetails(invoice)) {
+            if (totalUsedCreditAmt.compareTo(allocatedAmt) > 0) {
+              final BigDecimal pendingToAllocate = totalUsedCreditAmt.subtract(allocatedAmt);
+              paymentScheduleDetails.add(paymentScheduleDetail);
+
+              final BigDecimal psdAmt = paymentScheduleDetail.getAmount();
+              if (psdAmt.compareTo(pendingToAllocate) <= 0) {
+                paymentScheduleDetailsAmounts.put(paymentScheduleDetail.getId(), psdAmt);
+                allocatedAmt = allocatedAmt.add(psdAmt);
+              } else {
+                paymentScheduleDetailsAmounts.put(paymentScheduleDetail.getId(), pendingToAllocate);
+                allocatedAmt = allocatedAmt.add(pendingToAllocate);
               }
-
-              // Create new Payment
-              final boolean isSalesTransaction = invoice.isSalesTransaction();
-              final DocumentType docType = FIN_Utility.getDocumentType(invoice.getOrganization(),
-                  isSalesTransaction ? "ARR" : "APP");
-              final String strPaymentDocumentNo = FIN_Utility.getDocumentNo(docType,
-                  docType.getTable() != null ? docType.getTable().getDBTableName() : "");
-              final FIN_FinancialAccount bpFinAccount = isSalesTransaction ? invoice
-                  .getBusinessPartner().getAccount() : invoice.getBusinessPartner()
-                  .getPOFinancialAccount();
-              final FIN_Payment newPayment = FIN_AddPayment.savePayment(null, isSalesTransaction,
-                  docType, strPaymentDocumentNo, invoice.getBusinessPartner(),
-                  invoice.getPaymentMethod(), bpFinAccount, "0", creditPayment.getPaymentDate(),
-                  invoice.getOrganization(), invoice.getDocumentNo(), paymentScheduleDetails,
-                  paymentScheduleDetailsAmounts, false, false);
-              newPayment.setAmount(BigDecimal.ZERO);
-              newPayment.setGeneratedCredit(BigDecimal.ZERO);
-              newPayment.setUsedCredit(invoice.getGrandTotalAmount());
-
-              // Process the new payment
-              FIN_AddPayment.processPayment(vars, this, "P", newPayment);
-
-              // Update Invoice's description
-              final StringBuffer invDesc = new StringBuffer();
-              if (invoice.getDescription() != null) {
-                invDesc.append(invoice.getDescription());
-                invDesc.append("\n");
-              }
-              invDesc.append(String.format(
-                  Utility.messageBD(this, "APRM_InvoiceDescUsedCredit", vars.getLanguage()),
-                  creditPayment.getIdentifier()));
-              invoice.setDescription(invDesc.toString());
             }
           }
+
+          // Create new Payment
+          final boolean isSalesTransaction = invoice.isSalesTransaction();
+          final DocumentType docType = FIN_Utility.getDocumentType(invoice.getOrganization(),
+              isSalesTransaction ? "ARR" : "APP");
+          final String strPaymentDocumentNo = FIN_Utility.getDocumentNo(docType,
+              docType.getTable() != null ? docType.getTable().getDBTableName() : "");
+          final FIN_FinancialAccount bpFinAccount = isSalesTransaction ? invoice
+              .getBusinessPartner().getAccount() : invoice.getBusinessPartner()
+              .getPOFinancialAccount();
+          final FIN_Payment newPayment = FIN_AddPayment.savePayment(null, isSalesTransaction,
+              docType, strPaymentDocumentNo, invoice.getBusinessPartner(),
+              invoice.getPaymentMethod(), bpFinAccount, "0", FIN_Utility.getDate(strPaymentDate),
+              invoice.getOrganization(), invoice.getDocumentNo(), paymentScheduleDetails,
+              paymentScheduleDetailsAmounts, false, false);
+          newPayment.setAmount(BigDecimal.ZERO);
+          newPayment.setGeneratedCredit(BigDecimal.ZERO);
+          newPayment.setUsedCredit(totalUsedCreditAmt);
+
+          // Link new Payment with the credit payments used
+          for (final FIN_Payment creditPayment : selectedCreditPayment) {
+            final BigDecimal usedCreditAmt = selectedCreditPaymentAmounts
+                .get(creditPayment.getId());
+            FIN_PaymentProcess.linkCreditPayment(newPayment, usedCreditAmt, creditPayment);
+          }
+
+          // Process the new payment
+          FIN_AddPayment.processPayment(vars, this, "P", newPayment);
+
+          // Update Invoice's description
+          final StringBuffer invDesc = new StringBuffer();
+          if (invoice.getDescription() != null) {
+            invDesc.append(invoice.getDescription());
+            invDesc.append("\n");
+          }
+          invDesc.append(String.format(
+              Utility.messageBD(this, "APRM_InvoiceDescUsedCredit", vars.getLanguage()),
+              creditPaymentsIdentifiers.toString()));
+          invoice.setDescription(invDesc.toString());
+
         } catch (final Exception e) {
           log4j.error("Exception while canceling the credit in the invoice: " + strC_Invoice_ID);
           e.printStackTrace();
@@ -238,37 +338,41 @@
           OBContext.restorePreviousMode();
         }
       }
+      executePayments(response, vars, strWindowId, strTabId, strC_Invoice_ID, strOrg);
+    }
+  }
 
-      List<FIN_Payment> payments = null;
-      try {
-        OBContext.setAdminMode(true);
-        payments = dao.getPendingExecutionPayments(strC_Invoice_ID);
-      } finally {
-        OBContext.restorePreviousMode();
-      }
+  private void executePayments(HttpServletResponse response, VariablesSecureApp vars,
+      final String strWindowId, final String strTabId, final String strC_Invoice_ID,
+      final String strOrg) throws IOException, ServletException {
+    OBError myMessage = new OBError();
 
-      if (payments != null && payments.size() > 0) {
-        vars.setSessionValue("ExecutePayments|Window_ID", strWindowId);
-        vars.setSessionValue("ExecutePayments|Tab_ID", strTabId);
-        vars.setSessionValue("ExecutePayments|Org_ID",
-            vars.getSessionValue("ProcessInvoice|Org_ID"));
-        vars.setSessionValue("ExecutePayments|payments", FIN_Utility.getInStrList(payments));
-        if (myMessage != null)
-          vars.setMessage("ExecutePayments|message", myMessage);
-        response.sendRedirect(strDireccion
-            + "/org.openbravo.advpaymentmngt.ad_actionbutton/ExecutePayments.html");
-      } else {
-        String strWindowPath = Utility.getTabURL(strTabId, "R", true);
-        if (strWindowPath.equals(""))
-          strWindowPath = strDefaultServlet;
-        printPageClosePopUp(response, vars, strWindowPath);
-      }
+    List<FIN_Payment> payments = null;
+    try {
+      OBContext.setAdminMode(true);
+      payments = dao.getPendingExecutionPayments(strC_Invoice_ID);
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    if (payments != null && payments.size() > 0) {
+      vars.setSessionValue("ExecutePayments|Window_ID", strWindowId);
+      vars.setSessionValue("ExecutePayments|Tab_ID", strTabId);
+      vars.setSessionValue("ExecutePayments|Org_ID", strOrg);
+      vars.setSessionValue("ExecutePayments|payments", FIN_Utility.getInStrList(payments));
+      if (myMessage != null)
+        vars.setMessage("ExecutePayments|message", myMessage);
+      response.sendRedirect(strDireccion
+          + "/org.openbravo.advpaymentmngt.ad_actionbutton/ExecutePayments.html");
+    } else {
+      String strWindowPath = Utility.getTabURL(strTabId, "R", true);
+      if (strWindowPath.equals(""))
+        strWindowPath = strDefaultServlet;
+      printPageClosePopUp(response, vars, strWindowPath);
+    }
 
-      vars.removeSessionValue("ProcessInvoice|Window_ID");
-      vars.removeSessionValue("ProcessInvoice|Tab_ID");
-      vars.removeSessionValue("ProcessInvoice|Org_ID");
-
-    }
+    vars.removeSessionValue("ProcessInvoice|Window_ID");
+    vars.removeSessionValue("ProcessInvoice|Tab_ID");
+    vars.removeSessionValue("ProcessInvoice|Org_ID");
   }
 
   void printPageDocAction(HttpServletResponse response, VariablesSecureApp vars,
@@ -327,6 +431,100 @@
 
   }
 
+  void printPageCreditPaymentGrid(HttpServletResponse response, VariablesSecureApp vars,
+      String strC_Invoice_ID, String strdocaction, String strProcessing, String strdocstatus,
+      String stradTableId, String strWindowId, String strTabId, Date invoiceDate, String strOrg)
+      throws IOException, ServletException {
+    log4j.debug("Output: Credit Payment Grid popup");
+    String[] discard = { "" };
+    response.setContentType("text/html; charset=UTF-8");
+    PrintWriter out = response.getWriter();
+    XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
+        "org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid", discard).createXmlDocument();
+    xmlDocument.setParameter("css", vars.getTheme());
+    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
+    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
+    xmlDocument.setParameter("cancel", Utility.messageBD(this, "Cancel", vars.getLanguage()));
+    xmlDocument.setParameter("ok", Utility.messageBD(this, "OK", vars.getLanguage()));
+    xmlDocument.setParameter("window", strWindowId);
+    xmlDocument.setParameter("tab", strTabId);
+    xmlDocument.setParameter("adOrgId", strOrg);
+
+    xmlDocument.setParameter("invoiceGrossAmt", dao.getObject(Invoice.class, strC_Invoice_ID)
+        .getGrandTotalAmount().toString());
+
+    OBError myMessage = vars.getMessage("ProcessInvoice|CreditPaymentGrid");
+    vars.removeMessage("ProcessInvoice|CreditPaymentGrid");
+    if (myMessage != null) {
+      xmlDocument.setParameter("messageType", myMessage.getType());
+      xmlDocument.setParameter("messageTitle", myMessage.getTitle());
+      xmlDocument.setParameter("messageMessage", myMessage.getMessage());
+    }
+
+    xmlDocument.setParameter("dateDisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("paymentDate",
+        Utility.formatDate(invoiceDate, vars.getJavaDateFormat()));
+
+    out.println(xmlDocument.print());
+    out.close();
+
+  }
+
+  private void printGrid(HttpServletResponse response, VariablesSecureApp vars, String invoiceId)
+      throws IOException, ServletException {
+    log4j.debug("Output: Grid with credit payments");
+
+    final Invoice invoice = dao.getObject(Invoice.class, invoiceId);
+
+    String[] discard = {};
+    XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
+        "org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid", discard)
+        .createXmlDocument();
+
+    xmlDocument.setData("structure", getCreditPayments(invoice));
+
+    response.setContentType("text/html; charset=UTF-8");
+    PrintWriter out = response.getWriter();
+    out.println(xmlDocument.print());
+    out.close();
+  }
+
+  private FieldProvider[] getCreditPayments(Invoice invoice) {
+    FieldProvider[] data = FieldProviderFactory.getFieldProviderArray(creditPayments);
+    String dateFormat = OBPropertiesProvider.getInstance().getOpenbravoProperties()
+        .getProperty("dateFormat.java");
+    SimpleDateFormat dateFormater = new SimpleDateFormat(dateFormat);
+
+    BigDecimal pendingToPay = invoice.getGrandTotalAmount();
+    for (int i = 0; i < data.length; i++) {
+      FieldProviderFactory.setField(data[i], "finCreditPaymentId", creditPayments.get(i).getId());
+      FieldProviderFactory.setField(data[i], "documentNo", creditPayments.get(i).getDocumentNo());
+      FieldProviderFactory.setField(data[i], "paymentDescription", creditPayments.get(i)
+          .getDescription());
+      if (creditPayments.get(i).getPaymentDate() != null) {
+        FieldProviderFactory.setField(data[i], "documentDate",
+            dateFormater.format(creditPayments.get(i).getPaymentDate()).toString());
+      }
+
+      final BigDecimal outStandingAmt = creditPayments.get(i).getGeneratedCredit()
+          .subtract(creditPayments.get(i).getUsedCredit());
+      FieldProviderFactory.setField(data[i], "outstandingAmount", outStandingAmt.toString());
+
+      FieldProviderFactory.setField(
+          data[i],
+          "paymentAmount",
+          pendingToPay.compareTo(outStandingAmt) > 0 ? outStandingAmt.toString() : (pendingToPay
+              .compareTo(BigDecimal.ZERO) > 0 ? pendingToPay.toString() : ""));
+      pendingToPay = pendingToPay.subtract(outStandingAmt);
+
+      FieldProviderFactory.setField(data[i], "finSelectedCreditPaymentId",
+          "".equals(data[i].getField("paymentAmount")) ? "" : creditPayments.get(i).getId());
+      FieldProviderFactory.setField(data[i], "rownum", String.valueOf(i));
+    }
+
+    return data;
+  }
+
   private boolean isInvoiceWithPayments(Invoice invoice) {
     for (FIN_PaymentSchedule ps : OBDao.getFilteredCriteria(FIN_PaymentSchedule.class,
         Restrictions.eq(FIN_PaymentSchedule.PROPERTY_INVOICE, invoice)).list()) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Wed Oct 26 19:11:17 2011 +0200
@@ -1421,6 +1421,7 @@
     obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_RECEIPT, isReceipt));
     obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_GENERATEDCREDIT, BigDecimal.ZERO));
     obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPAP"));
+    obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPVOID"));
     obcPayment.add(Restrictions.neProperty(FIN_Payment.PROPERTY_GENERATEDCREDIT,
         FIN_Payment.PROPERTY_USEDCREDIT));
     obcPayment.addOrderBy(FIN_Payment.PROPERTY_PAYMENTDATE, true);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Wed Oct 26 19:11:17 2011 +0200
@@ -37,6 +37,7 @@
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
@@ -484,6 +485,18 @@
     return selectedPaymentScheduleDetailsAmounts;
   }
 
+  public static <T extends BaseOBObject> HashMap<String, BigDecimal> getSelectedBaseOBObjectAmount(
+      VariablesSecureApp vars, List<T> selectedBaseOBObjects, String htmlElementId)
+      throws ServletException {
+    HashMap<String, BigDecimal> selectedBaseOBObjectAmounts = new HashMap<String, BigDecimal>();
+
+    for (final T o : selectedBaseOBObjects) {
+      selectedBaseOBObjectAmounts.put((String) o.getId(),
+          new BigDecimal(vars.getNumericParameter(htmlElementId + (String) o.getId(), "")));
+    }
+    return selectedBaseOBObjectAmounts;
+  }
+
   /**
    * Builds a FieldProvider with a set of Payment Schedule Details based on the
    * selectedScheduledPaymentDetails and filteredScheduledPaymentDetails Lists. When the firstLoad
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Wed Oct 26 19:11:17 2011 +0200
@@ -21,11 +21,13 @@
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
 import org.hibernate.criterion.Restrictions;
+import org.openbravo.advpaymentmngt.ad_actionbutton.ProcessInvoice;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.exception.NoExecutionProcessFoundException;
@@ -45,8 +47,10 @@
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentDetail;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
+import org.openbravo.model.financialmgmt.payment.FIN_Payment_Credit;
 import org.openbravo.model.financialmgmt.payment.PaymentExecutionProcess;
 import org.openbravo.scheduling.ProcessBundle;
+import org.openbravo.service.db.DalConnectionProvider;
 
 public class FIN_PaymentProcess implements org.openbravo.scheduling.Process {
   private static AdvPaymentMngtDao dao;
@@ -180,8 +184,7 @@
           if (paymentAmount.compareTo(payment.getAmount()) != 0)
             payment.setUsedCredit(paymentAmount.subtract(payment.getAmount()));
           if (payment.getUsedCredit().compareTo(BigDecimal.ZERO) != 0)
-            updateUsedCredit(payment.getUsedCredit(), payment.getBusinessPartner(),
-                payment.isReceipt());
+            updateUsedCredit(payment);
 
           payment.setWriteoffAmount(paymentWriteOfAmount);
           payment.setProcessed(true);
@@ -372,6 +375,7 @@
           }
           List<FIN_PaymentDetail> paymentDetails = payment.getFINPaymentDetailList();
           List<ConversionRateDoc> conversionRates = payment.getCurrencyConversionRateDocList();
+          Set<String> invoiceDocNos = new HashSet<String>();
           for (FIN_PaymentDetail paymentDetail : paymentDetails) {
             removedPDS = new ArrayList<FIN_PaymentScheduleDetail>();
             for (FIN_PaymentScheduleDetail paymentScheduleDetail : paymentDetail
@@ -382,6 +386,8 @@
                 FIN_AddPayment.updatePaymentScheduleAmounts(paymentScheduleDetail
                     .getInvoicePaymentSchedule(), paymentScheduleDetail.getAmount().negate(),
                     paymentScheduleDetail.getWriteoffAmount().negate());
+                invoiceDocNos.add(paymentScheduleDetail.getInvoicePaymentSchedule().getInvoice()
+                    .getDocumentNo());
                 // BP SO_CreditUsed
                 businessPartner = paymentScheduleDetail.getInvoicePaymentSchedule().getInvoice()
                     .getBusinessPartner();
@@ -428,9 +434,9 @@
 
           if (payment.getGeneratedCredit().compareTo(BigDecimal.ZERO) == 0
               && payment.getUsedCredit().compareTo(BigDecimal.ZERO) == 1) {
-            undoUsedCredit(payment.getUsedCredit(), payment.getBusinessPartner(),
-                payment.isReceipt());
+            undoUsedCredit(payment, vars, invoiceDocNos);
           }
+          payment.getFINPaymentCreditList().clear();
           payment.setGeneratedCredit(BigDecimal.ZERO);
           payment.setUsedCredit(BigDecimal.ZERO);
 
@@ -491,6 +497,7 @@
              * Cancel all payment schedule details related to the payment
              */
             final List<FIN_PaymentScheduleDetail> removedPDS = new ArrayList<FIN_PaymentScheduleDetail>();
+            Set<String> invoiceDocNos = new HashSet<String>();
             for (final FIN_PaymentDetail paymentDetail : payment.getFINPaymentDetailList()) {
               for (final FIN_PaymentScheduleDetail paymentScheduleDetail : paymentDetail
                   .getFINPaymentScheduleDetailList()) {
@@ -508,6 +515,8 @@
                       outStandingAmt = outStandingAmt.add(invScheDetail.getAmount());
                       paymentScheduleDetail.setCanceled(true);
                     }
+                    invoiceDocNos.add(paymentScheduleDetail.getInvoicePaymentSchedule()
+                        .getInvoice().getDocumentNo());
                   }
                   // Create merged Payment Schedule Detail with the pending to be paid amount
                   if (outStandingAmt.compareTo(BigDecimal.ZERO) != 0) {
@@ -555,6 +564,12 @@
               for (FIN_PaymentScheduleDetail removedPD : removedPDS)
                 OBDal.getInstance().remove(removedPD);
             }
+            if (payment.getGeneratedCredit().compareTo(BigDecimal.ZERO) == 0
+                && payment.getUsedCredit().compareTo(BigDecimal.ZERO) == 1) {
+              undoUsedCredit(payment, vars, invoiceDocNos);
+            }
+            payment.getFINPaymentCreditList().clear();
+            payment.setUsedCredit(BigDecimal.ZERO);
           }
         } finally {
           OBDal.getInstance().flush();
@@ -630,36 +645,115 @@
     return true;
   }
 
-  private static void updateUsedCredit(BigDecimal usedAmount, BusinessPartner bp, boolean isReceipt) {
-    List<FIN_Payment> payments = dao.getCustomerPaymentsWithCredit(bp, isReceipt);
-    BigDecimal pendingToAllocateAmount = usedAmount;
-    for (FIN_Payment payment : payments) {
-      BigDecimal availableAmount = payment.getGeneratedCredit().subtract(payment.getUsedCredit());
-      if (pendingToAllocateAmount.compareTo(availableAmount) == 1) {
-        payment.setUsedCredit(payment.getUsedCredit().add(availableAmount));
-        pendingToAllocateAmount = pendingToAllocateAmount.subtract(availableAmount);
-        OBDal.getInstance().save(payment);
-      } else {
-        payment.setUsedCredit(payment.getUsedCredit().add(pendingToAllocateAmount));
-        OBDal.getInstance().save(payment);
+  private void updateUsedCredit(FIN_Payment newPayment) {
+    boolean fromProcessInvoice = false;
+    for (final StackTraceElement ste : Thread.currentThread().getStackTrace()) {
+      if (ste.getClassName().equals(ProcessInvoice.class.getName())) {
+        fromProcessInvoice = true;
         break;
       }
     }
+
+    if (!fromProcessInvoice) {
+      final BigDecimal usedAmount = newPayment.getUsedCredit();
+      final BusinessPartner bp = newPayment.getBusinessPartner();
+      final boolean isReceipt = newPayment.isReceipt();
+
+      List<FIN_Payment> creditPayments = dao.getCustomerPaymentsWithCredit(bp, isReceipt);
+      BigDecimal pendingToAllocateAmount = usedAmount;
+      for (FIN_Payment creditPayment : creditPayments) {
+        BigDecimal availableAmount = creditPayment.getGeneratedCredit().subtract(
+            creditPayment.getUsedCredit());
+        if (pendingToAllocateAmount.compareTo(availableAmount) == 1) {
+          creditPayment.setUsedCredit(creditPayment.getUsedCredit().add(availableAmount));
+          pendingToAllocateAmount = pendingToAllocateAmount.subtract(availableAmount);
+          linkCreditPayment(newPayment, availableAmount, creditPayment);
+          OBDal.getInstance().save(creditPayment);
+        } else {
+          creditPayment.setUsedCredit(creditPayment.getUsedCredit().add(pendingToAllocateAmount));
+          linkCreditPayment(newPayment, pendingToAllocateAmount, creditPayment);
+          OBDal.getInstance().save(creditPayment);
+          break;
+        }
+      }
+    }
   }
 
-  private void undoUsedCredit(BigDecimal usedAmount, BusinessPartner bp, Boolean isReceipt) {
-    List<FIN_Payment> payments = dao.getCustomerPaymentsWithUsedCredit(bp, isReceipt);
+  public static void linkCreditPayment(FIN_Payment newPayment, BigDecimal usedAmount,
+      FIN_Payment creditPayment) {
+    final FIN_Payment_Credit creditInfo = OBProvider.getInstance().get(FIN_Payment_Credit.class);
+    creditInfo.setPayment(newPayment);
+    creditInfo.setAmount(usedAmount);
+    creditInfo.setCurrency(newPayment.getCurrency());
+    creditInfo.setCreditPaymentUsed(creditPayment);
+    creditInfo.setOrganization(newPayment.getOrganization());
+    creditInfo.setClient(newPayment.getClient());
+    newPayment.getFINPaymentCreditList().add(creditInfo);
+  }
+
+  private void undoUsedCredit(FIN_Payment myPayment, VariablesSecureApp vars,
+      Set<String> invoiceDocNos) {
+    final BigDecimal usedAmount = myPayment.getUsedCredit();
+    final BusinessPartner bp = myPayment.getBusinessPartner();
+    final Boolean isReceipt = myPayment.isReceipt();
     BigDecimal pendingDeallocateAmount = usedAmount;
-    for (FIN_Payment payment : payments) {
-      BigDecimal paymentUsedAmount = payment.getUsedCredit();
-      if (usedAmount.compareTo(paymentUsedAmount) == 1) {
-        payment.setUsedCredit(BigDecimal.ZERO);
-        pendingDeallocateAmount = pendingDeallocateAmount.subtract(paymentUsedAmount);
-        OBDal.getInstance().save(payment);
-      } else {
-        payment.setUsedCredit(payment.getUsedCredit().subtract(pendingDeallocateAmount));
-        OBDal.getInstance().save(payment);
-        break;
+
+    final List<FIN_Payment> payments;
+    final boolean oldFlow;
+    if (myPayment.getFINPaymentCreditList().isEmpty()) {
+      // Credit payments created by the old flow, or from the Add details button
+      payments = dao.getCustomerPaymentsWithUsedCredit(bp, isReceipt);
+      oldFlow = true;
+    } else {
+      // Credit payments used by the new popup while completing invoice
+      payments = new ArrayList<FIN_Payment>();
+      for (final FIN_Payment_Credit pc : myPayment.getFINPaymentCreditList()) {
+        final FIN_Payment creditPaymentUsed = pc.getCreditPaymentUsed();
+        creditPaymentUsed.setUsedCredit(creditPaymentUsed.getUsedCredit().subtract(pc.getAmount()));
+        payments.add(creditPaymentUsed);
+      }
+      oldFlow = false;
+    }
+
+    for (final FIN_Payment payment : payments) {
+      // Update Description
+      final String payDesc = payment.getDescription();
+      if (payDesc != null) {
+        final String invoiceDocNoMsg = Utility.messageBD(new DalConnectionProvider(),
+            "APRM_CreditUsedinInvoice", vars.getLanguage());
+        if (invoiceDocNoMsg != null) {
+          final StringBuffer newDesc = new StringBuffer();
+          for (final String line : payDesc.split("\n")) {
+            boolean include = true;
+            if (line.startsWith(invoiceDocNoMsg.substring(0, invoiceDocNoMsg.lastIndexOf("%s")))) {
+              for (final String docNo : invoiceDocNos) {
+                if (line.indexOf(docNo) > 0) {
+                  include = false;
+                  break;
+                }
+              }
+            }
+            if (include) {
+              newDesc.append(line);
+              if (!"".equals(line))
+                newDesc.append("\n");
+            }
+          }
+          payment.setDescription(newDesc.toString());
+        }
+      }
+
+      if (oldFlow) {
+        BigDecimal paymentUsedAmount = payment.getUsedCredit();
+        if (usedAmount.compareTo(paymentUsedAmount) == 1) {
+          payment.setUsedCredit(BigDecimal.ZERO);
+          pendingDeallocateAmount = pendingDeallocateAmount.subtract(paymentUsedAmount);
+          OBDal.getInstance().save(payment);
+        } else {
+          payment.setUsedCredit(payment.getUsedCredit().subtract(pendingDeallocateAmount));
+          OBDal.getInstance().save(payment);
+          break;
+        }
       }
     }
   }
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -473,6 +473,17 @@
 <!--8B947CC936E44FBCBCE62F4E02A01C63-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--8B947CC936E44FBCBCE62F4E02A01C63--></AD_TEXTINTERFACES>
 
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A--><AD_TEXTINTERFACES>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <AD_TEXTINTERFACES_ID><![CDATA[8DFAF1EEAAE24EE094C0BF142C0BE56A]]></AD_TEXTINTERFACES_ID>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <TEXT><![CDATA[Payment Date]]></TEXT>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml]]></FILENAME>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--8DFAF1EEAAE24EE094C0BF142C0BE56A--></AD_TEXTINTERFACES>
+
 <!--937AA8C7B9DA4ACF92B9A1ACA7719A65--><AD_TEXTINTERFACES>
 <!--937AA8C7B9DA4ACF92B9A1ACA7719A65-->  <AD_TEXTINTERFACES_ID><![CDATA[937AA8C7B9DA4ACF92B9A1ACA7719A65]]></AD_TEXTINTERFACES_ID>
 <!--937AA8C7B9DA4ACF92B9A1ACA7719A65-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -594,6 +605,105 @@
 <!--AC44B03FF40047059E663CEB9CF49A5A-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--AC44B03FF40047059E663CEB9CF49A5A--></AD_TEXTINTERFACES>
 
+<!--AF049D5097F14A79E040007F010149FB--><AD_TEXTINTERFACES>
+<!--AF049D5097F14A79E040007F010149FB-->  <AD_TEXTINTERFACES_ID><![CDATA[AF049D5097F14A79E040007F010149FB]]></AD_TEXTINTERFACES_ID>
+<!--AF049D5097F14A79E040007F010149FB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AF049D5097F14A79E040007F010149FB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AF049D5097F14A79E040007F010149FB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AF049D5097F14A79E040007F010149FB-->  <TEXT><![CDATA[Include Payments Using Credit]]></TEXT>
+<!--AF049D5097F14A79E040007F010149FB-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html]]></FILENAME>
+<!--AF049D5097F14A79E040007F010149FB-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AF049D5097F14A79E040007F010149FB-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AF049D5097F14A79E040007F010149FB--></AD_TEXTINTERFACES>
+
+<!--AF2D1591711675E8E040007F0101337D--><AD_TEXTINTERFACES>
+<!--AF2D1591711675E8E040007F0101337D-->  <AD_TEXTINTERFACES_ID><![CDATA[AF2D1591711675E8E040007F0101337D]]></AD_TEXTINTERFACES_ID>
+<!--AF2D1591711675E8E040007F0101337D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AF2D1591711675E8E040007F0101337D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AF2D1591711675E8E040007F0101337D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AF2D1591711675E8E040007F0101337D-->  <TEXT><![CDATA[Payment Description]]></TEXT>
+<!--AF2D1591711675E8E040007F0101337D-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml]]></FILENAME>
+<!--AF2D1591711675E8E040007F0101337D-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AF2D1591711675E8E040007F0101337D-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AF2D1591711675E8E040007F0101337D--></AD_TEXTINTERFACES>
+
+<!--AF2E12144150C776E040007F01013C23--><AD_TEXTINTERFACES>
+<!--AF2E12144150C776E040007F01013C23-->  <AD_TEXTINTERFACES_ID><![CDATA[AF2E12144150C776E040007F01013C23]]></AD_TEXTINTERFACES_ID>
+<!--AF2E12144150C776E040007F01013C23-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AF2E12144150C776E040007F01013C23-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AF2E12144150C776E040007F01013C23-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AF2E12144150C776E040007F01013C23-->  <TEXT><![CDATA[Include Payments Using Credit:]]></TEXT>
+<!--AF2E12144150C776E040007F01013C23-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
+<!--AF2E12144150C776E040007F01013C23-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AF2E12144150C776E040007F01013C23-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AF2E12144150C776E040007F01013C23--></AD_TEXTINTERFACES>
+
+<!--AFAA1DE81243FDE8E040007F010159B7--><AD_TEXTINTERFACES>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <AD_TEXTINTERFACES_ID><![CDATA[AFAA1DE81243FDE8E040007F010159B7]]></AD_TEXTINTERFACES_ID>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <TEXT><![CDATA[* Invoice paid using a credit payment]]></TEXT>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html]]></FILENAME>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFAA1DE81243FDE8E040007F010159B7-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFAA1DE81243FDE8E040007F010159B7--></AD_TEXTINTERFACES>
+
+<!--AFB970D388478761E040007F01012C25--><AD_TEXTINTERFACES>
+<!--AFB970D388478761E040007F01012C25-->  <AD_TEXTINTERFACES_ID><![CDATA[AFB970D388478761E040007F01012C25]]></AD_TEXTINTERFACES_ID>
+<!--AFB970D388478761E040007F01012C25-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFB970D388478761E040007F01012C25-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFB970D388478761E040007F01012C25-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFB970D388478761E040007F01012C25-->  <TEXT><![CDATA[** Several invoices have been paid using the same credit payment]]></TEXT>
+<!--AFB970D388478761E040007F01012C25-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html]]></FILENAME>
+<!--AFB970D388478761E040007F01012C25-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFB970D388478761E040007F01012C25-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFB970D388478761E040007F01012C25--></AD_TEXTINTERFACES>
+
+<!--AFBBE094BB53D031E040007F01013B9F--><AD_TEXTINTERFACES>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <AD_TEXTINTERFACES_ID><![CDATA[AFBBE094BB53D031E040007F01013B9F]]></AD_TEXTINTERFACES_ID>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <TEXT><![CDATA[* Invoice paid using a credit payment]]></TEXT>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml]]></FILENAME>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFBBE094BB53D031E040007F01013B9F-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFBBE094BB53D031E040007F01013B9F--></AD_TEXTINTERFACES>
+
+<!--AFBBE094BB55D031E040007F01013B9F--><AD_TEXTINTERFACES>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <AD_TEXTINTERFACES_ID><![CDATA[AFBBE094BB55D031E040007F01013B9F]]></AD_TEXTINTERFACES_ID>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <TEXT><![CDATA[** Several invoices have been paid using the same credit payment]]></TEXT>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml]]></FILENAME>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFBBE094BB55D031E040007F01013B9F-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFBBE094BB55D031E040007F01013B9F--></AD_TEXTINTERFACES>
+
+<!--AFBBE094BB57D031E040007F01013B9F--><AD_TEXTINTERFACES>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <AD_TEXTINTERFACES_ID><![CDATA[AFBBE094BB57D031E040007F01013B9F]]></AD_TEXTINTERFACES_ID>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <TEXT><![CDATA[* Invoice paid using a credit payment]]></TEXT>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFBBE094BB57D031E040007F01013B9F-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFBBE094BB57D031E040007F01013B9F--></AD_TEXTINTERFACES>
+
+<!--AFBBE094BB59D031E040007F01013B9F--><AD_TEXTINTERFACES>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <AD_TEXTINTERFACES_ID><![CDATA[AFBBE094BB59D031E040007F01013B9F]]></AD_TEXTINTERFACES_ID>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <TEXT><![CDATA[** Several invoices have been paid using the same credit payment]]></TEXT>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AFBBE094BB59D031E040007F01013B9F-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--AFBBE094BB59D031E040007F01013B9F--></AD_TEXTINTERFACES>
+
 <!--B682A4F7A92C45A4BE2D04E087F45B6D--><AD_TEXTINTERFACES>
 <!--B682A4F7A92C45A4BE2D04E087F45B6D-->  <AD_TEXTINTERFACES_ID><![CDATA[B682A4F7A92C45A4BE2D04E087F45B6D]]></AD_TEXTINTERFACES_ID>
 <!--B682A4F7A92C45A4BE2D04E087F45B6D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html	Wed Oct 26 19:11:17 2011 +0200
@@ -13,7 +13,7 @@
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
-* All portions are Copyright (C) 2009 Openbravo SL 
+* All portions are Copyright (C) 2009-2011 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -279,7 +279,7 @@
   <input type="hidden" name="inpSecondKey"></input>
   <input type="hidden" name="inpKeyReferenceId"></input>
   <input type="hidden" name="inpTableReferenceId"></input>
-  <input type="hidden" name="inpissotrx" id="IsSOTrx" value="N">
+  <input type="hidden" name="inpissotrx" id="IsSOTrx" value="N"></input>
   <input type="hidden" name="inpAdTableId"></input>
   <input type="hidden" name="inpIsReceipt"></input>
   <input type="hidden" name="inpRecordId"></input>
@@ -407,6 +407,13 @@
                                 </tbody>
                               </table>
                             <!-- USER CONTROLS -->
+						  </td>
+						</tr>
+					  </table>
+					
+					</td>
+				   </tr>
+				 </table>		
               <table class="Main_Client_TableEdition">
                 <tr>
                   <td class="TableEdition_OneCell_width"></td>
@@ -504,7 +511,7 @@
                         </td>
                         <td class="FieldButton_ContentCell">
                           <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" onclick="calculator('frmMain.inpAmountFrom', document.frmMain.inpAmountFrom.value);return false;">
-                            <table class="FieldButton"  onmouseout="window.status='';return true;" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calculator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <table class="FieldButton"  onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calculator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
                               <tr>
                                 <td class="FieldButton_bg">
                                   <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calc" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
@@ -527,7 +534,7 @@
                         </td>
                         <td class="FieldButton_ContentCell">
                           <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" onclick="calculator('frmMain.inpAmountTo', document.frmMain.inpAmountTo.value);return false;">
-                            <table class="FieldButton"  onmouseout="window.status='';return true;" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calculator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <table class="FieldButton"  onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calculator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
                               <tr>
                                 <td class="FieldButton_bg">
                                   <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calc" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
@@ -788,13 +795,13 @@
                     <select  name="inpPaymentMethodId" id="paramPaymentMethodId" class="Combo Combo_TwoCells_width">
                       <option value=""> <div id="reportPaymentMethod_ID"></div></option>
                     </select>
-                  </td>
-                  <td class="TitleCell"><span class="LabelText">Financial Account</span></td>
-                  <td class="Combo_ContentCell" colspan="2">
-                    <select  name="inpFinancialAccountId" id="paramFinancialAccountId" class="Combo Combo_TwoCells_width">
-                      <option value=""> <div id="reportFinancialAccount_ID"></div></option>
-                    </select>
-                  </td>
+                  </td>  
+                  <td class="ContentCell"></td>
+                  <td class="TitleCell"><span class="LabelText">Include Payments Using Credit</span></td>
+                  <td class="Radio_Check_ContentCell">
+                    <span class="Checkbox_container_NOT_Focused">
+                      <input type="checkbox" name="inpInclPaymentUsingCredit" value="Y" id="paramInclPaymentUsingCredit"></input>
+                    </span></td>
                 </tr>
                 <tr>
                   <td class="TitleCell"><span class="LabelText">Currency</span></td>
@@ -803,9 +810,12 @@
                       <option value=""> <div id="reportC_Currency_ID"></div></option>
                     </select>
                   </td>
-                  <td class="ContentCell"></td>
-                  <td class="ContentCell"></td>
-                  <td class="ContentCell"></td>
+                  <td class="TitleCell"><span class="LabelText">Financial Account</span></td>
+                  <td class="Combo_ContentCell" colspan="2">
+                    <select  name="inpFinancialAccountId" id="paramFinancialAccountId" class="Combo Combo_TwoCells_width">
+                      <option value=""> <div id="reportFinancialAccount_ID"></div></option>
+                    </select>
+                  </td>
                 </tr>
                 
                 
@@ -843,7 +853,7 @@
                   <td class="TitleCell"><span class="LabelText">Payment Type</span></td>
                   <td class="Combo_ContentCell" colspan="2">
                     <select  name="inpPaymType" id="paramPaymType" class="ComboKey Combo_TwoCells_width" required="true">
-                        <option value=""><div id="reportPaymType"></option>
+                        <option value=""><div id="reportPaymType"></div></option>
                     </select>
                   </td>
                   <td class="ContentCell"></td>
@@ -1039,7 +1049,6 @@
                   <td class="ContentCell"></td>
                   <td class="ContentCell"></td>
                 </tr>
-              </table>
               <table class="Main_Client_TableEdition">
                   <tr>
                     <td colspan="6">
@@ -1081,11 +1090,12 @@
                                 <a href="#" onclick="validate(); openInvoiceTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldInvLink" style="xx">
                                   <span id="fieldInvoiceNumber">xx14500.34</span>
                                 </a>
+                                <span id="fieldInvoiceNumber_nolink" class="DataGrid_Body_Cell" style="xx">xx14500.34</span>
                               </td>
                                 
                               <td width="10%" id="fieldInvoiceDate" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                               <td width="10%" class="DataGrid_Body_Cell_Amount">
-                                <a href="#" onclick="validate(); openPaymentTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldPaymLink" style="xx">
+                                <a href="#" onclick="validate(); openPaymentTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldPaymLink" style="xx" title="xx">
                                   <span id="fieldPayment">xx14500.34</span>
                                 </a>
                               </td>
@@ -1167,10 +1177,11 @@
                                       <a href="#" onclick="validate(); openInvoiceTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldInvLink2" style="xx">
                                         <span id="fieldInvoiceNumber2">xx14500.34</span>
                                       </a>
+                                      <span id="fieldInvoiceNumber2_nolink" class="DataGrid_Body_Cell" style="xx">xx14500.34</span>
                                     </td>
                                     <td width="10%" id="fieldInvoiceDate2" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                                     <td width="10%" class="DataGrid_Body_Cell_Amount">
-                                      <a href="#" onclick="validate(); openPaymentTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldPaymLink2" style="xx">
+                                      <a href="#" onclick="validate(); openPaymentTab('yy', 'zz');" onmouseover="window.status='Payment Report';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldPaymLink2" style="xx" title="xx">
                                         <span id="fieldPayment2">xx14500.34</span>
                                       </a>
                                     </td>
@@ -1225,18 +1236,23 @@
                 </table>
 
                       <!-- USER CONTROLS -->
-                </td>
+                <table class="Main_Client_TableEdition">
+			      <tr>
+				   <td>					
+				    <div id="paramShowOneAsterisk" style="xx" class="RelationInfoContent">* Invoice paid using a credit payment</div>
+				    <div id="paramShowTwoAsterisk" style="xx" class="RelationInfoContent">** Several invoices have been paid using the same credit payment</div>
+				   </td>
+				  </tr>
+			  </table>		
               </tr>
               </table>
-              </td>
-            </tr>
-          </table>
-        </div>
+        
         <table width="100%" border="0" cellspacing="0" cellpadding="0" class="Menu_ContentPane_Bottom" id="tdbottomSeparator">
           <tr>
-            <td class="Main_Bottom_bg"><img src="../../../../../web/images/blank.gif" border="0"></td>
+            <td class="Main_Bottom_bg"><img src="../../../../../web/images/blank.gif" border="0"/></td>
           </tr>
         </table>
+	</div>
       </td>
       <td valign="top">
         <table width="100%" border="0" cellspacing="0" cellpadding="0" class="Main_ContentPane_Right" id="tdrightSeparator">
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java	Wed Oct 26 19:11:17 2011 +0200
@@ -112,11 +112,13 @@
       String strOrdCrit = vars.getInGlobalVariable("inpShown", "PaymentReport|OrdCrit", "",
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
               "FINPR_BPartner_Category", ""));
+      final String strInclPaymentUsingCredit = vars.getGlobalVariable("inpInclPaymentUsingCredit",
+          "PaymentReport|IncludePaymentUsingCredit", "Y");
       printPageDataSheet(response, vars, strOrg, strInclSubOrg, strDueDateFrom, strDueDateTo,
           strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, strcBPartnerIdIN,
           strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
           strFinancialAccountId, strcCurrency, strConvertCurrency, strConversionDate, strPaymType,
-          strOverdue, strGroupCrit, strOrdCrit);
+          strOverdue, strGroupCrit, strOrdCrit, strInclPaymentUsingCredit);
     } else if (vars.commandIn("FIND")) {
       String strOrg = vars.getRequestGlobalVariable("inpOrg", "PaymentReport|Organization");
       String strInclSubOrg = vars.getRequestGlobalVariable("inpInclSubOrg",
@@ -166,11 +168,14 @@
       String strOrdCrit = vars.getRequestInGlobalVariable("inpShown", "PaymentReport|OrdCrit",
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
               "FINPR_BPartner_Category", ""));
+      final String strInclPaymentUsingCredit = vars.getStringParameter("inpInclPaymentUsingCredit",
+          "N");
+      vars.setSessionValue("PaymentReport|IncludePaymentUsingCredit", strInclPaymentUsingCredit);
       printPageDataSheet(response, vars, strOrg, strInclSubOrg, strDueDateFrom, strDueDateTo,
           strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, strcBPartnerIdIN,
           strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
           strFinancialAccountId, strcCurrency, strConvertCurrency, strConversionDate, strPaymType,
-          strOverdue, strGroupCrit, strOrdCrit);
+          strOverdue, strGroupCrit, strOrdCrit, strInclPaymentUsingCredit);
     } else if (vars.commandIn("PDF", "XLS")) {
       String strOrg = vars.getRequestGlobalVariable("inpOrg", "PaymentReport|Organization");
       String strInclSubOrg = vars.getRequestGlobalVariable("inpInclSubOrg",
@@ -215,6 +220,9 @@
           new ValueListFilter("Date", "APRM_FATS_BPARTNER", "Project", "INS_CURRENCY",
               "FINPR_BPartner_Category", ""));
       String strOutput = "html";
+      final String strInclPaymentUsingCredit = vars.getStringParameter("inpInclPaymentUsingCredit",
+          "N");
+      vars.setSessionValue("PaymentReport|IncludePaymentUsingCredit", strInclPaymentUsingCredit);
       if (vars.commandIn("PDF"))
         strOutput = "pdf";
       else if (vars.commandIn("XLS"))
@@ -224,7 +232,7 @@
           strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, strcBPartnerIdIN,
           strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
           strFinancialAccountId, strcCurrency, strConvertCurrency, strConversionDate, strPaymType,
-          strOverdue, strOutput, strGroupCrit, strOrdCrit);
+          strOverdue, strOutput, strGroupCrit, strOrdCrit, strInclPaymentUsingCredit);
 
     } else if (vars.commandIn("LINK")) {
       String strTableId = vars.getRequiredStringParameter("inpAdTableId", IsIDFilter.instance);
@@ -254,7 +262,7 @@
       String strcProjectIdIN, String strfinPaymSt, String strPaymentMethodId,
       String strFinancialAccountId, String strcCurrency, String strConvertCurrency,
       String strConversionDate, String strPaymType, String strOverdue, String strGroupCrit,
-      String strOrdCrit) throws IOException, ServletException {
+      String strOrdCrit, String strInclPaymentUsingCredit) throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument = null;
@@ -269,7 +277,7 @@
           strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, strcBPartnerIdIN,
           strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
           strFinancialAccountId, strcCurrency, strConvertCurrency, strConversionDate, strPaymType,
-          strOverdue, strGroupCrit, strOrdCrit);
+          strOverdue, strGroupCrit, strOrdCrit, strInclPaymentUsingCredit);
 
       if (data.length == 0) {
 
@@ -510,6 +518,7 @@
     xmlDocument
         .setParameter("conversionDatedisplaySave", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("paymType", strPaymType);
+    xmlDocument.setParameter("inclPaymentUsingCredit", strInclPaymentUsingCredit);
 
     Vector<Object> vector = new Vector<Object>(0);
     SQLReturnObject sqlRO = new SQLReturnObject();
@@ -601,12 +610,30 @@
     xmlDocument.setData("reportOrdCrit", "liststructure", objectListData);
     xmlDocument.setData("reportShown", "liststructure", PaymentReportDao.getObjectList(strOrdCrit));
 
+    xmlDocument.setParameter("showOneAsterisk", showAsterisk(data, "*") ? "" : "Display:none");
+    xmlDocument.setParameter("showTwoAsterisk", showAsterisk(data, "**") ? "" : "Display:none");
+
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
     out.close();
   }
 
+  private boolean showAsterisk(FieldProvider[] data, String asterisk) {
+    if (asterisk == null || "".equals(asterisk) || data == null)
+      return false;
+    boolean showAsterisk = false;
+    for (final FieldProvider fp : data) {
+      if (fp.getField("INVOICE_NUMBER") != null && !"".equals(fp.getField("INVOICE_NUMBER"))
+          && fp.getField("INVOICE_NUMBER").length() >= asterisk.length()
+          && asterisk.equals(fp.getField("INVOICE_NUMBER").substring(0, asterisk.length()))) {
+        showAsterisk = true;
+        break;
+      }
+    }
+    return showAsterisk;
+  }
+
   private void printPage(HttpServletRequest request, HttpServletResponse response,
       VariablesSecureApp vars, String strOrg, String strInclSubOrg, String strDueDateFrom,
       String strDueDateTo, String strAmountFrom, String strAmountTo, String strDocumentDateFrom,
@@ -614,7 +641,8 @@
       String strcProjectIdIN, String strfinPaymSt, String strPaymentMethodId,
       String strFinancialAccountId, String strcCurrency, String strConvertCurrency,
       String strConversionDate, String strPaymType, String strOverdue, String strOutput,
-      String strGroupCrit, String strOrdCrit) throws IOException, ServletException {
+      String strGroupCrit, String strOrdCrit, String strInclPaymentUsingCredit) throws IOException,
+      ServletException {
 
     response.setContentType("text/html; charset=UTF-8");
 
@@ -623,7 +651,7 @@
         strDueDateTo, strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo,
         strcBPartnerIdIN, strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId,
         strFinancialAccountId, strcCurrency, strConvertCurrency, strConversionDate, strPaymType,
-        strOverdue, strGroupCrit, strOrdCrit);
+        strOverdue, strGroupCrit, strOrdCrit, strInclPaymentUsingCredit);
 
     if (data.length == 1 && data[0] == null) {
 
@@ -793,6 +821,14 @@
       parameters.put("OVERDUE_SHOW", Utility.messageBD(this, "No", vars.getLanguage()));
     parameters.put("GROUPCRIT_SHOW", Utility.messageBD(this, strGroupCrit, vars.getLanguage()));
     parameters.put("ORDCRIT_SHOW", strOrdCritShow);
+    if ("Y".equals(strInclPaymentUsingCredit)) {
+      parameters.put("INCL_PAYMENTUSINGCREDIT", Utility.messageBD(this, "Yes", vars.getLanguage()));
+    } else {
+      parameters.put("INCL_PAYMENTUSINGCREDIT", Utility.messageBD(this, "No", vars.getLanguage()));
+    }
+
+    parameters.put("ONE_ASTERISK_SHOW", new Boolean(showAsterisk(data, "*")));
+    parameters.put("TWO_ASTERISK_SHOW", new Boolean(showAsterisk(data, "**")));
 
     renderJR(vars, response, strReportName, strOutput, parameters, data, null);
   }
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -50,6 +50,9 @@
   <PARAMETER id="paramDocumentDateTo" name="documentDateTo" attribute="value"/>
   <PARAMETER id="paramDocumentDateTo" name="documentDateTodisplaySave" attribute="displayformat" replace="xx"/>
   <PARAMETER id="paramDocumentDateTo" name="documentDateTodisplaySave" attribute="saveformat" replace="yy"/>
+
+  <PARAMETER id="parameterInclPaymentUsingCredit" name="pinclPaymentUsingCredit" default="Y"/>
+  <PARAMETER id="paramInclPaymentUsingCredit" name="inclPaymentUsingCredit" boolean="checked" withId="parameterInclPaymentUsingCredit" default="Y"/>
   
   <PARAMETER id="paramcBPartnerId_INselected" name="paramcBPartnerId_INselected" default=""/>
   <SUBREPORT id="paramcBPartnerId_IN" name="paramcBPartnerId_IN" report="org/openbravo/erpCommon/reference/List">
@@ -124,6 +127,8 @@
     <FIELD id="fieldInvLink" attribute="onclick" replace="yy">ISRECEIPT</FIELD>
     <FIELD id="fieldInvLink" attribute="style" replace="xx">PAYMENT_PLAN_Y_N</FIELD>
     <FIELD id="fieldInvoiceNumber">INVOICE_NUMBER</FIELD>
+    <FIELD id="fieldInvoiceNumber_nolink">INVOICE_NUMBER</FIELD>
+    <FIELD id="fieldInvoiceNumber_nolink" attribute="style" replace="xx">NOT_PAYMENT_PLAN_Y_N</FIELD>
     
     <FIELD id="fieldInvoiceDate">INVOICE_DATE</FIELD>
     
@@ -131,6 +136,7 @@
     <FIELD id="fieldPaymLink" attribute="onclick" replace="zz">PAYMENT_ID</FIELD>
     <FIELD id="fieldPaymLink" attribute="onclick" replace="yy">ISRECEIPT</FIELD>
     <FIELD id="fieldPaymLink" attribute="style" replace="xx">PAYMENT_Y_N</FIELD>
+    <FIELD id="fieldPaymLink" attribute="title" replace="xx">PAYMENT_DESC</FIELD>
     
     <FIELD id="fieldDueDate">DUE_DATE</FIELD>
     <FIELD id="fieldPlannedDSO">PLANNED_DSO</FIELD>
@@ -163,12 +169,15 @@
     <FIELD id="fieldInvLink2" attribute="onclick" replace="yy">ISRECEIPT</FIELD>
     <FIELD id="fieldInvLink2" attribute="style" replace="xx">PAYMENT_PLAN_Y_N</FIELD>
     <FIELD id="fieldInvoiceNumber2">INVOICE_NUMBER</FIELD>
+    <FIELD id="fieldInvoiceNumber2_nolink">INVOICE_NUMBER</FIELD>
+    <FIELD id="fieldInvoiceNumber2_nolink" attribute="style" replace="xx">NOT_PAYMENT_PLAN_Y_N</FIELD>
     
     <FIELD id="fieldInvoiceDate2">INVOICE_DATE</FIELD>
     
     <FIELD id="fieldPaymLink2" attribute="onclick" replace="zz">PAYMENT_ID</FIELD>
     <FIELD id="fieldPaymLink2" attribute="onclick" replace="yy">ISRECEIPT</FIELD>
     <FIELD id="fieldPaymLink2" attribute="style" replace="xx">PAYMENT_Y_N</FIELD>
+    <FIELD id="fieldPaymLink2" attribute="title" replace="xx">PAYMENT_DESC</FIELD>
     <FIELD id="fieldPayment2">PAYMENT</FIELD>
     
     <FIELD id="fieldDueDate2">DUE_DATE</FIELD>
@@ -196,6 +205,9 @@
     <SECTION id="sectionStatus2" field="STATUS"/>
     <SECTION id="sectionDetail2"/>
   </structure>
-  
+
+   
+  <PARAMETER id="paramShowOneAsterisk" name="showOneAsterisk" attribute="style" replace="xx"/>
+  <PARAMETER id="paramShowTwoAsterisk" name="showTwoAsterisk" attribute="style" replace="xx"/>  
   <DISCARD id="discard"/>
 </REPORT>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Wed Oct 26 19:11:17 2011 +0200
@@ -22,12 +22,15 @@
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.Vector;
 
+import org.hibernate.Query;
+import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -62,6 +65,8 @@
 
 public class PaymentReportDao {
 
+  private static final long milisecDayConv = (1000 * 60 * 60 * 24);
+
   public PaymentReportDao() {
   }
 
@@ -76,6 +81,20 @@
       String strPaymentMethodId, String strFinancialAccountId, String strcCurrency,
       String strConvertCurrency, String strConversionDate, String strPaymType, String strOverdue,
       String strGroupCrit, String strOrdCrit) {
+    return getPaymentReport(vars, strOrg, strInclSubOrg, strDueDateFrom, strDueDateTo,
+        strAmountFrom, strAmountTo, strDocumentDateFrom, strDocumentDateTo, strcBPartnerIdIN,
+        strcBPGroupIdIN, strcProjectIdIN, strfinPaymSt, strPaymentMethodId, strFinancialAccountId,
+        strcCurrency, strConvertCurrency, strConversionDate, strPaymType, strOverdue, strGroupCrit,
+        strOrdCrit, "Y");
+  }
+
+  public FieldProvider[] getPaymentReport(VariablesSecureApp vars, String strOrg,
+      String strInclSubOrg, String strDueDateFrom, String strDueDateTo, String strAmountFrom,
+      String strAmountTo, String strDocumentDateFrom, String strDocumentDateTo,
+      String strcBPartnerIdIN, String strcBPGroupIdIN, String strcProjectIdIN, String strfinPaymSt,
+      String strPaymentMethodId, String strFinancialAccountId, String strcCurrency,
+      String strConvertCurrency, String strConversionDate, String strPaymType, String strOverdue,
+      String strGroupCrit, String strOrdCrit, String strInclPaymentUsingCredit) {
 
     final StringBuilder hsqlScript = new StringBuilder();
     final java.util.List<Object> parameters = new ArrayList<Object>();
@@ -84,10 +103,6 @@
         .getProperty("dateFormat.java");
     SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatString);
     FieldProvider[] data;
-    Date invoicedDate;
-    long plannedDSO = 0;
-    long currentDSO = 0;
-    long currentTime = 0;
     Currency transCurrency;
     BigDecimal transAmount = null;
     ConversionRate convRate = null;
@@ -139,6 +154,12 @@
         }
       }
 
+      // Exclude payments that use credit payment
+      if (!strInclPaymentUsingCredit.equalsIgnoreCase("Y")) {
+        hsqlScript.append(" and not (pay.amount = 0 ");
+        hsqlScript.append(" and pay.usedCredit > pay.generatedCredit) ");
+      }
+
       // due date from - due date to
       if (!strDueDateFrom.isEmpty()) {
         hsqlScript.append(" and invps.");
@@ -381,7 +402,6 @@
       BigDecimal amountSum = BigDecimal.ZERO;
       FieldProvider previousRow = null;
       ConversionRate previousConvRate = null;
-      long milisecDayConv = (1000 * 60 * 60 * 24);
       boolean isReceipt = false;
       boolean isAmtInLimit = false;
 
@@ -408,11 +428,29 @@
               .getPaymentDetails().getFinPayment().getPaymentMethod().getIdentifier());
 
           // payment
-          FieldProviderFactory.setField(data[i], "PAYMENT", FIN_PaymentScheduleDetail[i]
-              .getPaymentDetails().getFinPayment().getIdentifier().toString());
+          FieldProviderFactory.setField(
+              data[i],
+              "PAYMENT",
+              dateFormat.format(FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment()
+                  .getPaymentDate())
+                  + " - "
+                  + FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment()
+                      .getDocumentNo());
+          // payment description
+          FieldProviderFactory.setField(data[i], "PAYMENT_DESC", FIN_PaymentScheduleDetail[i]
+              .getPaymentDetails().getFinPayment().getDescription());
           // payment_id
           FieldProviderFactory.setField(data[i], "PAYMENT_ID", FIN_PaymentScheduleDetail[i]
               .getPaymentDetails().getFinPayment().getId().toString());
+          // payment_date
+          FieldProviderFactory.setField(
+              data[i],
+              "PAYMENT_DATE",
+              dateFormat.format(FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment()
+                  .getPaymentDate()));
+          // payment_docNo
+          FieldProviderFactory.setField(data[i], "PAYMENT_DOCNO", FIN_PaymentScheduleDetail[i]
+              .getPaymentDetails().getFinPayment().getDocumentNo());
           // payment yes / no
           FieldProviderFactory.setField(data[i], "PAYMENT_Y_N", "");
           // financialAccount
@@ -449,6 +487,10 @@
           FieldProviderFactory.setField(data[i], "PAYMENT", "");
           // payment_id
           FieldProviderFactory.setField(data[i], "PAYMENT_ID", "");
+          // payment_date
+          FieldProviderFactory.setField(data[i], "PAYMENT_DATE", "");
+          // payment_docNo
+          FieldProviderFactory.setField(data[i], "PAYMENT_DOCNO", "");
           // payment yes / no
           FieldProviderFactory.setField(data[i], "PAYMENT_Y_N", "Display:None");
           // financialAccount
@@ -469,59 +511,42 @@
         }
 
         if (FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule() != null) {
-          // project
-          if (FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule().getInvoice().getProject() != null)
-            FieldProviderFactory.setField(data[i], "PROJECT", FIN_PaymentScheduleDetail[i]
-                .getInvoicePaymentSchedule().getInvoice().getProject().getIdentifier());
-          else
+          fillLine(dateFormat, data[i], FIN_PaymentScheduleDetail[i],
+              FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule(), false);
+        } else if (FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment() != null) {
+          java.util.List<Invoice> invoices = getInvoicesUsingCredit(FIN_PaymentScheduleDetail[i]
+              .getPaymentDetails().getFinPayment());
+          if (invoices.size() == 1) {
+            FIN_PaymentSchedule ps = getInvoicePaymentSchedule(FIN_PaymentScheduleDetail[i]
+                .getPaymentDetails().getFinPayment());
+            fillLine(dateFormat, data[i], FIN_PaymentScheduleDetail[i], ps, true);
+          } else {
+            // project
             FieldProviderFactory.setField(data[i], "PROJECT", "");
-          // salesPerson
-          if (FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule().getInvoice()
-              .getSalesRepresentative() != null) {
-            FieldProviderFactory.setField(data[i], "SALES_PERSON", FIN_PaymentScheduleDetail[i]
-                .getInvoicePaymentSchedule().getInvoice().getSalesRepresentative().getIdentifier());
-          } else {
+            // salesPerson
             FieldProviderFactory.setField(data[i], "SALES_PERSON", "");
+            // invoiceNumber.
+            FieldProviderFactory.setField(data[i], "INVOICE_NUMBER", invoices.size() > 1 ? "**"
+                + getInvoicesDocNos(invoices) : "");
+            // payment plan id
+            FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_ID", "");
+            // payment plan yes / no
+            FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_Y_N",
+                invoices.size() != 1 ? "Display:none" : "");
+            // payment plan yes / no
+            FieldProviderFactory.setField(data[i], "NOT_PAYMENT_PLAN_Y_N", invoices.size() > 1 ? ""
+                : "Display:none");
+            // invoiceDate
+            FieldProviderFactory.setField(data[i], "INVOICE_DATE", "");
+            // dueDate.
+            FieldProviderFactory.setField(data[i], "DUE_DATE", "");
+            // plannedDSO
+            FieldProviderFactory.setField(data[i], "PLANNED_DSO", "0");
+            // currentDSO
+            FieldProviderFactory.setField(data[i], "CURRENT_DSO", "0");
+            // daysOverdue
+            FieldProviderFactory.setField(data[i], "OVERDUE", "0");
           }
-          // invoiceNumber
-          FieldProviderFactory.setField(data[i], "INVOICE_NUMBER", FIN_PaymentScheduleDetail[i]
-              .getInvoicePaymentSchedule().getInvoice().getDocumentNo());
-          // payment plan id
-          FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_ID", FIN_PaymentScheduleDetail[i]
-              .getInvoicePaymentSchedule().getId());
-          // payment plan yes / no
-          FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_Y_N", "");
-          // invoiceDate
-          invoicedDate = FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule().getInvoice()
-              .getInvoiceDate();
-          FieldProviderFactory.setField(data[i], "INVOICE_DATE", dateFormat.format(invoicedDate)
-              .toString());
-          // dueDate
-          FieldProviderFactory
-              .setField(
-                  data[i],
-                  "DUE_DATE",
-                  dateFormat.format(
-                      FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule().getDueDate())
-                      .toString());
-          // plannedDSO
-          plannedDSO = (FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule().getDueDate()
-              .getTime() - invoicedDate.getTime())
-              / milisecDayConv;
-          FieldProviderFactory.setField(data[i], "PLANNED_DSO", String.valueOf(plannedDSO));
-          // currentDSO
-          if (FIN_PaymentScheduleDetail[i].getPaymentDetails() != null) {
-            currentDSO = (FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment()
-                .getPaymentDate().getTime() - invoicedDate.getTime())
-                / milisecDayConv;
-          } else {
-            currentTime = System.currentTimeMillis();
-            currentDSO = (currentTime - invoicedDate.getTime()) / milisecDayConv;
-          }
-          FieldProviderFactory.setField(data[i], "CURRENT_DSO", String.valueOf((currentDSO)));
-          // daysOverdue
-          FieldProviderFactory.setField(data[i], "OVERDUE",
-              String.valueOf((currentDSO - plannedDSO)));
         } else {
           // project
           FieldProviderFactory.setField(data[i], "PROJECT", "");
@@ -533,6 +558,8 @@
           FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_ID", "");
           // payment plan yes / no
           FieldProviderFactory.setField(data[i], "PAYMENT_PLAN_Y_N", "Display:none");
+          // payment plan yes / no
+          FieldProviderFactory.setField(data[i], "NOT_PAYMENT_PLAN_Y_N", "Display:none");
           // invoiceDate
           FieldProviderFactory.setField(data[i], "INVOICE_DATE", "");
           // dueDate.
@@ -558,15 +585,22 @@
           convRate = this.getConversionRate(transCurrency, baseCurrency, strConversionDate);
 
           if (convRate != null) {
+            final int stdPrecission = convRate.getToCurrency().getStandardPrecision().intValue();
             if (isReceipt) {
               FieldProviderFactory.setField(data[i], "TRANS_AMOUNT", transAmount.toString());
-              FieldProviderFactory.setField(data[i], "BASE_AMOUNT",
-                  transAmount.multiply(convRate.getMultipleRateBy()).toString());
+              FieldProviderFactory.setField(
+                  data[i],
+                  "BASE_AMOUNT",
+                  transAmount.multiply(convRate.getMultipleRateBy())
+                      .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).toString());
             } else {
               FieldProviderFactory.setField(data[i], "TRANS_AMOUNT", transAmount.negate()
                   .toString());
-              FieldProviderFactory.setField(data[i], "BASE_AMOUNT",
-                  transAmount.multiply(convRate.getMultipleRateBy()).negate().toString());
+              FieldProviderFactory.setField(
+                  data[i],
+                  "BASE_AMOUNT",
+                  transAmount.multiply(convRate.getMultipleRateBy())
+                      .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).negate().toString());
             }
           } else {
             FieldProvider[] fp = new FieldProvider[1];
@@ -642,12 +676,20 @@
                 FieldProviderFactory.setField(previousRow, "BASE_AMOUNT", amountSum.negate()
                     .toString());
             } else {
+              final int stdPrecission = previousConvRate.getToCurrency().getStandardPrecision()
+                  .intValue();
               if (previousRow.getField("ISRECEIPT").equalsIgnoreCase("Y"))
-                FieldProviderFactory.setField(previousRow, "BASE_AMOUNT",
-                    amountSum.multiply(previousConvRate.getMultipleRateBy()).toString());
+                FieldProviderFactory.setField(
+                    previousRow,
+                    "BASE_AMOUNT",
+                    amountSum.multiply(previousConvRate.getMultipleRateBy())
+                        .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).toString());
               else
-                FieldProviderFactory.setField(previousRow, "BASE_AMOUNT",
-                    amountSum.multiply(previousConvRate.getMultipleRateBy()).negate().toString());
+                FieldProviderFactory.setField(
+                    previousRow,
+                    "BASE_AMOUNT",
+                    amountSum.multiply(previousConvRate.getMultipleRateBy())
+                        .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).negate().toString());
             }
 
             if (strAmountFrom.isEmpty() && strAmountTo.isEmpty()) {
@@ -710,12 +752,20 @@
             FieldProviderFactory
                 .setField(previousRow, "BASE_AMOUNT", amountSum.negate().toString());
         } else {
+          final int stdPrecission = previousConvRate.getToCurrency().getStandardPrecision()
+              .intValue();
           if (previousRow.getField("ISRECEIPT").equalsIgnoreCase("Y"))
-            FieldProviderFactory.setField(previousRow, "BASE_AMOUNT",
-                amountSum.multiply(previousConvRate.getMultipleRateBy()).toString());
+            FieldProviderFactory.setField(
+                previousRow,
+                "BASE_AMOUNT",
+                amountSum.multiply(previousConvRate.getMultipleRateBy())
+                    .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).toString());
           else
-            FieldProviderFactory.setField(previousRow, "BASE_AMOUNT",
-                amountSum.multiply(previousConvRate.getMultipleRateBy()).negate().toString());
+            FieldProviderFactory.setField(
+                previousRow,
+                "BASE_AMOUNT",
+                amountSum.multiply(previousConvRate.getMultipleRateBy())
+                    .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).negate().toString());
         }
 
         if (strAmountFrom.isEmpty() && strAmountTo.isEmpty()) {
@@ -743,6 +793,58 @@
     return (FieldProvider[]) groupedData.toArray(new FieldProvider[groupedData.size()]);
   }
 
+  private void fillLine(SimpleDateFormat dateFormat, FieldProvider data,
+      FIN_PaymentScheduleDetail fIN_PaymentScheduleDetail, FIN_PaymentSchedule paymentSchedule,
+      boolean creditPaysInvoice) {
+    Date invoicedDate;
+    long plannedDSO = 0;
+    long currentDSO = 0;
+    long currentTime = 0;
+    // project
+    if (paymentSchedule.getInvoice().getProject() != null)
+      FieldProviderFactory.setField(data, "PROJECT", paymentSchedule.getInvoice().getProject()
+          .getIdentifier());
+    else
+      FieldProviderFactory.setField(data, "PROJECT", "");
+    // salesPerson
+    if (paymentSchedule.getInvoice().getSalesRepresentative() != null) {
+      FieldProviderFactory.setField(data, "SALES_PERSON", paymentSchedule.getInvoice()
+          .getSalesRepresentative().getIdentifier());
+    } else {
+      FieldProviderFactory.setField(data, "SALES_PERSON", "");
+    }
+    // invoiceNumber
+    FieldProviderFactory.setField(data, "INVOICE_NUMBER", (creditPaysInvoice ? "*" : "")
+        + paymentSchedule.getInvoice().getDocumentNo());
+    // payment plan id
+    FieldProviderFactory.setField(data, "PAYMENT_PLAN_ID", paymentSchedule.getId());
+    // payment plan yes / no
+    FieldProviderFactory.setField(data, "PAYMENT_PLAN_Y_N", "");
+    // payment plan yes / no
+    FieldProviderFactory.setField(data, "NOT_PAYMENT_PLAN_Y_N", "Display:none");
+    // invoiceDate
+    invoicedDate = paymentSchedule.getInvoice().getInvoiceDate();
+    FieldProviderFactory.setField(data, "INVOICE_DATE", dateFormat.format(invoicedDate).toString());
+    // dueDate
+    FieldProviderFactory.setField(data, "DUE_DATE", dateFormat.format(paymentSchedule.getDueDate())
+        .toString());
+    // plannedDSO
+    plannedDSO = (paymentSchedule.getDueDate().getTime() - invoicedDate.getTime()) / milisecDayConv;
+    FieldProviderFactory.setField(data, "PLANNED_DSO", String.valueOf(plannedDSO));
+    // currentDSO
+    if (fIN_PaymentScheduleDetail.getPaymentDetails() != null) {
+      currentDSO = (fIN_PaymentScheduleDetail.getPaymentDetails().getFinPayment().getPaymentDate()
+          .getTime() - invoicedDate.getTime())
+          / milisecDayConv;
+    } else {
+      currentTime = System.currentTimeMillis();
+      currentDSO = (currentTime - invoicedDate.getTime()) / milisecDayConv;
+    }
+    FieldProviderFactory.setField(data, "CURRENT_DSO", String.valueOf((currentDSO)));
+    // daysOverdue
+    FieldProviderFactory.setField(data, "OVERDUE", String.valueOf((currentDSO - plannedDSO)));
+  }
+
   public ConversionRate getConversionRate(Currency transCurrency, Currency baseCurrency,
       String conversionDate) {
 
@@ -900,6 +1002,60 @@
     }
   }
 
+  public java.util.List<Invoice> getInvoicesUsingCredit(final FIN_Payment payment) {
+    final StringBuilder sql = new StringBuilder();
+    final java.util.List<Invoice> result = new ArrayList<Invoice>();
+
+    sql.append(" select distinct(pdv.invoicePaymentPlan.invoice.id) ");
+    sql.append(" from FIN_Payment_Credit pc, FIN_Payment p0, ");
+    sql.append("      FIN_Payment p1, FIN_Payment_Detail_V pdv  ");
+    sql.append(" where p0.id=pc.creditPaymentUsed ");
+    sql.append(" and pc.payment=p1.id ");
+    sql.append(" and pdv.payment=p1.id ");
+    sql.append(" and p0.id = '" + payment.getId() + "' ");
+
+    try {
+      OBContext.setAdminMode(true);
+      final Session session = OBDal.getInstance().getSession();
+      final Query query = session.createQuery(sql.toString());
+      for (final Object o : query.list()) {
+        result.add(OBDal.getInstance().get(Invoice.class, (String) o));
+      }
+
+      return result;
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  public FIN_PaymentSchedule getInvoicePaymentSchedule(FIN_Payment credit_payment) {
+    final StringBuilder sql = new StringBuilder();
+    sql.append(" select ps ");
+    sql.append(" from FIN_Payment_Credit pc, FIN_Payment_Detail_V pdv, ");
+    sql.append(" FIN_Payment_Schedule ps ");
+    sql.append(" where pc.payment = pdv.payment ");
+    sql.append(" and ps.id = pdv.invoicePaymentPlan ");
+    sql.append(" and pc.creditPaymentUsed.id = '" + credit_payment.getId() + "' ");
+
+    try {
+      OBContext.setAdminMode(true);
+      final Session session = OBDal.getInstance().getSession();
+      final Query query = session.createQuery(sql.toString());
+      return (FIN_PaymentSchedule) query.uniqueResult();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  public String getInvoicesDocNos(Collection<Invoice> invoices) {
+    final StringBuilder sb = new StringBuilder();
+    for (Invoice i : invoices) {
+      sb.append(i.getDocumentNo());
+      sb.append(", ");
+    }
+    return sb.delete(sb.length() - 2, sb.length()).toString();
+  }
+
   private BusinessPartner getDocumentBusinessPartner(FIN_PaymentScheduleDetail psd) {
     BusinessPartner bp = null;
     if (psd.getInvoicePaymentSchedule() != null) { // Invoice
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportExcel.jrxml	Wed Oct 26 19:11:17 2011 +0200
@@ -6,9 +6,9 @@
 		 columnCount="1"
 		 printOrder="Vertical"
 		 orientation="Landscape"
-		 pageWidth="1062"
+		 pageWidth="1385"
 		 pageHeight="595"
-		 columnWidth="1002"
+		 columnWidth="1325"
 		 columnSpacing="0"
 		 leftMargin="30"
 		 rightMargin="30"
@@ -194,6 +194,12 @@
 	<parameter name="OVERDUE_SHOW" isForPrompting="false" class="java.lang.String"/>
 	<parameter name="GROUPCRIT_SHOW" isForPrompting="false" class="java.lang.String"/>
 	<parameter name="ORDCRIT_SHOW" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="ONE_ASTERISK_SHOW" isForPrompting="false" class="java.lang.Boolean">
+		<defaultValueExpression ><![CDATA[new Boolean(false)]]></defaultValueExpression>
+	</parameter>
+	<parameter name="TWO_ASTERISK_SHOW" isForPrompting="false" class="java.lang.Boolean">
+		<defaultValueExpression ><![CDATA[new Boolean(false)]]></defaultValueExpression>
+	</parameter>
 	<queryString><![CDATA[SELECT 'hello' AS BP_GROUP, 'hello' AS BPARTNER, 'hello' AS PROJECT, 'hello' AS PAYMENT, 'hello' AS SALES_PERSON, 1234 AS INVOICE_NUMBER, to_Date('01/01/2010') AS INVOICE_DATE,
        to_Date('01/03/2010') AS DUE_DATE, 1234 AS PLANNED_DSO, 1234 AS CURRENT_DSO, 1234 AS OVERDUE, 1234 AS DAYS_OVERDUE, 1234 AS AMOUNT,
        'hello' AS CURRENCY, 1234 AS BASE_AMOUNT, 'hello' AS BASE_CURRENCY, 'hello' AS PAYMENT_METHOD, 'hello' AS FINANCIAL_ACCOUNT
@@ -219,6 +225,9 @@
 	<field name="FINANCIAL_ACCOUNT" class="java.lang.String"/>
 	<field name="GROUP_CRIT" class="java.lang.String"/>
 	<field name="STATUS" class="java.lang.String"/>
+	<field name="PAYMENT_DESC" class="java.lang.String"/>
+	<field name="PAYMENT_DATE" class="java.util.Date"/>
+	<field name="PAYMENT_DOCNO" class="java.lang.String"/>
 
 	<variable name="SUMSUBTOTALSTATUS" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
 		<variableExpression><![CDATA[$F{BASE_AMOUNT}]]></variableExpression>
@@ -259,7 +268,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="507"
+						x="523"
 						y="25"
 						width="65"
 						height="25"
@@ -273,9 +282,9 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="327"
+						x="335"
 						y="25"
-						width="70"
+						width="78"
 						height="25"
 						key="staticText-5"/>
 					<box leftPadding="2"></box>
@@ -287,7 +296,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="397"
+						x="413"
 						y="25"
 						width="55"
 						height="25"
@@ -302,7 +311,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="452"
+						x="468"
 						y="25"
 						width="55"
 						height="25"
@@ -316,7 +325,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="572"
+						x="895"
 						y="25"
 						width="62"
 						height="25"
@@ -330,7 +339,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="634"
+						x="957"
 						y="25"
 						width="33"
 						height="25"
@@ -345,7 +354,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="667"
+						x="990"
 						y="25"
 						width="33"
 						height="25"
@@ -360,7 +369,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="700"
+						x="1023"
 						y="25"
 						width="36"
 						height="25"
@@ -374,7 +383,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="876"
+						x="1199"
 						y="25"
 						width="80"
 						height="25"
@@ -389,7 +398,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="956"
+						x="1279"
 						y="25"
 						width="46"
 						height="25"
@@ -404,7 +413,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="736"
+						x="1059"
 						y="25"
 						width="80"
 						height="25"
@@ -419,7 +428,7 @@
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="816"
+						x="1139"
 						y="25"
 						width="60"
 						height="25"
@@ -477,7 +486,7 @@
 						style="Detail_Header"
 						x="251"
 						y="25"
-						width="76"
+						width="84"
 						height="25"
 						key="staticText-20"/>
 					<box leftPadding="2"></box>
@@ -486,6 +495,34 @@
 					</textElement>
 				<text><![CDATA[Project]]></text>
 				</staticText>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="588"
+						y="25"
+						width="227"
+						height="25"
+						key="staticText-22"/>
+					<box leftPadding="2"></box>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font size="8" isBold="false"/>
+					</textElement>
+				<text><![CDATA[Payment Description]]></text>
+				</staticText>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="815"
+						y="25"
+						width="80"
+						height="25"
+						key="staticText-25"/>
+					<box leftPadding="2"></box>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font size="8" isBold="false"/>
+					</textElement>
+				<text><![CDATA[Payment Date]]></text>
+				</staticText>
 			</band>
 		</pageHeader>
 		<columnHeader>
@@ -511,7 +548,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="507"
+						x="523"
 						y="0"
 						width="65"
 						height="25"
@@ -520,14 +557,14 @@
 					<textElement>
 						<font size="8"/>
 					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PAYMENT}==null ? " " : $F{PAYMENT})]]></textFieldExpression>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PAYMENT_DOCNO}]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="327"
+						x="335"
 						y="0"
-						width="70"
+						width="78"
 						height="25"
 						key="textField-5"/>
 					<box leftPadding="2"></box>
@@ -539,7 +576,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="397"
+						x="413"
 						y="0"
 						width="55"
 						height="25"
@@ -553,7 +590,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="452"
+						x="468"
 						y="0"
 						width="55"
 						height="25"
@@ -567,7 +604,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="572"
+						x="895"
 						y="0"
 						width="62"
 						height="25"
@@ -581,7 +618,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="634"
+						x="957"
 						y="0"
 						width="33"
 						height="25"
@@ -595,7 +632,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="667"
+						x="990"
 						y="0"
 						width="33"
 						height="25"
@@ -609,7 +646,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="700"
+						x="1023"
 						y="0"
 						width="36"
 						height="25"
@@ -623,7 +660,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="876"
+						x="1199"
 						y="0"
 						width="80"
 						height="25"
@@ -637,7 +674,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="956"
+						x="1279"
 						y="0"
 						width="46"
 						height="25"
@@ -651,7 +688,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="736"
+						x="1059"
 						y="0"
 						width="80"
 						height="25"
@@ -665,7 +702,7 @@
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="816"
+						x="1139"
 						y="0"
 						width="60"
 						height="25"
@@ -709,7 +746,7 @@
 						style="Report_Footer"
 						x="251"
 						y="0"
-						width="76"
+						width="84"
 						height="25"
 						key="textField-19"/>
 					<box leftPadding="2"></box>
@@ -718,6 +755,35 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PROJECT}]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Report_Footer"
+						x="588"
+						y="0"
+						width="227"
+						height="25"
+						key="textField-21"
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="2"></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PAYMENT_DESC}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Report_Footer"
+						x="815"
+						y="0"
+						width="80"
+						height="25"
+						key="textField-22"/>
+					<box leftPadding="2"></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.util.Date"><![CDATA[$F{PAYMENT_DATE}]]></textFieldExpression>
+				</textField>
 			</band>
 		</detail>
 		<columnFooter>
@@ -728,6 +794,42 @@
 			<band height="0"  isSplitAllowed="true" >
 			</band>
 		</pageFooter>
+		<lastPageFooter>
+			<band height="40"  isSplitAllowed="true" >
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="1"
+						y="1"
+						width="693"
+						height="17"
+						key="staticText-23">
+							<printWhenExpression><![CDATA[$P{ONE_ASTERISK_SHOW}]]></printWhenExpression>
+						</reportElement>
+					<box></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<text><![CDATA[* Invoice paid using a credit payment]]></text>
+				</staticText>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="1"
+						y="18"
+						width="693"
+						height="17"
+						key="staticText-24">
+							<printWhenExpression><![CDATA[$P{TWO_ASTERISK_SHOW}]]></printWhenExpression>
+						</reportElement>
+					<box></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<text><![CDATA[** Several invoices have been paid using the same credit payment]]></text>
+				</staticText>
+			</band>
+		</lastPageFooter>
 		<summary>
 			<band height="0"  isSplitAllowed="true" >
 			</band>
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml	Sat Nov 05 23:44:54 2011 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml	Wed Oct 26 19:11:17 2011 +0200
@@ -197,6 +197,13 @@
 	<parameter name="PAYMENT_METHOD_SHOW" isForPrompting="false" class="java.lang.String"/>
 	<parameter name="FINANCIAL_ACCOUNT_SHOW" isForPrompting="false" class="java.lang.String"/>
 	<parameter name="CONVERT_CURRENCY_SHOW" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="INCL_PAYMENTUSINGCREDIT" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="ONE_ASTERISK_SHOW" isForPrompting="false" class="java.lang.Boolean">
+		<defaultValueExpression ><![CDATA[new Boolean(false)]]></defaultValueExpression>
+	</parameter>
+	<parameter name="TWO_ASTERISK_SHOW" isForPrompting="false" class="java.lang.Boolean">
+		<defaultValueExpression ><![CDATA[new Boolean(false)]]></defaultValueExpression>
+	</parameter>
 	<queryString><![CDATA[SELECT 'hello' AS BP_GROUP, 'hello' AS BPARTNER, 'hello' AS PROJECT, 'hello' AS PAYMENT, 'hello' AS SALES_PERSON, 1234 AS INVOICE_NUMBER, to_Date('01/01/2010') AS INVOICE_DATE,
        to_Date('01/03/2010') AS DUE_DATE, 1234 AS PLANNED_DSO, 1234 AS CURRENT_DSO, 1234 AS OVERDUE, 1234 AS DAYS_OVERDUE, 1234 AS AMOUNT,
        'hello' AS CURRENCY, 1234 AS BASE_AMOUNT, 'hello' AS BASE_CURRENCY, 'hello' AS PAYMENT_METHOD, 'hello' AS FINANCIAL_ACCOUNT
@@ -385,6 +392,34 @@
 				<staticText>
 					<reportElement
 						style="Report_Footer"
+						x="408"
+						y="20"
+						width="179"
+						height="18"
+						key="staticText-50"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Include Payments Using Credit:]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Report_Footer"
+						x="593"
+						y="20"
+						width="179"
+						height="18"
+						key="textField-46"/>
+					<box></box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{INCL_PAYMENTUSINGCREDIT}.toString()]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
 						x="11"
 						y="40"
 						width="179"
@@ -1865,6 +1900,42 @@
 			<band height="0"  isSplitAllowed="true" >
 			</band>
 		</pageFooter>
+		<lastPageFooter>
+			<band height="40"  isSplitAllowed="true" >
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="3"
+						y="4"
+						width="693"
+						height="17"
+						key="staticText-51">
+							<printWhenExpression><![CDATA[$P{ONE_ASTERISK_SHOW}]]></printWhenExpression>
+						</reportElement>
+					<box></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<text><![CDATA[* Invoice paid using a credit payment]]></text>
+				</staticText>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="3"
+						y="21"
+						width="693"
+						height="17"
+						key="staticText-52">
+							<printWhenExpression><![CDATA[$P{TWO_ASTERISK_SHOW}]]></printWhenExpression>
+						</reportElement>
+					<box></box>
+					<textElement>
+						<font size="8"/>
+					</textElement>
+				<text><![CDATA[** Several invoices have been paid using the same credit payment]]></text>
+				</staticText>
+			</band>
+		</lastPageFooter>
 		<summary>
 			<band height="30"  isSplitAllowed="true" >
 				<staticText>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/tables/FIN_PAYMENT_CREDIT.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+  <database name="TABLE FIN_PAYMENT_CREDIT">
+    <table name="FIN_PAYMENT_CREDIT" primaryKey="FIN_PAYMENT_CREDIT_KEY">
+      <column name="FIN_PAYMENT_CREDIT_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISACTIVE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[Y]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="FIN_PAYMENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="FIN_PAYMENT_ID_USED" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AMOUNT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
+        <default><![CDATA[0]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="AD_CLIENT" name="FIN_CR_AD_CLIENT_PAYMENTS">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="FIN_CR_AD_ORG_PAYMENTS">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_CURRENCY" name="FIN_CR_C_CURRENCY_PAYMENTS">
+        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="FIN_PAYMENT" name="FIN_CR_FIN_PAYMENT">
+        <reference local="FIN_PAYMENT_ID" foreign="FIN_PAYMENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="FIN_PAYMENT" name="FIN_CR_FIN_PAYMENT_USED">
+        <reference local="FIN_PAYMENT_ID_USED" foreign="FIN_PAYMENT_ID"/>
+      </foreign-key>
+      <check name="FIN_CR_PAYMENT_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+    </table>
+  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -267000,6 +267000,421 @@
 <!--ACD6E6D9F125445C97E22C05EBA0A346-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--ACD6E6D9F125445C97E22C05EBA0A346--></AD_COLUMN>
 
+<!--ADFF06FF43CABA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CABA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <NAME><![CDATA[FIN_Payment_Credit_ID]]></NAME>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <DESCRIPTION><![CDATA[Unique identifier for a FIN Payment Credit]]></DESCRIPTION>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <HELP><![CDATA[Tracks the places where the credit payment has been used]]></HELP>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <COLUMNNAME><![CDATA[FIN_Payment_Credit_ID]]></COLUMNNAME>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[13]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISKEY><![CDATA[Y]]></ISKEY>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[ADFF07B10A7856DCE040007F01012F40]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <POSITION><![CDATA[1]]></POSITION>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CABA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CABA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43CBBA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CBBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <NAME><![CDATA[Client]]></NAME>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <COLUMNNAME><![CDATA[AD_Client_ID]]></COLUMNNAME>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[@AD_CLIENT_ID@]]></DEFAULTVALUE>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[102]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <POSITION><![CDATA[2]]></POSITION>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CBBA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CBBA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43CCBA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CCBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <NAME><![CDATA[Organization]]></NAME>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[@AD_ORG_ID@]]></DEFAULTVALUE>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[113]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <POSITION><![CDATA[3]]></POSITION>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CCBA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CCBA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43CDBA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CDBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <NAME><![CDATA[Creation Date]]></NAME>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <DESCRIPTION><![CDATA[The date that this record is completed.]]></DESCRIPTION>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <HELP><![CDATA[The Created field indicates the date that this record was created.]]></HELP>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Created]]></COLUMNNAME>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[SYSDATE]]></DEFAULTVALUE>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[245]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <POSITION><![CDATA[4]]></POSITION>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CDBA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CDBA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43CEBA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CEBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <NAME><![CDATA[Created By]]></NAME>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <DESCRIPTION><![CDATA[User who created this records]]></DESCRIPTION>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <HELP><![CDATA[The Created By field indicates the user who created this record.]]></HELP>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Createdby]]></COLUMNNAME>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[246]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <POSITION><![CDATA[5]]></POSITION>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CEBA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CEBA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43CFBA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CFBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <NAME><![CDATA[Updated]]></NAME>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <DESCRIPTION><![CDATA[x not implemented]]></DESCRIPTION>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <HELP><![CDATA[The Updated field indicates the date that this record was updated.]]></HELP>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Updated]]></COLUMNNAME>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[SYSDATE]]></DEFAULTVALUE>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[607]]></AD_ELEMENT_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <POSITION><![CDATA[6]]></POSITION>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43CFBA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43CFBA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43D0BA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D0BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <NAME><![CDATA[Updated By]]></NAME>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <DESCRIPTION><![CDATA[User who updated this records]]></DESCRIPTION>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <HELP><![CDATA[The Updated By field indicates the user who updated this record.]]></HELP>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Updatedby]]></COLUMNNAME>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[608]]></AD_ELEMENT_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <POSITION><![CDATA[7]]></POSITION>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43D0BA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43D0BA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43D1BA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D1BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <NAME><![CDATA[Active]]></NAME>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Isactive]]></COLUMNNAME>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[Y]]></DEFAULTVALUE>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[348]]></AD_ELEMENT_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <POSITION><![CDATA[8]]></POSITION>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43D1BA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43D1BA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43D2BA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D2BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <NAME><![CDATA[Payment]]></NAME>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <DESCRIPTION><![CDATA[Payment event]]></DESCRIPTION>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <HELP><![CDATA[Payment event]]></HELP>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <COLUMNNAME><![CDATA[FIN_Payment_ID]]></COLUMNNAME>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISPARENT><![CDATA[Y]]></ISPARENT>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[7891269C83EA655DE040007F010155CE]]></AD_ELEMENT_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <POSITION><![CDATA[9]]></POSITION>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43D2BA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43D2BA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43D4BA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D4BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <NAME><![CDATA[Amount]]></NAME>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <COLUMNNAME><![CDATA[Amount]]></COLUMNNAME>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[22]]></AD_REFERENCE_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[12]]></FIELDLENGTH>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <DEFAULTVALUE><![CDATA[0]]></DEFAULTVALUE>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[7890366979712CEFE040007F01013334]]></AD_ELEMENT_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <POSITION><![CDATA[12]]></POSITION>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43D4BA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43D4BA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFF06FF43D7BA83E040007F01012F39--><AD_COLUMN>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D7BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <NAME><![CDATA[Currency]]></NAME>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <COLUMNNAME><![CDATA[C_Currency_ID]]></COLUMNNAME>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_ELEMENT_ID><![CDATA[193]]></AD_ELEMENT_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <POSITION><![CDATA[13]]></POSITION>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFF06FF43D7BA83E040007F01012F39-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFF06FF43D7BA83E040007F01012F39--></AD_COLUMN>
+
+<!--ADFFC3EEE6118D7AE040007F01013D8C--><AD_COLUMN>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_COLUMN_ID><![CDATA[ADFFC3EEE6118D7AE040007F01013D8C]]></AD_COLUMN_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <NAME><![CDATA[Credit Payment Used]]></NAME>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <DESCRIPTION><![CDATA[Represents the credit payment that has been used]]></DESCRIPTION>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <HELP><![CDATA[Represents the credit payment that has been used]]></HELP>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <COLUMNNAME><![CDATA[FIN_Payment_Id_Used]]></COLUMNNAME>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_REFERENCE_VALUE_ID><![CDATA[5E77652CBFEB4F03A3A0629642D024DD]]></AD_REFERENCE_VALUE_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_ELEMENT_ID><![CDATA[ADFFC3B26CB61D04E040007F01013D82]]></AD_ELEMENT_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <POSITION><![CDATA[10]]></POSITION>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--ADFFC3EEE6118D7AE040007F01013D8C-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--ADFFC3EEE6118D7AE040007F01013D8C--></AD_COLUMN>
+
 <!--AE3FB28F95334421BB3DFAAA5B85307A--><AD_COLUMN>
 <!--AE3FB28F95334421BB3DFAAA5B85307A-->  <AD_COLUMN_ID><![CDATA[AE3FB28F95334421BB3DFAAA5B85307A]]></AD_COLUMN_ID>
 <!--AE3FB28F95334421BB3DFAAA5B85307A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -25091,6 +25091,32 @@
 <!--AD9A07DFFE5541AF8B891693459BB6B5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--AD9A07DFFE5541AF8B891693459BB6B5--></AD_ELEMENT>
 
+<!--ADFF07B10A7856DCE040007F01012F40--><AD_ELEMENT>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <AD_ELEMENT_ID><![CDATA[ADFF07B10A7856DCE040007F01012F40]]></AD_ELEMENT_ID>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <COLUMNNAME><![CDATA[FIN_Payment_Credit_ID]]></COLUMNNAME>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <NAME><![CDATA[FIN Payment Credit]]></NAME>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <PRINTNAME><![CDATA[FIN Payment Credit]]></PRINTNAME>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <DESCRIPTION><![CDATA[Unique identifier for a FIN Payment Credit]]></DESCRIPTION>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <HELP><![CDATA[Tracks the places where the credit payment has been used]]></HELP>
+<!--ADFF07B10A7856DCE040007F01012F40-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF07B10A7856DCE040007F01012F40--></AD_ELEMENT>
+
+<!--ADFFC3B26CB61D04E040007F01013D82--><AD_ELEMENT>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <AD_ELEMENT_ID><![CDATA[ADFFC3B26CB61D04E040007F01013D82]]></AD_ELEMENT_ID>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <COLUMNNAME><![CDATA[FIN_Payment_Id_Used]]></COLUMNNAME>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <NAME><![CDATA[Credit Payment Used]]></NAME>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <PRINTNAME><![CDATA[Credit Payment Used]]></PRINTNAME>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <DESCRIPTION><![CDATA[Represents the credit payment that has been used]]></DESCRIPTION>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <HELP><![CDATA[Represents the credit payment that has been used]]></HELP>
+<!--ADFFC3B26CB61D04E040007F01013D82-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFFC3B26CB61D04E040007F01013D82--></AD_ELEMENT>
+
 <!--AF7A8ABE9B6711DDA4130016D4C601F7--><AD_ELEMENT>
 <!--AF7A8ABE9B6711DDA4130016D4C601F7-->  <AD_ELEMENT_ID><![CDATA[AF7A8ABE9B6711DDA4130016D4C601F7]]></AD_ELEMENT_ID>
 <!--AF7A8ABE9B6711DDA4130016D4C601F7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -190149,6 +190149,418 @@
 <!--AD44BF4F571E4D5BA903DE7AE04CCBBD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--AD44BF4F571E4D5BA903DE7AE04CCBBD--></AD_FIELD>
 
+<!--ADFEA61356F9FF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA61356F9FF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <NAME><![CDATA[FIN_Payment_Credit_ID]]></NAME>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <DESCRIPTION><![CDATA[Unique identifier for a FIN Payment Credit]]></DESCRIPTION>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <HELP><![CDATA[Tracks the places where the credit payment has been used]]></HELP>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CABA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA61356F9FF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA61356F9FF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA61356FBFF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA61356FBFF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <NAME><![CDATA[Client]]></NAME>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CBBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA61356FBFF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA61356FBFF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA61356FDFF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA61356FDFF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <NAME><![CDATA[Organization]]></NAME>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CCBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA61356FDFF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA61356FDFF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA61356FFFF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA61356FFFF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <NAME><![CDATA[Active]]></NAME>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D1BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA61356FFFF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA61356FFFF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA6135701FF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA6135701FF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA6135701FF0CE040007F01013508-->  <NAME><![CDATA[Payment]]></NAME>
+<!--ADFEA6135701FF0CE040007F01013508-->  <DESCRIPTION><![CDATA[Payment event]]></DESCRIPTION>
+<!--ADFEA6135701FF0CE040007F01013508-->  <HELP><![CDATA[Payment event]]></HELP>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D2BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFEA6135701FF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA6135701FF0CE040007F01013508-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA6135701FF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA6135701FF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA6135701FF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA6135701FF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA6135701FF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA6135701FF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA6135705FF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA6135705FF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA6135705FF0CE040007F01013508-->  <NAME><![CDATA[Amount]]></NAME>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D4BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFEA6135705FF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA6135705FF0CE040007F01013508-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA6135705FF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA6135705FF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA6135705FF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA6135705FF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA6135705FF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA6135705FF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFEA6135707FF0CE040007F01013508--><AD_FIELD>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_FIELD_ID><![CDATA[ADFEA6135707FF0CE040007F01013508]]></AD_FIELD_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFEA6135707FF0CE040007F01013508-->  <NAME><![CDATA[Currency]]></NAME>
+<!--ADFEA6135707FF0CE040007F01013508-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--ADFEA6135707FF0CE040007F01013508-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D7BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFEA6135707FF0CE040007F01013508-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFEA6135707FF0CE040007F01013508-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFEA6135707FF0CE040007F01013508-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFEA6135707FF0CE040007F01013508-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFEA6135707FF0CE040007F01013508-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFEA6135707FF0CE040007F01013508-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFEA6135707FF0CE040007F01013508-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFEA6135707FF0CE040007F01013508--></AD_FIELD>
+
+<!--ADFF308AA2DCA111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2DCA111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <NAME><![CDATA[FIN Payment Credit]]></NAME>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <DESCRIPTION><![CDATA[Unique identifier for a FIN Payment Credit]]></DESCRIPTION>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <HELP><![CDATA[Tracks the places where the credit payment has been used]]></HELP>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CABA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2DCA111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2DCA111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2DEA111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2DEA111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <NAME><![CDATA[Client]]></NAME>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CBBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2DEA111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2DEA111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2E0A111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2E0A111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <NAME><![CDATA[Organization]]></NAME>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43CCBA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2E0A111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2E0A111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2E2A111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2E2A111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <NAME><![CDATA[Active]]></NAME>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D1BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2E2A111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2E2A111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2E4A111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2E4A111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <NAME><![CDATA[Payment]]></NAME>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <DESCRIPTION><![CDATA[Payment event]]></DESCRIPTION>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <HELP><![CDATA[Payment event]]></HELP>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D2BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2E4A111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2E4A111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2E8A111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2E8A111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <NAME><![CDATA[Amount]]></NAME>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D4BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2E8A111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2E8A111E040007F0101304F--></AD_FIELD>
+
+<!--ADFF308AA2ECA111E040007F0101304F--><AD_FIELD>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_FIELD_ID><![CDATA[ADFF308AA2ECA111E040007F0101304F]]></AD_FIELD_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <NAME><![CDATA[Currency]]></NAME>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_COLUMN_ID><![CDATA[ADFF06FF43D7BA83E040007F01012F39]]></AD_COLUMN_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFF308AA2ECA111E040007F0101304F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFF308AA2ECA111E040007F0101304F--></AD_FIELD>
+
+<!--ADFFE9B884011DDDE040007F01013E19--><AD_FIELD>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_FIELD_ID><![CDATA[ADFFE9B884011DDDE040007F01013E19]]></AD_FIELD_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <NAME><![CDATA[Credit Payment Used]]></NAME>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <DESCRIPTION><![CDATA[Represents the credit payment that has been used]]></DESCRIPTION>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <HELP><![CDATA[Represents the credit payment that has been used]]></HELP>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_COLUMN_ID><![CDATA[ADFFC3EEE6118D7AE040007F01013D8C]]></AD_COLUMN_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFFE9B884011DDDE040007F01013E19-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFFE9B884011DDDE040007F01013E19--></AD_FIELD>
+
+<!--ADFFEB0194FF7FBCE040007F01013E25--><AD_FIELD>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_FIELD_ID><![CDATA[ADFFEB0194FF7FBCE040007F01013E25]]></AD_FIELD_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <NAME><![CDATA[Credit Payment Used]]></NAME>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <DESCRIPTION><![CDATA[Represents the credit payment that has been used]]></DESCRIPTION>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <HELP><![CDATA[Represents the credit payment that has been used]]></HELP>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_COLUMN_ID><![CDATA[ADFFC3EEE6118D7AE040007F01013D8C]]></AD_COLUMN_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADFFEB0194FF7FBCE040007F01013E25-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADFFEB0194FF7FBCE040007F01013E25--></AD_FIELD>
+
 <!--AEAEFFCA2F7D4E8592C60863B54836E2--><AD_FIELD>
 <!--AEAEFFCA2F7D4E8592C60863B54836E2-->  <AD_FIELD_ID><![CDATA[AEAEFFCA2F7D4E8592C60863B54836E2]]></AD_FIELD_ID>
 <!--AEAEFFCA2F7D4E8592C60863B54836E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -3883,6 +3883,54 @@
 <!--AE4ED865065A432AB641E859FA02686F-->  <NAME><![CDATA[jdbc/openbravo]]></NAME>
 <!--AE4ED865065A432AB641E859FA02686F--></AD_MODEL_OBJECT>
 
+<!--AE66869F3A94350BE040007F0101424C--><AD_MODEL_OBJECT>
+<!--AE66869F3A94350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A94350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A94350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A94350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A94350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A94350BE040007F0101424C-->  <ACTION><![CDATA[W]]></ACTION>
+<!--AE66869F3A94350BE040007F0101424C-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--AE66869F3A94350BE040007F0101424C-->  <CLASSNAME><![CDATA[org.openbravo.erpWindows.PaymentIn.UsedCreditSource]]></CLASSNAME>
+<!--AE66869F3A94350BE040007F0101424C-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--AE66869F3A94350BE040007F0101424C-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--AE66869F3A94350BE040007F0101424C--></AD_MODEL_OBJECT>
+
+<!--AE66869F3A98350BE040007F0101424C--><AD_MODEL_OBJECT>
+<!--AE66869F3A98350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A98350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A98350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A98350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A98350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A98350BE040007F0101424C-->  <ACTION><![CDATA[W]]></ACTION>
+<!--AE66869F3A98350BE040007F0101424C-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--AE66869F3A98350BE040007F0101424C-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.ComboReloadsFF80818132AF937F0132AFA84F97003A]]></CLASSNAME>
+<!--AE66869F3A98350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A98350BE040007F0101424C-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--AE66869F3A98350BE040007F0101424C--></AD_MODEL_OBJECT>
+
+<!--AE66869F3A9A350BE040007F0101424C--><AD_MODEL_OBJECT>
+<!--AE66869F3A9A350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9A350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9A350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9A350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9A350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9A350BE040007F0101424C-->  <ACTION><![CDATA[W]]></ACTION>
+<!--AE66869F3A9A350BE040007F0101424C-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--AE66869F3A9A350BE040007F0101424C-->  <CLASSNAME><![CDATA[org.openbravo.erpWindows.PaymentOut.UsedCreditSource]]></CLASSNAME>
+<!--AE66869F3A9A350BE040007F0101424C-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--AE66869F3A9A350BE040007F0101424C-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--AE66869F3A9A350BE040007F0101424C--></AD_MODEL_OBJECT>
+
+<!--AE66869F3A9E350BE040007F0101424C--><AD_MODEL_OBJECT>
+<!--AE66869F3A9E350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9E350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9E350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9E350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9E350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9E350BE040007F0101424C-->  <ACTION><![CDATA[W]]></ACTION>
+<!--AE66869F3A9E350BE040007F0101424C-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--AE66869F3A9E350BE040007F0101424C-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.ComboReloadsFF80818132AFC4050132AFC7F94A000A]]></CLASSNAME>
+<!--AE66869F3A9E350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A9E350BE040007F0101424C-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--AE66869F3A9E350BE040007F0101424C--></AD_MODEL_OBJECT>
+
 <!--B5FE07148F9C4A818027E2C8D628516B--><AD_MODEL_OBJECT>
 <!--B5FE07148F9C4A818027E2C8D628516B-->  <AD_MODEL_OBJECT_ID><![CDATA[B5FE07148F9C4A818027E2C8D628516B]]></AD_MODEL_OBJECT_ID>
 <!--B5FE07148F9C4A818027E2C8D628516B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -4110,6 +4110,86 @@
 <!--ACF55029BBC7476AA1EB6C502EDE5BA9-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--ACF55029BBC7476AA1EB6C502EDE5BA9--></AD_MODEL_OBJECT_MAPPING>
 
+<!--AE66869F3A95350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A95350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A95350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A95350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A95350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A95350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A95350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A94350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A95350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentIn/UsedCreditSource_Relation.html]]></MAPPINGNAME>
+<!--AE66869F3A95350BE040007F0101424C-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--AE66869F3A95350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A96350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A96350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A96350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A96350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A96350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A96350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A96350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A94350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A96350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentIn/UsedCreditSource_Edition.html]]></MAPPINGNAME>
+<!--AE66869F3A96350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A96350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A97350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A97350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A97350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A97350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A97350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A97350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A97350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A94350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A97350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentIn/UsedCreditSource_Excel.xls]]></MAPPINGNAME>
+<!--AE66869F3A97350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A97350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A99350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A99350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A99350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A99350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A99350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A99350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A99350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A98350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A99350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/ad_callouts/ComboReloadsFF80818132AF937F0132AFA84F97003A.html]]></MAPPINGNAME>
+<!--AE66869F3A99350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A99350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A9B350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A9B350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A9B350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A9B350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9B350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9B350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9B350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9A350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9B350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentOut/UsedCreditSource_Relation.html]]></MAPPINGNAME>
+<!--AE66869F3A9B350BE040007F0101424C-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--AE66869F3A9B350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A9C350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A9C350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A9C350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A9C350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9C350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9C350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9C350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9A350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9C350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentOut/UsedCreditSource_Edition.html]]></MAPPINGNAME>
+<!--AE66869F3A9C350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A9C350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A9D350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A9D350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A9D350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A9D350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9D350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9D350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9D350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9A350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9D350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/PaymentOut/UsedCreditSource_Excel.xls]]></MAPPINGNAME>
+<!--AE66869F3A9D350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A9D350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
+<!--AE66869F3A9F350BE040007F0101424C--><AD_MODEL_OBJECT_MAPPING>
+<!--AE66869F3A9F350BE040007F0101424C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AE66869F3A9F350BE040007F0101424C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--AE66869F3A9F350BE040007F0101424C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE66869F3A9F350BE040007F0101424C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE66869F3A9F350BE040007F0101424C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE66869F3A9F350BE040007F0101424C-->  <AD_MODEL_OBJECT_ID><![CDATA[AE66869F3A9E350BE040007F0101424C]]></AD_MODEL_OBJECT_ID>
+<!--AE66869F3A9F350BE040007F0101424C-->  <MAPPINGNAME><![CDATA[/ad_callouts/ComboReloadsFF80818132AFC4050132AFC7F94A000A.html]]></MAPPINGNAME>
+<!--AE66869F3A9F350BE040007F0101424C-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--AE66869F3A9F350BE040007F0101424C--></AD_MODEL_OBJECT_MAPPING>
+
 <!--AFEFA3ECE5E543C8BFCB049F0208577F--><AD_MODEL_OBJECT_MAPPING>
 <!--AFEFA3ECE5E543C8BFCB049F0208577F-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[AFEFA3ECE5E543C8BFCB049F0208577F]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--AFEFA3ECE5E543C8BFCB049F0208577F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -4519,6 +4519,18 @@
 <!--5D4B2983E0254AA1B60A82A7B92DB67D-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--5D4B2983E0254AA1B60A82A7B92DB67D--></AD_REFERENCE>
 
+<!--5E77652CBFEB4F03A3A0629642D024DD--><AD_REFERENCE>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_REFERENCE_ID><![CDATA[5E77652CBFEB4F03A3A0629642D024DD]]></AD_REFERENCE_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <NAME><![CDATA[FIN_Payment]]></NAME>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <PARENTREFERENCE_ID><![CDATA[18]]></PARENTREFERENCE_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--5E77652CBFEB4F03A3A0629642D024DD--></AD_REFERENCE>
+
 <!--60E231391A7348DDA7171E780F62EF99--><AD_REFERENCE>
 <!--60E231391A7348DDA7171E780F62EF99-->  <AD_REFERENCE_ID><![CDATA[60E231391A7348DDA7171E780F62EF99]]></AD_REFERENCE_ID>
 <!--60E231391A7348DDA7171E780F62EF99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_TABLE.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_REF_TABLE.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -1131,6 +1131,17 @@
 <!--595E4FB3F743477BA5A670452556C3DF-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--595E4FB3F743477BA5A670452556C3DF--></AD_REF_TABLE>
 
+<!--5E77652CBFEB4F03A3A0629642D024DD--><AD_REF_TABLE>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_REFERENCE_ID><![CDATA[5E77652CBFEB4F03A3A0629642D024DD]]></AD_REFERENCE_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_TABLE_ID><![CDATA[D1A97202E832470285C9B1EB026D54E2]]></AD_TABLE_ID>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_KEY><![CDATA[7891269C83D0655DE040007F010155CE]]></AD_KEY>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <AD_DISPLAY><![CDATA[7891269C83E0655DE040007F010155CE]]></AD_DISPLAY>
+<!--5E77652CBFEB4F03A3A0629642D024DD-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--5E77652CBFEB4F03A3A0629642D024DD--></AD_REF_TABLE>
+
 <!--65447418FD4D428CA025AC9AF26ADA21--><AD_REF_TABLE>
 <!--65447418FD4D428CA025AC9AF26ADA21-->  <AD_REFERENCE_ID><![CDATA[65447418FD4D428CA025AC9AF26ADA21]]></AD_REFERENCE_ID>
 <!--65447418FD4D428CA025AC9AF26ADA21-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_TAB.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -12320,4 +12320,54 @@
 <!--FF808181309036230130905FCB450044-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--FF808181309036230130905FCB450044--></AD_TAB>
 
+<!--FF80818132AF937F0132AFA84F97003A--><AD_TAB>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_TAB_ID><![CDATA[FF80818132AF937F0132AFA84F97003A]]></AD_TAB_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132AF937F0132AFA84F97003A-->  <NAME><![CDATA[Used Credit Source]]></NAME>
+<!--FF80818132AF937F0132AFA84F97003A-->  <DESCRIPTION><![CDATA[Tracks the places where the credit payment is used]]></DESCRIPTION>
+<!--FF80818132AF937F0132AFA84F97003A-->  <HELP><![CDATA[A credit payment can be used in several payments. This table tracks the places where the credit has been used]]></HELP>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_WINDOW_ID><![CDATA[E547CE89D4C04429B6340FFA44E70716]]></AD_WINDOW_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--FF80818132AF937F0132AFA84F97003A-->  <TABLEVEL><![CDATA[1]]></TABLEVEL>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--FF80818132AF937F0132AFA84F97003A-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--FF80818132AF937F0132AFA84F97003A-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--FF80818132AF937F0132AFA84F97003A-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--FF80818132AF937F0132AFA84F97003A-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--FF80818132AF937F0132AFA84F97003A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FF80818132AF937F0132AFA84F97003A-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--FF80818132AF937F0132AFA84F97003A-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--FF80818132AF937F0132AFA84F97003A--></AD_TAB>
+
+<!--FF80818132AFC4050132AFC7F94A000A--><AD_TAB>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_TAB_ID><![CDATA[FF80818132AFC4050132AFC7F94A000A]]></AD_TAB_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <NAME><![CDATA[Used Credit Source]]></NAME>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <DESCRIPTION><![CDATA[Tracks the places where the credit payment is used]]></DESCRIPTION>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <HELP><![CDATA[A credit payment can be used in several payments. This table tracks the places where the credit has been used]]></HELP>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_WINDOW_ID><![CDATA[6F8F913FA60F4CBD93DC1D3AA696E76E]]></AD_WINDOW_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <TABLEVEL><![CDATA[1]]></TABLEVEL>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--FF80818132AFC4050132AFC7F94A000A-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--FF80818132AFC4050132AFC7F94A000A--></AD_TAB>
+
 </data>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -9772,4 +9772,28 @@
 <!--FF808181308EA42301308FB5F7BC0049-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1D44B84E040007F01006125]]></AD_PACKAGE_ID>
 <!--FF808181308EA42301308FB5F7BC0049--></AD_TABLE>
 
+<!--FF80818132AF937F0132AF9E94FF0013--><AD_TABLE>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <AD_TABLE_ID><![CDATA[FF80818132AF937F0132AF9E94FF0013]]></AD_TABLE_ID>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <NAME><![CDATA[FIN_Payment_Credit]]></NAME>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <DESCRIPTION><![CDATA[Tracks the places where the credit payment is used]]></DESCRIPTION>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <HELP><![CDATA[A credit payment can be used in several payments. This table tracks the places where the credit has been used]]></HELP>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <TABLENAME><![CDATA[FIN_Payment_Credit]]></TABLENAME>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <CLASSNAME><![CDATA[FIN_Payment_Credit]]></CLASSNAME>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISVIEW><![CDATA[N]]></ISVIEW>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <AD_WINDOW_ID><![CDATA[E547CE89D4C04429B6340FFA44E70716]]></AD_WINDOW_ID>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISSECURITYENABLED><![CDATA[N]]></ISSECURITYENABLED>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISDELETEABLE><![CDATA[Y]]></ISDELETEABLE>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISHIGHVOLUME><![CDATA[N]]></ISHIGHVOLUME>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <IMPORTTABLE><![CDATA[N]]></IMPORTTABLE>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISCHANGELOG><![CDATA[N]]></ISCHANGELOG>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <PO_WINDOW_ID><![CDATA[6F8F913FA60F4CBD93DC1D3AA696E76E]]></PO_WINDOW_ID>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--FF80818132AF937F0132AF9E94FF0013-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1E64B84E040007F01006125]]></AD_PACKAGE_ID>
+<!--FF80818132AF937F0132AF9E94FF0013--></AD_TABLE>
+
 </data>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Sat Nov 05 23:44:54 2011 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -19322,6 +19322,94 @@
 <!--AE7B8660F2B811DDA8F4001D09C4A2FE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--AE7B8660F2B811DDA8F4001D09C4A2FE--></AD_TEXTINTERFACES>
 
+<!--AEA335E1B37030CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37030CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37030CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37030CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37030CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37030CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37030CDE040007F01015C39-->  <TEXT><![CDATA[Select Credit Payments]]></TEXT>
+<!--AEA335E1B37030CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37030CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37030CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37030CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37230CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37230CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37230CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37230CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37230CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37230CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37230CDE040007F01015C39-->  <TEXT><![CDATA[Use Credit Payment]]></TEXT>
+<!--AEA335E1B37230CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37230CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37230CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37230CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37430CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37430CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37430CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37430CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37430CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37430CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37430CDE040007F01015C39-->  <TEXT><![CDATA[Total Gross Amount]]></TEXT>
+<!--AEA335E1B37430CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37430CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37430CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37430CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37630CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37630CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37630CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37630CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37630CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37630CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37630CDE040007F01015C39-->  <TEXT><![CDATA[Credit to be used]]></TEXT>
+<!--AEA335E1B37630CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37630CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37630CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37630CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37830CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37830CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37830CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37830CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37830CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37830CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37830CDE040007F01015C39-->  <TEXT><![CDATA[Credit Payment No]]></TEXT>
+<!--AEA335E1B37830CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37830CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37830CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37830CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37A30CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37A30CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <TEXT><![CDATA[Payment Date]]></TEXT>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37A30CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37A30CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA335E1B37C30CDE040007F01015C39--><AD_TEXTINTERFACES>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA335E1B37C30CDE040007F01015C39]]></AD_TEXTINTERFACES_ID>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <TEXT><![CDATA[Outstanding Amount]]></TEXT>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html]]></FILENAME>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA335E1B37C30CDE040007F01015C39-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA335E1B37C30CDE040007F01015C39--></AD_TEXTINTERFACES>
+
+<!--AEA33AB7C2CD17B4E040007F01015CA1--><AD_TEXTINTERFACES>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <AD_TEXTINTERFACES_ID><![CDATA[AEA33AB7C2CD17B4E040007F01015CA1]]></AD_TEXTINTERFACES_ID>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <TEXT><![CDATA[Out of range]]></TEXT>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid.srpt]]></FILENAME>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--AEA33AB7C2CD17B4E040007F01015CA1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AEA33AB7C2CD17B4E040007F01015CA1--></AD_TEXTINTERFACES>
+
 <!--AEB4114777D14A2988B8937F98CAFA16--><AD_TEXTINTERFACES>
 <!--AEB4114777D14A2988B8937F98CAFA16-->  <AD_TEXTINTERFACES_ID><![CDATA[AEB4114777D14A2988B8937F98CAFA16]]></AD_TEXTINTERFACES_ID>
 <!--AEB4114777D14A2988B8937F98CAFA16-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid.srpt	Wed Oct 26 19:11:17 2011 +0200
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+-->
+<div id="sectionLinesDetail">
+  <input type="hidden" name="inpRecordIdxx" value="" id="fieldRecordId"/>
+  <input type="hidden" name="inpRecordAmtxx" value="" id="fieldRecordAmt"/>
+  <tr id="funcEvenOddRow" class="DataGrid_Body_Row DataGrid_Body_Row_xx" bgcolor="#E1E1E1">
+    <td class="DataGrid_Body_LineNoCell"> <input type="checkbox" name="inpCreditPaymentId" value="" id="fieldCreditPaymentId" onclick="updateData(this.value, this.checked, true);return true;"/></td>
+    <td class="DataGrid_Body_Cell" id="fieldDocumentNo">xx50010</td>
+    <td class="DataGrid_Body_Cell" id="fieldDescription">xxPaymentDescription</td>
+    <td class="DataGrid_Body_Cell" id="fieldDocumentDate">xx12/12/2009</td>
+    <td class="DataGrid_Body_Cell_Amount" id="fieldOutstandingAmount">xx60.00</td>
+    <td class="DataGrid_Body_Cell_Amount">
+      <input type="text"
+      onkeyup="" name="inpPaymentAmountxx" maxlength="22" value=""
+      class="dojoValidateValid TextBox_btn_OneCell_width number TextBox required"
+      id="inpPaymentAmount"
+      outputformat="euroEdition"
+      onfocus="numberInputEvent('onfocus', this);" onblur="numberInputEvent('onblur', this);" onkeydown="numberInputEvent('onkeydown', this, event);"
+      onchange="paymentAmountOnChange(this);" />
+
+      <span id="paraminvalidSpanxx" style="display: none;" class="TextBox_MsgContainer_span">
+        <table class="TextBox_MsgContainer_table">
+          <tbody>
+            <tr class="TextBox_MsgContainer_tr">
+              <td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td>
+            </tr>
+            <tr>
+              <td class="invalid" colspan="2"><div id="paramGridLineAmountinvalidSpanText" class="TextBox_MsgContainer_div2">Out of range</div></td>
+            </tr>
+          </tbody>
+        </table>
+      </span>
+
+    </td>
+  </tr>
+</div>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/AddCreditPaymentGrid.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+-->
+<REPORT>
+  <template file="AddCreditPaymentGrid.srpt"/> 
+
+  <structure name="structure">
+    <FIELD id="fieldSelectedCreditPaymentId" attribute="value">finSelectedCreditPaymentId</FIELD>
+    <FIELD id="fieldCreditPaymentId" attribute="value">finCreditPaymentId</FIELD>
+    <FIELD id="fieldCreditPaymentId" boolean="checked" withId="fieldSelectedCreditPaymentId">finCreditPaymentId</FIELD>
+    <FIELD id="fieldRecordId" attribute="value">finCreditPaymentId</FIELD>
+    <FIELD id="fieldRecordId" attribute="name" replace="xx">rownum</FIELD>
+    <FIELD id="fieldRecordAmt" attribute="value" format="euroEdition">outstandingAmount</FIELD>
+    <FIELD id="fieldRecordAmt" attribute="name" replace="xx">finCreditPaymentId</FIELD>
+    <FIELD id="fieldDocumentNo">documentNo</FIELD>
+    <FIELD id="fieldDescription">paymentDescription</FIELD>
+    <FIELD id="fieldDocumentDate">documentDate</FIELD>
+    <FIELD id="fieldOutstandingAmount" format="euroEdition">outstandingAmount</FIELD>
+    <FIELD id="inpPaymentAmount" attribute="name" replace="xx">finCreditPaymentId</FIELD>
+    <FIELD id="inpPaymentAmount" attribute="value" format="euroEdition">paymentAmount</FIELD>
+    <FIELD id="funcEvenOddRow" attribute="bgcolor" replace="#E1E1E1">gridLineColor</FIELD>
+    <FIELD id="paraminvalidSpanxx" attribute="id" replace="xx">finCreditPaymentId</FIELD>
+
+    <SECTION id="sectionLinesDetail"/>
+  </structure>
+  <DISCARD id="discard"/>
+</REPORT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html	Wed Oct 26 19:11:17 2011 +0200
@@ -0,0 +1,570 @@
+<!--
+*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html 
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License. 
+* The Original Code is Openbravo ERP. 
+* The Initial Developer of the Original Code is Openbravo SLU 
+* All portions are Copyright (C) 2011 Openbravo SLU 
+* All Rights Reserved. 
+* Contributor(s):  ______________________________________.
+************************************************************************
+-->
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Select Credit Payments</title>
+    <link rel="shortcut icon" href="../../../../../web/images/favicon.ico" type="image/x-icon" />
+    <link rel="stylesheet" type="text/css" href="../../../../../web/skins/Default/Openbravo_ERP_250.css" id="paramCSS"></link>
+    <script language="JavaScript" src="../../../../../web/js/shortcuts.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/utils.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/ajax.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/dojoConfig.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/dojo/dojo.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/messages.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../utility/DynamicJS.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/jscalendar/calendar.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/jscalendar/lang/calendar-es.js" type="text/javascript" id="fieldCalendar"></script>
+    <script language="JavaScript" src="../../../../../web/js/default/DateTextBox.js" type="text/javascript"></script>
+    <script language="JavaScript" type="text/javascript" id="paramLanguage">defaultLang = "en_US";</script>
+    <script language="JavaScript" src="../../../../../web/js/windowKeyboard.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/appStatus.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/js/default/MessageBox.js" type="text/javascript"></script>   
+    <script language="JavaScript" src="../../../../../web/js/searchs.js" type="text/javascript"></script>
+    <script language="JavaScript" src="../../../../../web/org.openbravo.advpaymentmngt/FIN_Utilities.js" type="text/javascript"></script>
+    <script type="text/javascript">
+    //  window.onunload = reloadOpener; // reloads opener on closing
+      dojo.hostenv.writeIncludes(); //makes debugging in Venkman possible
+    </script>
+    <script language="JavaScript" type="text/javascript" id="paramDirectory">
+      var baseDirectory="../../../../../web/";
+    </script>
+    <script language="JavaScript" type="text/javascript" id="paramArray">
+      var arrDocAction = null;
+    </script>
+    <script language="JavaScript" type="text/javascript">
+      function submitThisPage(strCommand) {
+        if (validate()){
+          setProcessingMode('popup', true);
+          submitCommandForm(strCommand, false, null, null, '_self');
+        }
+        return true;
+      }
+    </script>
+
+    <script language="JavaScript" type="text/javascript">
+    function onLoadDo(){
+        setProcessingMode('popup', false);
+        this.windowTables = new Array(
+          new windowTableId('client', 'buttonOK')
+        );
+        setWindowTableParentElement();
+        enableShortcuts('popup');
+        setBrowserAutoComplete(false);
+
+        loadGridList();
+        reloadOpener();
+        initFIN_Utilities(document.frmMain);
+        setWindowElementFocus('firstElement');
+    }
+
+    function onResizeDo(){
+    }
+    
+    function validate(action, form, value) {
+      var frm=document.frmMain;
+      if (frm.inpPaymentDate.value==null || frm.inpPaymentDate.value=="") {
+        setWindowElementFocus(frm.inpPaymentDate);
+        showJSMessage(7);
+        return false;
+      }
+      
+      var expectedAmt = frm.inpExpectedPayment.value || 0;
+      var invoiceAmt = frm.inpInvoiceGrossAmt.value;      
+      if ( compare(expectedAmt, '>', invoiceAmt) ) {
+        setWindowElementFocus(frm.inpExpectedPayment);
+        showJSMessage('APRM_JSMOREAMOUTALLOCATED');
+        return false;
+      }
+      
+      for (i=0; i < frm.elements.length; i++) {
+        var tag = frm.elements[i].name.slice(0, "inpPaymentAmount".length);
+        if (tag === "inpPaymentAmount") {
+          if (!validatePaymentAmt(frm.elements[i])) {
+            setWindowElementFocus(frm.elements[i]);
+            showJSMessage('APRM_JSMOREAMOUTALLOCATED');
+            return false;
+          }
+        }
+      }
+      setProcessingMode('popup', true);
+      return true;
+   }
+   function validatePaymentAmt(element) {
+     var id = element.name.slice("inpPaymentAmount".length);
+     var outStandingAmount = frm.elements["inpRecordAmt" + id].value || 0;
+     var amount = element.value || 0;
+     var invalidSpan = document.getElementById('paraminvalidSpan'+id);
+     if (invalidSpan) {
+       var valid = isBetweenZeroAndMaxValue(amount, outStandingAmount);
+       document.getElementById('paraminvalidSpan'+id).style.display = !valid ? 'block' : 'none';
+       if (!valid) {
+         return false;
+       }
+     }
+     return true;
+   }
+   function validateDate(element){
+     isValidDate(element.value, element.getAttribute("displayformat"))
+   }
+   
+    </script>
+<script language="JavaScript" type="text/javascript">
+function loadGridList() {
+  try {
+    var url = "../org.openbravo.advpaymentmngt.ad_actionbutton/ProcessInvoice.html";
+    var paramXMLReq = null;
+    return submitXmlHttpRequest(callBackGrid, document.frmMain, "GRIDLIST", url, false, null, paramXMLReq);
+  } catch (e) {
+    alert(e);
+  }
+}
+
+function callBackGrid(paramXMLParticular, XMLHttpRequestObj) {
+  var strText = "";
+  if (getReadyStateHandler(XMLHttpRequestObj)) {
+    try {
+      if (XMLHttpRequestObj.responseText) {
+        strText = XMLHttpRequestObj.responseText;
+        var aux = strText.substring(29, strText.length-8);
+        var tableBody = document.getElementById('sectionGrid');
+        var browserName = getBrowserInfo('name');
+        if (browserName.toUpperCase().indexOf('INTERNET EXPLORER') != -1) {
+          var temp = document.createElement("span");
+          temp.id = 'temp';
+          temp.style.display = 'none';
+          var newRows = '<table><tbody id=\"sectionGrid\">'+ aux;
+          temp.innerHTML = newRows;
+          tableBody.parentNode.replaceChild(temp.firstChild.firstChild, tableBody);
+          temp.parentNode.removeChild(temp);
+        }
+        tableBody.innerHTML = aux;
+        
+        reloadOpener();
+        updateExpectedAmt();
+      } else {
+        document.getElementById('sectionGrid').innerHTML = '';
+      }
+    } catch (e) {
+    }
+  }
+  return true;
+}
+</script>
+<script type="text/javascript">
+function paymentAmountOnChange(element){
+  validatePaymentAmt(element);
+  updateExpectedAmt();
+  numberInputEvent('onchange', element);
+}
+function updateExpectedAmt() {
+  frm.inpExpectedPayment.value = 0;
+  var i;
+  for (i=0; i < frm.elements.length; i++) {
+    var tag = frm.elements[i].name.slice(0, "inpPaymentAmount".length);
+    if (tag === "inpPaymentAmount") {
+      frm.inpExpectedPayment.value = add(frm.inpExpectedPayment.value, frm.elements[i].value || 0);
+      if (!frm.elements[i].value) {
+        updateReadOnly(frm.elements[i].name.slice("inpPaymentAmount".length), false);
+      }
+    }
+  }
+  numberInputEvent('onchange', frm.elements["inpExpectedPayment"]);
+}
+
+function updateReadOnly(key, mark) {
+  if (mark === null) {
+    mark = false;
+  }
+  frm.elements["inpPaymentAmount" + key].disabled = !mark;
+
+  if (mark) {
+    frm.elements["inpPaymentAmount" + key].className = frm.elements["inpPaymentAmount" + key].className.replace(' readonly', '');
+  } else {
+    var classText = frm.elements["inpPaymentAmount" + key].className;
+    if (classText.search('readonly') === -1) {
+      frm.elements["inpPaymentAmount" + key].className = classText.concat(" readonly");
+    }
+    frm.elements["inpPaymentAmount" + key].value = '';
+    invalidSpan = document.getElementById('paraminvalidSpan'+key);
+    if (invalidSpan) {
+      document.getElementById('paraminvalidSpan'+key).style.display = 'none';
+    }
+  }
+
+  return true;
+}
+
+function updateData(key, mark) {
+  if (mark==null) mark=false;
+  if (mark) {
+    distributeAmt(key);
+  }
+  updateReadOnly(key, mark);
+  updateExpectedAmt();
+  return true;
+}
+
+function distributeAmt(key){
+  var invoiceAmount = frm.inpInvoiceGrossAmt.value || 0;
+  var expectedAmount = frm.inpExpectedPayment.value || 0;
+  var outStandingAmount = frm.elements["inpRecordAmt" + key].value || 0;
+  
+  var pendingToPay = subtract(invoiceAmount, expectedAmount);
+  if (compare(pendingToPay, '>', 0)) {
+    if (compare(outStandingAmount, '>=', pendingToPay)) {
+      frm.elements["inpPaymentAmount" + key].value = pendingToPay;
+    } else {
+      frm.elements["inpPaymentAmount" + key].value = outStandingAmount;
+    }
+  }
+  numberInputEvent('onchange', frm.elements["inpPaymentAmount" + key]);
+}
+</script>
+</head>
+
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">
+  <form id="form" method="post" action="ProcessInvoice.html" name="frmMain">
+    <input type="hidden" name="Command">
+    <input type="hidden" name="IsPopUpCall" value="1"></input>
+    <input type="hidden" name="inpKey" value="" id="key"></input>
+    <input type="hidden" name="inpwindowId" value="" id="window"></input>
+    <input type="hidden" name="inpTabId" value="" id="tab"></input>
+    <input type="hidden" name="inpadOrgId" value="" id="adOrgId"></input>
+    
+    <div class="Popup_ContentPane_CircleLogo">
+      <div class="Popup_WindowLogo">
+	<img class="Popup_WindowLogo_Icon Popup_WindowLogo_Icon_process" src="../../../../../web/images/blank.gif" border=0/></img>
+      </div>
+    </div>
+    <table cellspacing="0" cellpadding="0" width="100%" id="table_header">
+      <tr>
+	<td>
+          <table cellspacing="0" cellpadding="0" class="Popup_ContentPane_NavBar">
+            <tr class="Popup_NavBar_bg"><td></td>
+              <td class="Popup_NavBar_separator_cell"></td>
+              <td class="Popup_NavBar_bg_logo_left"></td>
+              <td class="Popup_NavBar_bg_logo" width="1" onclick="openNewBrowser('http://www.openbravo.com', 'Openbravo');return false;"><img src="../../../../../web/images/blank.gif" alt="Openbravo" title="Openbravo" border="0" id="openbravoLogo" class="Popup_NavBar_logo" /></td>
+              <td class="Popup_NavBar_bg_logo_right"></td>
+              <td class="Popup_NavBar_Popup_title_cell"><span name="lbl" id="lblPopupTitle">Use Credit Payment</span></td>
+              <td class="Popup_NavBar_separator_cell"></td>
+            </tr>
+          </table>
+	</td>
+      </tr>
+      <tr>
+	<td>
+          <table cellspacing="0" cellpadding="0" class="Popup_ContentPane_SeparatorBar">
+            <tr>
+              <td class="Popup_SeparatorBar_bg"></td>
+            </tr>
+          </table>
+	</td>
+      </tr>
+    </table>
+
+    <table cellspacing="0" cellpadding="0" width="100%">
+      <tr>
+	<td>
+          <div class="Popup_ContentPane_Client" style="overflow: auto;" id="client_messagebox">
+
+            <!-- MessageBox -->
+            <table cellpadding="0" cellspacing="0" id="messageBoxID" class="MessageBoxyy">
+              <tbody>
+		<tr class="MessageBox_TopMargin">
+		  <td class="MessageBox_LeftMargin"></td>
+		  <td></td>
+		  <td class="MessageBox_RightMargin"></td>
+		</tr>
+		<tr>
+		  <td class="MessageBox_LeftMargin"></td>
+		  <td>
+
+                    <table cellpadding="0" cellspacing="0" class="MessageBox_Container">
+                      <tbody>
+			<tr>
+			  <td class="MessageBox_LeftTrans">
+			    <table style="width: 100%; height: 100%" cellpadding="0" cellspacing="0">
+                              <tbody>
+				<tr>
+				  <td class="MessageBox_TopLeft"></td>
+				</tr>
+				<tr>
+				  <td class="MessageBox_Left"></td>
+				</tr>
+                              </tbody>
+			    </table>
+			  </td>
+			  <td class="MessageBox_bg">
+
+			    <table class="MessageBox_Top">
+			      <tbody>
+				<tr>
+				  <td>
+				    <span>
+				      <table cellpadding="0" cellspacing="0" class="MessageBox_Body_ContentCell">
+					<tbody>
+					  <tr>
+					    <td class="MessageBox_Icon_ContentCell">
+					      <div class="MessageBox_Icon"></div>
+					    </td>
+					    <td style="vertical-align: top;" id="messageBoxIDContent">
+					      <span>
+						<div class="MessageBox_TextTitle" id="messageBoxIDTitle">
+						  xxInfo: AccessTableWithNoView
+						</div>
+						<div class="MessageBox_TextDescription" id="messageBoxIDMessage">
+						  xxThe current information is empty.
+						</div>
+						<div class="MessageBox_TextSeparator"></div>
+					      </span>
+					    </td>
+					  </tr>
+					</tbody>
+				      </table>
+				    </span>
+				  </td>
+				</tr>
+                              </tbody>
+			    </table>
+
+			  </td>
+			  <td class="MessageBox_RightTrans">
+			    <table style="width: 100%; height: 100%" cellpadding="0" cellspacing="0">
+                              <tbody>
+				<tr>
+				  <td class="MessageBox_TopRight"></td>
+				</tr>
+				<tr>
+				  <td class="MessageBox_Right"></td>
+				</tr>
+                              </tbody>
+			    </table>
+			  </td>
+			</tr>
+			<tr>
+			  <td rowspan="2" class="MessageBox_BottomLeft">
+			  </td>
+			  <td class="MessageBox_BottomTrans MessageBox_bg">
+			  </td>
+			  <td rowspan="2" class="MessageBox_BottomRight">
+			  </td>
+			</tr>
+			<tr>
+			  <td class="MessageBox_Bottom">
+			  </td>
+			</tr>
+                      </tbody>
+                    </table>
+
+		  </td>
+		  <td class="MessageBox_RightMargin"></td>
+		</tr>
+		<tr class="MessageBox_BottomMargin">
+		  <td class="MessageBox_LeftMargin"></td>
+		  <td></td>
+                  <td class="MessageBox_RightMargin"></td>
+		</tr>
+              </tbody>
+            </table>
+            <!-- MessageBox END -->
+          </div>
+	</td>
+      </tr>
+    </table>
+    
+    <!-- Read only info -->
+    <table cellspacing="0" cellpadding="0" width="100%">
+      <tr>		
+	<td></td>
+	<td></td>
+      </tr>
+      <tr>
+        <td class="TableEdition_OneCell_width"></td>
+        <td class="TableEdition_OneCell_width"></td>
+        <td class="TableEdition_OneCell_width"></td>
+        <td class="TableEdition_OneCell_width"></td>
+        <td class="TableEdition_OneCell_width"></td>
+      </tr>
+      <tr>
+        <td class="TitleCell"><span name="lbl" id="lblGrandTotalAmt" class="LabelText">Total Gross Amount</span></td>
+        <td class="TextBox_ContentCell"><input class="readonly dojoValidateValid TextBox_OneCells_width number" type="text" name="inpInvoiceGrossAmt" value="" id="paramInvoiceGrossAmt" outputformat="euroEdition"></input></td>
+        <td class="TitleCell"><span class="LabelText" name="lbl" id="lblPendingAmount">Credit to be used</span></td>
+        <td class="TextBox_ContentCell"><input class="readonly dojoValidateValid TextBox_OneCell_width number" type="text" name="inpExpectedPayment" value="" id="paramPendingAmt" outputformat="euroEdition"></input></td>      
+        <td class="TitleCell"></td>
+      </tr>
+      <tr>
+              <td class="TitleCell"><span name="lbl" id="lblPaymentDate" class="LabelText">Payment Date</span></td>
+              <td class="TextBox_btn_ContentCell">
+                <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
+                  <tr>
+                    <td class="TextBox_ContentCell">
+                      <table style="border: 0px none; border-collapse: collapse;">
+                        <tr><td style="padding-top: 0px;">
+                          <input type="text" id="paramPaymentDate" name="inpPaymentDate" onchange="validateDateTextBox(this.id); validateDate(this);logChanges(this);return true;" onblur="expandDateYear(this.id);" oncontextmenu="changeToEditingMode('oncontextmenu');" onpaste="changeToEditingMode('onpaste');" oncut="changeToEditingMode('oncut');" onkeypress="changeToEditingMode('onkeypress');" onkeydown="changeToEditingMode('onkeydown');" onkeyup="autoCompleteDate(this);" maxlength="10" value="" required="true" class="dojoValidateValid required TextBox_btn_OneCell_width" displayFormat="xx" saveFormat="yy">
+                        </td></tr>
+                      </table>
+                      <span id="paramPaymentDateinvalidSpan" style="display: none;" class="TextBox_MsgContainer_span">
+                        <table class="TextBox_MsgContainer_table">
+                          <tbody><tr class="TextBox_MsgContainer_tr"><td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td></tr>
+                          <tr><td class="invalid" colspan="2"><div name="invalidText" id="paramPaymentDateinvalidSpanText" class="TextBox_MsgContainer_div2">* The value entered is not valid.</div></td></tr>
+                        </tbody></table>
+                      </span>
+                      <span id="paramPaymentDatemissingSpan" style="display: none;" class="TextBox_MsgContainer_span">
+                        <table class="TextBox_MsgContainer_table">
+                          <tbody><tr class="TextBox_MsgContainer_tr">
+                            <td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
+                          </tr>
+                          <tr>
+                            <td class="missing" colspan="2"><div name="missingText" id="paramPaymentDatemissingSpanText" class="TextBox_MsgContainer_div2">* This value is required.</div></td>
+                          </tr>
+                          </tbody></table>
+                      </span>
+                    </td>
+                    <td class="FieldButton_ContentCell">
+                      <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" onclick="showCalendar('frmMain.inpPaymentDate', document.frmMain.inpPaymentDate.value, false);return false;">
+                        <table class="FieldButton"  onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calendar';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                          <tr>
+                            <td class="FieldButton_bg">
+                              <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calendar" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
+                            </td>
+                          </tr>
+                        </table>
+                      </a>
+                    </td>
+                  </tr>
+                </table>
+              </td>
+              <td class="TitleCell"></td>
+              <td class="TitleCell"></td>
+              <td class="TitleCell"></td>
+         </tr>
+    </table>
+
+    <!-- Grid and Buttons -->
+    <table cellspacing="0" cellpadding="0" width="100%">
+      <!-- Grid -->
+      <tr>
+        <td>
+          <div class="Popup_ContentPane_Client" style="overflow: auto;" id="client_middle">
+            <table width="100%" cellspacing="0" cellpadding="0" class="Popup_Client_TablePopup">
+              <!-- Grid -->
+              <tr>	
+		<td>
+		  <table cellspacing="0" cellpadding="0" width="100%" class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;">
+                    <thead>
+                      <tr class="DataGrid_Body_Row">
+			<th class="DataGrid_Header_LineNoCell DataGrid_Body_Cell_CheckBox" width="25"> 
+                      <!--  <input type="checkbox" name="inpAllLines" onclick="markAll(document.frmMain.inpCreditPaymentId, this.checked);updateAll(true);return true;"/> -->    
+			</th>
+			<th class="DataGrid_Header_Cell" width="50">Credit Payment No</th>
+			<th class="DataGrid_Header_Cell" width="400">Description</th>
+			<th class="DataGrid_Header_Cell" width="70">Payment Date</th>
+			<th class="DataGrid_Header_Cell" width="70">Outstanding Amount</th>
+			<th class="DataGrid_Header_Cell" width="70">Amount</th>
+                      </tr>
+                    </thead>
+                    <tbody id="sectionGrid">
+                    </tbody>
+		  </table>
+		</td>
+              </tr>
+            </table>
+	  </div>
+	</td>
+      </tr>
+      
+      <!-- Buttons -->
+      <tr>
+	<td>
+          <div class="Popup_ContentPane_Client" style="overflow: auto; padding-bottom: 5px;" id="client_bottom">
+            <table cellspacing="0" cellpadding="0" class="Popup_Client_TableSelector">
+
+              <tr>
+		<td class="TableEdition_OneCell_width"></td>
+		<td class="TableEdition_OneCell_width"></td>
+		<td class="TableEdition_OneCell_width"></td>
+		<td class="TableEdition_OneCell_width"></td>
+		<td class="TableEdition_OneCell_width"></td>
+		<td class="TableEdition_OneCell_width"></td>
+              </tr>
+              <tr>
+		<td></td>
+		<td></td>
+		<td class="Button_RightAlign_ContentCell">
+                  <div>
+                    <button type="button" 
+			    id="buttonProcess"
+			    class="ButtonLink" 
+			    onclick="submitThisPage('USECREDITPAYMENTS');return false;"
+			    onfocus="buttonEvent('onfocus', this); window.status='Create'; return true;"
+			    onblur="buttonEvent('onblur', this);"
+			    onkeyup="buttonEvent('onkeyup', this);"
+			    onkeydown="buttonEvent('onkeydown', this);"
+			    onkeypress="buttonEvent('onkeypress', this);"
+			    onmouseup="buttonEvent('onmouseup', this);"
+			    onmousedown="buttonEvent('onmousedown', this);"
+			    onmouseover="buttonEvent('onmouseover', this); window.status='Create'; return true;"
+			    onmouseout="buttonEvent('onmouseout', this);">
+                      <table class="Button">
+			<tr>
+                          <td class="Button_left"><img class="Button_Icon Button_Icon_ok" alt="Process" title="Process" src="../../../../../web/images/blank.gif" border="0" /></td>
+                          <td class="Button_text Button_width">Process</td>
+                          <td class="Button_right"></td>
+			</tr>
+                      </table>
+                    </button>
+                  </div>
+		</td>
+		<td class="Button_LeftAlign_ContentCell">
+                  <div>
+                    <button type="button" 
+			    id="buttonCancel" 
+			    class="ButtonLink" 
+			    onclick="submitThisPage('CANCEL_USECREDITPAYMENTS');return false;"
+			    onfocus="buttonEvent('onfocus', this); window.status='Cancel'; return true;"
+			    onblur="buttonEvent('onblur', this);"
+			    onkeyup="buttonEvent('onkeyup', this);"
+			    onkeydown="buttonEvent('onkeydown', this);"
+			    onkeypress="buttonEvent('onkeypress', this);"
+			    onmouseup="buttonEvent('onmouseup', this);"
+			    onmousedown="buttonEvent('onmousedown', this);"
+			    onmouseover="buttonEvent('onmouseover', this); window.status='Cancel'; return true;"
+			    onmouseout="buttonEvent('onmouseout', this);">
+                      <table class="Button">
+			<tr>
+                          <td class="Button_left"><img class="Button_Icon Button_Icon_cancel" alt="Cancel" title="Cancel" src="../../../../../web/images/blank.gif" border="0" /></td>
+                          <td class="Button_text Button_width">Cancel</td>
+                          <td class="Button_right"></td>
+			</tr>
+                      </table>
+                    </button>
+                  </div>
+		</td>
+		<td></td>
+		<td></td>
+              </tr>
+            </table>
+          </div>
+	</td>
+      </tr>
+    </table>
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.xml	Wed Oct 26 19:11:17 2011 +0200
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2011 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<REPORT>
+    <template id="class" file="CreditPaymentGrid.html"/>
+    <PARAMETER id="paramLanguage" name="language" default=""/>
+    <PARAMETER id="paramCSS" name="css" attribute="href" replace="Default"/>
+    <PARAMETER id="messageBoxID" name="messageType" attribute="class" replace="yy" default="HIDDEN"/>
+    <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
+    <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
+    <PARAMETER id="fieldCalendar" name="calendar" attribute="src" replace="es" default="en"/>
+    
+    <PARAMETER id="key" name="key" default="" attribute="value"/>
+    <PARAMETER id="window" name="window" default="" attribute="value"/>
+    <PARAMETER id="tab" name="tab" default="" attribute="value"/>
+    <PARAMETER id="adOrgId" name="adOrgId" default="" attribute="value"/>
+    <PARAMETER id="processHelp" name="processDescription" default=""/>
+    <PARAMETER id="paramDirectory" name="directory" default=""/>
+    
+    <PARAMETER id="buttonOK" name="processId" default="" attribute="onclick" replace="xx"/>
+    <PARAMETER id="buttonOk" name="ok" default="" attribute="alt" replace="xx"/>
+    <PARAMETER id="buttonOk" name="ok" default="" attribute="title" replace="xx"/>
+    <PARAMETER id="buttonCancel" name="cancel" default="" attribute="alt" replace="xx"/> 
+    <PARAMETER id="buttonCancel" name="cancel" default="" attribute="title" replace="xx"/>  
+    
+    <PARAMETER id="paramPaymentDate" name="paymentDate" attribute="value"/>
+    <PARAMETER id="paramPaymentDate" name="dateDisplayFormat" attribute="displayformat" replace="xx"/>
+    <PARAMETER id="paramPaymentDate" name="dateDisplayFormat" attribute="saveformat" replace="yy"/>   
+
+    <PARAMETER id="paramInvoiceGrossAmt" name="invoiceGrossAmt" attribute="value" format="euroEdition"/>
+    <PARAMETER id="paramPendingAmt" name="pendingAmt" attribute="value" format="euroEdition"/>
+    
+    <DISCARD id="discard"/>
+</REPORT>