Definition at line 59 of file balancesheet-gw.h.
OSB_LIB::ObjectStatus OSB_DB::BalanceSheetGw::checkObjVs | ( | const Session & | session, | |
const OSB_LIB::BalanceSheet & | bs | |||
) | [private] |
Verify the object version of a balance sheet.
session | Database session to use. | |
bs | Balance sheet to verify: its object version is not modified. |
bool OSB_DB::BalanceSheetGw::close | ( | const Session & | session, | |
const OSB_LIB::BsPage & | page | |||
) | [private] |
Close a balance sheet.
The function updates BS_PAGE.CLOSED and, if not yet set, BS_PAGE.END_DATE.
session | Database session. | |
page | Balance page to close. |
OSB_LIB::BsPage::PageClosed |
long OSB_DB::BalanceSheetGw::fetchAdvanceCharges | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Get the advanced charges from database.
This function will retrieve all advanced charges applicable to a contract within the time period provided.
session | Database session. | |
page | Balance page for which to retrieve the advance charges. |
long OSB_DB::BalanceSheetGw::fetchOnetimeCharges | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Get the one time charges from database.
This function reads all one time charges of a balance page.
session | Database session. | |
page | Balance page for which to retrieve the onetime charges. |
OsbException | in case of a database error. |
bool OSB_DB::BalanceSheetGw::incrAdvTotal | ( | const Session & | session, | |
const OSB_LIB::BsPage::Oid & | pageId, | |||
const OSB_LIB::BsTotal::SubTotal & | st | |||
) | [private] |
Update the advance charge of a subtotal.
Wraps to incrSubTotal(), see there.
bool OSB_DB::BalanceSheetGw::incrOtcTotal | ( | const Session & | session, | |
const OSB_LIB::BsPage::Oid & | pageId, | |||
const OSB_LIB::BsTotal::SubTotal & | st | |||
) | [private] |
Update the onetime charge of a subtotal.
Wraps to incrSubTotal(), see there.
bool OSB_DB::BalanceSheetGw::incrSubTotal | ( | const Session & | session, | |
const std::string & | column, | |||
const OSB_LIB::BsPage::Oid & | pageId, | |||
const OSB_LIB::Currency::Oid & | cc, | |||
const OSB_LIB::Decimal & | delta | |||
) | [private] |
Update one amount in a subtotal.
For pageId and cc the function tries to add delta to BS_PAGE_TOTAL.column. If this fails a new entry is created using insert and the update is tried again. If this 2nd try fails, the function return false.
session | Database session to use. | |
column | Name of column to update. | |
pageId | Balance page to update. | |
cc | Currency code to update. | |
delta | Amount to add. |
bool OSB_DB::BalanceSheetGw::incrUsgTotal | ( | const Session & | session, | |
const OSB_LIB::BsPage::Oid & | pageId, | |||
const OSB_LIB::BsTotal::SubTotal & | st | |||
) | [private] |
Update the usage charge of a subtotal.
Wraps to incrSubTotal(), see there.
bool OSB_DB::BalanceSheetGw::insert | ( | const Session & | session, | |
const OSB_LIB::BsPage::Oid & | pageId, | |||
const OSB_LIB::Currency::Oid & | cc | |||
) | [private] |
Create an entry in BS_PAGE_TOTAL.
bool OSB_DB::BalanceSheetGw::insert | ( | const Session & | session, | |
OSB_LIB::OnetimeCharge & | otc | |||
) | [private] |
Insert a onetime charge.
session | Database session to use. | |
otc | Onetime charge to insert. |
bool OSB_DB::BalanceSheetGw::insert | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Create a new balance page.
session | Database session. | |
page | Balance page to insert (see below). |
OsbException | in case of a database error. |
bool OSB_DB::BalanceSheetGw::insert | ( | const Session & | session, | |
OSB_LIB::BalanceSheet & | bs | |||
) | [private] |
Create a balance sheet in the database.
session | Database session to use. | |
bs | Balance sheet to insert, on successful return its object version is 1. |
OSB_LIB::ObjectStatus OSB_DB::BalanceSheetGw::lock | ( | const Session & | session, | |
OSB_LIB::BalanceSheet & | bs, | |||
bool | noWait | |||
) | [private] |
Lock a balance sheet entry in database.
This function implements OSB_LIB::BalanceSheet::lock as specified there. It locks the balance sheet by its contract id.
session | Database session to use. | |
bs | Balance sheet to lock. | |
noWait | Set to true if the function should not wait for other process to unlock the balance sheet. If waiting is required, set to false. |
OSB_LIB::BalanceSheet::LockFailed | ||
OSB_LIB::BalanceSheet::Deadlock | ||
OsbException | in case of a database error |
long OSB_DB::BalanceSheetGw::nextVal | ( | const Session & | session, | |
const std::string & | seqName | |||
) | [private] |
Get the next number of a database sequence.
bool OSB_DB::BalanceSheetGw::read | ( | const Session & | session, | |
OSB_LIB::BalanceSheet & | bs | |||
) | [private] |
Read balance sheet data.
The function determines the data members of a balance page using the contract id as selection criteria. It does not read the individual pages, use readBsPages for this.
session | Database session to use. | |
bs | Balance sheet to read. |
BalanceSheet::NoBillcycle | if billcycle of the balance sheet has an illegal type. |
void OSB_DB::BalanceSheetGw::readBsPages | ( | const Session & | session, | |
OSB_LIB::BalanceSheet & | bs, | |||
bool | incClosed | |||
) | [private] |
Read the pages of a balance sheet.
session | Database session to use. | |
bs | Balance sheet to read for. | |
incClosed | Flag if closed pages should be read too. |
bool OSB_DB::BalanceSheetGw::readInfo | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Read basic balance page information.
The function used the object and the contract id of page to read data from BS_PAGE. If successful it calls readTotals to read the charge summary of the balance page.
session | Database session to use. | |
page | Balance page to read. |
OsbException | in case of a database error. |
bool OSB_DB::BalanceSheetGw::readRerate | ( | const Session & | session, | |
std::deque< OSB_LIB::Contract::Oid > & | dest | |||
) |
Read balance sheets whose pages need to be re-rated.
Only opened pages with status bpRerate are read into the balance sheets.
session | Database session to use. | |
dest | List to store the result. |
void OSB_DB::BalanceSheetGw::readTotals | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Get the charge totals of a balance page.
bool OSB_DB::BalanceSheetGw::remove | ( | const Session & | session, | |
OSB_LIB::OnetimeCharge & | otc | |||
) | [private] |
Delete a onetime charge.
session | Database session to use. | |
otc | Onetime charge to delete. |
bool OSB_DB::BalanceSheetGw::remove | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Delete a balance page from database.
session | Database session to use. | |
page | Balance page to delete, on successful return its object id is unset. |
OsbException |
|
bool OSB_DB::BalanceSheetGw::setStatus | ( | const Session & | session, | |
OSB_LIB::BsPage & | bs, | |||
OSB_LIB::BsPage::Status | status | |||
) | [private] |
Change status of balance page.
OSB_LIB::DateTime OSB_DB::BalanceSheetGw::sysDate | ( | const Session & | session | ) | [private] |
Get SYSDATE of the database.
bool OSB_DB::BalanceSheetGw::updLastCharged | ( | const Session & | session, | |
OSB_LIB::BsPage & | page | |||
) | [private] |
Set the last charged timestamp of a balance page.
session | Database session to use. | |
page | Balance page to update. |
OsbException | in case of a database error. |
bool OSB_DB::BalanceSheetGw::updRecoveryId | ( | const Session & | session, | |
const OSB_LIB::BsPage::Oid & | pageId, | |||
long | recoveryId | |||
) | [private] |
Set the recovery id.
session | Database session to use. | |
pageId | Balance page to update. | |
recoveryId | New recovery id of the page, 0 maps to NULL in the database. |
friend class OSB_LIB::BalanceSheet [friend] |
Definition at line 63 of file balancesheet-gw.h.
friend class OSB_LIB::BsPage [friend] |
Definition at line 62 of file balancesheet-gw.h.