payutc / scoobydoo

Interface web pour l'administration des données (droits, articles, comptabilité...)
2 stars 7 forks source link

Treso #7

Closed ptbrowne closed 11 years ago

ptbrowne commented 11 years ago

Ajout d'un module dans Scoobydoo permettant de voir le CA sur une période donnée.

apuyou commented 11 years ago

Voir https://github.com/payutc/scoobydoo/issues/2

Idem que sur https://github.com/payutc/server/pull/30, tu veux qu'on commence à tester ou non ?

ptbrowne commented 11 years ago

Oui je veux bien que vous testiez.

apuyou commented 11 years ago

Quand j'arrive sur le module, il y a :

Notice: Undefined variable: summary in /Users/arthur/Sites/scoo/modules/treso/ModuleTreso.class.php on line 42

Du coup ça fait planter le JavaScript :

Uncaught TypeError: Cannot read property 'success' of null :8888/scoo/?module=treso&action=index:57
Uncaught TypeError: Cannot read property 'forEach' of null underscore.js:77

Ensuite si je tape une date à la main, il me renvoie sur la page d'accueil de scoobydoo, donc j'arrive pas plus loin ^^

Juste par curiosité aussi, il y a une raison pour laquelle tu fais les tableaux en JS et pas en PHP ?

ptbrowne commented 11 years ago

Tu peux essayer une URL genre : http://localhost/payutc/scoobydoo/?module=treso&action=index&day=01&month=10&year=2012&day2=18&month2=11&year2=2012 pour voir si ca marche ?

On Sun, Nov 18, 2012 at 10:37 PM, Arthur Puyou notifications@github.comwrote:

Quand j'arrive sur le module, il y a :

Notice: Undefined variable: summary in /Users/arthur/Sites/scoo/modules/treso/ModuleTreso.class.php on line 42

Du coup ça fait planter le JavaScript :

Uncaught TypeError: Cannot read property 'success' of null :8888/scoo/?module=treso&action=index:57 Uncaught TypeError: Cannot read property 'forEach' of null underscore.js:77

Ensuite si je tape une date à la main, il me renvoie sur la page d'accueil de scoobydoo, donc j'arrive pas plus loin ^^

Juste par curiosité aussi, il y a une raison pour laquelle tu fais les tableaux en JS et pas en PHP ?

— Reply to this email directly or view it on GitHubhttps://github.com/payutc/scoobydoo/pull/7#issuecomment-10492021.

apuyou commented 11 years ago

Ouaip ça marche, par contre j'ai mon article en coupé en trois (alors que c'est le même obj_id) :

var summary = {"success":[{"0":"2","obj_id":"2","1":"Coca","obj_name":"Coca","2":"Softs","categorie":"Softs","3":"0","objet_deleted":"0","4":"1","nombre":"1","5":"0.7000","montant_total":"0.7000","6":"PICASSO","fun_name":"PICASSO","7":"17","jour":"17","8":"10","mois":"10","9":"42","semaine":"42","10":"2012","annee":"2012"},{"0":"2","obj_id":"2","1":"Coca","obj_name":"Coca","2":"Softs","categorie":"Softs","3":"0","objet_deleted":"0","4":"6","nombre":"6","5":"4.2000","montant_total":"4.2000","6":"PICASSO","fun_name":"PICASSO","7":"24","jour":"24","8":"10","mois":"10","9":"43","semaine":"43","10":"2012","annee":"2012"},{"0":"2","obj_id":"2","1":"Coca","obj_name":"Coca","2":"Softs","categorie":"Softs","3":"0","objet_deleted":"0","4":"1","nombre":"1","5":"0.7000","montant_total":"0.7000","6":"PICASSO","fun_name":"PICASSO","7":"25","jour":"25","8":"10","mois":"10","9":"43","semaine":"43","10":"2012","annee":"2012"}],"query":"\n\t\tSELECT t.obj_id,\n\t\t\t   o.obj_name, parent.obj_name as categorie,\n\t\t\t   o.obj_removed as objet_deleted, COUNT(*) as nombre,\n\t\t\t   SUM(pur_price\/100) as montant_total, fun.fun_name,\n\n\t\t\t   DAY(pur_date) as jour,\n\t\t\t   MONTH(pur_date) as mois,\n\t\t\t   WEEK(pur_date) as semaine,\n\t\t\t   YEAR(pur_date) as annee\n\n\t\tFROM t_purchase_pur t, t_object_obj o, t_object_obj parent, tj_object_link_oli link, t_fundation_fun fun\n\t\tWHERE t.obj_id = o.obj_id\n\t\tAND fun.fun_id = t.fun_id\n\t\tAND link.obj_id_child = o.obj_id\n\t\tAND link.obj_id_parent = parent.obj_id\n\t\tAND link.oli_removed = 0\n\t\tAND pur_removed = 0\n\n\t\tAND DATE(pur_date) BETWEEN '%u-%u-%u' AND '%u-%u-%u'\n\t\tGROUP BY obj_id, DAY(pur_date), MONTH(pur_date)\n\t\tORDER BY fun_name, mois, jour ASC\n        \t"};

Y'a aussi toutes les données en double dans le json (fetch_array+fetch_assoc), mais c'est côté serveur ça.

trecouvr commented 11 years ago

Yop,

Faudrait que tu fasses une fonction (dans la partie php de scoobydoo) qui le sors au format csv, voir excel. Comme ça le trésorier a juste a cliquer sur un bouton download.

mattgu74 commented 11 years ago

+1 pour thomas mais presqiue rien à voir avec le commit ,)

trecouvr commented 11 years ago

corrigé dans c3594230ecdafc653a7f6e84373e35a872ca6df2