details: /erp/stable/2.50/rev/fcf0fcf7e9b4
changeset: 9563:fcf0fcf7e9b4
user: David Alsasua <david.alsasua <at> openbravo.com>
date: Thu Jul 07 16:13:58 2011 +0200
summary: Fixes issue 17668: Cuaderno 34 is wrong with negative payments
diffstat:
src/org/openbravo/erpCommon/ad_actionButton/CreateFile.java | 6 +++++-
src/org/openbravo/erpCommon/ad_actionButton/CreateFile34_data.xsql | 8
+++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diffs (48 lines):
diff -r 2102d94b083d -r fcf0fcf7e9b4
src/org/openbravo/erpCommon/ad_actionButton/CreateFile.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFile.java Thu Jul
07 15:59:12 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFile.java Thu Jul
07 16:13:58 2011 +0200
@@ -680,7 +680,11 @@
// (common)
strBuf =
strBuf.append("010").append(Lineas[i].payamt).append(Lineas[i].nCuenta); //
F1-F4
strBuf = strBuf.append(strGastos);
- strBuf = strBuf.append(cConcepto == 'N' ? "1" : cConcepto == 'P' ? "8" :
"9").append(" ");
+ strBuf = strBuf.append(cConcepto == 'N' ? "1" : cConcepto == 'P' ? "8" :
"9");
+ if ("Y".equalsIgnoreCase((Lineas[i].negativa)))
+ strBuf = strBuf.append("- ");
+ else
+ strBuf = strBuf.append(" ");
strBuf =
strBuf.append(Lineas[i].dc).append(Principio[0].hueco).append("\r\n");
// 011
diff -r 2102d94b083d -r fcf0fcf7e9b4
src/org/openbravo/erpCommon/ad_actionButton/CreateFile34_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFile34_data.xsql
Thu Jul 07 15:59:12 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFile34_data.xsql
Thu Jul 07 16:13:58 2011 +0200
@@ -53,7 +53,8 @@
''
AS PLA,
''
AS PROV,
''
AS NOM,
- B.CODEBANK || B.CODEBRANCH || ba.CODEACCOUNT
AS ACCT
+ B.CODEBANK || B.CODEBRANCH || ba.CODEACCOUNT
AS ACCT,
+ '' AS NEGATIVA
from c_bankAccount ba,
ad_client c,
c_Bank b,
@@ -78,7 +79,7 @@
<Sql>
<![CDATA[
SELECT LPAD(BP.TAXID,12,' ') AS NIF, BP.TAXID,
- LPAD(TO_CHAR(ROUND(DP.AMOUNT*100)),12,'0') AS
PAYAMT,
+ LPAD(TO_CHAR(ROUND(ABS(DP.AMOUNT)*100)),12,'0')
AS PAYAMT,
SUBSTR(TRIM(LPAD(BP_A.ACCOUNTNO,20,'0')),1,4)|| /*BANCO*/
SUBSTR(TRIM(LPAD(BP_A.ACCOUNTNO,20,'0')),5,4)|| /*OFICINA*/
SUBSTR(TRIM(LPAD(BP_A.ACCOUNTNO,20,'0')),11) AS N_CUENTA,
@@ -91,7 +92,8 @@
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(COALESCE(to_char(L.POSTAL),'')||COALESCE(to_char(L.CITY),'')),'Á','A'),'É','E'),'Í','I'),'Ó','O'),'Ú','U')
AS PLA,
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(RPAD(COALESCE(to_char(R.DESCRIPTION),'
'),36,' ')),'Á','A'),'É','E'),'Í','I'),'Ó','O'),'Ú','U') AS PROVINCIA,
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(R.DESCRIPTION),'Á','A'),'É','E'),'Í','I'),'Ó','O'),'Ú','U')
AS PROV,
-
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(RPAD(COALESCE(to_char(DP.DESCRIPTION),'
'),36,' ')),'Á','A'),'É','E'),'Í','I'),'Ó','O'),'Ú','U') AS CONCEPTO
+
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(RPAD(COALESCE(to_char(DP.DESCRIPTION),'
'),36,' ')),'Á','A'),'É','E'),'Í','I'),'Ó','O'),'Ú','U') AS CONCEPTO,
+ CASE WHEN (DP.AMOUNT < 0) THEN 'Y' ELSE 'N' END AS NEGATIVA
FROM c_remittanceline S, C_DEBT_PAYMENT DP,
C_BPARTNER BP left join C_BP_BANKACCOUNT
BP_A on BP.C_BPARTNER_ID = BP_A.C_BPARTNER_ID
LEFT JOIN C_BPARTNER_LOCATION BP_L on
BP.C_BPARTNER_ID = BP_L.C_BPARTNER_ID
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits