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 to 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, a "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, cannot 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 classRepresents 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 TypeMethodDescriptionvoidallowExcess(Account account, Money excess) Allow excess in an account participating in this transaction.static String[]static voidColumn definitions.static JournalVouchercreateFrom(UnpostedJournal unpostedJournal) Create an instance of theJournalVoucherfrom the givenUnpostedJournal.final voidCredit a local currency account.final voidcredit(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) Credit a local currency account.final voidcredit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) Credit a foreign currency account.final voidcredit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Credit a foreign currency account.final voidCredit a foreign currency account.final voidcredit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) Credit a foreign currency account.final voidCredit a local currency account.final voidCredit a local currency account.final voidcredit(Account account, BigDecimal amount, int entrySerial, String type, String particulars) Credit a local currency account.final voidcredit(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) Credit a local currency account.final voidcredit(Account account, BigDecimal amount, String type, String particulars) Credit a local currency account.final voidCredit a local currency account.final voidcredit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) Credit a foreign currency account.final voidcredit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Credit a foreign currency account.final voidcredit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) Credit a foreign currency account.final voidcredit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars, Date valueDate) Credit a foreign currency account.final voidDebit a local currency account.final voiddebit(Account account, Money amount, int entrySerial, String type, String particulars, Date valueDate) Debit a local currency account.final voiddebit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars) Debit a foreign currency account.final voiddebit(Account account, Money amount, Money localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Debit a foreign currency account.final voidDebit a foreign currency account.final voiddebit(Account account, Money amount, Money localCurrencyAmount, String type, String particulars, Date valueDate) Debit a foreign currency account.final voidDebit a local currency account.final voidDebit a local currency account.final voiddebit(Account account, BigDecimal amount, int entrySerial, String type, String particulars) Debit a local currency account.final voiddebit(Account account, BigDecimal amount, int entrySerial, String type, String particulars, Date valueDate) Debit a local currency account.final voiddebit(Account account, BigDecimal amount, String type, String particulars) Debit a local currency account.final voidDebit a local currency account.final voiddebit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars) Debit a foreign currency account.final voiddebit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, int entrySerial, String type, String particulars, Date valueDate) Debit a foreign currency account.final voiddebit(Account account, BigDecimal amount, BigDecimal localCurrencyAmount, String type, String particulars) Debit a foreign currency account.final voiddebit(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.intGet 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.intgetNo()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 StringGet 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.voidIgnore a foreign system so that this JV will not be sent to that system.voidignoreForeignSystem(Id ffsId) Ignore a foreign system so that this JV will not be sent to that system.static voidvoidpredateTransactions(TransactionManager transactionManager, Date date, String remarks) Change the date of the associated transactions.static String[]Save this JV as an unposted journal.voidSet the date of this JV.voidsetForeignReference(String foreignReference) Set the foreign reference of this JV (to be used by the foreign system).voidsetLedgerTran(DecimalNumber ledgerTran) Set the original transaction Id of this voucher for which ledger entries are created.voidsetLedgerTran(Object value) Set the original transaction Id of this voucher for which ledger entries are created.voidsetNo(int no) Set the serial number of this JV.voidsetOrigin(ForeignFinancialSystem foreignSystem) Set the origin of this JV.voidSet the origin of this JV.voidsetOrigin(BigDecimal idValue) Set the origin of this JV.voidSet the owner of this JV.voidsetOwner(StoredObject owner) Set the owner of this JV.voidsetOwner(BigDecimal idValue) Set the owner of this JV.voidsetSystemEntity(Id systemEntityId) Set the system entity of this JV.voidsetSystemEntity(SystemEntity systemEntity) Set the system entity of this JV.voidsetSystemEntity(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.voidvalidate()The system invokes this method internally whenever the object gets saved to the DB (that means, while doing transactions).voidThe system will invoke this whenever the object is saved to the DB.voidThis 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, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getContemporaryOf, 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, listDeletedIds, 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, loadAttributesFrom, 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, 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, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.storedobject.core.HasReference
getAmend, getTagSuffix, serialTagMethods 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:
setSystemEntityin 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:
getSystemEntityIdin interfaceHasReference- Specified by:
getSystemEntityIdin interfaceOfEntity- Returns:
- System entity Id.
-
getSystemEntity
Get the system entity of this JV.- Specified by:
getSystemEntityin interfaceHasReference- Specified by:
getSystemEntityin 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:
getNoin interfaceHasReference- Returns:
- Serial number.
-
getTagPrefix
Description copied from interface:HasReferenceGet the prefix of the tag to be used for generating the reference.Warning: This should be a fixed string value.
- Specified by:
getTagPrefixin interfaceHasReference- Returns:
- A fixed tag value to be used as the prefix.
-
getReference
Get the reference of this JV.- Specified by:
getReferencein 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 theDecimalNumberthat 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
DecimalNumberthat 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:StoredObjectThe system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting 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:
validateDatain classStoredObject- Parameters:
tm- Current transaction manager.- Throws:
Exception- If data is invalid.
-
validate
Description copied from class:StoredObjectThe system invokes this method internally 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/undeleting 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 the 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-methods 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:
validatein classStoredObject- Throws:
Exception- By raising an exception from this method, the current transaction can be abandoned.
-
validateUpdate
Description copied from class:StoredObjectThis 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:
validateUpdatein 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot 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. (Cannot be empty ornull).valueDate- Value-date.- Throws:
Exception- Any exception.
-
getDate
Get the date of this JV.- Specified by:
getDatein 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 (
nullwill 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 during implementation.
- Parameters:
transactionManager- Transaction manager.date- New date.- Throws:
Exception- if changed can't be carried out.
-
toDisplay
Description copied from class:StoredObjectDisplay representation of the instance used for human-friendly display.- Specified by:
toDisplayin interfaceDisplayable- Overrides:
toDisplayin classStoredObject- Returns:
- Display representation of the instance.
-
toString
Description copied from class:StoredObjectString representation of the instance. Mostly used for logging purposes.- Overrides:
toStringin classStoredObject- Returns:
- String representation of the instance.
-
saveAsUnposted
Save this JV as an unposted journal.- Parameters:
tm- Transaction manager.- Returns:
- Instance of the
UnpostedJournalcreated. - Throws:
Exception- If any error occurs.
-
createFrom
Create an instance of theJournalVoucherfrom the givenUnpostedJournal.- Parameters:
unpostedJournal- Unposted journal.- Returns:
- JV created.
- Throws:
Exception- If any error occurs.
-