Class JournalVoucher
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,HasReference
,OfEntity
Represents a Journal Voucher (JV). All financial transactions require a JV and this is the only way to create
financial ledger entries (referred as "entries" in this documentation) in the system.
A JV is owned by an instanceof a StoredObject
and that is the one creating
the entries. For example, an "Cash Sales Invoice" object may be creating a "Sales JV" by debiting the "cash
account" with the "invoice amount", crediting the "sales account" with the "items total" and crediting the
"tax account" with the "tax part" of the invoice.
JV entries, once created can not be changed. The only way to change any financial transaction is to pass reversal entries via some reversal JVs. So, a "reversal JV" system needs to be designed separately for such cases.
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Represents a ledger entry of the JV.Nested classes/interfaces inherited from interface com.storedobject.core.HasReference
HasReference.Amend<T extends StoredObject>
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
allowExcess
(Account account, Money excess) Allow excess in an account participating in this transaction.static String[]
static void
Column definitions.static JournalVoucher
createFrom
(UnpostedJournal unpostedJournal) Create an instance of theJournalVoucher
from the givenUnpostedJournal
.final void
Credit a local currency account.final void
credit
(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) Credit a local currency account.final void
credit
(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) Credit a foreign currency account.final void
credit
(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Credit a foreign currency account.final void
Credit a foreign currency account.final void
credit
(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) Credit a foreign currency account.final void
Credit a local currency account.final void
Credit a local currency account.final void
credit
(Account account, BigDecimal amount, int entrySerial, String type, String particulars) Credit a local currency account.final void
credit
(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) Credit a local currency account.final void
credit
(Account account, BigDecimal amount, String type, String particulars) Credit a local currency account.final void
Credit a local currency account.final void
credit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) Credit a foreign currency account.final void
credit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Credit a foreign currency account.final void
credit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) Credit a foreign currency account.final void
credit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars, Date valueDate) Credit a foreign currency account.final void
Debit a local currency account.final void
debit
(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) Debit a local currency account.final void
debit
(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) Debit a foreign currency account.final void
debit
(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Debit a foreign currency account.final void
Debit a foreign currency account.final void
debit
(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) Debit a foreign currency account.final void
Debit a local currency account.final void
Debit a local currency account.final void
debit
(Account account, BigDecimal amount, int entrySerial, String type, String particulars) Debit a local currency account.final void
debit
(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) Debit a local currency account.final void
debit
(Account account, BigDecimal amount, String type, String particulars) Debit a local currency account.final void
Debit a local currency account.final void
debit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) Debit a foreign currency account.final void
debit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Debit a foreign currency account.final void
debit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) Debit a foreign currency account.final void
debit
(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars, Date valueDate) Debit a foreign currency account.entries()
Get the entries of this JV.getDate()
Get the date of this JV.getEntry
(int index) Get the entry at a specific index.int
Get the entry count of this JV.Get the foreign reference of this JV (to be used by the foreign system).Get the owner who generated this JV.Get the original transaction Id of this voucher for which ledger entries are created.int
getNo()
Get the serial number of this JV.Get the offset amount of this JV.Get the origin of this JV.Get the origin of this JV.Get the origin Id of this JV.getOwner()
Get the owner.Get the owner Id.final String
Get the reference of this JV.Get the system entity of this JV.Get the system entity Id of this JV.Get the prefix of the tag to be used for generating the reference.Get the list of all vouchers in this transaction.void
Ignore a foreign system so that this JV will not be sent to that system.void
ignoreForeignSystem
(Id ffsId) Ignore a foreign system so that this JV will not be sent to that system.static void
void
predateTransactions
(TransactionManager transactionManager, Date date, String remarks) Change the date of the associated transactions.static String[]
Save this JV as an unposted journal.void
Set the date of this JV.void
setForeignReference
(String foreignReference) Set the foreign reference of this JV (to be used by the foreign system).void
setLedgerTran
(DecimalNumber ledgerTran) Set the original transaction Id of this voucher for which ledger entries are created.void
setLedgerTran
(Object value) Set the original transaction Id of this voucher for which ledger entries are created.void
setNo
(int no) Set the serial number of this JV.void
setOrigin
(ForeignFinancialSystem foreignSystem) Set the origin of this JV.void
Set the origin of this JV.void
setOrigin
(BigDecimal idValue) Set the origin of this JV.void
Set the owner of this JV.void
setOwner
(StoredObject owner) Set the owner of this JV.void
setOwner
(BigDecimal idValue) Set the owner of this JV.void
setSystemEntity
(Id systemEntityId) Set the system entity of this JV.void
setSystemEntity
(SystemEntity systemEntity) Set the system entity of this JV.void
setSystemEntity
(BigDecimal idValue) Set the system entity of this JV.Display representation of the instance used for human-friendly display.toString()
String representation of the instance.void
validate()
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions).void
This will be invoked by the system whenever the object is saved to the DB.void
This method will be invoked whenever an existing instance is updated in the database.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, transacting, undelete, undelete, undeleted, updated, user, userId, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.HasReference
getAmend, getTagSuffix, serialTag
Methods inherited from interface com.storedobject.core.OfEntity
check, findSystemEntityId
-
Constructor Details
-
JournalVoucher
public JournalVoucher()Constructor. -
JournalVoucher
-
-
Method Details
-
columns
Column definitions.- Parameters:
columns
- Column holder. Column definitions to be added to this.
-
indices
-
protectedColumns
-
browseColumns
-
setSystemEntity
Set the system entity of this JV.- Specified by:
setSystemEntity
in interfaceOfEntity
- Parameters:
systemEntityId
- System entity Id.
-
setSystemEntity
Set the system entity of this JV.- Parameters:
idValue
- Id of the system entity.
-
setSystemEntity
Set the system entity of this JV.- Parameters:
systemEntity
- System entity.
-
getSystemEntityId
Get the system entity Id of this JV.- Specified by:
getSystemEntityId
in interfaceHasReference
- Specified by:
getSystemEntityId
in interfaceOfEntity
- Returns:
- System entity Id.
-
getSystemEntity
Get the system entity of this JV.- Specified by:
getSystemEntity
in interfaceHasReference
- Specified by:
getSystemEntity
in interfaceOfEntity
- Returns:
- System entity.
-
setNo
public void setNo(int no) Set the serial number of this JV.- Parameters:
no
- Serial number.
-
getNo
Get the serial number of this JV.- Specified by:
getNo
in interfaceHasReference
- Returns:
- Serial number.
-
getTagPrefix
Description copied from interface:HasReference
Get the prefix of the tag to be used for generating the reference.Warning: This should be a fixed string value.
- Specified by:
getTagPrefix
in interfaceHasReference
- Returns:
- A fixed tag value to be used as the prefix.
-
getReference
Get the reference of this JV.- Specified by:
getReference
in interfaceHasReference
- Returns:
- Reference.
-
getGeneratedBy
Get the owner who generated this JV.- Returns:
- Name of the owner of this JV.
-
getOriginatedFrom
-
setOwner
-
setOwner
-
setOwner
-
getOwnerId
Get the owner Id.- Returns:
- Id.
-
getOwner
-
setLedgerTran
Set the original transaction Id of this voucher for which ledger entries are created.Note: For internal use only.
- Parameters:
ledgerTran
- An instance of theDecimalNumber
that embeds the transaction Id.
-
setLedgerTran
Set the original transaction Id of this voucher for which ledger entries are created.Note: For internal use only.
- Parameters:
value
- Value that embeds the transaction Id.
-
getLedgerTran
Get the original transaction Id of this voucher for which ledger entries are created.- Returns:
- An instance of the
DecimalNumber
that embeds the transaction Id.
-
setOrigin
Set the origin of this JV.- Parameters:
originId
- Id of the origin.
-
setOrigin
Set the origin of this JV.- Parameters:
idValue
- Id of the origin.
-
setOrigin
Set the origin of this JV.- Parameters:
foreignSystem
- Origin.
-
getOriginId
Get the origin Id of this JV.- Returns:
- Origin Id.
-
getOrigin
-
ignoreForeignSystem
Ignore a foreign system so that this JV will not be sent to that system.- Parameters:
ffs
- Foreign system to be ignored.
-
ignoreForeignSystem
Ignore a foreign system so that this JV will not be sent to that system.- Parameters:
ffsId
- Id of the foreign system to be ignored.
-
setForeignReference
Set the foreign reference of this JV (to be used by the foreign system).- Parameters:
foreignReference
- Reference.
-
getForeignReference
Get the foreign reference of this JV (to be used by the foreign system).- Returns:
- Reference.
-
getOffsetAmount
Get the offset amount of this JV. The offset amount is the amount in local currency that is required to balance this JV.- Returns:
- Offset amount.
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
validate
Description copied from class:StoredObject
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions). It will be invoked in all cases (while creating new objects and updating/deleting/un-deleting existing objects). If this method raises any exceptions, the process of saving to the DB will be abandoned.
This method is not usually used for validating data (For that purpose,
StoredObject.validateData(TransactionManager)
is recommended). It is mainly used for validating state of the object. Methods such asStoredObject.created()
,StoredObject.updated()
,StoredObject.deleted()
,StoredObject.undeleted()
etc. are used to check the specific states but overridden methods may check for other "application-specific"/"business-specific" states.This method is invoked only after one of the other operation-specific validate method is invoked depending on the save operation -
StoredObject.validateInsert()
,StoredObject.validateUpdate()
,StoredObject.validateDelete()
,StoredObject.validateUndelete()
.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
- Overrides:
validate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateUpdate
Description copied from class:StoredObject
This method will be invoked whenever an existing instance is updated in the database. So, it will be called within an active transaction. Child classes can override this method to do validation when an existing instance is updated in the database.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
Also, see
StoredObject.validate()
.- Overrides:
validateUpdate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
debit
public final void debit(Account account, Money amount, int entrySerial, String type, String particulars) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, int entrySerial, String type, String particulars) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, int entrySerial, String type, String particulars) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, int entrySerial, String type, String particulars) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, String type, String particulars) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, String type, String particulars) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, String type, String particulars) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, String type, String particulars) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.entrySerial
- Entry serial.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, String type, String particulars, Date valueDate) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, String type, String particulars, Date valueDate) throws Exception Debit a local currency account.- Parameters:
account
- Account to be debited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
debit
public final void debit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars, Date valueDate) throws Exception Debit a foreign currency account.- Parameters:
account
- Account to be debited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, String type, String particulars, Date valueDate) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, String type, String particulars, Date valueDate) throws Exception Credit a local currency account.- Parameters:
account
- Account to be credited.amount
- Amount.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
credit
public final void credit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars, Date valueDate) throws Exception Credit a foreign currency account.- Parameters:
account
- Account to be credited.amount
- Amount in account currency.localCurrencyAmount
- Amount in local currency.type
- Transaction type (As defined inTransactionType
).particulars
- Particulars (narration) of the transaction entry. (Can not be empty ornull
).valueDate
- Value-date.- Throws:
Exception
- Any exception.
-
getDate
Get the date of this JV.- Specified by:
getDate
in interfaceHasReference
- Returns:
- Date.
-
setDate
Set the date of this JV. (Should not call this method for a JV that is already saved).- Parameters:
date
- Date to set.
-
entries
Get the entries of this JV. (This will be available only for JVs that are already saved to the DB).- Returns:
- Stream of entries.
-
getEntryCount
public int getEntryCount()Get the entry count of this JV. (This will be available only for JVs that are already saved to the DB).- Returns:
- Entry count.
-
getEntry
Get the entry at a specific index. (This will be available only for JVs that are already saved to the DB).- Parameters:
index
- Index of the entry.- Returns:
- Entry at the index (
null
will be returned for out-of-range index values).
-
getVouchers
Get the list of all vouchers in this transaction. The first entry in the list will be this voucher itself.- Returns:
- List of journal vouchers.
-
allowExcess
-
predateTransactions
public void predateTransactions(TransactionManager transactionManager, Date date, String remarks) throws Exception Change the date of the associated transactions.Note: This method is useful only for data pick up of old transaction during implementation.
- Parameters:
transactionManager
- Transaction manager.date
- New date.- Throws:
Exception
- if changed can't be carried out.
-
toDisplay
Description copied from class:StoredObject
Display representation of the instance used for human-friendly display.- Specified by:
toDisplay
in interfaceDisplayable
- Overrides:
toDisplay
in classStoredObject
- Returns:
- Display representation of the instance.
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
saveAsUnposted
Save this JV as an unposted journal.- Parameters:
tm
- Transaction manager.- Returns:
- Instance of the
UnpostedJournal
created. - Throws:
Exception
- If any error occurs.
-
createFrom
Create an instance of theJournalVoucher
from the givenUnpostedJournal
.- Parameters:
unpostedJournal
- Unposted journal.- Returns:
- JV created.
- Throws:
Exception
- If any error occurs.
-