Skip to content

Commit

Permalink
graphael
Browse files Browse the repository at this point in the history
  • Loading branch information
harenome committed Apr 28, 2014
1 parent e17d5b9 commit b796f75
Show file tree
Hide file tree
Showing 11 changed files with 825 additions and 504 deletions.
660 changes: 300 additions & 360 deletions qlot/ajoutmarchandisedialog.ui

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion qlot/articles_existants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ articles_existants_const_iterator articles_existants::end (void) const

void articles_existants::ajouter_article (const article & a)
{
_articles.insert (articles_existants_element (a.reference ().vers_entier (), a));
if (existe (a.reference ()))
{
article & ar = operator[] (a.reference ());
ar.modifier_date_livraison (a.date_livraison ());
}
else
_articles.insert (articles_existants_element (a.reference ().vers_entier (), a));
}

void articles_existants::retirer_article (const article & a)
Expand Down
9 changes: 7 additions & 2 deletions qlot/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <iostream>
#include "mainwindow.h"
#include "ui_mainwindow.h"

Expand Down Expand Up @@ -92,15 +93,18 @@ void MainWindow::nouvellebdd()
void MainWindow::enregistrer()
{
QString filename;
filename = QFileDialog::getSaveFileName(this,tr("Enregistrer un fichier de gestion QloT"),QString(),tr("FichierQloT (*.qlot *.culotte)"));
filename = QFileDialog::getSaveFileName(this,tr("Enregistrer un fichier de gestion QloT"),QString(),tr("FichierQloT *.qlot(*.qlot *.culotte)"));
es::sauvegarder_magasin(filename.toStdString(),m);
}

void MainWindow::ouvrir()
{
QString filename;
filename = QFileDialog::getOpenFileName(this,tr("Ouvrir un fichier de gestion QloT"),QString(),tr("FichierQloT (*.qlot *.culotte)"));
filename = QFileDialog::getOpenFileName(this,tr("Ouvrir un fichier de gestion QloT"),QString(),tr("FichierQloT *.qlot(*.qlot *.culotte)"));
es::charger_magasin(filename.toStdString(),m);
std::cout << filename.toStdString() << std::endl;
affichage_gestion();
affichage_vente();
}

void MainWindow::affichage_gestion()
Expand Down Expand Up @@ -595,6 +599,7 @@ void MainWindow::affichage_vente()
}
std::vector<vente> vv = m.ventes();

std::cout << vv[i] << std::endl;
sprintf(id[i],"%u",vv[i].id());
ui->tableWidget_vente->item(i,0)->setText(id[i]);

Expand Down
33 changes: 30 additions & 3 deletions qlot/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</rect>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
Expand Down Expand Up @@ -131,6 +131,15 @@
<property name="autoScroll">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
Expand All @@ -150,7 +159,7 @@
<number>8</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
Expand Down Expand Up @@ -345,6 +354,24 @@
</widget>
</widget>
<widget class="QTableWidget" name="tableWidget_vente">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>180</number>
</attribute>
Expand Down Expand Up @@ -382,7 +409,7 @@
<x>0</x>
<y>0</y>
<width>744</width>
<height>25</height>
<height>17</height>
</rect>
</property>
<widget class="QMenu" name="menuFichier">
Expand Down
2 changes: 1 addition & 1 deletion qlot/pourcentage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ std::ostream & operator<< (std::ostream & os, const pourcentage & p)
std::istream & operator>> (std::istream & is, pourcentage & p)
{
unsigned int valeur;
unsigned int caractere;
char caractere;

is >> valeur >> caractere;

Expand Down
103 changes: 49 additions & 54 deletions qlot/qlot.pro.user

Large diffs are not rendered by default.

265 changes: 265 additions & 0 deletions qlot/qlot.pro.user.c69e12f.2.5pre1

Large diffs are not rendered by default.

225 changes: 151 additions & 74 deletions qlot/statdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,93 +9,170 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>187</height>
<width>210</width>
<height>136</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Statistiques</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../images/qlot_512.svg</normaloff>../images/qlot_512.svg</iconset>
</property>
<widget class="QPushButton" name="valide_stat">
<property name="geometry">
<rect>
<x>150</x>
<y>130</y>
<width>98</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
<widget class="QSplitter" name="splitter">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>110</x>
<y>80</y>
<width>201</width>
<height>27</height>
<x>15</x>
<y>15</y>
<width>181</width>
<height>108</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Bénéfices</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_benefice">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="suffix">
<string>€</string>
</property>
<property name="maximum">
<double>999999.989999999990687</double>
</property>
</widget>
</widget>
<widget class="QSplitter" name="splitter_2">
<property name="geometry">
<rect>
<x>80</x>
<y>30</y>
<width>231</width>
<height>27</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QLabel" name="label">
<property name="text">
<string>Chiffre d'affaire</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_chiffre_affaire">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="suffix">
<string>€</string>
</property>
<property name="maximum">
<double>999999.989999999990687</double>
</property>
</widget>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing</set>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Chiffre d'affaire</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_chiffre_affaire">
<property name="wrapping">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string>€</string>
</property>
<property name="maximum">
<double>999999.989999999990687</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Bénéfices</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_benefice">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string>€</string>
</property>
<property name="maximum">
<double>999999.989999999990687</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="valide_stat">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources/>
Expand Down
10 changes: 9 additions & 1 deletion qlot/stock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ stock_const_iterator stock::end (void) const

void stock::ajouter_article (const article_stock & a)
{
_stock.insert (stock_element (a.reference ().vers_entier (), a));
reference_article r = a.reference ();
if (article_en_stock (r))
{
article_stock & ar = operator[] (r);
unsigned nouveau_stock = ar.quantite_stock () + a.quantite_stock ();;
ar.modifier_quantite_stock (nouveau_stock);
}
else
_stock.insert (stock_element (a.reference ().vers_entier (), a));
}

void stock::ajouter_article (const reference_article & reference, unsigned int quantite, const pourcentage & rabais)
Expand Down
2 changes: 1 addition & 1 deletion qlot/stockdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StockDialog : public QDialog
Ui::StockDialog *ui;

private slots:
void StockDialog::refresh_nb();
void refresh_nb();
};

#endif // STOCKDIALOG_H
Loading

0 comments on commit b796f75

Please sign in to comment.