Related To Issue 26571:Posting of Cash Vat lines for multi line schedule line
authorAtul Gaware <atul.gaware@openbravo.com>
Mon, 26 May 2014 16:34:59 +0530
changeset 23388 f5796fb5b658
parent 23387 cbb97a88d93a
child 23389 10b6743505d4
Related To Issue 26571:Posting of Cash Vat lines for multi line schedule line
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Fri May 23 16:41:21 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Mon May 26 16:34:59 2014 +0530
@@ -384,7 +384,7 @@
                   .getInvoice()
                   : null);
           docLine.setDoubtFulDebtAmount(new BigDecimal(data[i].getField("DoubtFulDebtAmount")));
-          docLine.setInvoiceTaxCashVAT_V(paymentDetail_ID);
+          docLine.setInvoiceTaxCashVAT_V(strPaymentId);
         }
         docLine.setIsPrepayment(data[i].getField("isprepayment"));
         docLine.setCGlItemId(data[i].getField("cGlItemId"));
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Fri May 23 16:41:21 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Mon May 26 16:34:59 2014 +0530
@@ -296,7 +296,7 @@
                 && detail.getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule() != null ? detail
                 .getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule().getInvoice()
                 : null);
-        docLine.setInvoiceTaxCashVAT_V(Line_ID);
+        docLine.setInvoiceTaxCashVAT_V(detail.getFinPayment().getId());
         list.add(docLine);
       } finally {
         OBContext.restorePreviousMode();
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Fri May 23 16:41:21 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Mon May 26 16:34:59 2014 +0530
@@ -689,10 +689,10 @@
         detail.m_C_Costcenter_ID = data[i].getField("cCostcenterId");
         detail.setAmount(data[i].getField("Amount"));
         final String finPaymentDetailID = data[i].getField("FIN_Payment_Detail_ID");
-        detail.setInvoiceTaxCashVAT_V(finPaymentDetailID);
         // Cambiar line to reflect BPs
         FIN_PaymentDetail paymentDetail = OBDal.getInstance().get(FIN_PaymentDetail.class,
             finPaymentDetailID);
+        detail.setInvoiceTaxCashVAT_V(paymentDetail.getFinPayment().getId());
         fact = createFactPaymentDetails(detail, paymentDetail, as, conn, fact, Fact_Acct_Group_ID,
             Fact_Acct_Group_ID2);
       }
--- a/src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java	Fri May 23 16:41:21 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java	Mon May 26 16:34:59 2014 +0530
@@ -50,20 +50,19 @@
     this.invoiceTaxCashVAT_V = invoiceTaxCashVAT_V;
   }
 
-  public void setInvoiceTaxCashVAT_V(String finPaymentDetailID) {
-    if (StringUtils.isBlank(finPaymentDetailID)) {
+  public void setInvoiceTaxCashVAT_V(String finPaymentID) {
+    if (StringUtils.isBlank(finPaymentID)) {
       this.invoiceTaxCashVAT_V = new ArrayList<InvoiceTaxCashVAT_V>();
     } else {
       try {
         OBContext.setAdminMode(true);
         final StringBuffer hql = new StringBuffer();
         hql.append(" as itcv ");
-        hql.append(" where itcv." + InvoiceTaxCashVAT_V.PROPERTY_PAYMENTDETAILS
-            + ".id = :finPaymentDetailID ");
+        hql.append(" where itcv." + InvoiceTaxCashVAT_V.PROPERTY_PAYMENT + ".id = :finPaymentID ");
         hql.append(" and itcv." + InvoiceTaxCashVAT_V.PROPERTY_CANCELED + " = false");
         OBQuery<InvoiceTaxCashVAT_V> obq = OBDal.getInstance().createQuery(
             InvoiceTaxCashVAT_V.class, hql.toString());
-        obq.setNamedParameter("finPaymentDetailID", finPaymentDetailID);
+        obq.setNamedParameter("finPaymentID", finPaymentID);
         obq.setFilterOnReadableClients(false);
         obq.setFilterOnReadableOrganization(false);