Suivez et participez au développement du nouvel OpenCellar : PLOC.co
> Open Cellar for Windows
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Developers resources
> Open Cellar for Mobile
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Open Cellar for Mac/Linux
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Developers resources
> My Account
> My Live services
> My pages
> My library
> My published wines
> My labels
> My posted messages
> Write a page
> Open Cellar Forum Index
> Windows Forum
> Mac/Linux Forum
> Mobile Forum
> Search for and import wines
> Search for labels
> Compare prices (Sniffer)
Search:
> Search with all engines
> Search in forums
> Search in personal pages
> Search on open-cellar.com
> Search in wine cards
> Search in labels
> Search in price comparison tool (Sniffer)
Welcome (
connect
-
create an account
)
Home
»
The forum
»
Open Cellar Home Edition (Windows)
Nuage de tags
Open Cellar
Scripts
Etiquette
PPP
Cellar book
Mac
Vista
Synchronisation
Excel export
vinoXml
usb
sniffer
backup
import
printing
chardonnet
palm
statistics
Linux
Entrée-sortie
08/12/2007
Reply
Entrée-sortie
vauchel max
32 posts
Est-il possible de lister les entrées-sorties. Je ne les retrouve que dans les statistiques.
Sincères salutations
08/12/2007
Reply
Re : Entrée-sortie
Administrateur
3099 posts
Bonsoir,
Oui c'est faisable, copier/coller le script suivant (menu Préférences -> Editeur de scripts)
if(App.ActiveCellar == null) { MessageBox.Show("Aucune cave n'est ouverte"); return; } TableManager manager = new TableManager(App); manager.BeginUpdate(); DataTable table = new DataTable("AfficherPA"); table.DefaultView.AllowDelete = false; table.CaseSensitive = false; table.DefaultView.AllowEdit = false; table.DefaultView.AllowNew = false; // SysId DataColumn col = new DataColumn("SysId", typeof(string)); col.Caption = "SysId"; table.Columns.Add(col); // Année col = new DataColumn("Year", typeof(ushort)); col.Caption = "Année"; table.Columns.Add(col); // Nom col = new DataColumn("Name", typeof(string)); col.Caption = "Vin"; table.Columns.Add(col); // Prix col = new DataColumn("Price", typeof(float)); col.Caption = "Prix unitaire "; table.Columns.Add(col); // Achat col = new DataColumn("Buy", typeof(ushort)); col.Caption = "Achat "; table.Columns.Add(col); // Consommation col = new DataColumn("Consume", typeof(ushort)); col.Caption = "Consommation "; table.Columns.Add(col); // Date col = new DataColumn("Date", typeof(DateTime)); col.Caption = "Date "; table.Columns.Add(col); // Commentaire fiche col = new DataColumn("Comment", typeof(string)); col.Caption = "Commentaire fiche"; table.Columns.Add(col); table.BeginLoadData(); // Liste des vins ObjectCollection oc = manager.Application.ActiveCellar.GetCollection((ushort)ObjectType.Wine); for(int i = 0; i < oc.Count; i++) { Wine w = (Wine)oc[i]; // Fiches achats consos for (int j = 0; j < w.Purchases.Count; j++) { PurchaseSales ps = (PurchaseSales)w.Purchases[j]; DataRow r = table.NewRow(); r["Name"] = w.Name.Trim(); r["SysId"] = w.SystemUID; r["Comment"] = ps.Comment.Replace("\n", " "); r["Year"] = w.Year; r["Price"] = ps.Price; r["Buy"] = ps.PurchaseBottles; r["Date"] = ps.Date; r["Consume"] = ps.ConsumeBottles; table.Rows.Add(r); } } table.EndLoadData(); manager.DataSource = table; manager.EndUpdate(); ITableWindow tableWindow = (ITableWindow)App.GetWindow(WindowType.Table, manager); if(tableWindow != null) { tableWindow.Show(); }
Il vous affichera le vin, le millésime, prix unitaire, date, nb achat, nb conso et commentaire.
Matthieu
10/12/2007
Reply
Re : Entrée-sortie
psgfan
60 posts
Excellent !
Encore un script bien utile
Sera t'il par ex inclus dans la prochaine weeklybuild ?
Sinon pourrais tu proposer pour faciliter le tri une version qui inclu les colonnes region et appelation stp ?
10/12/2007
Reply
Re : Entrée-sortie
Administrateur
3099 posts
Et hop,
if(App.ActiveCellar == null) { MessageBox.Show("Aucune cave n'est ouverte"); return; } TableManager manager = new TableManager(App); manager.BeginUpdate(); DataTable table = new DataTable("AfficherPAEx"); table.DefaultView.AllowDelete = false; table.CaseSensitive = false; table.DefaultView.AllowEdit = false; table.DefaultView.AllowNew = false; // SysId DataColumn col = new DataColumn("SysId", typeof(string)); col.Caption = "SysId"; table.Columns.Add(col); // Année col = new DataColumn("Year", typeof(ushort)); col.Caption = "Année"; table.Columns.Add(col); // Nom col = new DataColumn("Name", typeof(string)); col.Caption = "Vin"; table.Columns.Add(col); // Région col = new DataColumn("Area", typeof(string)); col.Caption = "Région"; table.Columns.Add(col); // Appellation col = new DataColumn("Appellation", typeof(string)); col.Caption = "Appellation"; table.Columns.Add(col); // Prix col = new DataColumn("Price", typeof(float)); col.Caption = "Prix unitaire "; table.Columns.Add(col); // Achat col = new DataColumn("Buy", typeof(ushort)); col.Caption = "Achat "; table.Columns.Add(col); // Consommation col = new DataColumn("Consume", typeof(ushort)); col.Caption = "Consommation "; table.Columns.Add(col); // Date col = new DataColumn("Date", typeof(DateTime)); col.Caption = "Date "; table.Columns.Add(col); // Commentaire fiche col = new DataColumn("Comment", typeof(string)); col.Caption = "Commentaire fiche"; table.Columns.Add(col); table.BeginLoadData(); // Liste des vins ObjectCollection oc = manager.Application.ActiveCellar.GetCollection((ushort)ObjectType.Wine); for(int i = 0; i < oc.Count; i++) { Wine w = (Wine)oc[i]; // Fiches achats consos for (int j = 0; j < w.Purchases.Count; j++) { PurchaseSales ps = (PurchaseSales)w.Purchases[j]; DataRow r = table.NewRow(); r["Name"] = w.Name.Trim(); r["Area"] = w.Area.Name.Trim(); r["Appellation"] = w.Appellation.Name.Trim(); r["SysId"] = w.SystemUID; r["Comment"] = ps.Comment.Replace("\n", " "); r["Year"] = w.Year; r["Price"] = ps.Price; r["Buy"] = ps.PurchaseBottles; r["Date"] = ps.Date; r["Consume"] = ps.ConsumeBottles; table.Rows.Add(r); } } table.EndLoadData(); manager.DataSource = table; manager.EndUpdate(); ITableWindow tableWindow = (ITableWindow)App.GetWindow(WindowType.Table, manager); if(tableWindow != null) { tableWindow.Show(); }
Pour ce qui est de l'intégration je prépare un pack de scripts tout aussi sympathique ;-)
Matthieu
11/12/2007
Reply
Re : Entrée-sortie
psgfan
60 posts
merci
++
© 2006-2014
Matthieu DUCROCQ
- All rights reserved - Last update: january 2014 |
|
Support Open Cellar
|
Contact
|
About