FactDev
0.1
|
The BillingDatabase class Billing (or Quote) table database. More...
#include <billingdatabase.h>
Public Member Functions | |
Models::Billing * | getBilling (const int pId) |
BillingDatabase::getBilling get informations about the billing identified by pId More... | |
WdgModels::BillingsTableModel * | getBillingsTable (const int idProject) throw (DbException*) |
BillingDatabase::getBillingsTable Return an item model of billings for QTableView. More... | |
int | addBilling (const Models::Billing &) |
BillingDatabase::addBilling Add the billing pBilling to the database. More... | |
void | updateBilling (const Models::Billing &) |
BillingDatabase::updateCustomer Update informations about the billing pCustomer | |
void | removeBilling (const int pId) |
BillingDatabase::removeCustomer Remove the billing with the id pId More... | |
void | addBillingProject (const int idProject, const int idBilling, const int idContributory) |
BillingDatabase::addBillingProject Link a project, a billing and a contributory in the table BillingProject. More... | |
bool | isBillingPaid (const int pId) |
BillingDatabase::isBillingPaid Return TRUE if the id pId correspond to a Billing and not quote (isBilling = 1) and if this billing is paid (isPaid = 1) else return FALSE. More... | |
void | removeBillingProject (const int idProject, const int idBilling, const int idContributory) |
BillingDatabase::removeBillingProject remove a link between a project, a billing and a contributory in the table BillingProject. More... | |
int | getMaxBillingNumber () |
getMaxBillingNumber Get the last number of a billing More... | |
int | getMaxQuoteNumber () |
getMaxQuoteNumber Get the last number of a quote More... | |
int | getMaxBillingNumberOfCustomer (const int idCustomer) |
BillingDatabase::getMaxBillingNumberOfCustomer Get the last number of a Customer's Billing. More... | |
int | getMaxQuoteNumberOfCustomer (const int idCustomer) |
BillingDatabase::getMaxQuoteNumberOfCustomer Get the last number of a Customer's quote. More... | |
QSharedPointer< Models::Billing > | getBilling (QSqlQuery &q) |
BillingDatabase::getBilling Add the element of the q request and return their. More... | |
QMap< Project *, Billing * > | getAllBillingsOfProject () |
BillingDatabase::getAllBillingsOfProject Return a map with the project id as key linked to the billing. More... | |
QList< Billing > | getBillsBetweenDates (QDate begin, QDate end) |
Get the bills between begin and end dates. More... | |
QList< Billing > | getBills (const int projectId=0) |
Get the bills. More... | |
QList< Billing > | getBillsPaid (const int projectId=0) |
Get the bills paid. More... | |
int | getNbBills (const int customerId=0) |
Get the number of bills. More... | |
int | getNbBillsPaid (const int customerId=0) |
Get the number of bills paid. More... | |
int | getNbQuotes (const int customerId=0) |
Get the number of quotes. More... | |
int | getNbDocs (const int customerId=0) |
Get the number of documents. More... | |
Public Member Functions inherited from Databases::Database | |
QString | lastError (const QSqlQuery &q) const |
Database::lastError Return an error message on the last error occured during the SQL request q More... | |
void | testCases () |
Database::testCases Realise a test cases. | |
void | executeFile (QString pName) |
Database::executerFichier Exeute a specified file named pName More... | |
void | openTransaction () |
Database::openTransaction Open new transaction. | |
void | closeTransaction () |
Database::closeTransaction Close current transaction. | |
void | close () |
Database::close Close database access. | |
void | open () |
Database::open Open database. | |
~Database () | |
Database::~Database Suppression object, and close database access. | |
void | setDatabase (QSqlDatabase sql) |
Database::setDatabase Set database. More... | |
void | updateBillingNumber () |
Database::updateBillingNumber Update the billing number. | |
void | cleanDatabase () |
Database::clearDatabase Drop alls tables of Database WARNING: We can't restore data after. | |
void | changeDatabase (Databases::DbType dbType) |
changeDatabase Change the current database : mysql to sqlite or sqlite to mysql More... | |
Static Public Member Functions | |
static BillingDatabase * | instance () throw (DbException*) |
BillingDatabase::getInstance Return an instance of BillingDatabase More... | |
Static Public Member Functions inherited from Databases::Database | |
static Database * | instance (bool tests=false) throw (DbException*) |
Database::getInstance Return an instance of Database. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Databases::Database | |
Database (bool tests=false) throw (DbException*) | |
Database::Database Database is a singleton. | |
QVariant | value (const QSqlQuery &q, const QString &champ) const |
Database::valeur Value of database field. More... | |
Protected Attributes inherited from Databases::Database | |
QSettings * | _settings |
settings | |
QSqlDatabase | mDatabase |
contains Database | |
QList< Database * > | _instances |
List of instances. | |
Static Protected Attributes inherited from Databases::Database | |
static Database * | _instance = 0 |
Instance. | |
static bool | _dbInstance = 0 |
an instance of db is open | |
static bool | isOpen = false |
Database is open. | |
static bool | _isMysql = false |
The BillingDatabase class Billing (or Quote) table database.
int Databases::BillingDatabase::addBilling | ( | const Models::Billing & | pBilling | ) |
BillingDatabase::addBilling Add the billing pBilling to the database.
void Databases::BillingDatabase::addBillingProject | ( | const int | idProject, |
const int | idBilling, | ||
const int | idContributory | ||
) |
BillingDatabase::addBillingProject Link a project, a billing and a contributory in the table BillingProject.
idProject | Project id |
idBilling | Billing id |
idContributory | Contributory id |
BillingDatabase::getAllBillingsOfProject Return a map with the project id as key linked to the billing.
Models::Billing * Databases::BillingDatabase::getBilling | ( | const int | pId | ) |
BillingDatabase::getBilling get informations about the billing identified by pId
pId | billing id |
QSharedPointer< Billing > Databases::BillingDatabase::getBilling | ( | QSqlQuery & | q | ) |
BillingDatabase::getBilling Add the element of the q request and return their.
q | SQL request |
WdgModels::BillingsTableModel * Databases::BillingDatabase::getBillingsTable | ( | const int | idProject | ) | |
throw | ( | DbException * | |||
) |
BillingDatabase::getBillingsTable Return an item model of billings for QTableView.
pId | the project id of the billings returned |
DbException |
QList< Billing > Databases::BillingDatabase::getBills | ( | const int | projectId = 0 | ) |
Get the bills.
projectId | Get the specified project bills |
QList< Billing > Databases::BillingDatabase::getBillsBetweenDates | ( | QDate | begin, |
QDate | end | ||
) |
Get the bills between begin and end dates.
begin | |
end |
QList< Billing > Databases::BillingDatabase::getBillsPaid | ( | const int | projectId = 0 | ) |
Get the bills paid.
projectId | Get the specified project bills paid |
int Databases::BillingDatabase::getMaxBillingNumber | ( | ) |
getMaxBillingNumber Get the last number of a billing
int Databases::BillingDatabase::getMaxBillingNumberOfCustomer | ( | const int | idCustomer | ) |
BillingDatabase::getMaxBillingNumberOfCustomer Get the last number of a Customer's Billing.
idCustomer | Customer id |
int Databases::BillingDatabase::getMaxQuoteNumber | ( | ) |
getMaxQuoteNumber Get the last number of a quote
int Databases::BillingDatabase::getMaxQuoteNumberOfCustomer | ( | const int | idCustomer | ) |
BillingDatabase::getMaxQuoteNumberOfCustomer Get the last number of a Customer's quote.
idCustomer | Customer id |
int Databases::BillingDatabase::getNbBills | ( | const int | customerId = 0 | ) |
Get the number of bills.
customerId | If customerId isn't specified or if it's not valid, get all bills else get the specified customer bills |
int Databases::BillingDatabase::getNbBillsPaid | ( | const int | customerId = 0 | ) |
Get the number of bills paid.
customerId | If customerId isn't specified if it's not valid, get all bills paid else get the specified customer bills paid |
int Databases::BillingDatabase::getNbDocs | ( | const int | customerId = 0 | ) |
Get the number of documents.
customerId | If customerId isn't specified or if if it's not valid, get all documents else get the specified customer documents |
int Databases::BillingDatabase::getNbQuotes | ( | const int | customerId = 0 | ) |
Get the number of quotes.
customerId | If customerId isn't specified or if it's not valid, get all quotes else get the specified customer quotes |
|
static |
BillingDatabase::getInstance Return an instance of BillingDatabase
bool Databases::BillingDatabase::isBillingPaid | ( | const int | pId | ) |
BillingDatabase::isBillingPaid Return TRUE if the id pId correspond to a Billing and not quote (isBilling = 1) and if this billing is paid (isPaid = 1) else return FALSE.
pId | Billing id |
void Databases::BillingDatabase::removeBilling | ( | const int | pId | ) |
BillingDatabase::removeCustomer Remove the billing with the id pId
pId | billing id |
void Databases::BillingDatabase::removeBillingProject | ( | const int | idProject, |
const int | idBilling, | ||
const int | idContributory | ||
) |
BillingDatabase::removeBillingProject remove a link between a project, a billing and a contributory in the table BillingProject.
idProject | Project id |
idBilling | Billing id |
idContributory | Contributory id |