#1364 RequestInvoice can't stop further issue

Module_Specific
open
nobody
Requests (5)
9
2010-03-16
2008-07-11
No

Refering to wiki post here http://www.adempiere.com/wiki/index.php/ManPageP_InvoiceRequests

and SF discussion here

I hereby submit a patch to give more control in resolving the above issue.

Index: G:/adempiere_trunk/base/src/org/compiere/process/RequestInvoice.java

--- G:/adempiere_trunk/base/src/org/compiere/process/RequestInvoice.java (revision 5629)
+++ G:/adempiere_trunk/base/src/org/compiere/process/RequestInvoice.java (working copy)
@@ -94,10 +94,13 @@
String sql = "SELECT * FROM R_Request r"
+ " INNER JOIN R_Status s ON (r.R_Status_ID=s.R_Status_ID) "
+ "WHERE s.IsClosed='Y'"
- + " AND r.R_RequestType_ID=?";
- // globalqss -- avoid double invoicing
- // + " AND EXISTS (SELECT 1 FROM R_RequestUpdate ru " +
- // "WHERE ru.R_Request_ID=r.R_Request_ID AND NVL(C_InvoiceLine_ID,0)=0";
+ + " AND r.R_RequestType_ID=?"
+
+ // globalqss -- avoid double invoicing //red1 C_InvoiceRequest_ID
+ + " AND EXISTS (SELECT 1 FROM R_RequestUpdate ru " +
+ "WHERE ru.R_Request_ID=r.R_Request_ID AND NVL(C_InvoiceRequest_ID,0)=0)";
+ // globalqss -- avoid double invoicing -- end --
+
if (p_R_Group_ID != 0)
sql += " AND r.R_Group_ID=?";
if (p_R_Category_ID != 0)
@@ -134,6 +137,11 @@
oldC_BPartner_ID = request.getC_BPartner_ID();
}
invoiceLine(request);
+
+ //red1 - remedy to bug #
+ request.setC_InvoiceRequest_ID(m_invoice.get_ID());
+ request.setIsInvoiced(true);
+ //red1 -- end --
}
invoiceDone();
//
@@ -223,7 +231,7 @@
//
il.setPrice();
il.save();
- // updates[i].setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
+ updates[i].setQtyInvoiced(qty); //red1 set QTY into the RequestUpdate detail line
// updates[i].save();
}
} // invoiceLine

Discussion

  • Redhuan D. Oon

    Redhuan D. Oon - 2008-09-03

    Logged In: YES
    user_id=867558
    Originator: YES

    Added a line to ensure that the Request is saved. Pls take patch below.. if its ok then we can commit.

    + request.save();
    + //red1 -- end --
    }
    invoiceDone();
    //
    @@ -223,7 +232,7 @@

    File Added: patch.txt

     
  • Redhuan D. Oon

    Redhuan D. Oon - 2008-09-03
     
  • Carlos Ruiz

    Carlos Ruiz - 2010-03-16
    • labels: --> Requests
    • milestone: --> Module_Specific
    • priority: 5 --> 9
     
  • Carlos Ruiz

    Carlos Ruiz - 2010-03-16

    I think the issue is still present as the patch has not been applied.

    To peer review and test.

    Regards,

    Carlos Ruiz

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks