Fixed bug [ 1859647 ] Remittance>CreateFile: Decimals in PostgreSQL
authorCarlos Romero <carlos.romero@openbravo.com>
Tue, 29 Jan 2008 12:18:52 +0000
changeset 381 c94c8e05919d
parent 380 8d5e0e654c6b
child 382 298a5434c215
Fixed bug [ 1859647 ] Remittance>CreateFile: Decimals in PostgreSQL
src/org/openbravo/erpCommon/ad_actionButton/CreateFile_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFile_data.xsql	Tue Jan 29 11:46:30 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFile_data.xsql	Tue Jan 29 12:18:52 2008 +0000
@@ -54,7 +54,7 @@
     <Sql>
     <![CDATA[
       SELECT RPAD(COALESCE(BP.NAME2,BP.NAME),40,' ') AS TERCERO,RPAD(TO_CHAR(COALESCE(C_INVOICE.DATEINVOICED,DP.DATEPLANNED), 'DDMMYY'),14) AS FECHA_FACTURA, 
-      TO_CHAR(TO_CHAR(DP.DATEPLANNED, 'DDMMYY')) AS FECHA_VENCIMIENTO,LPAD(DP.AMOUNT*100,10,0) AS PAYAMT, 
+      TO_CHAR(TO_CHAR(DP.DATEPLANNED, 'DDMMYY')) AS FECHA_VENCIMIENTO,LPAD(ROUND(DP.AMOUNT*100,0),10,0) AS PAYAMT, 
       (SELECT MAX(BP_A.ACCOUNTNO) FROM C_BP_BANKACCOUNT BP_A WHERE BP.C_BPARTNER_ID = BP_A.C_BPARTNER_ID AND BP_A.ISACTIVE='Y')  AS CREDITCARDNUMBER,
       LPAD(BP.VALUE,12,'0') AS N_FACTURA, RPAD(LPAD(BP.VALUE,8,'0'),12,' ') AS N_FACTURA19,L.CITY AS CIUDAD, RPAD(L.ADDRESS1,40,' ') AS DIRECCION, 
       TO_CHAR(now(),'DD')||TO_CHAR(now(),'MM')||TO_CHAR(now(),'YY') AS HOY, RPAD(COALESCE(TO_CHAR(DP.DESCRIPTION),' '),40,' ') AS CONCEPTO,
@@ -75,7 +75,7 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT RPAD(Lpad(sum(DP.AMOUNT)*100,10,0),16,' ') AS PAYAMT, 
+      SELECT RPAD(LPAD(ROUND(sum(DP.AMOUNT)*100,0),10,0),16,' ') AS PAYAMT, 
       LPAD(COUNT(*),10,0) AS N_FACTURA 
       FROM C_DEBT_PAYMENT DP,
 			     c_remittanceLine rl