/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new PaymentHistory(this); } /**
bSuccess = this.postDistTrx(recordOwner, recTransactionType, recSelectApTrx, fldVendorID, recTrxStatus.getField(TrxStatus.TRX_DESC_ID), fldTrxID, -dDistributedAmount, -dDistributedAmountUSD); int iDistGroupID = (int)recordOwner.getRecord(AcctDetailDist.ACCT_DETAIL_DIST_FILE).getField(AcctDetailDist.ACCT_DETAIL_DIST_GROUP_ID).getValue(); this.addNew(); int iOldKeyArea = this.getDefaultOrder(); this.setKeyArea(PaymentHistory.AP_TRX_ID_KEY); this.getField(PaymentHistory.AP_TRX_ID).moveFieldToThis(recApTrx.getField(ApTrx.ID)); this.getField(PaymentHistory.TRX_DATE).setToLimit(DBConstants.START_SELECT_KEY); this.getField(PaymentHistory.ID).setData(null); if (this.seek(">=")) if (this.getField(PaymentHistory.AP_TRX_ID).equals(recApTrx.getField(ApTrx.ID))) fldAccountID = this.getTrxAccountID(PostingType.DIST_POST); this.setKeyArea(iOldKeyArea); if ((fldAccountID == null) || (fldAccountID.isNull()))
this.addNew(); this.getField(PaymentHistory.AP_TRX_ID).moveFieldToThis(recApTrx.getField(ApTrx.ID)); this.getField(PaymentHistory.TRX_STATUS_ID).setValue(iTrxStatusID); this.getField(PaymentHistory.TRX_DATE).setValue(DateTimeField.todaysDate()); this.getField(PaymentHistory.AMOUNT_APPLIED).setValue(dAmount); this.getField(PaymentHistory.AMOUNT_LOCAL).setValue(dAmountUSD); this.getField(PaymentHistory.CURR_LOSS_LOCAL).setValue(dCurrLoss); this.getField(PaymentHistory.LINKED_TRX_ID).moveFieldToThis(fldTrxID); if (fldTrxDescID != null) this.getField(PaymentHistory.LINKED_TRX_DESC_ID).moveFieldToThis(fldTrxDescID); this.getField(PaymentHistory.TRX_ENTRY).setValue(DateTimeField.currentTime()); this.add(); Object bookmark = this.getLastModified(DBConstants.DATA_SOURCE_HANDLE); this.setHandle(bookmark, DBConstants.DATA_SOURCE_HANDLE); bSuccess = this.onPostTrxDist(fldAccountID, dAmountUSD, strPostType, recAcctDetail, recAcctDetailDist, recPeriod); if (!bSuccess) bSuccess = this.onPostTrxDist(fldCurrAccountID, dCurrLoss, strDiffPostingType, recAcctDetail, recAcctDetailDist, recPeriod); if (!bSuccess)
/** * Post the distribution detail. * @param recBaseTrx The base transaction to post. * @param recTransactionType The transaction type for the DIST posting. * @return true If successful. */ public boolean postDistTrx(BaseTrx recBaseTrx, TransactionType recTransactionType) { PaymentHistory recPaymentHistory = (PaymentHistory)this.getRecord(PaymentHistory.PAYMENT_HISTORY_FILE); ApTrx recApTrx = (ApTrx)this.getDistRecord(); Record recPaymentRequest = this.getDetailRecord(); BaseField fldVendorID = recPaymentRequest.getField(PaymentRequest.VENDOR_ID); BankTrx recBankTrx = (BankTrx)this.getRecord(BankTrx.BANK_TRX_FILE); double dAmountUSD = -recBankTrx.getField(BankTrx.AMOUNT_LOCAL).getValue(); // Must be positive. BaseField fldTrxID = recBankTrx.getField(BankTrx.ID); BaseField fldTrxDescID = ((TrxStatusField)recBankTrx.getField(BankTrx.TRX_STATUS_ID)).getReference().getField(TrxStatus.TRX_DESC_ID); double dAmount = recPaymentRequest.getField(PaymentRequest.AMOUNT).getValue(); return recPaymentHistory.postDistTrx(this, recTransactionType, recApTrx, fldVendorID, fldTrxDescID, fldTrxID, dAmount, dAmountUSD); }
/** * Distribute this prepayment to the selected amounts for this vendor. */ public boolean distribute() { ApTrx recApTrx = (ApTrx)this.getMainRecord(); PaymentHistory recPaymentHistory = (PaymentHistory)this.getRecord(PaymentHistory.PAYMENT_HISTORY_FILE); return recPaymentHistory.distribute(this, recApTrx, m_recSelectApTrx); }
this.addPaymentHistory(recordOwner, recApTrx, fldAccountID, PostingType.DIST_POST, (int)recTransactionType.getField(TransactionType.SOURCE_TRX_STATUS_ID).getValue(), fldTrxDescID, fldTrxID, dAmountSelected, dAmountSelectedUSD, fldCurrAccountID, PostingType.DIFFERENCE_POST, dCurrencyLoss); this.addPaymentHistory(recordOwner, recApTrx, fldAccountID, PostingType.DIST_POST, (int)recTransactionType.getField(TransactionType.SOURCE_TRX_STATUS_ID).getValue(), fldTrxDescID, fldTrxID, dCheckBalance, dCheckBalanceUSD, null, null, 0);
/** * OpenHeaderRecord Method. */ public Record openHeaderRecord() { return new PaymentHistory(this); } /**
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new PaymentHistory(this); } /**
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new PaymentHistory(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new PaymentHistory(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new PaymentHistory(this); new TrxDesc(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new Vendor(this); new PaymentHistory(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new Tour(this); new PaymentHistory(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new BankTrx(this); new PaymentHistory(this); new ApControl(this); new TrxDesc(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new TrxStatus(this); new TransactionType(this); new PaymentHistory(this); new AcctDetail(this); new AcctDetailDist(this); new Period(this); new ApControl(this); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new ApTrx(this); new PaymentHistory(this); new BankTrx(this); new TrxStatus(this); new TrxGroup(this); new ApControl(this); new AcctDetail(this); new AcctDetailDist(this); new Period(this); } /**