diff --git a/mondumas.egg-info/PKG-INFO b/mondumas.egg-info/PKG-INFO index dc19f33..a3fe2df 100644 --- a/mondumas.egg-info/PKG-INFO +++ b/mondumas.egg-info/PKG-INFO @@ -2,57 +2,55 @@ Metadata-Version: 2.1 Name: mondumas Version: 1.0 Summary: mondumas -Home-page: UNKNOWN +Home-page: Author: Author-email: -License: UNKNOWN -Description: # README # - - Cette application web permet aux collaborateurs de l'entreprise Dumas : - - - de consulter et de gérer les dossiers des clients depuis leur tablette - - de créer un rapport de fuite et le faire signer par le client - - Elle est développée avec les composants open source suivants : - - ## Backend - - - [Python](https://www.python.org/downloads/) 3.7 - - [Pyramid web framework](https://trypyramid.com/) 1.10 - - [MySQL server](https://mysql.com/) 5.7 sur Windows Server 2008 R2 Standard - - [Apache web server](https://apache.org/) 2.4 sur Debian GNU/Linux 9 (stretch) - - ## Frontend - - - [Bootstrap framework](https://getbootstrap.com/) for CSS 3.3.7 - - [Jquery](https://jquery.com/download/) for JavaScript 3.2.1 - - Chameleon templates - - [FormValidation](https://formvalidation.io/) form validator 0.7.0 - - ## Jquery Plugins - - - [DataTables](https://datatables.net/) 1.10.20 - - [Fullcalendar](https://fullcalendar.io/) 3.9.0 - - [fullcalendar Scheduler](https://fullcalendar.io/) 1.9.4 - - [Jquery-ui et jquery-ui-themes](https://jqueryui.com/) 1.12.1 - - [jSignature](https://willowsystems.github.io/jSignature) - - [less.js](http://lesscss.org/) 3.11.1 - - [moment.js](https://momentjs.com/) with-locales.min.js - - - [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) - - - - 0.0 - --- - - - Initial version - Keywords: web wsgi bfg pylons pyramid -Platform: UNKNOWN Classifier: Programming Language :: Python Classifier: Framework :: Pyramid Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application Provides-Extra: testing + +# README # + +Cette application web permet aux collaborateurs de l'entreprise Dumas : + + - de consulter et de gérer les dossiers des clients depuis leur tablette + - de créer un rapport de fuite et le faire signer par le client + +Elle est développée avec les composants open source suivants : + +## Backend + +- [Python](https://www.python.org/downloads/) 3.7 +- [Pyramid web framework](https://trypyramid.com/) 1.10 +- [MySQL server](https://mysql.com/) 5.7 sur Windows Server 2008 R2 Standard +- [Apache web server](https://apache.org/) 2.4 sur Debian GNU/Linux 9 (stretch) + +## Frontend + +- [Bootstrap framework](https://getbootstrap.com/) for CSS 3.3.7 +- [Jquery](https://jquery.com/download/) for JavaScript 3.2.1 +- Chameleon templates +- [FormValidation](https://formvalidation.io/) form validator 0.7.0 + +## Jquery Plugins + +- [DataTables](https://datatables.net/) 1.10.20 +- [Fullcalendar](https://fullcalendar.io/) 3.9.0 +- [fullcalendar Scheduler](https://fullcalendar.io/) 1.9.4 +- [Jquery-ui et jquery-ui-themes](https://jqueryui.com/) 1.12.1 +- [jSignature](https://willowsystems.github.io/jSignature) +- [less.js](http://lesscss.org/) 3.11.1 +- [moment.js](https://momentjs.com/) with-locales.min.js + + +[Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) + + + +0.0 +--- + +- Initial version diff --git a/mondumas.egg-info/entry_points.txt b/mondumas.egg-info/entry_points.txt index 19e4c93..1454dfe 100644 --- a/mondumas.egg-info/entry_points.txt +++ b/mondumas.egg-info/entry_points.txt @@ -1,4 +1,2 @@ - [paste.app_factory] - main = mondumas:main - [console_scripts] - \ No newline at end of file +[paste.app_factory] +main = mondumas:main diff --git a/mondumas.egg-info/requires.txt b/mondumas.egg-info/requires.txt index 311dd41..bc50042 100644 --- a/mondumas.egg-info/requires.txt +++ b/mondumas.egg-info/requires.txt @@ -8,7 +8,7 @@ SQLAlchemy==1.2.19 transaction zope.sqlalchemy==1.1 waitress -mysqlclient==2.1 +mysqlclient==1.4 docutils pdfkit python-dateutil diff --git a/mondumas/models/devis.py b/mondumas/models/devis.py index c14b7fa..3db1631 100644 --- a/mondumas/models/devis.py +++ b/mondumas/models/devis.py @@ -25,19 +25,23 @@ def execute_query(request, query, params): mark_changed(request.dbsession) transaction.commit() -def get_devis_byName(request, societe, name): - numero = to_int(name) + +def get_dossiers_byName(request, societe, name): + # lires tous les dossiers d'un chantier - if numero > 0: - query = """SELECT date,'DE' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, COALESCE(totalht,0) AS montant, status, nosin, nopol, nochantier, web - FROM devis WHERE societe=:societe AND no_id >=:name AND web = 'W' LIMIT 300;;""" % (societe, name) - elif len(name) == 0: - query = """SELECT date,'DE' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, COALESCE(totalht,0) AS montant, status, nosin, nopol, nochantier, web - FROM devis WHERE societe=:societe AND web = 'W' ORDER BY no_id DESC LIMIT 300;""" - else: - query = """(SELECT date,'DE' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, COALESCE(totalht,0) AS montant, status, nosin, nopol , nochantier, web - FROM devis WHERE societe=:societe AND c_nom LIKE ':name%' AND web = 'W' LIMIT 500)""" - results = request.dbsession.execute(query, {'societe': societe, 'name': name}).fetchall() + query = """select * from ( + SELECT date,'DD' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, 0 AS montant, status, nosin, societe , no_id as nochantier + FROM dem_devis WHERE societe=:societe AND c_nom LIKE :name + UNION + SELECT date,'DE' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, COALESCE(totalht,0) AS montant, status, nosin, societe , nochantier + FROM devis WHERE societe=:societe AND c_nom LIKE :name + UNION + SELECT date,'FA' AS TYPE, LPAD(no_id,6,'0') AS numero, nomcli, CONCAT(c_nom,'; ',c_adr,'; ',c_ville) AS chantier, COALESCE(totalht,0) AS montant, status, nosin, societe , nochantier + FROM facture WHERE societe=:societe AND c_nom LIKE :name + ) a + order by date, TYPE + """ + results = request.dbsession.execute(query, {'societe': societe, 'name': name+'%'}).fetchall() return results def get_devfac_by_no(request,nodossier): @@ -235,3 +239,14 @@ def update_devis_cloture(request, nodevis, status, logged_in): query = "UPDATE devis SET STATUS = :status, USERMAJ = :logged_in WHERE societe=:societe AND no_id=:nochantier;" execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'status': status, 'logged_in': logged_in}) +def update_devis_nochantier(request, societe, no_devis, nochantier): + # extraire type de doc et no de doc à mettre à jour + type = no_devis[0:2] + no_id = no_devis[3:] + if type == 'DE': + # maj le numero du dossier du devis + query = "UPDATE devis SET nochantier = :nochantier WHERE societe=:societe AND no_id=:no_id;" + else: + # maj le numero du dossier de la facture + query = "UPDATE facture SET nochantier = :nochantier WHERE societe=:societe AND no_id=:no_id;" + execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'no_id': no_id}) diff --git a/mondumas/routes.py b/mondumas/routes.py index 77edd74..b91b04c 100644 --- a/mondumas/routes.py +++ b/mondumas/routes.py @@ -22,8 +22,9 @@ def includeme(config): # devis config.add_route('devis_ligne', '/devis_ligne/{type_ligne}/{nodevis}/{nolig}') config.add_route('devis_lig_mv', '/devis_lig_mv/{move}/{nodevis}/{nolig}') - config.add_route('devis_list', '/devis_list') + config.add_route('devis_list', '/devis_list/{societe}/{nodevis}') config.add_route('devis_create', '/devis_create/{nodossier}') + config.add_route('devis_nochantier', '/devis_nochantier/{societe}/{nodevis}/{nochantier}') config.add_route('devis_web', '/devis_web/{nodevis}') config.add_route('devis_view', '/devis_view/{nodevis}') config.add_route('devis_preview', '/devis_preview/{nodevis}') diff --git a/mondumas/templates/default/home.pt b/mondumas/templates/default/home.pt index 32ebfe3..78ef56f 100644 --- a/mondumas/templates/default/home.pt +++ b/mondumas/templates/default/home.pt @@ -133,11 +133,11 @@