* @param compId Description of the Parameter
* @return Description of the Return Value
*/
public Object buttonGetReportOld(boolean isJFreeReport,
String rapName, int compId) {
JdbcTable db = getJdbcTable(compId);
if (isJFreeReport) {
if (db==null)return null;
db.GetFirstRecord();
return new TransactionTable(db.resultSet);
}
if (db==null)return "";
if (!db.GetFirstRecord()) {
return "";
}
//Print the Report header
if (intField1.getText().length() != 0 && intField2.getText().length() != 0 &&
intField2.getInteger().intValue() >= intField1.getInteger().intValue()) {
jTextArea.append(Translator.getTranslation("Start Transaction number") + " " + intField1.getText());
jTextArea.append(newline);
jTextArea.append(Translator.getTranslation("Stop Transaction number") + " " + intField2.getText());
jTextArea.append(newline);
}
if (((Integer) customerComboBox.getSelectedItemsKey()).intValue() != 0) {
jTextArea.append(Translator.getTranslation("Customer") + " " + customerComboBox.getSelectedItemsSecondaryKey());
jTextArea.append(newline);
}
AddReportHeaders();
boolean bIsNewAccount = true;
double fDebitTotal = 0;
double fCreditTotal = 0;
double fTotalSum=0;
Integer processingAccount;
Integer processingTransaction;
boolean bNewRecordExists;
do {
processingAccount = (Integer) db.getObject("Amount.Account", null);
processingTransaction = (Integer) db.getObject("Customer2.CustId", null);
initializeRow(fieldSize, 8);
jTextArea.append(renderIntegerField(
db.getObject("Customer2.CustId", null), 14));
jTextArea.append(renderField((String)
db.getObject("Customer2.CustName", null), 50));
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
initializeRow(fieldSize, 8);
String sLotsOfLines = new String("--------------------------------------------------------------------------");
addField(sLotsOfLines, fieldSize, 1,
-1, false);
addField(sLotsOfLines, fieldSize, 2,
-1, false);
addField(sLotsOfLines, fieldSize, 3,
-1, false);
addField(sLotsOfLines, fieldSize, 4,
-1, false);
addField(sLotsOfLines, fieldSize, 5,
-1, false);
addField(sLotsOfLines, fieldSize, 6,
-1, false);
addField(sLotsOfLines, fieldSize, 7,
-1, false);
addField(sLotsOfLines, fieldSize, 8,
-1, false);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
initializeRow(fieldSize, 8);
addField(Translator.getTranslation("Transaction"), fieldSize, 1,
-1, false);
addField(Translator.getTranslation("InvDate"), fieldSize, 2,
-1, false);
addField(Translator.getTranslation("Commentary"), fieldSize, 3,
-1, false);
addField(Translator.getTranslation("Commentary"), fieldSize, 4,
-1, false);
addField(Translator.getTranslation("Account"), fieldSize, 5,
-1, false);
addField(Translator.getTranslation("Account name"), fieldSize, 6,
-1, false);
addField(Translator.getTranslation("Debit"), fieldSize, 7,
-1, true);
addField(Translator.getTranslation("Credit"), fieldSize, 8,
-1, true);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
IntHolder iType = new IntHolder();
do {
initializeRow(fieldSize, 8);
if (SetupInfo.getBoolProperty(SetupInfo.SHOW_PERIOD_ID))
addField(db.getObject("PeriodId", iType), fieldSize, 1, iType.iValue, false);
else
addField(db.getObject("Amount.Act_id", iType), fieldSize, 1, iType.iValue, false);
addField(
db.getObject("InvDate", iType), fieldSize, 2, iType.iValue, false);
addField((String)
db.getObject("Activity2.Notes", iType), fieldSize, 3, iType.iValue, false);
addField((String)
db.getObject("Amount.Notes", iType), fieldSize, 4, iType.iValue, false);
addField(
db.getObject("Amount.Account", iType), fieldSize, 5, iType.iValue, false);
addField((String)
db.getObject("AccDesc", iType), fieldSize, 6, iType.iValue, false);
if (((Integer) db.getObject("IsDebit", iType)).intValue() == 1) {
addField(db.getObject("Amount.Amount", iType),
fieldSize, 7, iType.iValue, false);
fDebitTotal += ((Double)
db.getObject("Amount.Amount", null)).doubleValue();
} else {
addField(db.getObject("Amount.Amount", iType),
fieldSize, 8, iType.iValue, false);
fCreditTotal += ((Double)
db.getObject("Amount.Amount", null)).doubleValue();
}
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
bNewRecordExists = db.GetNextRecord();
if(!bNewRecordExists || processingAccount.intValue()
!= ((Integer) db.getObject("Amount.Account", null)).intValue()
|| processingTransaction.intValue()
!= ((Integer) db.getObject("Customer2.CustId", null)).intValue()){
initializeRow(fieldSize, 8);
addField("-----------------------", fieldSize, 7, -1, false);
addField("-----------------------", fieldSize, 8, -1, false);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
initializeRow(fieldSize, 8);
addField(Translator.getTranslation("Balance"), fieldSize, 4, -1, false);
fTotalSum+=fDebitTotal-fCreditTotal;
addField(new Double(fDebitTotal-fCreditTotal), fieldSize, 6, Types.DOUBLE, false);
addField(new Double(fDebitTotal), fieldSize, 7, Types.DOUBLE, false);
addField(new Double(fCreditTotal), fieldSize, 8, Types.DOUBLE, false);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
processingAccount = (Integer) db.getObject("Amount.Account", null);
fCreditTotal=0;
fDebitTotal=0;
}
} while (bNewRecordExists && processingTransaction.intValue()
== ((Integer) db.getObject("Customer2.CustId", null)).intValue());
initializeRow(fieldSize, 8);
addField("-----------------------------------------", fieldSize, 4, -1, false);
addField("-----------------------", fieldSize, 5, -1, false);
addField("-----------------------------------------", fieldSize, 6, -1, false);
addField("-----------------------", fieldSize, 7, -1, false);
addField("-----------------------", fieldSize, 8, -1, false);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
initializeRow(fieldSize, 8);
addField(Translator.getTranslation("Total"), fieldSize, 4, -1, false);
addField(new Double(fTotalSum), fieldSize, 6, Types.DOUBLE, false);
jTextArea.append(sbRow.toString());
jTextArea.append(newline);
processingAccount = (Integer) db.getObject("Amount.Account", null);
fTotalSum=0;
jTextArea.append(newline);
jTextArea.append(newline);