Reformatting file
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Thu, 28 Jul 2011 17:57:43 +0200
changeset 13334 038a1d151bb0
parent 13333 52f07f8abaa9
child 13335 597a83fddc53
Reformatting file
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Thu Jul 28 17:57:07 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Thu Jul 28 17:57:43 2011 +0200
@@ -30,7 +30,6 @@
 
 import org.apache.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
-import org.openbravo.advpaymentmngt.APRM_FinaccTransactionV;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.dal.core.OBContext;
@@ -42,8 +41,6 @@
 import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.SequenceIdData;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
-import org.openbravo.model.common.currency.ConversionRateDoc;
-import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.AcctSchemaTableDocType;
 import org.openbravo.model.financialmgmt.accounting.FIN_FinancialAccountAccounting;
 import org.openbravo.model.financialmgmt.accounting.coa.AccountingCombination;
@@ -145,13 +142,12 @@
         FieldProviderFactory.setField(data[i], "cGlItemId",
             paymentDetails.get(i).getGLItem() != null ? paymentDetails.get(i).getGLItem().getId()
                 : "");
-        FieldProviderFactory.setField(data[i], "cInvoiceId",
-        		paymentDetails.get(i)
-                .getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule() != null
-                && paymentDetails.get(i).getFINPaymentScheduleDetailList().get(0)
-                    .getInvoicePaymentSchedule().getInvoice() != null ? paymentDetails
-                .get(i).getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule()
-                .getInvoice().getId(): "");
+        FieldProviderFactory.setField(data[i], "cInvoiceId", paymentDetails.get(i)
+            .getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule() != null
+            && paymentDetails.get(i).getFINPaymentScheduleDetailList().get(0)
+                .getInvoicePaymentSchedule().getInvoice() != null ? paymentDetails.get(i)
+            .getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule().getInvoice()
+            .getId() : "");
         // Calculate Business Partner from payment header or from details if header is null
         BusinessPartner bPartner = payment.getBusinessPartner() != null ? payment
             .getBusinessPartner() : (paymentDetails.get(i).getFINPaymentScheduleDetailList().get(0)
@@ -431,9 +427,9 @@
           fact.createLine(
               line,
               getAccountGLItem(OBDal.getInstance().get(GLItem.class, line.getCGlItemId()), as,
-              isReceipt, conn), paymentCurrencyId, isReceipt ? "":line.getAmount(), 
-              isReceipt ? line.getAmount() : "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, null,
-              paymentToSchemaConversionRate, conn);
+                  isReceipt, conn), paymentCurrencyId, isReceipt ? "" : line.getAmount(),
+              isReceipt ? line.getAmount() : "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+              DocumentType, null, paymentToSchemaConversionRate, conn);
         } else {
           fact.createLine(
               line,
@@ -458,22 +454,24 @@
       }
     } else {
       fact.createLine(
-		  null, 
-		  getAccountPayment(conn, txnFinPayment.getPaymentMethod(), txnFinPayment.getAccount(), as,
-			  txnFinPayment.isReceipt()), 
-			  txnFinPayment.getCurrency().getId(),
-    	      !txnFinPayment.isReceipt() ? txnFinPayment.getAmount().toString()
-    	          : "", txnFinPayment.isReceipt() ? txnFinPayment.getAmount()
-    	          .toString() : "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, paymentDate,
-    	      docToSchemaConversionRate, EXCHANGE_DOCTYPE_Payment, txnFinPayment.getId(), conn);
+          null,
+          getAccountPayment(conn, txnFinPayment.getPaymentMethod(), txnFinPayment.getAccount(), as,
+              txnFinPayment.isReceipt()), txnFinPayment.getCurrency().getId(), !txnFinPayment
+              .isReceipt() ? txnFinPayment.getAmount().toString() : "",
+          txnFinPayment.isReceipt() ? txnFinPayment.getAmount().toString() : "",
+          Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, paymentDate,
+          docToSchemaConversionRate, EXCHANGE_DOCTYPE_Payment, txnFinPayment.getId(), conn);
     }
-    fact.createLine(null, getAccountUponDepositWithdrawal(conn, txnFinPayment.getPaymentMethod(),
-            transaction.getAccount(), as, txnFinPayment.isReceipt()), C_Currency_ID, 
-            transaction.getDepositAmount().toString(), transaction.getPaymentAmount().toString(),
-            Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, null, docToSchemaConversionRate, EXCHANGE_DOCTYPE_Transaction, transaction.getId(), conn);
-    if(!transaction.getForeignCurrency().equals(as.getC_Currency_ID())){
-    	MultiCurrency=true;
-    	createFactCurrencyBalancing(as, conn, fact, Fact_Acct_Group_ID, transaction);
+    fact.createLine(
+        null,
+        getAccountUponDepositWithdrawal(conn, txnFinPayment.getPaymentMethod(),
+            transaction.getAccount(), as, txnFinPayment.isReceipt()), C_Currency_ID, transaction
+            .getDepositAmount().toString(), transaction.getPaymentAmount().toString(),
+        Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, null, docToSchemaConversionRate,
+        EXCHANGE_DOCTYPE_Transaction, transaction.getId(), conn);
+    if (!transaction.getForeignCurrency().equals(as.getC_Currency_ID())) {
+      MultiCurrency = true;
+      createFactCurrencyBalancing(as, conn, fact, Fact_Acct_Group_ID, transaction);
     }
     SeqNo = "0";
     return fact;