|
CenGen - Генератор ценников
1.1
|
00001 #ifndef SELLFILTERWIDGET_H 00002 #define SELLFILTERWIDGET_H 00003 00004 #include <QWidget> 00005 #include <QGridLayout> 00006 #include <QLabel> 00007 #include <QComboBox> 00008 #include <QPushButton> 00009 #include <QCalendarWidget> 00010 #include <QSettings> 00011 #include <QToolBar> 00012 #include <QFileInfo> 00013 #include <QFileDialog> 00014 #include <QProgressBar> 00015 #include <QStatusBar> 00016 #include <QApplication> 00017 #include <QDebug> 00018 #include "tinformer.h" 00019 #include "dialog.h" 00020 //#include "cengen.h" 00021 00022 QT_BEGIN_NAMESPACE 00023 class QGridLayout; 00024 class QLabel; 00025 class QComboBox; 00026 class QPushButton; 00027 class QCalendarWidget; 00028 class QSettings; 00029 class QToolBar; 00030 QT_END_NAMESPACE 00031 00032 00033 class SellFilterWidget : public QWidget { 00034 Q_OBJECT 00035 00036 public: 00037 SellFilterWidget(QToolBar *ui_mainToolBar, 00038 QStatusBar *statBar, 00039 QWidget* pwgt = 0); 00040 ~SellFilterWidget(); 00041 00042 void check_sell_file(); 00043 QList<Tovar> apply_sell_filter(QList<Tovar> curTb, QDate dt1, QDate dt2, int methodSell); 00044 QList<Tovar> apply_sell_filter(QList<Tovar> curTb); 00045 00046 QVector<Tovar> get_sold_tovars(); 00047 QVector<Tovar> get_sold_tovars(QDate dt1, QDate dt2); 00048 00049 QDate get_date_start() { 00050 return dateStart->selectedDate(); 00051 } 00052 QDate get_date_end() { 00053 return dateStop->selectedDate(); 00054 } 00055 void setSellFileName(QString name) { 00056 sellFileName = name; 00057 } 00058 QString getSellFileName() { 00059 return sellFileName; 00060 } 00061 00062 void setOpisateli(QStringList lst) { 00063 sellOpisateli = lst; 00064 sellNomerBox->addItems(sellOpisateli); 00065 sellDateBox->addItems(sellOpisateli); 00066 sellTimeBox->addItems(sellOpisateli); 00067 sellKolBox->addItems(sellOpisateli); 00068 } 00069 QStringList getOpisateli() { 00070 return sellOpisateli; 00071 } 00072 00073 void setNomberBoxIndex(int idx) { 00074 sellNomerBox->setCurrentIndex(idx); 00075 } 00076 int getNomberBoxIndex() { 00077 return sellNomerBox->currentIndex(); 00078 } 00079 00080 void setDateBoxIndex(int idx) { 00081 sellDateBox->setCurrentIndex(idx); 00082 } 00083 int getDateBoxIndex() { 00084 return sellDateBox->currentIndex(); 00085 } 00086 00087 void setTimeBoxIndex(int idx) { 00088 sellTimeBox->setCurrentIndex(idx); 00089 } 00090 int getTimeBoxIndex() { 00091 return sellTimeBox->currentIndex(); 00092 } 00093 00094 void setKolBoxIndex(int idx) { 00095 sellKolBox->setCurrentIndex(idx); 00096 } 00097 int getKolBoxIndex() { 00098 return sellKolBox->currentIndex(); 00099 } 00100 00101 void setLastKnownFile(QString fl) { 00102 last_known_file = fl; 00103 } 00104 QString getLastKnownFile() { 00105 return last_known_file; 00106 } 00107 00108 void setLastKnownPos(int pos) { 00109 last_known_pos = pos; 00110 } 00111 int getLastKnownPos() { 00112 return last_known_pos; 00113 } 00114 00115 void setLastKnownDate(QDate dt) { 00116 last_known_date = dt; 00117 } 00118 QDate getLastKnownDate() { 00119 return last_known_date; 00120 } 00121 void setSellMethod(int index) { 00122 methodSellBox->setCurrentIndex(index); 00123 } 00124 00125 void on_clear_last_button_clicked(QSettings *m_settings); 00126 void updateSellTab(); 00127 00128 private slots: 00129 void on_selectSellFileButtonClicked(); 00130 void on_clear_last_button_clicked(); 00131 int foundStartPos(QDate dt1, int init_pos); 00132 int foundEndPos(QDate dt2, int init_pos); 00133 int foundInitPos(QDate dt1); 00134 00135 private: 00136 //QWidget *tab7; 00137 QGridLayout *layTab7; 00138 QLabel *lb1, *lb2, *lb3, *lb4, *lb5, *lb6, *lb7, *lb8, *lb9, *lb10; 00139 QComboBox *sellNomerBox, *sellDateBox, *sellTimeBox, *sellKolBox; 00140 QPushButton *selectSellFileButton; 00141 QPushButton *saveSellSettingsButton; 00142 QString sellFileName; 00143 QStringList sellOpisateli; 00144 QComboBox *methodSellBox; 00145 //QLineEdit *methodSellValue; 00146 QCalendarWidget *dateStart, *dateStop; 00147 bool sell_file_is_checked; 00148 Tinformer *sell_informer; 00149 QDate last_known_date; 00150 int last_known_pos; 00151 QString last_known_file; 00152 QPushButton *clear_last_button; 00153 QProgressBar *progressBar; 00154 QStatusBar *statusBar; 00155 00156 //methodSellBox->setCurrentIndex(1); 00157 //int methodSell = methodSellBox->currentIndex(); 00158 //0 - заменить количество товара количеством проданных единиц 00159 //1 - вычесть из старого количества количество проданных единиц 00160 //2 - определение среднего за день (заносим в поле Цена2) и количества проданного 00161 00162 00163 }; 00164 00165 00166 #endif // SELLFILTERWIDGET_H