Definition at line 71 of file contract.h.
typedef Id<Contract> OSB_LIB::Contract::Oid |
typedef Id<Associate> OSB_LIB::Contract::OwnerId |
Possible accounting types for a contract.
The accounting type indicates if a contract is with a customer, i.e., invoices for sales must be generated, or if it is with a supplier for which reconciliation statements for purchases are created.
atCustomer | Customer; create invoice for sales. |
atSupplier | Supplier; create reconciliation statements for purchases. |
atUnknown | Unknown accounting type. |
Definition at line 97 of file contract.h.
Contract::AccountingType OSB_LIB::Contract::accountingType | ( | ) | const [inline] |
bool OSB_LIB::Contract::addPersProduct | ( | OSB_DB::Session & | session, | |
PersProduct & | pp, | |||
bool | noWait | |||
) |
Add a personalized product to the contact.
Add a personalized product entry to the database. Also add it to the persproduct list. Pers. product id, contract id and status of the pers. product will be set and session will be committed if successful.
The action is not allowed when the contract is deactivated.
session | Database session. | |
pp | Pers product to be added. | |
noWait | Don't wait for database locks? |
OsbException | from lock(const OSB_DB::Session&, bool) const, see there. | |
OsbException | if the contract is deactivated. |
bool OSB_LIB::Contract::applyChange | ( | const OSB_DB::Session & | session, | |
const StatusChange & | change, | |||
OsbErrors & | errors, | |||
bool | noWait | |||
) | [private] |
Apply a change of the effective status to pers. products.
session | Database session to use. | |
change | Status change to process, it contains the old and new effective status. | |
errors | Gets errors and warnings. | |
noWait | Don't wait for database locks? Needed to lock the pers. products. |
The identifier of the billcycle.
Definition at line 626 of file contract.h.
References billcycleId_.
int OSB_LIB::Contract::buildPersParts | ( | ) |
Build pers parts for all personalized products.
The function calls the member function PersProdct::buildPersParts() for each subscribed product of the contract.
OsbException |
|
bool OSB_LIB::Contract::changeStatus | ( | const OSB_DB::Session & | session, | |
StatusChange & | change, | |||
OsbErrors & | errors, | |||
bool | noWait | |||
) | [private] |
Change the effective status of the contract.
session | Database session to use. | |
change | Copy of the status change to process, it contains the max. allowed effective status. | |
errors | Gets errors and warnings. | |
noWait | Don't wait for database locks? Needed to lock the pers. products. |
Called only by RequestHandler or Associate.
const DateTime & OSB_LIB::Contract::createdDate | ( | ) | const [inline] |
Date when the contract was first created.
Definition at line 616 of file contract.h.
References createdDate_.
const Money & OSB_LIB::Contract::creditLimit | ( | ) | const [inline] |
Credit limit amount. Can be zero if no credit limit.
Definition at line 631 of file contract.h.
References creditLimit_.
bool OSB_LIB::Contract::delPersProduct | ( | OSB_DB::Session & | session, | |
const PersProduct::Oid & | oid, | |||
bool | noWait | |||
) |
Remove a personalized product for this contract.
Including remove an entry from the database, also remove it from the perproduct list. Session will be committed if successful.
session | Database session. | |
oid | Object id of personalized product to be removed. | |
noWait | Don't wait for database locks? |
OsbException | from lock(const OSB_DB::Session&, bool) const, see there. | |
OsbException | if the pers. product is not found. |
bool OSB_LIB::Contract::delPp | ( | const OSB_DB::Session & | session, | |
const PersProduct::Oid & | oid | |||
) | [private] |
Remove a personalized product for this contract.
Including remove an entry from the database, also remove it from the perproduct list.
session | Database session. | |
oid | Object id of personalized product to be removed. |
OsbException | if the pers. product is not found. |
const Status & OSB_LIB::Contract::effStatus | ( | ) | const [inline] |
const DateTime & OSB_LIB::Contract::effStatusDate | ( | ) | const [inline] |
Date when effective status became valid.
Definition at line 646 of file contract.h.
References effStatusDate_.
const PersProduct* OSB_LIB::Contract::findPersProduct | ( | const PersProduct::Oid & | oid | ) | const |
Find the pers product based on the given oid.
oid | Oid of the pers product. |
const PersProduct& OSB_LIB::Contract::getPersProduct | ( | const PersProduct::Oid & | oid | ) | const |
Find the pers product based on the given oid.
oid | Oid of the pers product. |
OsbException | if the pers. product is not found. |
static void OSB_LIB::Contract::handleObjectStatus | ( | ObjectStatus | os, | |
const Contract::Oid & | id | |||
) | [static, private] |
Evalute the object status of a contract.
os | Object status to evaluate. | |
id | The id of the contract for which os is valid. |
ObjectDeleted | ||
ObjectModified | ||
ObjectBusy | if noWait is true and the contract is locked by another database session. |
void OSB_LIB::Contract::incObjVs | ( | const OSB_DB::Session & | session | ) | [private] |
Increment the object version by 1.
session | Database session to use. |
OsbException | (internal error) if the update of the object version fails in the database. |
bool OSB_LIB::Contract::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a contract to database.
This method will only be called by associate.
The object's id is not set before the function call. If the function completed successfully, the object will have it's id set, else the id will still be the same (not set).
session | Database session to use. |
void OSB_LIB::Contract::lock | ( | const OSB_DB::Session & | session, | |
bool | noWait | |||
) | const [private] |
Lock a contract in the database.
session | Database session to use. | |
noWait | Don't wait for database locks? |
OsbException | from handleObjectStatus(). |
static void OSB_LIB::Contract::lock | ( | const OSB_DB::Session & | session, | |
const Contract::Oid & | id, | |||
bool | noWait | |||
) | [static, private] |
Lock a contract in the database.
session | Database session to use. | |
id | The object id of the contract to lock. | |
noWait | Don't wait for database locks? |
OsbException | from handleObjectStatus(), (ObjectModified is not applicable). |
long OSB_LIB::Contract::objVs | ( | ) | const [inline] |
const Contract::Oid & OSB_LIB::Contract::oid | ( | ) | const [inline] |
The associate id who owns the contract.
Definition at line 611 of file contract.h.
References ownerId_.
PersProduct* OSB_LIB::Contract::persProduct | ( | const PersProduct::Oid & | oid | ) |
Find the pers product based on the given oid.
oid | Oid of pers product. |
const Status & OSB_LIB::Contract::prefStatus | ( | ) | const [inline] |
const DateTime & OSB_LIB::Contract::prefStatusDate | ( | ) | const [inline] |
Date when prefer status was required.
Definition at line 656 of file contract.h.
References prefStatusDate_.
const PersProducts & OSB_LIB::Contract::products | ( | ) | const [inline] |
bool OSB_LIB::Contract::read | ( | const OSB_DB::Session & | session | ) |
Read the contract from the database.
session | Database session to use. |
void OSB_LIB::Contract::readStatusChanges | ( | const OSB_DB::Session & | session, | |
const Period & | period | |||
) |
Get status changes for a period of time.
The function reads the status changes for a contract itself and all personalized products and their nodes of this contract and a time period.
session | Database session to use. | |
period | Time period covered by the status requests, the upper boundary is not included. |
void OSB_LIB::Contract::readStatusRequests | ( | const OSB_DB::Session & | session, | |
const Period & | period | |||
) |
Get status requests for a period of time.
The function reads the status requests for a contract itself and all personalized products and their nodes of this contract and a time period.
session | Database session to use. | |
period | Time period covered by the status requests, the upper boundary is not included. |
bool OSB_LIB::Contract::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove a contract from database.
This method will be called by associate.
The action only can be done when the status is on svCreated.
session | Database session. |
OsbException |
|
bool OSB_LIB::Contract::requestStatus | ( | const OSB_DB::Session & | session, | |
StatusRequest & | request, | |||
OsbErrors & | errors, | |||
bool | noWait | |||
) |
Set the preferred status of the contract.
session | Database session to use. | |
request | Preferred status to set, see below. | |
errors | Get warnings and errors during processing. | |
noWait | Don't wait for database locks? |
OsbException | if the contract was modified in the database. | |
OsbException | if the contract is locked and noWait is true. |
bool OSB_LIB::Contract::setAccountingType | ( | AccountingType | accountingType | ) | [inline] |
bool OSB_LIB::Contract::setCreditLimit | ( | const Money & | credit | ) | [inline] |
OsbError OSB_LIB::Contract::setPrefStatus | ( | const OSB_DB::Session & | session, | |
const StatusRequest & | request | |||
) | [private] |
Set the preferred status of the contract.
session | Database session to use. | |
request | Status request that triggered the change of the preferred status. |
const StatusChanges & OSB_LIB::Contract::statusChanges | ( | ) | const [inline] |
Get the status changes.
The list is meaningful only after having called readStatusChanges().
Definition at line 671 of file contract.h.
References chngs_.
const StatusRequests & OSB_LIB::Contract::statusRequests | ( | ) | const [inline] |
Get the status requests.
The list is meaningful only after having called readStatusRequests().
Definition at line 676 of file contract.h.
References reqs_.
static AccountingType OSB_LIB::Contract::toAccountingType | ( | char | at | ) | [static] |
Convert a character into an accounting type.
at | Value to convert. |
static char OSB_LIB::Contract::toChar | ( | AccountingType | at | ) | [static] |
Convert an accounting type to a character.
at | Accounting type to convert. |
void OSB_LIB::Contract::update | ( | OSB_DB::Session & | session, | |
bool | noWait | |||
) |
This function allow contract to update itself into database.
This function will update an existing contract object in the database. If the function completed successfully, the object's objVs will increment by 1. Session will be committed if successful.
session | Database session. | |
noWait | Don't wait for database locks? |
OsbException | from lock(const OSB_DB::Session&, bool) const, see there. |
friend class AnCList [friend] |
friend class Associate [friend] |
Definition at line 74 of file contract.h.
friend class OSB_DB::ContractGw [friend] |
Definition at line 73 of file contract.h.
friend class OSB_DB::PersProductGw [friend] |
Definition at line 72 of file contract.h.
friend class RequestHandler [friend] |
Definition at line 76 of file contract.h.
Sales (invoices) or purchases (reconciliation) contract.
Definition at line 590 of file contract.h.
Referenced by accountingType(), and setAccountingType().
Id<Billcycle> OSB_LIB::Contract::billcycleId_ [private] |
id of billcycle
Definition at line 570 of file contract.h.
Referenced by billcycleId(), and setBillCycle().
StatusChanges OSB_LIB::Contract::chngs_ [private] |
DateTime OSB_LIB::Contract::createdDate_ [private] |
date when the contract was first created
Definition at line 566 of file contract.h.
Referenced by createdDate().
Money OSB_LIB::Contract::creditLimit_ [private] |
Credit limit of contract;.
Definition at line 588 of file contract.h.
Referenced by creditLimit(), and setCreditLimit().
Status OSB_LIB::Contract::effStatus_ [private] |
the "currently" effective status
Definition at line 572 of file contract.h.
Referenced by effStatus().
DateTime OSB_LIB::Contract::effStatusDate_ [private] |
date when effective status was set
Definition at line 574 of file contract.h.
Referenced by effStatusDate().
long OSB_LIB::Contract::objVs_ [private] |
Oid OSB_LIB::Contract::oid_ [private] |
OwnerId OSB_LIB::Contract::ownerId_ [private] |
Status OSB_LIB::Contract::prefStatus_ [private] |
the perferred status of the associate
Definition at line 576 of file contract.h.
Referenced by prefStatus().
DateTime OSB_LIB::Contract::prefStatusDate_ [private] |
date when preferred status was requested
Definition at line 578 of file contract.h.
Referenced by prefStatusDate().
PersProducts OSB_LIB::Contract::products_ [private] |
StatusRequests OSB_LIB::Contract::reqs_ [private] |
Id<TaxKey> OSB_LIB::Contract::taxkey_ [private] |
taxkey of the contract
Definition at line 568 of file contract.h.
Referenced by setTaxkey(), and taxkey().