Fixed price calculation in camp module. UI fixes.

closes #309
master
Josef Rokos 8 years ago
parent b83e1ee56e
commit 1df897e5c8

@ -246,11 +246,6 @@ void CampService::calcPeople(CampDataPtr data)
} }
} }
if (item->adbItem()->ztp())
{
continue;
}
if (sale != QDecDouble(0) && !fixedSale) if (sale != QDecDouble(0) && !fixedSale)
{ {
QDecDouble itemSale = (item->price() * sale) / 100; QDecDouble itemSale = (item->price() * sale) / 100;
@ -331,6 +326,11 @@ void CampService::calcPrice(CampDataPtr data)
void CampService::addAccFee(CampDataPtr data, AddressItemPtr item, int startAge, int endAge, int days) void CampService::addAccFee(CampDataPtr data, AddressItemPtr item, int startAge, int endAge, int days)
{ {
if (item->adbItem()->ztp())
{
return;
}
auto addAccService = [this, item, data](int count){ auto addAccService = [this, item, data](int count){
ServiceItemPtr srvItem(new ServiceItem); ServiceItemPtr srvItem(new ServiceItem);

@ -8,6 +8,8 @@
#include <accservice.h> #include <accservice.h>
#include <reporting/reportviewer.h> #include <reporting/reportviewer.h>
#include <QScroller>
//////////////////////////////////// ////////////////////////////////////
/// \brief AddressHelper::AddressHelper /// \brief AddressHelper::AddressHelper
/// \param parent /// \param parent
@ -204,6 +206,9 @@ CampWizard::CampWizard(QWidget *parent) :
ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
QScroller::grabGesture(ui->tabServices, QScroller::LeftMouseButtonGesture);
QScroller::grabGesture(ui->tabPeople, QScroller::LeftMouseButtonGesture);
m_newRecord = false; m_newRecord = false;
} }

@ -1,6 +1,8 @@
#include "detailwidget.h" #include "detailwidget.h"
#include "ui_detailwidget.h" #include "ui_detailwidget.h"
#include <QScroller>
#include "campservice.h" #include "campservice.h"
DetailWidget::DetailWidget(QWidget *parent) : DetailWidget::DetailWidget(QWidget *parent) :
@ -28,6 +30,9 @@ DetailWidget::DetailWidget(QWidget *parent) :
ui->tabServices->hideColumn(7); ui->tabServices->hideColumn(7);
ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
QScroller::grabGesture(ui->tabServices, QScroller::LeftMouseButtonGesture);
QScroller::grabGesture(ui->tabPeople, QScroller::LeftMouseButtonGesture);
} }
DetailWidget::~DetailWidget() DetailWidget::~DetailWidget()

@ -2,6 +2,7 @@
#include "ui_paydvouchersdialog.h" #include "ui_paydvouchersdialog.h"
#include <QFileDialog> #include <QFileDialog>
#include <QScroller>
#include "receiptgenerator.h" #include "receiptgenerator.h"
#include "shopservice.h" #include "shopservice.h"
@ -48,6 +49,9 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
m_voucherModel->setData(srv.paiedVouchers()); m_voucherModel->setData(srv.paiedVouchers());
ui->tableVouchers->sortByColumn(0,Qt::AscendingOrder); ui->tableVouchers->sortByColumn(0,Qt::AscendingOrder);
QScroller::grabGesture(ui->tableVouchers, QScroller::LeftMouseButtonGesture);
QScroller::grabGesture(ui->tableItems, QScroller::LeftMouseButtonGesture);
connect(ui->tableVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, &srv](const QModelIndex &current, const QModelIndex &) { connect(ui->tableVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, &srv](const QModelIndex &current, const QModelIndex &) {
QSharedPointer<Voucher> voucher = m_voucherModel->itemFromIndex(current); QSharedPointer<Voucher> voucher = m_voucherModel->itemFromIndex(current);
srv.loadItems(voucher); srv.loadItems(voucher);

@ -13,6 +13,7 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QMessageBox> #include <QMessageBox>
#include <QScroller>
#include "data/favorititem.h" #include "data/favorititem.h"
#include "favbutton.h" #include "favbutton.h"
@ -127,6 +128,10 @@ void ShopForm::loadLast()
ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
ui->commodityTable->setColumnHidden(4, true); ui->commodityTable->setColumnHidden(4, true);
ui->commodityTable->setColumnHidden(2, true); ui->commodityTable->setColumnHidden(2, true);
ui->commodityTable->setColumnWidth(3, 90);
QScroller::grabGesture(ui->commodityTable, QScroller::LeftMouseButtonGesture);
QScroller::grabGesture(ui->actualReceipt, QScroller::LeftMouseButtonGesture);
if (srv.isEetEnabled()) if (srv.isEetEnabled())
{ {

Loading…
Cancel
Save