Added support for VAT calculations.
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QDecDouble.hh>
|
||||
#include "../core_global.h"
|
||||
|
||||
class GlobalSettings : public QObject
|
||||
class CORESHARED_EXPORT GlobalSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ GlobalSettingsForm::GlobalSettingsForm(QWidget *parent) :
|
||||
registerBinding(ui->ic);
|
||||
registerBinding(ui->vatPayer);
|
||||
registerBinding(ui->dic);
|
||||
registerBinding(ui->vatHigh);
|
||||
registerBinding(ui->vatFirstLower);
|
||||
registerBinding(ui->vatSecondLower);
|
||||
}
|
||||
|
||||
GlobalSettingsForm::~GlobalSettingsForm()
|
||||
@@ -39,4 +42,10 @@ void GlobalSettingsForm::loadEntity()
|
||||
SettingsService srv("CORE");
|
||||
QSharedPointer<GlobalSettings> settings = srv.loadSettings<GlobalSettings>();
|
||||
setEntity(settings);
|
||||
ui->grpVat->setEnabled(settings->vatPayer());
|
||||
}
|
||||
|
||||
void GlobalSettingsForm::on_vatPayer_toggled(bool checked)
|
||||
{
|
||||
ui->grpVat->setEnabled(checked);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ public slots:
|
||||
// IForm interface
|
||||
public:
|
||||
void loadEntity() override;
|
||||
private slots:
|
||||
void on_vatPayer_toggled(bool checked);
|
||||
};
|
||||
|
||||
#endif // GLOBALSETTINGSFORM_H
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>422</width>
|
||||
<height>323</height>
|
||||
<width>586</width>
|
||||
<height>419</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -20,6 +20,9 @@
|
||||
<string>Company info</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
@@ -47,6 +50,63 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpVat">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>VAT rates</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>High</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="vatHigh">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>First lower</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="vatFirstLower">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Second lower</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="vatSecondLower">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user