details:   https://code.openbravo.com/erp/devel/pi/rev/235d47fa148d
changeset: 25739:235d47fa148d
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Wed Jan 21 13:29:26 2015 +0530
summary:   Related to Issue 28591:Removed unwanted code from the modulescript 
to update
payment plan and payment plan details

diffstat:

 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.class
                    |    0 
 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.class
                |    0 
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.java
         |   11 -
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD_data.xsql
    |  141 ---
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java
 |  367 ----------
 5 files changed, 0 insertions(+), 519 deletions(-)

diffs (truncated from 553 to 300 lines):

diff -r b44f867c1a6b -r 235d47fa148d 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.class
 has changed
diff -r b44f867c1a6b -r 235d47fa148d 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.class
 has changed
diff -r b44f867c1a6b -r 235d47fa148d 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.java
 Tue Jan 20 15:59:49 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD.java
 Wed Jan 21 13:29:26 2015 +0530
@@ -32,17 +32,6 @@
         for (Issue28591UpdatePSDData upsd : data) {
           Issue28591UpdatePSDData.updatePSDAmount(cp, upsd.outstandingamt, 
upsd.finPaymentScheduledetailId);
         }
-        Issue28591UpdatePSDData[] wrongdata = 
Issue28591UpdatePSDData.selectWrongPSD(cp);
-        for (Issue28591UpdatePSDData wpsd : wrongdata) {
-          Issue28591UpdatePSDData.updateWrongInvoiceAmt(cp, wpsd.wrongamt, 
wpsd.cInvoiceId);
-          Issue28591UpdatePSDData.updateWrongPSAmt(cp, wpsd.wrongamt, 
wpsd.finPaymentScheduleId);
-          Issue28591UpdatePSDData.updateWrongPSDAmt(cp, wpsd.wrongamt, 
wpsd.finPaymentScheduledetailId);
-          String finPaymentDetailId = 
Issue28591UpdatePSDData.selectFinPaymentDetailId(cp);
-          Issue28591UpdatePSDData.createCredit(cp, finPaymentDetailId, 
wpsd.finPaymentId, wpsd.wrongamt);
-          Issue28591UpdatePSDData.createCreditScheduledetail(cp, 
finPaymentDetailId, wpsd.wrongamt);
-          Issue28591UpdatePSDData.updateCreditGenerated(cp, wpsd.wrongamt, 
wpsd.finPaymentId);
-          Issue28591UpdatePSDData.updateWrongPDAmt(cp, wpsd.wrongamt, 
wpsd.finPaymentDetailId);          
-        }
         Issue28591UpdatePSDData.createPreference(cp);
      }
     } catch (Exception e) {
diff -r b44f867c1a6b -r 235d47fa148d 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD_data.xsql
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD_data.xsql
    Tue Jan 20 15:59:49 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSD_data.xsql
    Wed Jan 21 13:29:26 2015 +0530
@@ -42,147 +42,6 @@
       having sum(psd.amount) <> ps.outstandingamt
       ]]>
     </Sql>
-   </SqlMethod>
-   <SqlMethod name="selectWrongPSD" type="preparedStatement" return="multiple">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-      select i.c_invoice_id, fp.c_currency_id, bp.c_bpartner_id, 
bp.bp_currency_id, fp.fin_payment_id, ps.fin_payment_schedule_id,
-      psd.fin_payment_scheduledetail_id, pd.fin_payment_detail_id, 
ps.outstandingamt as wrongamt, to_char(fp.isreceipt) as isreceipt
-      from c_invoice i
-      left join c_bpartner bp on bp.c_bpartner_id = i.c_bpartner_id
-      left join fin_payment_schedule ps on ps.c_invoice_id = i.c_invoice_id
-      left join fin_payment_scheduledetail psd on 
psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id
-      left join fin_payment_detail pd on psd.fin_payment_detail_id = 
pd.fin_payment_detail_id
-      left join fin_payment fp on fp.fin_payment_id = pd.fin_payment_id
-      where i.outstandingamt < 0
-      and i.outstandingamt = ps.outstandingamt
-      and ps.paidamt = psd.amount
-      ]]>
-   </Sql>
-  </SqlMethod>
-  <SqlMethod name="updateWrongInvoiceAmt" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        update c_invoice set ispaid= case when 
grandtotal=totalpaid+to_number(?) then 'Y' else 'N' end,  
totalpaid=totalpaid+to_number(?),
-         LastCalculatedOnDate=LastCalculatedOnDate+to_number(?), 
outstandingamt=outstandingamt-to_number(?) ,
-         DaysTillDue=substract_days(to_timestamp(now()),(select min (duedate) 
from FIN_Payment_Schedule where  c_invoice_id=?)),
-         Percentageoverdue=(select round((sum(case when fp.Paymentdate > 
ps.duedate then psd.amount else 0 end )*100)/GrandTotal,2)
-         from  c_invoice ci, fin_payment_scheduledetail psd , 
fin_payment_schedule ps,  fin_payment fp,  FIN_Payment_Detail pd
-         where ps.c_invoice_id = ci.c_invoice_id
-         AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id
-         and  pd.fin_payment_detail_id=psd.fin_payment_detail_id
-         and fp.fin_payment_id=pd.fin_payment_id
-         and ci.c_invoice_id=?
-         group by  ci.c_invoice_id, ci.grandtotal, ci.totalpaid, 
ci.LastCalculatedOnDate, ci.DaysTillDue, ci.Percentageoverdue),
-         updatedby='0', updated=now()
-         where c_invoice_id=?
-      ]]>
-    </Sql>
-    <Parameter name="Amount"/>
-    <Parameter name="Amount"/>
-    <Parameter name="Amount"/>
-    <Parameter name="Amount"/>
-    <Parameter name="cInvoiceId"/>
-    <Parameter name="cInvoiceId"/>
-    <Parameter name="cInvoiceId"/>    
-  </SqlMethod>  
-  <SqlMethod name="updateWrongPSAmt" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        UPDATE FIN_PAYMENT_SCHEDULE SET PAIDAMT = PAIDAMT + TO_NUMBER(?), 
-        OUTSTANDINGAMT= OUTSTANDINGAMT - TO_NUMBER(?),
-        updatedby='0', updated=now()
-        WHERE FIN_PAYMENT_SCHEDULE_ID = ?
-      ]]>
-    </Sql>
-    <Parameter name="outStandingAmount"/>
-    <Parameter name="outStandingAmount"/>
-    <Parameter name="finPaymentScheduleId"/>
-  </SqlMethod>
-  <SqlMethod name="updateWrongPSDAmt" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        UPDATE FIN_PAYMENT_SCHEDULEDETAIL SET AMOUNT=AMOUNT + TO_NUMBER(?),
-        updatedby='0', updated=now()
-        WHERE FIN_PAYMENT_SCHEDULEDETAIL_ID = ?
-      ]]>
-    </Sql>
-    <Parameter name="Amount"/>
-    <Parameter name="finPaymentScheduledetailId"/>
-  </SqlMethod>
-  <SqlMethod name="selectFinPaymentDetailId" type="preparedStatement" 
return="String">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        SELECT get_uuid() as fin_payment_detail_id
-        FROM DUAL        
-      ]]>
-    </Sql>
-  </SqlMethod>
-  <SqlMethod name="createCredit" type="preparedStatement" return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        INSERT INTO fin_payment_detail (
-          fin_payment_detail_id, ad_client_id, ad_org_id, isactive,
-          createdby, created, updatedby, updated, fin_payment_id, 
-          amount, refund, isprepayment
-        ) VALUES (
-          ?, '0', '0', 'Y',
-          '0', NOW(), '0', NOW(), ?,
-          TO_NUMBER(?)*(-1), 'N', 'Y'      
-        )
-      ]]>
-    </Sql>
-    <Parameter name="finPaymentDetailId"/>
-    <Parameter name="finPaymentId"/>
-    <Parameter name="Amount"/>
-  </SqlMethod>
-  <SqlMethod name="createCreditScheduledetail" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        INSERT INTO fin_payment_scheduledetail (
-          fin_payment_scheduledetail_id, ad_client_id, ad_org_id, isactive,
-          createdby, created, updatedby, updated, fin_payment_detail_id, 
-          amount
-        ) VALUES (
-          get_uuid(), '0', '0', 'Y',
-          '0', NOW(), '0', NOW(), ?,
-          TO_NUMBER(?)*(-1)      
-        )
-      ]]>
-    </Sql>
-    <Parameter name="finPaymentDetailId"/>
-    <Parameter name="Amount"/>
-  </SqlMethod>
-  <SqlMethod name="updateCreditGenerated" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        UPDATE FIN_PAYMENT SET 
generated_credit=generated_credit+(TO_NUMBER(?)*-1),
-        updatedby='0', updated=now()
-        WHERE FIN_PAYMENT_ID = ?
-      ]]>
-    </Sql>
-    <Parameter name="Amount"/>
-    <Parameter name="finPaymentId"/>
-  </SqlMethod>
-  <SqlMethod name="updateWrongPDAmt" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        UPDATE FIN_PAYMENT_DETAIL SET AMOUNT=AMOUNT+TO_NUMBER(?),
-        updatedby='0', updated=now()
-        WHERE FIN_PAYMENT_DETAIL_ID = ?
-      ]]>
-    </Sql>
-    <Parameter name="Amount"/>
-    <Parameter name="finPaymentDetailId"/>
   </SqlMethod>
   <SqlMethod name="updatePSDAmount" type="preparedStatement" return="rowcount">
     <SqlMethodComment></SqlMethodComment>
diff -r b44f867c1a6b -r 235d47fa148d 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java
 Tue Jan 20 15:59:49 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/Issue28591UpdatePSDData.java
 Wed Jan 21 13:29:26 2015 +0530
@@ -185,373 +185,6 @@
     return(objectIssue28591UpdatePSDData);
   }
 
-  public static Issue28591UpdatePSDData[] selectWrongPSD(ConnectionProvider 
connectionProvider)    throws ServletException {
-    return selectWrongPSD(connectionProvider, 0, 0);
-  }
-
-  public static Issue28591UpdatePSDData[] selectWrongPSD(ConnectionProvider 
connectionProvider, int firstRegister, int numberRegisters)    throws 
ServletException {
-    String strSql = "";
-    strSql = strSql + 
-      "      select i.c_invoice_id, fp.c_currency_id, bp.c_bpartner_id, 
bp.bp_currency_id, fp.fin_payment_id, ps.fin_payment_schedule_id," +
-      "      psd.fin_payment_scheduledetail_id, pd.fin_payment_detail_id, 
ps.outstandingamt as wrongamt, to_char(fp.isreceipt) as isreceipt" +
-      "      from c_invoice i" +
-      "      left join c_bpartner bp on bp.c_bpartner_id = i.c_bpartner_id" +
-      "      left join fin_payment_schedule ps on ps.c_invoice_id = 
i.c_invoice_id" +
-      "      left join fin_payment_scheduledetail psd on 
psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id" +
-      "      left join fin_payment_detail pd on psd.fin_payment_detail_id = 
pd.fin_payment_detail_id" +
-      "      left join fin_payment fp on fp.fin_payment_id = 
pd.fin_payment_id" +
-      "      where i.outstandingamt < 0" +
-      "      and i.outstandingamt = ps.outstandingamt" +
-      "      and ps.paidamt = psd.amount";
-
-    ResultSet result;
-    Vector<java.lang.Object> vector = new Vector<java.lang.Object>(0);
-    PreparedStatement st = null;
-
-    try {
-    st = connectionProvider.getPreparedStatement(strSql);
-
-      result = st.executeQuery();
-      long countRecord = 0;
-      long countRecordSkip = 1;
-      boolean continueResult = true;
-      while(countRecordSkip < firstRegister && continueResult) {
-        continueResult = result.next();
-        countRecordSkip++;
-      }
-      while(continueResult && result.next()) {
-        countRecord++;
-        Issue28591UpdatePSDData objectIssue28591UpdatePSDData = new 
Issue28591UpdatePSDData();
-        objectIssue28591UpdatePSDData.cInvoiceId = UtilSql.getValue(result, 
"c_invoice_id");
-        objectIssue28591UpdatePSDData.cCurrencyId = UtilSql.getValue(result, 
"c_currency_id");
-        objectIssue28591UpdatePSDData.cBpartnerId = UtilSql.getValue(result, 
"c_bpartner_id");
-        objectIssue28591UpdatePSDData.bpCurrencyId = UtilSql.getValue(result, 
"bp_currency_id");
-        objectIssue28591UpdatePSDData.finPaymentId = UtilSql.getValue(result, 
"fin_payment_id");
-        objectIssue28591UpdatePSDData.finPaymentScheduleId = 
UtilSql.getValue(result, "fin_payment_schedule_id");
-        objectIssue28591UpdatePSDData.finPaymentScheduledetailId = 
UtilSql.getValue(result, "fin_payment_scheduledetail_id");
-        objectIssue28591UpdatePSDData.finPaymentDetailId = 
UtilSql.getValue(result, "fin_payment_detail_id");
-        objectIssue28591UpdatePSDData.wrongamt = UtilSql.getValue(result, 
"wrongamt");
-        objectIssue28591UpdatePSDData.isreceipt = UtilSql.getValue(result, 
"isreceipt");
-        objectIssue28591UpdatePSDData.InitRecordNumber = 
Integer.toString(firstRegister);
-        vector.addElement(objectIssue28591UpdatePSDData);
-        if (countRecord >= numberRegisters && numberRegisters != 0) {
-          continueResult = false;
-        }
-      }
-      result.close();
-    } catch(SQLException e){
-      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
-      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) 
+ "@" + e.getMessage());
-    } catch(Exception ex){
-      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
-      throw new ServletException("@CODE=@" + ex.getMessage());
-    } finally {
-      try {
-        connectionProvider.releasePreparedStatement(st);
-      } catch(Exception ignore){
-        ignore.printStackTrace();
-      }
-    }
-    Issue28591UpdatePSDData objectIssue28591UpdatePSDData[] = new 
Issue28591UpdatePSDData[vector.size()];
-    vector.copyInto(objectIssue28591UpdatePSDData);
-    return(objectIssue28591UpdatePSDData);
-  }
-
-  public static int updateWrongInvoiceAmt(ConnectionProvider 
connectionProvider, String Amount, String cInvoiceId)    throws 
ServletException {
-    String strSql = "";
-    strSql = strSql + 
-      "        update c_invoice set ispaid= case when 
grandtotal=totalpaid+to_number(?) then 'Y' else 'N' end,  
totalpaid=totalpaid+to_number(?)," +
-      "         LastCalculatedOnDate=LastCalculatedOnDate+to_number(?), 
outstandingamt=outstandingamt-to_number(?) ," +
-      "         DaysTillDue=substract_days(to_timestamp(now()),(select min 
(duedate) from FIN_Payment_Schedule where  c_invoice_id=?))," +
-      "         Percentageoverdue=(select round((sum(case when fp.Paymentdate 
> ps.duedate then psd.amount else 0 end )*100)/GrandTotal,2)" +
-      "         from  c_invoice ci, fin_payment_scheduledetail psd , 
fin_payment_schedule ps,  fin_payment fp,  FIN_Payment_Detail pd" +
-      "         where ps.c_invoice_id = ci.c_invoice_id" +
-      "         AND psd.fin_payment_schedule_invoice = 
ps.fin_payment_schedule_id" +
-      "         and  pd.fin_payment_detail_id=psd.fin_payment_detail_id" +
-      "         and fp.fin_payment_id=pd.fin_payment_id" +
-      "         and ci.c_invoice_id=?" +
-      "         group by  ci.c_invoice_id, ci.grandtotal, ci.totalpaid, 
ci.LastCalculatedOnDate, ci.DaysTillDue, ci.Percentageoverdue)," +
-      "         updatedby='0', updated=now()" +
-      "         where c_invoice_id=?";
-
-    int updateCount = 0;
-    PreparedStatement st = null;
-
-    int iParameter = 0;
-    try {
-    st = connectionProvider.getPreparedStatement(strSql);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, Amount);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, Amount);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, Amount);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, Amount);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, cInvoiceId);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, cInvoiceId);
-      iParameter++; UtilSql.setValue(st, iParameter, 12, null, cInvoiceId);
-
-      updateCount = st.executeUpdate();
-    } catch(SQLException e){
-      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
-      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) 
+ "@" + e.getMessage());
-    } catch(Exception ex){
-      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
-      throw new ServletException("@CODE=@" + ex.getMessage());
-    } finally {
-      try {
-        connectionProvider.releasePreparedStatement(st);
-      } catch(Exception ignore){
-        ignore.printStackTrace();
-      }
-    }

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to