details:   http://code.openbravo.com/erp/devel/pi/rev/3318be97ec56
changeset: 3523:3318be97ec56
user:      Gorka Mauleon <gorka.mauleon <at> openbravo.com>
date:      Mon Apr 06 17:34:44 2009 +0200
summary:   fixes 0008164: Payment report: does not show the sales representative

diffstat:

 src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html      |  54 
+++++-----
 src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.xml       |   2 +
 src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql |  14 +-
 3 files changed, 39 insertions(+), 31 deletions(-)

diffs (203 lines):

diff -r 3a5c5f1bb042 -r 3318be97ec56 
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html     Mon Apr 
06 16:48:19 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.html     Mon Apr 
06 17:34:44 2009 +0200
@@ -523,43 +523,45 @@
                   <div id="sectionStatus">
                     <table cellspacing="0" cellpadding="0" width="100%" 
class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto; 
border-top: 0px none;">
                       <tr class="DataGrid_Body_Row">
-                        <th class="DataGrid_Header_Cell" colspan="11"><span 
id="fieldStatus">XXSALDADOS</span></th>
+                        <th class="DataGrid_Header_Cell" colspan="12"><span 
id="fieldStatus">XXSALDADOS</span></th>
                       </tr>
                       <tr class="DataGrid_Body_Row">
-                        <th class="DataGrid_Header_Cell" 
width="24%">Description</th>
-                        <th class="DataGrid_Header_Cell" 
width="11%">Invoice</th>
+                        <th class="DataGrid_Header_Cell" 
width="20%">Description</th>
+                        <th class="DataGrid_Header_Cell" 
width="10%">Invoice</th>
                         <th class="DataGrid_Header_Cell" width="8%">Date</th>
                         <th class="DataGrid_Header_Cell" width="6%">Amount</th>
-                        <th class="DataGrid_Header_Cell" 
width="7%">Canceled</th>
+                        <th class="DataGrid_Header_Cell" 
width="6%">Canceled</th>
                         <th class="DataGrid_Header_Cell" 
width="5%">Currency</th>
-                        <th class="DataGrid_Header_Cell" width="11%">Payment 
rule</th>
-                        <th class="DataGrid_Header_Cell" width="11%">Cancelled 
Settlement</th>
-                        <th class="DataGrid_Header_Cell" width="11%">Generated 
Settlement</th>
+                        <th class="DataGrid_Header_Cell" width="10%">Payment 
rule</th>
+                        <th class="DataGrid_Header_Cell" width="10%">Cancelled 
Settlement</th>
+                        <th class="DataGrid_Header_Cell" width="10%">Generated 
Settlement</th>
                         <th class="DataGrid_Header_Cell" width="6%">Paid</th>
                         <th class="DataGrid_Header_Cell" width="6%">Status</th>
+                        <th class="DataGrid_Header_Cell" width="10%">Sales 
Rep.</th>
                       </tr>
                       <div id="sectionDetail">
                         <tr class="DataGrid_Body_Row DataGrid_Body_Row_yy" 
id="funcEvenOddRow1xx">
-                          <td class="DataGrid_Body_Cell" width="24%" 
id="fieldDescription">xxPABLO SAROBE GONZÁLEZ</td>
-                          <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcInvoiceId, xx, false, document.frmMain, 
'../yy/Header_Relation.html', null, false, true);return false;" 
onmouseover="window.status='Invoice';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="idfieldCInvoiceId">
+                          <td class="DataGrid_Body_Cell" width="20%" 
id="fieldDescription">xxPABLO SAROBE GONZÁLEZ</td>
+                          <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcInvoiceId, xx, false, document.frmMain, 
'../yy/Header_Relation.html', null, false, true);return false;" 
onmouseover="window.status='Invoice';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="idfieldCInvoiceId">
                             <span 
id="fieldDocumentno">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
                           <td class="DataGrid_Body_Cell" width="8%" 
id="fieldDateplanned">xx12/07/1923</td>
                           <td class="DataGrid_Body_Cell" width="6%" 
id="fieldAmount">xx3456&nbsp;</td>
                           <td class="DataGrid_Body_Cell" width="7%" 
id="fieldWriteoffamt">xx12345&nbsp;</td>
                           <td class="DataGrid_Body_Cell" width="5%" 
id="fieldCurrency">xxEUR</td>
-                          <td class="DataGrid_Body_Cell" width="11%" 
id="fieldPaymentRule" >xxContado albarán</td>
-                          <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, yy, false, document.frmMain, 
'../Settlement/CancelledPayments_Relation.html', null, false, true);return 
false;" onmouseover="window.status='Cancelled Settlement';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="fieldCDebtPaymentId">
+                          <td class="DataGrid_Body_Cell" width="10%" 
id="fieldPaymentRule" >xxContado albarán</td>
+                          <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, yy, false, document.frmMain, 
'../Settlement/CancelledPayments_Relation.html', null, false, true);return 
false;" onmouseover="window.status='Cancelled Settlement';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="fieldCDebtPaymentId">
                             <span 
id="fieldDebtCancel">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
-                          <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, zz, false, document.frmMain, 'xx', null, 
false, true);return false;" onmouseover="window.status='Generated 
Settlement';return true;" onmouseout="window.status='';return true;" 
class="LabelLink_noicon" id="fieldCDebtPaymentId2">
+                          <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, zz, false, document.frmMain, 'xx', null, 
false, true);return false;" onmouseover="window.status='Generated 
Settlement';return true;" onmouseout="window.status='';return true;" 
class="LabelLink_noicon" id="fieldCDebtPaymentId2">
                             <span 
id="fieldDebtGenerate">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
                           <td class="DataGrid_Body_Cell" 
id="fieldPaid">xxSi</td>
                           <td class="DataGrid_Body_Cell" 
id="fieldDpStatus">xx--</td>
+                          <td class="DataGrid_Body_Cell" 
id="fieldSalesRepName">xx--</td>
                         </tr>
                       </div>
                       <tr class="DataGrid_Body_Row">
                         <th class="DataGrid_Header_Cell" colspan="2"><span 
class="Bold">Total amount</span></th>
                         <th class="DataGrid_Header_Cell" colspan="2"><span 
class="Bold" id="fieldSumAmount">xx23455.56</span></th>
-                        <th class="DataGrid_Header_Cell" 
colspan="7">&nbsp;</th>
+                        <th class="DataGrid_Header_Cell" 
colspan="8">&nbsp;</th>
                       </tr>
                     </table>
                     <div style="height:25px;" />
@@ -568,43 +570,45 @@
                 <div id="sectionStatus2">
                   <table cellspacing="0" cellpadding="0" width="100%" 
class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto; 
border-top: 0px none;">
                     <tr class="DataGrid_Body_Row">
-                      <th class="DataGrid_Header_Cell" colspan="11"><span 
id="fieldStatus">XXSALDADOS</span></th>
+                      <th class="DataGrid_Header_Cell" colspan="12"><span 
id="fieldStatus">XXSALDADOS</span></th>
                     </tr>
                     <tr class="DataGrid_Body_Row">
-                      <th class="DataGrid_Header_Cell" 
width="24%">Description</th>
-                      <th class="DataGrid_Header_Cell" width="11%">Invoice</th>
+                      <th class="DataGrid_Header_Cell" 
width="20%">Description</th>
+                      <th class="DataGrid_Header_Cell" width="10%">Invoice</th>
                       <th class="DataGrid_Header_Cell" width="8%">Date</th>
                       <th class="DataGrid_Header_Cell" width="6%">Amount</th>
                       <th class="DataGrid_Header_Cell" width="7%">Canceled</th>
                       <th class="DataGrid_Header_Cell" width="5%">Currency</th>
-                      <th class="DataGrid_Header_Cell" width="11%">Payment 
rule</th>
-                      <th class="DataGrid_Header_Cell" width="11%">Cancelled 
Settlement</th>
-                      <th class="DataGrid_Header_Cell" width="11%">Generated 
Settlement</th>
+                      <th class="DataGrid_Header_Cell" width="10%">Payment 
rule</th>
+                      <th class="DataGrid_Header_Cell" width="10%">Cancelled 
Settlement</th>
+                      <th class="DataGrid_Header_Cell" width="10%">Generated 
Settlement</th>
                       <th class="DataGrid_Header_Cell" width="6%">Paid</th>
                       <th class="DataGrid_Header_Cell" width="6%">Status</th>
+                      <th class="DataGrid_Header_Cell" width="10%">Sales 
Rep.</th>
                     </tr>
                     <div id="sectionDetail2">
                       <tr class="DataGrid_Body_Row DataGrid_Body_Row_yy" 
id="funcEvenOddRow2xx">
-                        <td class="DataGrid_Body_Cell" width="24%" 
id="fieldDescription2">xxPABLO SAROBE GONZÁLEZ</td>
-                        <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcInvoiceId, xx, false, document.frmMain, 
'../yy/Header_Relation.html', null, false, true);return false;" 
onmouseover="window.status='Invoice';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="idfieldCInvoiceId2">
+                        <td class="DataGrid_Body_Cell" width="20%" 
id="fieldDescription2">xxPABLO SAROBE GONZÁLEZ</td>
+                        <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcInvoiceId, xx, false, document.frmMain, 
'../yy/Header_Relation.html', null, false, true);return false;" 
onmouseover="window.status='Invoice';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="idfieldCInvoiceId2">
                           <span 
id="fieldDocumentno2">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
                         <td class="DataGrid_Body_Cell" width="8%" 
id="fieldDateplanned2">xx12/07/1923</td>
                         <td class="DataGrid_Body_Cell" width="6%" 
id="fieldAmount2">xx3456&nbsp;</td>
                         <td class="DataGrid_Body_Cell" width="7%" 
id="fieldWriteoffamt2">xx12345&nbsp;</td>
                         <td class="DataGrid_Body_Cell" width="5%" 
id="fieldCurrency2">xxEUR</td>
-                        <td class="DataGrid_Body_Cell" width="11%" 
id="fieldPaymentRule2" >xxContado albarán</td>
-                        <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, yy, false, document.frmMain, 
'../Settlement/CancelledPayments_Relation.html', null, false, true);return 
false;" onmouseover="window.status='Cancelled Settlement';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="fieldCDebtPaymentId2">
+                        <td class="DataGrid_Body_Cell" width="10%" 
id="fieldPaymentRule2" >xxContado albarán</td>
+                        <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, yy, false, document.frmMain, 
'../Settlement/CancelledPayments_Relation.html', null, false, true);return 
false;" onmouseover="window.status='Cancelled Settlement';return true;" 
onmouseout="window.status='';return true;" class="LabelLink_noicon" 
id="fieldCDebtPaymentId2">
                           <span 
id="fieldDebtCancel2">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
-                        <td class="DataGrid_Body_Cell" width="11%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, zz, false, document.frmMain, 'xx', null, 
false, true);return false;" onmouseover="window.status='Generated 
Settlement';return true;" onmouseout="window.status='';return true;" 
class="LabelLink_noicon" id="fieldCDebtPaymentId22">
+                        <td class="DataGrid_Body_Cell" width="10%"> <a 
href="#" onclick="submitCommandFormParameter('DIRECT', 
document.frmMain.inpcDebtPaymentId, zz, false, document.frmMain, 'xx', null, 
false, true);return false;" onmouseover="window.status='Generated 
Settlement';return true;" onmouseout="window.status='';return true;" 
class="LabelLink_noicon" id="fieldCDebtPaymentId22">
                           <span 
id="fieldDebtGenerate2">xx24/10/2004</span></a><span>&nbsp;&nbsp;&nbsp;</span></td>
                         <td class="DataGrid_Body_Cell" 
id="fieldPaid2">xxSi</td>
                         <td class="DataGrid_Body_Cell" 
id="fieldDpStatus2">xx--</td>
+                        <td class="DataGrid_Body_Cell" 
id="fieldSalesRepName2">xx--</td>
                       </tr>
                     </div>
                     <tr class="DataGrid_Body_Row">
                       <th class="DataGrid_Header_Cell" colspan="2"> <span 
class="Bold">Total amount</span></th>
                       <th class="DataGrid_Header_Cell" colspan="2"> <span 
class="Bold" id="fieldSumAmount22">xx23455.56</span></th>
-                      <th class="DataGrid_Header_Cell" colspan="7">&nbsp;</th>
+                      <th class="DataGrid_Header_Cell" colspan="8">&nbsp;</th>
                     </tr>
                   </table>
                   <div style="height:15px;" />
diff -r 3a5c5f1bb042 -r 3318be97ec56 
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.xml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.xml      Mon Apr 
06 16:48:19 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment.xml      Mon Apr 
06 17:34:44 2009 +0200
@@ -81,6 +81,7 @@
     <FIELD id="fieldDebtGenerate">debtgenerate</FIELD>
     <FIELD id="fieldStatus">status</FIELD>
     <FIELD id="fieldDpStatus">dpstatus</FIELD>
+    <FIELD id="fieldSalesRepName">salesrepname</FIELD>
     <FIELD id="fieldPaid">ispaid</FIELD>
     <FIELD id="idfieldCInvoiceId" attribute="onclick" 
replace="xx">cInvoiceId</FIELD>
     <FIELD id="idfieldCInvoiceId" attribute="onclick" 
replace="yy">invoiceType</FIELD>
@@ -117,6 +118,7 @@
     <FIELD id="fieldDebtGenerate2">debtgenerate</FIELD>
     <FIELD id="fieldStatus2">status</FIELD>
     <FIELD id="fieldDpStatus2">dpstatus</FIELD>
+    <FIELD id="fieldSalesRepName2">salesrepname</FIELD>
     <FIELD id="fieldPaid2">ispaid</FIELD>
     <FIELD id="idfieldCInvoiceId2" attribute="onclick" 
replace="xx">cInvoiceId</FIELD>
     <FIELD id="idfieldCInvoiceId2" attribute="onclick" 
replace="yy">invoiceType</FIELD>
diff -r 3a5c5f1bb042 -r 3318be97ec56 
src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql        
Mon Apr 06 16:48:19 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql        
Mon Apr 06 17:34:44 2009 +0200
@@ -36,7 +36,7 @@
       'P' THEN AD_MESSAGE_GET2('DPR_PENDING',?) END) AS STATUS,
       DP.DESCRIPTION, AD_MESSAGE_GET2(DP.ISPAID, ?) AS ISPAID, 
       (CASE DP.ISRECEIPT WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' 
END) AS INVOICE_TYPE, 
-      (CASE s2.SETTLEMENTTYPE WHEN 'I' THEN 
'../ManualSettlement/CreatePayment_Relation.html' ELSE 
'../Settlement/CreatedPayments_Relation.html' END) AS PATH, COALESCE(RLT2.NAME, 
RL2.NAME) AS DPSTATUS
+      (CASE s2.SETTLEMENTTYPE WHEN 'I' THEN 
'../ManualSettlement/CreatePayment_Relation.html' ELSE 
'../Settlement/CreatedPayments_Relation.html' END) AS PATH, COALESCE(RLT2.NAME, 
RL2.NAME) AS DPSTATUS, URS.NAME AS SALESREPNAME
       FROM C_DEBT_PAYMENT DP left join C_SETTLEMENT S1 on 
DP.C_SETTLEMENT_CANCEL_ID = S1.C_SETTLEMENT_ID
                              left join C_SETTLEMENT S2 on 
DP.C_SETTLEMENT_GENERATE_ID = S2.C_SETTLEMENT_ID
                              left join C_BPARTNER B    on DP.C_BPARTNER_ID = 
B.C_BPARTNER_ID
@@ -45,7 +45,7 @@
                                                               AND 
RLT.AD_LANGUAGE = ?,
            AD_REF_LIST RL2    left join AD_REF_LIST_TRL RLT2 on 
RL2.AD_REF_LIST_ID = RLT2.AD_REF_LIST_ID
                                                               AND 
RLT2.AD_LANGUAGE = ?,
-           C_CURRENCY C    
+           C_CURRENCY C, AD_USER URS    
       WHERE DP.C_CURRENCY_ID = C.C_CURRENCY_ID 
       AND DP.PAYMENTRULE = RL.VALUE
       AND RL.AD_REFERENCE_ID = '195'
@@ -55,9 +55,10 @@
       AND DP.AD_Org_ID IN ('1') 
       AND DP.IsActive='Y'
       AND DP.IsValid='Y'
+      AND I.SALESREP_ID = URS.AD_USER_ID
       GROUP BY (CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID 
END), (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE 
DP.C_DEBT_PAYMENT_ID END), B.NAME, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN 
I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END), DP.DATEPLANNED, DP.AMOUNT,
       DP.WRITEOFFAMT, C.ISO_CODE, (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN 
S1.DOCUMENTNO||' ('||S1.DATETRX||')' END), (CASE WHEN S2.DOCUMENTNO IS NOT NULL 
THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END), RLT.NAME, RL.NAME, RLT2.NAME, 
RL2.NAME, DP.C_Settlement_Cancel_ID,
-      DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT 
WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, 
DP.STATUS
+      DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT 
WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, 
DP.STATUS, URS.NAME
       ORDER BY BPARTNER, STATUS, DP.DATEPLANNED
      ]]></Sql>
       <Field name="rownum" value="count"/>
@@ -96,7 +97,7 @@
       'P' THEN AD_MESSAGE_GET2('DPR_PENDING',?) END) AS STATUS,
       DP.DESCRIPTION, AD_MESSAGE_GET2(DP.ISPAID, ?) AS ISPAID, 
       (CASE DP.ISRECEIPT WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' 
END) AS INVOICE_TYPE, 
-      (CASE s2.SETTLEMENTTYPE WHEN 'I' THEN 
'../ManualSettlement/CreatePayment_Relation.html' ELSE 
'../Settlement/CreatedPayments_Relation.html' END) AS PATH, COALESCE(RLT2.NAME, 
RL2.NAME) AS DPSTATUS
+      (CASE s2.SETTLEMENTTYPE WHEN 'I' THEN 
'../ManualSettlement/CreatePayment_Relation.html' ELSE 
'../Settlement/CreatedPayments_Relation.html' END) AS PATH, COALESCE(RLT2.NAME, 
RL2.NAME) AS DPSTATUS, URS.NAME AS SALESREPNAME
       FROM C_DEBT_PAYMENT DP left join C_SETTLEMENT S1 on 
DP.C_SETTLEMENT_CANCEL_ID = S1.C_SETTLEMENT_ID
                              left join C_SETTLEMENT S2 on 
DP.C_SETTLEMENT_GENERATE_ID = S2.C_SETTLEMENT_ID
                              left join C_BPARTNER B    on DP.C_BPARTNER_ID = 
B.C_BPARTNER_ID
@@ -105,10 +106,11 @@
                                                               AND 
RLT.AD_LANGUAGE = ?,
            AD_REF_LIST RL2    left join AD_REF_LIST_TRL RLT2 on 
RL2.AD_REF_LIST_ID = RLT2.AD_REF_LIST_ID
                                                               AND 
RLT2.AD_LANGUAGE = ?,
-           C_CURRENCY C    
+           C_CURRENCY C, AD_USER URS   
       WHERE DP.C_CURRENCY_ID = C.C_CURRENCY_ID 
       AND DP.PAYMENTRULE = RL.VALUE
       AND RL.AD_REFERENCE_ID = '195'
+      AND I.SALESREP_ID = URS.AD_USER_ID
       AND DP.STATUS = RL2.VALUE
       AND RL2.AD_REFERENCE_ID = '800070'
       AND DP.AD_Client_ID IN ('1') 
@@ -117,7 +119,7 @@
       AND DP.IsValid='Y'
       GROUP BY (CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID 
END), (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE 
DP.C_DEBT_PAYMENT_ID END), B.NAME, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN 
I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END), DP.DATEPLANNED, DP.AMOUNT,
       DP.WRITEOFFAMT, C.ISO_CODE, (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN 
S1.DOCUMENTNO||' ('||S1.DATETRX||')' END), (CASE WHEN S2.DOCUMENTNO IS NOT NULL 
THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END), RLT.NAME, RL.NAME, RLT2.NAME, 
RL2.NAME, DP.C_Settlement_Cancel_ID,
-      DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT 
WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, 
DP.STATUS
+      DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT 
WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, 
DP.STATUS, URS.NAME
       ORDER BY STATUS, DP.DATEPLANNED, BPARTNER
      ]]></Sql>
       <Field name="rownum" value="count"/>

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to