Package com.storedobject.core
Class TaxRegion
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Name
com.storedobject.core.TaxRegion
- All Implemented Interfaces:
Displayable,HasName,StringFiller,HasId
Represents a tax region, which defines a set of tax rules and configurations for a specific region.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds a column with the specified name and data type to the given Columns instance.computeTax(StoredObject parent, InventoryItemType itemType, Quantity quantity, Money unitCost, Transaction transaction) Computes and save the applicable taxes for a given inventory item based on the provided parameters.computeTax(Date date, StoredObject parent, InventoryItemType itemType, Quantity quantity, Money unitCost, Transaction transaction) Computes and save the applicable taxes for a given inventory item based on the provided parameters.static TaxRegionRetrieves a TaxRegion instance based on the provided name.booleanRetrieves the active status of the TaxRegion.static TaxRegionRetrieves the default TaxRegion instance.static TaxRegionRetrieves a TaxRegion object for the given identifier.Retrieves the list of tax types associated with the current region.static inthints()Provides hint values for object instances in the tax region system.static ObjectIterator<TaxRegion> Retrieves a list of TaxRegion objects filtered by the specified name.voidsaved()This method is called when an object is saved.voidsetActive(boolean active) Sets the active status of the TaxRegion.Methods inherited from class com.storedobject.core.Name
getName, getUniqueCondition, indices, setName, toString, validateDataMethods 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, getActor, 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, 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, migrateLink, migrateLink, 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, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
TaxRegion
public TaxRegion()Default constructor for the TaxRegion class. Initializes a new instance of the TaxRegion object.
-
-
Method Details
-
columns
Adds a column with the specified name and data type to the given Columns instance.- Parameters:
columns- the Columns instance to which the column will be added
-
get
-
list
Retrieves a list of TaxRegion objects filtered by the specified name.- Parameters:
name- the name used to filter the TaxRegion objects- Returns:
- an ObjectIterator containing the filtered TaxRegion objects
-
hints
public static int hints()Provides hint values for object instances in the tax region system. The hints are a bitwise combination of predefined constants such asObjectHint.SMALLandObjectHint.SMALL_LIST.- Returns:
- A bitwise combination of integer constants indicating object size or list size hints.
-
saved
This method is called when an object is saved. It performs necessary post-save operations, including removing the object from the cache to ensure consistency with the storage.- Overrides:
savedin classStoredObject- Throws:
Exception- if an error occurs during the cache removal process
-
setActive
public void setActive(boolean active) Sets the active status of the TaxRegion.- Parameters:
active- a boolean value indicating whether the TaxRegion is active (true) or inactive (false)
-
getActive
-
getFor
Retrieves a TaxRegion object for the given identifier. If the object is not found in the cache, it is retrieved from persistent storage, cached, and then returned.- Parameters:
id- the unique identifier of the TaxRegion to retrieve- Returns:
- the TaxRegion object corresponding to the given ID, or null if it does not exist
-
getDefault
Retrieves the default TaxRegion instance. If the default instance has not been initialized, it fetches the first active TaxRegion ordered by ID and initializes it.- Returns:
- the default TaxRegion instance
-
getTaxTypes
Retrieves the list of tax types associated with the current region. If the list is not initialized, it will fetch and populate the tax types based on the region's identifier and filter by active status, ordering them by display order.- Returns:
- a list of TaxType objects representing the tax types for the region
-
computeTax
public List<Tax> computeTax(StoredObject parent, InventoryItemType itemType, Quantity quantity, Money unitCost, Transaction transaction) throws Exception Computes and save the applicable taxes for a given inventory item based on the provided parameters.- Parameters:
parent- The parent object representing the context for the tax computation.itemType- The type of inventory item for which taxes are to be computed.quantity- The quantity of the inventory item being taxed.unitCost- The cost per unit of the inventory item.transaction- Transaction- Returns:
- A list of taxes applicable to the specified inventory item and context.
- Throws:
Exception
-
computeTax
public List<Tax> computeTax(Date date, StoredObject parent, InventoryItemType itemType, Quantity quantity, Money unitCost, Transaction transaction) throws Exception Computes and save the applicable taxes for a given inventory item based on the provided parameters.- Parameters:
date- The date for which the tax computation is being performed.parent- The parent object representing the context for the tax computation.itemType- The type of inventory item for which taxes are to be computed.quantity- The quantity of the inventory item being taxed.unitCost- The cost per unit of the inventory item.transaction- Transaction- Returns:
- A list of taxes applicable to the specified inventory item and context.
- Throws:
Exception
-