IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs / X_DepositBatch X_DepositBatchLine

This commit is contained in:
Carlos Ruiz 2013-03-18 15:35:58 -05:00
parent 1dae118cb9
commit 45318ef957
18 changed files with 491 additions and 161 deletions

View File

@ -0,0 +1,153 @@
-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs
ALTER TABLE X_DepositBatch RENAME TO C_DepositBatch
;
ALTER TABLE C_DepositBatch RENAME COLUMN X_DepositBatch_ID TO C_DepositBatch_ID
;
ALTER TABLE C_DepositBatch RENAME COLUMN X_DepositBatch_UU TO C_DepositBatch_UU
;
ALTER TABLE X_DepositBatchLine RENAME TO C_DepositBatchLine
;
ALTER TABLE C_DepositBatchLine RENAME COLUMN X_DepositBatchLine_ID TO C_DepositBatchLine_ID
;
ALTER TABLE C_DepositBatchLine RENAME COLUMN X_DepositBatchLine_UU TO C_DepositBatchLine_UU
;
ALTER TABLE C_DepositBatchLine RENAME COLUMN X_DepositBatch_ID TO C_DepositBatch_ID
;
ALTER TABLE C_Payment RENAME COLUMN X_DepositBatch_ID TO C_DepositBatch_ID
;
-- Mar 18, 2013 2:45:55 PM COT
UPDATE AD_Sequence SET Description='Table C_DepositBatch', Name='C_DepositBatch',Updated=TO_DATE('2013-03-18 14:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200051
;
-- Mar 18, 2013 2:46:00 PM COT
UPDATE AD_Sequence SET Description='Table C_DepositBatchLine', Name='C_DepositBatchLine',Updated=TO_DATE('2013-03-18 14:46:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200052
;
-- Mar 18, 2013 2:46:19 PM COT
UPDATE AD_Table SET TableName='C_DepositBatch',Updated=TO_DATE('2013-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200056
;
-- Mar 18, 2013 2:46:23 PM COT
UPDATE AD_Table SET TableName='C_DepositBatchLine',Updated=TO_DATE('2013-03-18 14:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200057
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatch_ID',Updated=TO_DATE('2013-03-18 14:46:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202195
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL, AD_Element_ID=202195 WHERE UPPER(ColumnName)='C_DEPOSITBATCH_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:40 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatchLine_ID',Updated=TO_DATE('2013-03-18 14:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202199
;
-- Mar 18, 2013 2:46:40 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL, AD_Element_ID=202199 WHERE UPPER(ColumnName)='C_DEPOSITBATCHLINE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', PrintName='C_DepositBatchLine_UU',Updated=TO_DATE('2013-03-18 14:46:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL, AD_Element_ID=202200 WHERE UPPER(ColumnName)='C_DEPOSITBATCHLINE_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Field SET Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=202200) AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_PrintFormatItem SET PrintName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=202200)
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', PrintName='C_DepositBatch_UU',Updated=TO_DATE('2013-03-18 14:46:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL, AD_Element_ID=202196 WHERE UPPER(ColumnName)='C_DEPOSITBATCH_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Field SET Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=202196) AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_PrintFormatItem SET PrintName='C_DepositBatch_UU', Name='C_DepositBatch_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=202196)
;
-- Mar 18, 2013 3:12:20 PM COT
-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs
UPDATE AD_Column SET DefaultValue='@SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_DepositBatchLine WHERE C_DepositBatch_ID=@C_DepositBatch_ID@',Updated=TO_DATE('2013-03-18 15:12:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=208438
;
SELECT register_migration_script('201303181447_IDEMPIERE-764.sql') FROM dual
;

View File

@ -0,0 +1,153 @@
-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs
ALTER TABLE X_DepositBatch RENAME TO C_DepositBatch
;
ALTER TABLE C_DepositBatch RENAME X_DepositBatch_ID TO C_DepositBatch_ID
;
ALTER TABLE C_DepositBatch RENAME X_DepositBatch_UU TO C_DepositBatch_UU
;
ALTER TABLE X_DepositBatchLine RENAME TO C_DepositBatchLine
;
ALTER TABLE C_DepositBatchLine RENAME X_DepositBatchLine_ID TO C_DepositBatchLine_ID
;
ALTER TABLE C_DepositBatchLine RENAME X_DepositBatchLine_UU TO C_DepositBatchLine_UU
;
ALTER TABLE C_DepositBatchLine RENAME X_DepositBatch_ID TO C_DepositBatch_ID
;
ALTER TABLE C_Payment RENAME X_DepositBatch_ID TO C_DepositBatch_ID
;
-- Mar 18, 2013 2:45:55 PM COT
UPDATE AD_Sequence SET Description='Table C_DepositBatch', Name='C_DepositBatch',Updated=TO_TIMESTAMP('2013-03-18 14:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200051
;
-- Mar 18, 2013 2:46:00 PM COT
UPDATE AD_Sequence SET Description='Table C_DepositBatchLine', Name='C_DepositBatchLine',Updated=TO_TIMESTAMP('2013-03-18 14:46:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200052
;
-- Mar 18, 2013 2:46:19 PM COT
UPDATE AD_Table SET TableName='C_DepositBatch',Updated=TO_TIMESTAMP('2013-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200056
;
-- Mar 18, 2013 2:46:23 PM COT
UPDATE AD_Table SET TableName='C_DepositBatchLine',Updated=TO_TIMESTAMP('2013-03-18 14:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200057
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatch_ID',Updated=TO_TIMESTAMP('2013-03-18 14:46:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202195
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL, AD_Element_ID=202195 WHERE UPPER(ColumnName)='C_DEPOSITBATCH_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:36 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatch_ID', Name='Deposit Batch', Description=NULL, Help=NULL WHERE AD_Element_ID=202195 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:40 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatchLine_ID',Updated=TO_TIMESTAMP('2013-03-18 14:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202199
;
-- Mar 18, 2013 2:46:40 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL, AD_Element_ID=202199 WHERE UPPER(ColumnName)='C_DEPOSITBATCHLINE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:41 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatchLine_ID', Name='Deposit Batch Line', Description=NULL, Help=NULL WHERE AD_Element_ID=202199 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', PrintName='C_DepositBatchLine_UU',Updated=TO_TIMESTAMP('2013-03-18 14:46:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL, AD_Element_ID=202200 WHERE UPPER(ColumnName)='C_DEPOSITBATCHLINE_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202200 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_Field SET Name='C_DepositBatchLine_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=202200) AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:47 PM COT
UPDATE AD_PrintFormatItem SET PrintName='C_DepositBatchLine_UU', Name='C_DepositBatchLine_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=202200)
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Element SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', PrintName='C_DepositBatch_UU',Updated=TO_TIMESTAMP('2013-03-18 14:46:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Column SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL, AD_Element_ID=202196 WHERE UPPER(ColumnName)='C_DEPOSITBATCH_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Process_Para SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_InfoColumn SET ColumnName='C_DepositBatch_UU', Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=202196 AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_Field SET Name='C_DepositBatch_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=202196) AND IsCentrallyMaintained='Y'
;
-- Mar 18, 2013 2:46:54 PM COT
UPDATE AD_PrintFormatItem SET PrintName='C_DepositBatch_UU', Name='C_DepositBatch_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=202196)
;
-- Mar 18, 2013 3:12:20 PM COT
-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs
UPDATE AD_Column SET DefaultValue='@SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_DepositBatchLine WHERE C_DepositBatch_ID=@C_DepositBatch_ID@',Updated=TO_TIMESTAMP('2013-03-18 15:12:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=208438
;
SELECT register_migration_script('201303181447_IDEMPIERE-764.sql') FROM dual
;

View File

@ -44,7 +44,7 @@ import org.compiere.process.SvrProcess;
public class DepositBatchClose extends SvrProcess
{
/** Deposit Batch from Record */
private int m_X_DepositBatch_ID = 0;
private int m_C_DepositBatch_ID = 0;
/**
* Prepare - e.g., get Parameters.
@ -60,7 +60,7 @@ public class DepositBatchClose extends SvrProcess
else
log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
}
m_X_DepositBatch_ID = getRecord_ID();
m_C_DepositBatch_ID = getRecord_ID();
} // prepare
/**
@ -70,7 +70,7 @@ public class DepositBatchClose extends SvrProcess
*/
protected String doIt() throws Exception
{
MDepositBatch depositbatch = new MDepositBatch (getCtx(), m_X_DepositBatch_ID, get_TrxName());
MDepositBatch depositbatch = new MDepositBatch (getCtx(), m_C_DepositBatch_ID, get_TrxName());
if (log.isLoggable(Level.INFO)) log.info("doIt - " + depositbatch);
MDepositBatchLine[] depositbatchLines = depositbatch.getLines();

View File

@ -20,15 +20,15 @@ import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for X_DepositBatch
/** Generated Interface for C_DepositBatch
* @author iDempiere (generated)
* @version Release 1.0a
*/
public interface I_X_DepositBatch
public interface I_C_DepositBatch
{
/** TableName=X_DepositBatch */
public static final String Table_Name = "X_DepositBatch";
/** TableName=C_DepositBatch */
public static final String Table_Name = "C_DepositBatch";
/** AD_Table_ID=200056 */
public static final int Table_ID = 200056;
@ -242,21 +242,21 @@ public interface I_X_DepositBatch
*/
public int getUpdatedBy();
/** Column name X_DepositBatch_ID */
public static final String COLUMNNAME_X_DepositBatch_ID = "X_DepositBatch_ID";
/** Column name C_DepositBatch_ID */
public static final String COLUMNNAME_C_DepositBatch_ID = "C_DepositBatch_ID";
/** Set Deposit Batch */
public void setX_DepositBatch_ID (int X_DepositBatch_ID);
public void setC_DepositBatch_ID (int C_DepositBatch_ID);
/** Get Deposit Batch */
public int getX_DepositBatch_ID();
public int getC_DepositBatch_ID();
/** Column name X_DepositBatch_UU */
public static final String COLUMNNAME_X_DepositBatch_UU = "X_DepositBatch_UU";
/** Column name C_DepositBatch_UU */
public static final String COLUMNNAME_C_DepositBatch_UU = "C_DepositBatch_UU";
/** Set X_DepositBatch_UU */
public void setX_DepositBatch_UU (String X_DepositBatch_UU);
/** Set C_DepositBatch_UU */
public void setC_DepositBatch_UU (String C_DepositBatch_UU);
/** Get X_DepositBatch_UU */
public String getX_DepositBatch_UU();
/** Get C_DepositBatch_UU */
public String getC_DepositBatch_UU();
}

View File

@ -20,15 +20,15 @@ import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for X_DepositBatchLine
/** Generated Interface for C_DepositBatchLine
* @author iDempiere (generated)
* @version Release 1.0a
*/
public interface I_X_DepositBatchLine
public interface I_C_DepositBatchLine
{
/** TableName=X_DepositBatchLine */
public static final String Table_Name = "X_DepositBatchLine";
/** TableName=C_DepositBatchLine */
public static final String Table_Name = "C_DepositBatchLine";
/** AD_Table_ID=200057 */
public static final int Table_ID = 200057;
@ -170,32 +170,32 @@ public interface I_X_DepositBatchLine
*/
public int getUpdatedBy();
/** Column name X_DepositBatch_ID */
public static final String COLUMNNAME_X_DepositBatch_ID = "X_DepositBatch_ID";
/** Column name C_DepositBatch_ID */
public static final String COLUMNNAME_C_DepositBatch_ID = "C_DepositBatch_ID";
/** Set Deposit Batch */
public void setX_DepositBatch_ID (int X_DepositBatch_ID);
public void setC_DepositBatch_ID (int C_DepositBatch_ID);
/** Get Deposit Batch */
public int getX_DepositBatch_ID();
public int getC_DepositBatch_ID();
public org.compiere.model.I_X_DepositBatch getX_DepositBatch() throws RuntimeException;
public org.compiere.model.I_C_DepositBatch getC_DepositBatch() throws RuntimeException;
/** Column name X_DepositBatchLine_ID */
public static final String COLUMNNAME_X_DepositBatchLine_ID = "X_DepositBatchLine_ID";
/** Column name C_DepositBatchLine_ID */
public static final String COLUMNNAME_C_DepositBatchLine_ID = "C_DepositBatchLine_ID";
/** Set Deposit Batch Line */
public void setX_DepositBatchLine_ID (int X_DepositBatchLine_ID);
public void setC_DepositBatchLine_ID (int C_DepositBatchLine_ID);
/** Get Deposit Batch Line */
public int getX_DepositBatchLine_ID();
public int getC_DepositBatchLine_ID();
/** Column name X_DepositBatchLine_UU */
public static final String COLUMNNAME_X_DepositBatchLine_UU = "X_DepositBatchLine_UU";
/** Column name C_DepositBatchLine_UU */
public static final String COLUMNNAME_C_DepositBatchLine_UU = "C_DepositBatchLine_UU";
/** Set X_DepositBatchLine_UU */
public void setX_DepositBatchLine_UU (String X_DepositBatchLine_UU);
/** Set C_DepositBatchLine_UU */
public void setC_DepositBatchLine_UU (String C_DepositBatchLine_UU);
/** Get X_DepositBatchLine_UU */
public String getX_DepositBatchLine_UU();
/** Get C_DepositBatchLine_UU */
public String getC_DepositBatchLine_UU();
}

View File

@ -340,6 +340,17 @@ public interface I_C_Payment
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_DepositBatch_ID */
public static final String COLUMNNAME_C_DepositBatch_ID = "C_DepositBatch_ID";
/** Set Deposit Batch */
public void setC_DepositBatch_ID (int C_DepositBatch_ID);
/** Get Deposit Batch */
public int getC_DepositBatch_ID();
public org.compiere.model.I_C_DepositBatch getC_DepositBatch() throws RuntimeException;
/** Column name C_DocType_ID */
public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID";

View File

@ -48,7 +48,7 @@ import org.compiere.util.DB;
* @author Alejandro Falcone
* @version $Id: MDepositBatch.java,v 1.3 2007/06/28 00:51:03 afalcone Exp $
*/
public class MDepositBatch extends X_X_DepositBatch
public class MDepositBatch extends X_C_DepositBatch
{
/**
*
@ -58,13 +58,13 @@ public class MDepositBatch extends X_X_DepositBatch
/**
* Create & Load existing Persistent Object
* @param ctx context
* @param X_DepositBatch_ID The unique ID of the object
* @param C_DepositBatch_ID The unique ID of the object
* @param trxName transaction name
*/
public MDepositBatch (Properties ctx, int X_DepositBatch_ID, String trxName)
public MDepositBatch (Properties ctx, int C_DepositBatch_ID, String trxName)
{
super (ctx, X_DepositBatch_ID, trxName);
if (X_DepositBatch_ID == 0)
super (ctx, C_DepositBatch_ID, trxName);
if (C_DepositBatch_ID == 0)
{
setDocStatus (DOCSTATUS_Drafted);
setProcessed (false);
@ -94,7 +94,7 @@ public class MDepositBatch extends X_X_DepositBatch
{
this (original.getCtx(), 0, original.get_TrxName());
setClientOrg(original);
setX_DepositBatch_ID(original.getX_DepositBatch_ID());
setC_DepositBatch_ID(original.getC_DepositBatch_ID());
setDescription(original.getDescription());
setC_DocType_ID(original.getC_DocType_ID());
@ -104,19 +104,6 @@ public class MDepositBatch extends X_X_DepositBatch
setDepositAmt(original.getDepositAmt());
} // MDepositBatch
public int getX_DepositBatch_ID()
{
Integer ii = (Integer)get_Value("X_DepositBatch_ID");
if (ii == null)
return 0;
return ii.intValue();
}
public void setX_DepositBatch_ID(int X_DepositBatch_ID)
{
set_Value("X_DepositBatch_ID", Integer.valueOf(X_DepositBatch_ID));
}
/**
* Overwrite Client/Org if required
* @param AD_Client_ID client
@ -279,10 +266,10 @@ public class MDepositBatch extends X_X_DepositBatch
*/
protected boolean afterDelete (boolean success)
{
if (getX_DepositBatch_ID() != 0 )
if (getC_DepositBatch_ID() != 0 )
{
String sql = "UPDATE C_Payment p SET X_DepositBatch_ID= 0 WHERE p.X_DepositBatch_ID=?";
DB.executeUpdate(sql, getX_DepositBatch_ID(), get_TrxName());
String sql = "UPDATE C_Payment p SET C_DepositBatch_ID= 0 WHERE p.C_DepositBatch_ID=?";
DB.executeUpdateEx(sql, new Object[] {getC_DepositBatch_ID()}, get_TrxName());
}
return success;
@ -296,13 +283,13 @@ public class MDepositBatch extends X_X_DepositBatch
public MDepositBatchLine[] getLines()
{
ArrayList<MDepositBatchLine> list = new ArrayList<MDepositBatchLine>();
String sql = "SELECT * FROM X_DepositBatchLine WHERE X_DepositBatch_ID=? ORDER BY Line";
String sql = "SELECT * FROM C_DepositBatchLine WHERE C_DepositBatch_ID=? ORDER BY Line";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(sql, get_TrxName());
pstmt.setInt(1, getX_DepositBatch_ID());
pstmt.setInt(1, getC_DepositBatch_ID());
rs = pstmt.executeQuery();
while (rs.next())
list.add(new MDepositBatchLine (getCtx(), rs, get_TrxName()));

View File

@ -44,7 +44,7 @@ import org.compiere.util.Env;
* @version $Id: MDepositBatchLine.java,v 1.3 2007/07/02 00:51:02 afalcone Exp $
*
*/
public class MDepositBatchLine extends X_X_DepositBatchLine
public class MDepositBatchLine extends X_C_DepositBatchLine
{
/**
*
@ -59,10 +59,10 @@ import org.compiere.util.Env;
* @param C_BankStatementLine_ID id
* @param trxName transaction
*/
public MDepositBatchLine (Properties ctx, int X_DepositBatchLine_ID, String trxName)
public MDepositBatchLine (Properties ctx, int C_DepositBatchLine_ID, String trxName)
{
super (ctx, X_DepositBatchLine_ID, trxName);
if (X_DepositBatchLine_ID == 0)
super (ctx, C_DepositBatchLine_ID, trxName);
if (C_DepositBatchLine_ID == 0)
{
setPayAmt(Env.ZERO);
}
@ -87,7 +87,7 @@ import org.compiere.util.Env;
{
this (statement.getCtx(), 0, statement.get_TrxName());
setClientOrg(statement);
setX_DepositBatch_ID(statement.getX_DepositBatch_ID());
setC_DepositBatch_ID(statement.getC_DepositBatch_ID());
} // MDepositBatchLine
/**
@ -125,16 +125,16 @@ import org.compiere.util.Env;
// Set Line No
if (getLine() == 0)
{
String sql = "SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM X_DepositBatchLine WHERE X_DepositBatch_ID=?";
int ii = DB.getSQLValue (get_TrxName(), sql, getX_DepositBatch_ID());
String sql = "SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_DepositBatchLine WHERE C_DepositBatch_ID=?";
int ii = DB.getSQLValue (get_TrxName(), sql, getC_DepositBatch_ID());
setLine (ii);
}
// Set DepositBatch_ID into C_Payment table
if (getC_Payment_ID() != 0 )
{
String sql = "UPDATE C_Payment p SET X_DepositBatch_ID=? WHERE p.C_Payment_ID=?";
DB.executeUpdate(sql, new Object[] {getX_DepositBatch_ID(), getC_Payment_ID()}, false, get_TrxName());
String sql = "UPDATE C_Payment p SET C_DepositBatch_ID=? WHERE p.C_Payment_ID=?";
DB.executeUpdateEx(sql, new Object[] {getC_DepositBatch_ID(), getC_Payment_ID()}, get_TrxName());
}
//
@ -164,8 +164,8 @@ import org.compiere.util.Env;
updateHeader();
if (getC_Payment_ID() != 0 )
{
String sql = "UPDATE C_Payment p SET X_DepositBatch_ID= 0 WHERE p.C_Payment_ID=?";
DB.executeUpdate(sql, getC_Payment_ID(), get_TrxName());
String sql = "UPDATE C_Payment p SET C_DepositBatch_ID= 0 WHERE p.C_Payment_ID=?";
DB.executeUpdateEx(sql, new Object[] {getC_Payment_ID()}, get_TrxName());
}
return success;
@ -178,12 +178,11 @@ import org.compiere.util.Env;
*/
private void updateHeader()
{
StringBuilder sql = new StringBuilder();
sql.append("UPDATE X_DepositBatch dp");
sql.append(" SET DepositAmt=(SELECT COALESCE(SUM(PayAmt),0) FROM X_DepositBatchLine dpl ");
sql.append("WHERE dpl.X_DepositBatch_ID=dp.X_DepositBatch_ID AND dpl.IsActive='Y') ");
sql.append("WHERE X_DepositBatch_ID=?");
DB.executeUpdate(sql.toString(), getX_DepositBatch_ID(), get_TrxName());
String sql = "UPDATE C_DepositBatch dp"
+ " SET DepositAmt=(SELECT COALESCE(SUM(PayAmt),0) FROM C_DepositBatchLine dpl "
+ "WHERE dpl.C_DepositBatch_ID=dp.C_DepositBatch_ID AND dpl.IsActive='Y') "
+ "WHERE C_DepositBatch_ID=?";
DB.executeUpdateEx(sql, new Object[] {getC_DepositBatch_ID()}, get_TrxName());
} // updateHeader
} // MDepositBatchLine

View File

@ -24,10 +24,10 @@ import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
/** Generated Model for X_DepositBatch
/** Generated Model for C_DepositBatch
* @author iDempiere (generated)
* @version Release 1.0a - $Id$ */
public class X_X_DepositBatch extends PO implements I_X_DepositBatch, I_Persistent
public class X_C_DepositBatch extends PO implements I_C_DepositBatch, I_Persistent
{
/**
@ -36,10 +36,10 @@ public class X_X_DepositBatch extends PO implements I_X_DepositBatch, I_Persiste
private static final long serialVersionUID = 20130123L;
/** Standard Constructor */
public X_X_DepositBatch (Properties ctx, int X_DepositBatch_ID, String trxName)
public X_C_DepositBatch (Properties ctx, int C_DepositBatch_ID, String trxName)
{
super (ctx, X_DepositBatch_ID, trxName);
/** if (X_DepositBatch_ID == 0)
super (ctx, C_DepositBatch_ID, trxName);
/** if (C_DepositBatch_ID == 0)
{
setC_BankAccount_ID (0);
setC_DocType_ID (0);
@ -52,12 +52,12 @@ public class X_X_DepositBatch extends PO implements I_X_DepositBatch, I_Persiste
// DR
setDocumentNo (null);
setProcessed (false);
setX_DepositBatch_ID (0);
setC_DepositBatch_ID (0);
} */
}
/** Load Constructor */
public X_X_DepositBatch (Properties ctx, ResultSet rs, String trxName)
public X_C_DepositBatch (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
@ -79,7 +79,7 @@ public class X_X_DepositBatch extends PO implements I_X_DepositBatch, I_Persiste
public String toString()
{
StringBuffer sb = new StringBuffer ("X_X_DepositBatch[")
StringBuffer sb = new StringBuffer ("X_C_DepositBatch[")
.append(get_ID()).append("]");
return sb.toString();
}
@ -337,36 +337,36 @@ public class X_X_DepositBatch extends PO implements I_X_DepositBatch, I_Persiste
}
/** Set Deposit Batch.
@param X_DepositBatch_ID Deposit Batch */
public void setX_DepositBatch_ID (int X_DepositBatch_ID)
@param C_DepositBatch_ID Deposit Batch */
public void setC_DepositBatch_ID (int C_DepositBatch_ID)
{
if (X_DepositBatch_ID < 1)
set_ValueNoCheck (COLUMNNAME_X_DepositBatch_ID, null);
if (C_DepositBatch_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, null);
else
set_ValueNoCheck (COLUMNNAME_X_DepositBatch_ID, Integer.valueOf(X_DepositBatch_ID));
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, Integer.valueOf(C_DepositBatch_ID));
}
/** Get Deposit Batch.
@return Deposit Batch */
public int getX_DepositBatch_ID ()
public int getC_DepositBatch_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_X_DepositBatch_ID);
Integer ii = (Integer)get_Value(COLUMNNAME_C_DepositBatch_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set X_DepositBatch_UU.
@param X_DepositBatch_UU X_DepositBatch_UU */
public void setX_DepositBatch_UU (String X_DepositBatch_UU)
/** Set C_DepositBatch_UU.
@param C_DepositBatch_UU C_DepositBatch_UU */
public void setC_DepositBatch_UU (String C_DepositBatch_UU)
{
set_Value (COLUMNNAME_X_DepositBatch_UU, X_DepositBatch_UU);
set_Value (COLUMNNAME_C_DepositBatch_UU, C_DepositBatch_UU);
}
/** Get X_DepositBatch_UU.
@return X_DepositBatch_UU */
public String getX_DepositBatch_UU ()
/** Get C_DepositBatch_UU.
@return C_DepositBatch_UU */
public String getC_DepositBatch_UU ()
{
return (String)get_Value(COLUMNNAME_X_DepositBatch_UU);
return (String)get_Value(COLUMNNAME_C_DepositBatch_UU);
}
}

View File

@ -23,10 +23,10 @@ import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
/** Generated Model for X_DepositBatchLine
/** Generated Model for C_DepositBatchLine
* @author iDempiere (generated)
* @version Release 1.0a - $Id$ */
public class X_X_DepositBatchLine extends PO implements I_X_DepositBatchLine, I_Persistent
public class X_C_DepositBatchLine extends PO implements I_C_DepositBatchLine, I_Persistent
{
/**
@ -35,24 +35,24 @@ public class X_X_DepositBatchLine extends PO implements I_X_DepositBatchLine, I_
private static final long serialVersionUID = 20130123L;
/** Standard Constructor */
public X_X_DepositBatchLine (Properties ctx, int X_DepositBatchLine_ID, String trxName)
public X_C_DepositBatchLine (Properties ctx, int C_DepositBatchLine_ID, String trxName)
{
super (ctx, X_DepositBatchLine_ID, trxName);
/** if (X_DepositBatchLine_ID == 0)
super (ctx, C_DepositBatchLine_ID, trxName);
/** if (C_DepositBatchLine_ID == 0)
{
setC_Payment_ID (0);
setLine (0);
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM X_DepositBatchLine WHERE X_DepositBatch_ID=@X_DepositBatch_ID@
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_DepositBatchLine WHERE C_DepositBatch_ID=@C_DepositBatch_ID@
setPayAmt (Env.ZERO);
setProcessed (false);
setProcessing (false);
setX_DepositBatch_ID (0);
setX_DepositBatchLine_ID (0);
setC_DepositBatch_ID (0);
setC_DepositBatchLine_ID (0);
} */
}
/** Load Constructor */
public X_X_DepositBatchLine (Properties ctx, ResultSet rs, String trxName)
public X_C_DepositBatchLine (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
@ -74,7 +74,7 @@ public class X_X_DepositBatchLine extends PO implements I_X_DepositBatchLine, I_
public String toString()
{
StringBuffer sb = new StringBuffer ("X_X_DepositBatchLine[")
StringBuffer sb = new StringBuffer ("X_C_DepositBatchLine[")
.append(get_ID()).append("]");
return sb.toString();
}
@ -192,26 +192,26 @@ public class X_X_DepositBatchLine extends PO implements I_X_DepositBatchLine, I_
return false;
}
public org.compiere.model.I_X_DepositBatch getX_DepositBatch() throws RuntimeException
public org.compiere.model.I_C_DepositBatch getC_DepositBatch() throws RuntimeException
{
return (org.compiere.model.I_X_DepositBatch)MTable.get(getCtx(), org.compiere.model.I_X_DepositBatch.Table_Name)
.getPO(getX_DepositBatch_ID(), get_TrxName()); }
return (org.compiere.model.I_C_DepositBatch)MTable.get(getCtx(), org.compiere.model.I_C_DepositBatch.Table_Name)
.getPO(getC_DepositBatch_ID(), get_TrxName()); }
/** Set Deposit Batch.
@param X_DepositBatch_ID Deposit Batch */
public void setX_DepositBatch_ID (int X_DepositBatch_ID)
@param C_DepositBatch_ID Deposit Batch */
public void setC_DepositBatch_ID (int C_DepositBatch_ID)
{
if (X_DepositBatch_ID < 1)
set_ValueNoCheck (COLUMNNAME_X_DepositBatch_ID, null);
if (C_DepositBatch_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, null);
else
set_ValueNoCheck (COLUMNNAME_X_DepositBatch_ID, Integer.valueOf(X_DepositBatch_ID));
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, Integer.valueOf(C_DepositBatch_ID));
}
/** Get Deposit Batch.
@return Deposit Batch */
public int getX_DepositBatch_ID ()
public int getC_DepositBatch_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_X_DepositBatch_ID);
Integer ii = (Integer)get_Value(COLUMNNAME_C_DepositBatch_ID);
if (ii == null)
return 0;
return ii.intValue();
@ -222,40 +222,40 @@ public class X_X_DepositBatchLine extends PO implements I_X_DepositBatchLine, I_
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), String.valueOf(getX_DepositBatch_ID()));
return new KeyNamePair(get_ID(), String.valueOf(getC_DepositBatch_ID()));
}
/** Set Deposit Batch Line.
@param X_DepositBatchLine_ID Deposit Batch Line */
public void setX_DepositBatchLine_ID (int X_DepositBatchLine_ID)
@param C_DepositBatchLine_ID Deposit Batch Line */
public void setC_DepositBatchLine_ID (int C_DepositBatchLine_ID)
{
if (X_DepositBatchLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_X_DepositBatchLine_ID, null);
if (C_DepositBatchLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_DepositBatchLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_X_DepositBatchLine_ID, Integer.valueOf(X_DepositBatchLine_ID));
set_ValueNoCheck (COLUMNNAME_C_DepositBatchLine_ID, Integer.valueOf(C_DepositBatchLine_ID));
}
/** Get Deposit Batch Line.
@return Deposit Batch Line */
public int getX_DepositBatchLine_ID ()
public int getC_DepositBatchLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_X_DepositBatchLine_ID);
Integer ii = (Integer)get_Value(COLUMNNAME_C_DepositBatchLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set X_DepositBatchLine_UU.
@param X_DepositBatchLine_UU X_DepositBatchLine_UU */
public void setX_DepositBatchLine_UU (String X_DepositBatchLine_UU)
/** Set C_DepositBatchLine_UU.
@param C_DepositBatchLine_UU C_DepositBatchLine_UU */
public void setC_DepositBatchLine_UU (String C_DepositBatchLine_UU)
{
set_Value (COLUMNNAME_X_DepositBatchLine_UU, X_DepositBatchLine_UU);
set_Value (COLUMNNAME_C_DepositBatchLine_UU, C_DepositBatchLine_UU);
}
/** Get X_DepositBatchLine_UU.
@return X_DepositBatchLine_UU */
public String getX_DepositBatchLine_UU ()
/** Get C_DepositBatchLine_UU.
@return C_DepositBatchLine_UU */
public String getC_DepositBatchLine_UU ()
{
return (String)get_Value(COLUMNNAME_X_DepositBatchLine_UU);
return (String)get_Value(COLUMNNAME_C_DepositBatchLine_UU);
}
}

View File

@ -33,7 +33,7 @@ public class X_C_Payment extends PO implements I_C_Payment, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20130318L;
/** Standard Constructor */
public X_C_Payment (Properties ctx, int C_Payment_ID, String trxName)
@ -552,6 +552,31 @@ public class X_C_Payment extends PO implements I_C_Payment, I_Persistent
return ii.intValue();
}
public org.compiere.model.I_C_DepositBatch getC_DepositBatch() throws RuntimeException
{
return (org.compiere.model.I_C_DepositBatch)MTable.get(getCtx(), org.compiere.model.I_C_DepositBatch.Table_Name)
.getPO(getC_DepositBatch_ID(), get_TrxName()); }
/** Set Deposit Batch.
@param C_DepositBatch_ID Deposit Batch */
public void setC_DepositBatch_ID (int C_DepositBatch_ID)
{
if (C_DepositBatch_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_DepositBatch_ID, Integer.valueOf(C_DepositBatch_ID));
}
/** Get Deposit Batch.
@return Deposit Batch */
public int getC_DepositBatch_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_DepositBatch_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException
{
return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name)

View File

@ -19,7 +19,7 @@ import org.compiere.model.I_C_Invoice;
import org.compiere.model.I_M_InOut;
import org.compiere.model.I_M_PackageMPS;
import org.compiere.model.I_M_RMA;
import org.compiere.model.I_X_DepositBatch;
import org.compiere.model.I_C_DepositBatch;
/**
*
@ -43,7 +43,7 @@ public class DefaultCreateFromFactory implements ICreateFromFactory
return new VCreateFromRMAUI(mTab);
else if (tableName.equals(I_M_PackageMPS.Table_Name))
return new VCreateFromPackageShipmentUI(mTab);
else if (tableName.equals(I_X_DepositBatch.Table_Name))
else if (tableName.equals(I_C_DepositBatch.Table_Name))
return new VCreateFromDepositBatchUI(mTab);
return null;
}

View File

@ -139,7 +139,7 @@ public class VCreateFromDepositBatchUI extends CreateFromDepositBatch implements
dialog.getConfirmPanel().addButton(refreshButton);
dialog.getRootPane().setDefaultButton(refreshButton);
if (getGridTab().getValue("X_DepositBatch_ID") == null)
if (getGridTab().getValue("C_DepositBatch_ID") == null)
{
ADialog.error(0, dialog, "SaveErrorRowNotFound");
return false;

View File

@ -21,7 +21,7 @@ import org.compiere.model.I_C_Invoice;
import org.compiere.model.I_M_InOut;
import org.compiere.model.I_M_PackageMPS;
import org.compiere.model.I_M_RMA;
import org.compiere.model.I_X_DepositBatch;
import org.compiere.model.I_C_DepositBatch;
/**
*
@ -45,7 +45,7 @@ public class DefaultCreateFromFactory implements ICreateFromFactory
return new WCreateFromRMAUI(mTab);
else if (tableName.equals(I_M_PackageMPS.Table_Name))
return new WCreateFromPackageShipmentUI(mTab);
else if (tableName.equals(I_X_DepositBatch.Table_Name))
else if (tableName.equals(I_C_DepositBatch.Table_Name))
return new WCreateFromDepositBatchUI(mTab);
return null;
}

View File

@ -139,7 +139,7 @@ public class WCreateFromDepositBatchUI extends CreateFromDepositBatch implements
refreshButton.addEventListener(Events.ON_CLICK, this);
window.getConfirmPanel().addButton(refreshButton);
if (getGridTab().getValue("X_DepositBatch_ID") == null)
if (getGridTab().getValue("C_DepositBatch_ID") == null)
{
FDialog.error(0, window, "SaveErrorRowNotFound");
return false;

View File

@ -153,10 +153,12 @@ public class WButtonEditor extends WEditor implements IProcessButton
}
}
@Override
@Override
public String getDisplay()
{
return m_value.toString();
if (m_value != null)
return m_value.toString();
return null;
}
@Override

View File

@ -181,21 +181,21 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
StringBuilder sql = new StringBuilder();
sql.append("SELECT py.X_DepositBatch_ID, db.DocumentNo, db.DateDeposit, db.C_BankAccount_ID, ba.AccountNo,");
sql.append("SELECT py.C_DepositBatch_ID, db.DocumentNo, db.DateDeposit, db.C_BankAccount_ID, ba.AccountNo,");
sql.append("SUM(currencyConvert(p.PayAmt,p.C_Currency_ID,ba.C_Currency_ID,?,null,p.AD_Client_ID,p.AD_Org_ID)) AS amount,");
sql.append("SUM(p.PayAmt) AS amountoriginal");
sql.append(" FROM C_BankAccount ba");
sql.append(" INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)");
sql.append(" INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)");
sql.append(" INNER JOIN C_Payment py ON (py.C_Payment_ID=p.C_Payment_ID)");
sql.append(" INNER JOIN X_DepositBatch db ON (py.X_DepositBatch_ID = db.X_DepositBatch_ID) ");
sql.append(" INNER JOIN C_DepositBatch db ON (py.C_DepositBatch_ID = db.C_DepositBatch_ID) ");
sql.append(getSQLWhere(BPartner, DocumentNo, DateFrom, DateTo, AmtFrom, AmtTo, DocType, TenderType, AuthCode));
sql.append(" AND p.IsReceipt = 'Y'");
sql.append(" AND py.X_DepositBatch_ID <> 0");
sql.append(" AND py.C_DepositBatch_ID <> 0");
sql.append(" AND db.Processed = 'Y'");
sql.append(" GROUP BY py.X_DepositBatch_ID,db.DocumentNo,db.DateDeposit, db.C_BankAccount_ID,ba.AccountNo");
sql.append(" GROUP BY py.C_DepositBatch_ID,db.DocumentNo,db.DateDeposit, db.C_BankAccount_ID,ba.AccountNo");
PreparedStatement pstmt = null;
ResultSet rs = null;
@ -210,7 +210,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
line.add(new Boolean(false)); // 0-Selection
line.add(rs.getTimestamp(3)); // 1-DateDeposit
KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
line.add(pp); // 2-X_DepositBatch
line.add(pp); // 2-C_DepositBatch
line.add(rs.getBigDecimal(7)); // 3-PayAmt
line.add(rs.getBigDecimal(6)); // 4-Conv Amt
pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
@ -257,11 +257,11 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
sql.append(" INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)");
sql.append(" INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)");
sql.append(" INNER JOIN C_Payment py ON (py.C_Payment_ID=p.C_Payment_ID)");
sql.append(" INNER JOIN X_DepositBatch db ON (py.X_DepositBatch_ID = db.X_DepositBatch_ID)");
sql.append(" INNER JOIN C_DepositBatch db ON (py.C_DepositBatch_ID = db.C_DepositBatch_ID)");
sql.append(" LEFT OUTER JOIN C_BPartner bp ON (p.C_BPartner_ID=bp.C_BPartner_ID)");
sql.append(" WHERE p.Processed='Y' AND p.IsReconciled='N'");
sql.append(" AND p.IsReceipt = 'Y'");
sql.append(" AND py.X_DepositBatch_ID = ?");
sql.append(" AND py.C_DepositBatch_ID = ?");
sql.append(" AND p.DocStatus IN ('CO','CL','RE','VO') AND p.PayAmt<>0");
sql.append(" AND p.C_BankAccount_ID=?");
sql.append(" AND NOT EXISTS (SELECT * FROM C_BankStatementLine l WHERE p.C_Payment_ID=l.C_Payment_ID AND l.StmtAmt <> 0)");
@ -276,13 +276,13 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
if(((Boolean) miniTable.getValueAt(i, 0)).booleanValue())
{
Timestamp trxDate = (Timestamp) miniTable.getValueAt(i, 1); // 1-DateTrx
KeyNamePair pp = (KeyNamePair) miniTable.getValueAt(i, 2); // 2-X_DepositBatch_ID
int X_DepositBatch_ID = pp.getKey();
KeyNamePair pp = (KeyNamePair) miniTable.getValueAt(i, 2); // 2-C_DepositBatch_ID
int C_DepositBatch_ID = pp.getKey();
pp = (KeyNamePair) miniTable.getValueAt(i, 5); // 5- C_BankAccount_ID
int C_BankAccount_ID = pp.getKey();
if (log.isLoggable(Level.FINE)) log.fine("Deposit Batch Date=" + trxDate + ", Batch=" + X_DepositBatch_ID
if (log.isLoggable(Level.FINE)) log.fine("Deposit Batch Date=" + trxDate + ", Batch=" + C_DepositBatch_ID
+" , Bank Account" + C_BankAccount_ID);
PreparedStatement pstmt = null;
@ -291,7 +291,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
{
pstmt = DB.prepareStatement(sql.toString(), null);
pstmt.setTimestamp(1, ts);
pstmt.setInt(2, X_DepositBatch_ID);
pstmt.setInt(2, C_DepositBatch_ID);
pstmt.setInt(3, C_BankAccount_ID);
rs = pstmt.executeQuery();
while(rs.next())
@ -330,7 +330,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm
Vector<String> columnNames = new Vector<String>(6);
columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
columnNames.add(Msg.translate(Env.getCtx(), "Date"));
columnNames.add(Msg.getElement(Env.getCtx(), "X_DepositBatch_ID"));
columnNames.add(Msg.getElement(Env.getCtx(), "C_DepositBatch_ID"));
columnNames.add(Msg.translate(Env.getCtx(), "Amount"));
columnNames.add(Msg.translate(Env.getCtx(), "ConvertedAmount"));
columnNames.add(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));

View File

@ -47,7 +47,7 @@ public abstract class CreateFromDepositBatch extends CreateFromBatch
public boolean dynInit() throws Exception
{
log.config("");
setTitle(Msg.getElement(Env.getCtx(), "X_DepositBatch_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
setTitle(Msg.getElement(Env.getCtx(), "C_DepositBatch_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
return true;
}
@ -68,7 +68,7 @@ public abstract class CreateFromDepositBatch extends CreateFromBatch
sql.append(getSQLWhere(BPartner, DocumentNo, DateFrom, DateTo, AmtFrom, AmtTo, DocType, TenderType, AuthCode));
sql.append(" AND p.IsReceipt = 'Y'");
sql.append(" AND (py.X_DepositBatch_ID = 0 OR py.X_DepositBatch_ID IS NULL)");
sql.append(" AND (py.C_DepositBatch_ID = 0 OR py.C_DepositBatch_ID IS NULL)");
sql.append(" ORDER BY p.DateTrx");
@ -123,8 +123,8 @@ public abstract class CreateFromDepositBatch extends CreateFromBatch
public boolean save(IMiniTable miniTable, String trxName)
{
// fixed values
int X_DepositBatch_ID = ((Integer) getGridTab().getValue("X_DepositBatch_ID")).intValue();
MDepositBatch db = new MDepositBatch(Env.getCtx(), X_DepositBatch_ID, null);
int C_DepositBatch_ID = ((Integer) getGridTab().getValue("C_DepositBatch_ID")).intValue();
MDepositBatch db = new MDepositBatch(Env.getCtx(), C_DepositBatch_ID, null);
if (log.isLoggable(Level.CONFIG)) log.config(db.toString());
// Lines