Added support for Value Added Tax.
This commit is contained in:
@@ -7,6 +7,8 @@ GlobalSettings::GlobalSettings(QObject *parent) : QObject(parent)
|
||||
m_vatHigh = 0;
|
||||
m_vatFirstLower = 0;
|
||||
m_vatSecondLower = 0;
|
||||
m_vatPayer = false;
|
||||
m_pricesWithVAT = true;
|
||||
}
|
||||
|
||||
QString GlobalSettings::firmName() const
|
||||
@@ -156,5 +158,15 @@ void GlobalSettings::setPhone(const QString &phone)
|
||||
m_phone = phone;
|
||||
}
|
||||
|
||||
bool GlobalSettings::pricesWithVAT() const
|
||||
{
|
||||
return m_pricesWithVAT;
|
||||
}
|
||||
|
||||
void GlobalSettings::setPricesWithVAT(bool pricesWithVAT)
|
||||
{
|
||||
m_pricesWithVAT = pricesWithVAT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class CORESHARED_EXPORT GlobalSettings : public QObject
|
||||
Q_PROPERTY(int ic READ ic WRITE setIc)
|
||||
Q_PROPERTY(QString dic READ dic WRITE setDic)
|
||||
Q_PROPERTY(bool vatPayer READ vatPayer WRITE setVatPayer)
|
||||
Q_PROPERTY(bool pricesWithVAT READ pricesWithVAT WRITE setPricesWithVAT)
|
||||
Q_PROPERTY(QString logoPath READ logoPath WRITE setLogoPath)
|
||||
Q_PROPERTY(QDecDouble vatHigh READ vatHigh WRITE setVatHigh)
|
||||
Q_PROPERTY(QDecDouble vatFirstLower READ vatFirstLower WRITE setVatFirstLower)
|
||||
@@ -74,6 +75,9 @@ public:
|
||||
QString phone() const;
|
||||
void setPhone(const QString &phone);
|
||||
|
||||
bool pricesWithVAT() const;
|
||||
void setPricesWithVAT(bool pricesWithVAT);
|
||||
|
||||
private:
|
||||
QString m_firmName;
|
||||
QString m_street;
|
||||
@@ -83,6 +87,7 @@ private:
|
||||
int m_ic;
|
||||
QString m_dic;
|
||||
bool m_vatPayer;
|
||||
bool m_pricesWithVAT;
|
||||
QString m_logoPath;
|
||||
int m_vatHigh;
|
||||
int m_vatFirstLower;
|
||||
|
||||
@@ -24,6 +24,7 @@ GlobalSettingsForm::GlobalSettingsForm(QWidget *parent) :
|
||||
registerBinding(ui->city);
|
||||
registerBinding(ui->ic);
|
||||
registerBinding(ui->vatPayer);
|
||||
registerBinding(ui->pricesWithVAT);
|
||||
registerBinding(ui->dic);
|
||||
registerBinding(ui->vatHigh);
|
||||
registerBinding(ui->vatFirstLower);
|
||||
@@ -110,6 +111,7 @@ void GlobalSettingsForm::loadEntity()
|
||||
QSharedPointer<GlobalSettings> settings = srv.loadSettings<GlobalSettings>();
|
||||
setEntity(settings);
|
||||
ui->grpVat->setEnabled(settings->vatPayer());
|
||||
ui->pricesWithVAT->setEnabled(settings->vatPayer());
|
||||
|
||||
if (!settings->logoPath().isEmpty())
|
||||
{
|
||||
@@ -123,6 +125,7 @@ void GlobalSettingsForm::loadEntity()
|
||||
void GlobalSettingsForm::on_vatPayer_toggled(bool checked)
|
||||
{
|
||||
ui->grpVat->setEnabled(checked);
|
||||
ui->pricesWithVAT->setEnabled(checked);
|
||||
}
|
||||
|
||||
void GlobalSettingsForm::on_season_currentIndexChanged(int)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>759</width>
|
||||
<height>557</height>
|
||||
<height>630</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -253,6 +253,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="pricesWithVAT">
|
||||
<property name="text">
|
||||
<string>Prices with VAT</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user