Fixed MSVS2010 build. Compiler does not support virtual template methods.
This commit is contained in:
+2
-2
@@ -67,7 +67,7 @@ public:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void save(QSharedPointer<T> entity) {
|
void save(QSharedPointer<T> entity) {
|
||||||
if (!checkPermission(PERM_ADD)) {
|
if (!checkPermission(PERM_ADD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
emit dataChanged();
|
emit dataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void update(QSharedPointer<T> entity) {
|
void update(QSharedPointer<T> entity) {
|
||||||
if (!checkPermission(PERM_EDIT)) {
|
if (!checkPermission(PERM_EDIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -122,11 +122,11 @@ void ShopForm::onCountChanged()
|
|||||||
|
|
||||||
if (m_voucher->status() == Voucher::NEW && m_voucher->id() == 0)
|
if (m_voucher->status() == Voucher::NEW && m_voucher->id() == 0)
|
||||||
{
|
{
|
||||||
srv.save(m_voucher);
|
srv.saveVoucher(m_voucher);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
srv.update(m_voucher);
|
srv.updateVoucher(m_voucher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void ShopForm::doTempSave(bool comboChanged)
|
|||||||
if (!m_voucher->items().isEmpty())
|
if (!m_voucher->items().isEmpty())
|
||||||
{
|
{
|
||||||
m_voucher->setStatus(Voucher::TEMPORARY);
|
m_voucher->setStatus(Voucher::TEMPORARY);
|
||||||
srv.update(m_voucher);
|
srv.updateVoucher(m_voucher);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comboChanged && ui->receiptCombo->currentIndex() > 0)
|
if (comboChanged && ui->receiptCombo->currentIndex() > 0)
|
||||||
@@ -176,7 +176,7 @@ void ShopForm::changeReceipt()
|
|||||||
srv.loadItems(m_voucher);
|
srv.loadItems(m_voucher);
|
||||||
connectItemSignals();
|
connectItemSignals();
|
||||||
m_voucher->setStatus(Voucher::NEW);
|
m_voucher->setStatus(Voucher::NEW);
|
||||||
srv.update(m_voucher);
|
srv.updateVoucher(m_voucher);
|
||||||
|
|
||||||
m_itemsModel->setData(m_voucher->items());
|
m_itemsModel->setData(m_voucher->items());
|
||||||
ui->total->setText(m_voucher->totalPrice().toString());
|
ui->total->setText(m_voucher->totalPrice().toString());
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ QDecDouble ShopService::vatRate(Enums::VatType vatType)
|
|||||||
return vatRate;
|
return vatRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShopService::save(QSharedPointer<Voucher> entity)
|
void ShopService::saveVoucher(QSharedPointer<Voucher> entity)
|
||||||
{
|
{
|
||||||
Transaction tr;
|
Transaction tr;
|
||||||
odb::database *db = Context::instance().db();
|
odb::database *db = Context::instance().db();
|
||||||
@@ -139,7 +139,7 @@ void ShopService::save(QSharedPointer<Voucher> entity)
|
|||||||
tr.commit();
|
tr.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShopService::update(QSharedPointer<Voucher> entity)
|
void ShopService::updateVoucher(QSharedPointer<Voucher> entity)
|
||||||
{
|
{
|
||||||
Transaction tr;
|
Transaction tr;
|
||||||
odb::database *db = Context::instance().db();
|
odb::database *db = Context::instance().db();
|
||||||
|
|||||||
+2
-3
@@ -26,10 +26,9 @@ private:
|
|||||||
QSharedPointer<GlobalSettings> m_gs;
|
QSharedPointer<GlobalSettings> m_gs;
|
||||||
QDecDouble vatRate(Enums::VatType vatType);
|
QDecDouble vatRate(Enums::VatType vatType);
|
||||||
|
|
||||||
// Service interface
|
|
||||||
public:
|
public:
|
||||||
virtual void save(QSharedPointer<Voucher> entity) override;
|
void saveVoucher(QSharedPointer<Voucher> entity);
|
||||||
virtual void update(QSharedPointer<Voucher> entity) override;
|
void updateVoucher(QSharedPointer<Voucher> entity);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHOPSERVICE_H
|
#endif // SHOPSERVICE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user