Added support for Value Added Tax.
This commit is contained in:
@@ -13,6 +13,9 @@ ShopSettings::ShopSettings(QObject *parent) : QObject(parent)
|
||||
m_favBtnCols = 0;
|
||||
m_favBtnRows = 0;
|
||||
m_favBtnSize = 0;
|
||||
|
||||
m_rounding = Enums::R_NONE;
|
||||
m_decimalPlaces = 0;
|
||||
}
|
||||
|
||||
QString ShopSettings::output() const
|
||||
@@ -164,3 +167,33 @@ void ShopSettings::setFavBtnSize(int favBtnSize)
|
||||
{
|
||||
m_favBtnSize = favBtnSize;
|
||||
}
|
||||
|
||||
Enums::Rounding ShopSettings::rounding() const
|
||||
{
|
||||
return m_rounding;
|
||||
}
|
||||
|
||||
void ShopSettings::setRounding(const Enums::Rounding &rounding)
|
||||
{
|
||||
m_rounding = rounding;
|
||||
}
|
||||
|
||||
int ShopSettings::decimalPlaces() const
|
||||
{
|
||||
return m_decimalPlaces;
|
||||
}
|
||||
|
||||
void ShopSettings::setDecimalPlaces(int decimalPlaces)
|
||||
{
|
||||
m_decimalPlaces = decimalPlaces;
|
||||
}
|
||||
|
||||
QString ShopSettings::roundingItem() const
|
||||
{
|
||||
return m_roundingItem;
|
||||
}
|
||||
|
||||
void ShopSettings::setRoundingItem(const QString &roundingItem)
|
||||
{
|
||||
m_roundingItem = roundingItem;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define RECEIPTSETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <enums.h>
|
||||
|
||||
class ShopSettings : public QObject
|
||||
{
|
||||
@@ -22,6 +23,10 @@ class ShopSettings : public QObject
|
||||
Q_PROPERTY(int favBtnRows READ favBtnRows WRITE setFavBtnRows)
|
||||
Q_PROPERTY(int favBtnSize READ favBtnSize WRITE setFavBtnSize)
|
||||
|
||||
Q_PROPERTY(Enums::Rounding rounding READ rounding WRITE setRounding)
|
||||
Q_PROPERTY(int decimalPlaces READ decimalPlaces WRITE setDecimalPlaces)
|
||||
Q_PROPERTY(QString roundingItem READ roundingItem WRITE setRoundingItem)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -77,6 +82,15 @@ public:
|
||||
int favBtnSize() const;
|
||||
void setFavBtnSize(int favBtnSize);
|
||||
|
||||
Enums::Rounding rounding() const;
|
||||
void setRounding(const Enums::Rounding &rounding);
|
||||
|
||||
int decimalPlaces() const;
|
||||
void setDecimalPlaces(int decimalPlaces);
|
||||
|
||||
QString roundingItem() const;
|
||||
void setRoundingItem(const QString &roundingItem);
|
||||
|
||||
private:
|
||||
QString m_output;
|
||||
CODEPAGE m_codepage;
|
||||
@@ -95,6 +109,10 @@ private:
|
||||
int m_favBtnCols;
|
||||
int m_favBtnRows;
|
||||
int m_favBtnSize;
|
||||
|
||||
Enums::Rounding m_rounding;
|
||||
int m_decimalPlaces;
|
||||
QString m_roundingItem;
|
||||
};
|
||||
|
||||
typedef QSharedPointer<ShopSettings> ShopSettingsPtr;
|
||||
|
||||
@@ -35,6 +35,16 @@ ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
|
||||
registerBinding(ui->favBtnRows);
|
||||
registerBinding(ui->favBtnSize);
|
||||
|
||||
QList<ComboData> listRounding;
|
||||
listRounding
|
||||
<< ComboData(Enums::R_NONE, tr("None"))
|
||||
<< ComboData(Enums::R_UP, tr("Up"))
|
||||
<< ComboData(Enums::R_DOWN, tr("Down"))
|
||||
<< ComboData(Enums::R_MATH, tr("Mathematic"));
|
||||
registerBinding(ui->rounding, listRounding);
|
||||
registerBinding(ui->decimalPlaces);
|
||||
registerBinding(ui->roundingItem);
|
||||
|
||||
m_itemModel = new AutoTableModel<ShopItem>();
|
||||
}
|
||||
|
||||
|
||||
@@ -273,6 +273,55 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Other</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Rounding</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="rounding"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Decimal places</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="decimalPlaces"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Rounding item text</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="roundingItem"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user