commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue-contrib] r226 - / schmuck schmuck/bin schmuck/etc schmuck/share


From: johannes
Subject: [gnue-contrib] r226 - / schmuck schmuck/bin schmuck/etc schmuck/share
Date: Tue, 18 Oct 2005 08:45:24 -0500 (CDT)

Author: johannes
Date: 2005-10-18 08:45:24 -0500 (Tue, 18 Oct 2005)
New Revision: 226

Added:
   schmuck/
   schmuck/bilder/
   schmuck/bin/
   schmuck/bin/createdb
   schmuck/bin/form
   schmuck/bin/form.bat
   schmuck/etc/
   schmuck/etc/connections.conf
   schmuck/pdfs/
   schmuck/share/
   schmuck/share/__init__.py
   schmuck/share/laderep.py
   schmuck/share/schmuck.gfd
   schmuck/share/schmuck.gsd
   schmuck/var/
Log:
Added to repository


Added: schmuck/bin/createdb
===================================================================
--- schmuck/bin/createdb        2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/bin/createdb        2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+cd $(dirname $0)
+cd ..
+gnue-schema --connections=etc/connections.conf --connection=schmuck 
share/schmuck.gsd


Property changes on: schmuck/bin/createdb
___________________________________________________________________
Name: svn:executable
   + *

Added: schmuck/bin/form
===================================================================
--- schmuck/bin/form    2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/bin/form    2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+cd $(dirname $0)
+cd ..
+param=""
+test "$DISPLAY" || param="-u curses"
+export PYTHONPATH="$PYTHONPATH:./share"
+gfcvs -s --connections=etc/connections.conf ${param} share/schmuck.gfd


Property changes on: schmuck/bin/form
___________________________________________________________________
Name: svn:executable
   + *

Added: schmuck/bin/form.bat
===================================================================
--- schmuck/bin/form.bat        2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/bin/form.bat        2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,6 @@
address@hidden OFF
+
+cd ..
+REM SET PYTHONPATH=%PYTHONPATH%;g:\luna\share\
+copy share\laderep.py c:\programme\gnue\bin
+c:\programme\gnue\bin\gnue-forms -s --connections=etc/connections.conf 
share/schmuck.gfd


Property changes on: schmuck/bin/form.bat
___________________________________________________________________
Name: svn:executable
   + *

Added: schmuck/etc/connections.conf
===================================================================
--- schmuck/etc/connections.conf        2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/etc/connections.conf        2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,13 @@
+[schmuck]
+comment = Berno Test Datenbank
+provider = pypgsql
+host = langley
+dbname = schmuck
+username = gnue
+password = gnue
+
+[schmuck-sqlite]
+comment = Berno Test Datenbank
+provider = sqlite
+dbname = var/schmuck
+encoding = latin1

Added: schmuck/share/__init__.py
===================================================================


Property changes on: schmuck/share/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: schmuck/share/laderep.py
===================================================================
--- schmuck/share/laderep.py    2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/share/laderep.py    2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,413 @@
+# Schmuck - Report Generator
+#
+# Copyright 2005 Bytewise Software GmbH
+#
+# This program is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+import os
+import os.path
+import datetime
+import Image
+
+from gnue import paths
+from gnue.common.apps import errors
+from gnue.common.datasources import GConnections
+from gnue.common.datasources import GDataSource
+
+from reportlab.pdfgen import canvas
+from reportlab.lib.units import cm, mm
+from reportlab.lib.pagesizes import A4
+from reportlab.pdfbase import pdfmetrics
+
+# =============================================================================
+# Exceptions
+# =============================================================================
+
+class NoFileNameError (errors.ApplicationError):
+  def __init__ (self):
+    msg = u_("Kein Dateiname fuer die PDF-Datei angegeben")
+    errors.ApplicationError.__init__ (self, msg)
+
+
+# =============================================================================
+# Berichtklasse fuer Laden-Inhalt
+# =============================================================================
+
+class LadeBericht:
+
+  # ---------------------------------------------------------------------------
+  # Constructor
+  # ---------------------------------------------------------------------------
+
+  def __init__ (self, connection, connections = None, filename = None,
+      statusText = None):
+    """
+    @param connection: name der connection
+    """
+
+    if connections is None:
+      if 'GNUE_CONNECTIONS' in os.environ:
+        cfile = os.environ ['GNUE_CONNECTIONS']
+      else:
+        cfile = os.path.join (paths.config, "connections.conf")
+
+      self.__connections = GConnections.GConnections (cfile)
+    else:
+      self.__connections = connections
+
+    self.connection = connection
+    self.filename   = filename
+    self.statusText = statusText
+
+
+  # ---------------------------------------------------------------------------
+  # PDF-Bericht erzeugen
+  # ---------------------------------------------------------------------------
+
+  def run (self, ladenr, filename = None):
+    """
+    @param ladennr: Nummer der Lade die ausgewertet werden soll
+    @param filename: Dateiname der PDF-Datei
+    """
+
+    pdffile = filename or self.filename
+    if not pdffile:
+      raise NoFileNameError
+
+    if ladenr:
+      self.ladeText = self.__ladeLesen (ladenr)
+    else:
+      self.ladeText = None
+
+    pdfcanv = canvas.Canvas (pdffile, pagesize = A4)
+
+    self.__setupPage (pdfcanv, ladenr, self.ladeText)
+
+    if ladenr is not None:
+      for record in self.__LadenInhalt (ladenr):
+        self.__recordDrucken (pdfcanv, ladenr, record)
+    else:
+      for record in self.__ArtikelListe ():
+        self.__recordDrucken (pdfcanv, None, record)
+
+    pdfcanv.line (cm, self.__line, A4 [0] - 1 * cm, self.__line)
+
+    pdfcanv.showPage ()
+    pdfcanv.save ()
+
+
+  # ---------------------------------------------------------------------------
+  # Bezeichnung der Lade lesen
+  # ---------------------------------------------------------------------------
+
+  def __ladeLesen (self, ladenr):
+
+    ladeRS = GDataSource.DataSourceWrapper (self.__connections, [u'text'],
+                 {'connection': self.connection,
+                  'name': 'dtsLade',
+                  'table': u'lade'}).createResultSet ({'nummer': ladenr})
+
+    rec = ladeRS.firstRecord ()
+
+    return rec is not None and rec.getField ('text') or '*** Unbekannt ***'
+
+
+  # ---------------------------------------------------------------------------
+  # Generator fuer den Inhalt der Lade
+  # ---------------------------------------------------------------------------
+
+  def __LadenInhalt (self, ladenr):
+
+    source = GDataSource.DataSourceWrapper (self.__connections,
+              ['i.nummer', 'i.artikel', 'a.text', 'a.preis'],
+              {'name': 'dtsInhalt',
+               'connection': self.connection,
+               'table': "inhalt i LEFT JOIN artikel a ON a.nummer = i.artikel",
+               'primarykey': "i.lade, i.nummer",
+               'order_by': "i.nummer"})
+
+    resultSet = source.createResultSet ({'i.lade': ladenr})
+
+    record = resultSet.firstRecord ()
+    while record is not None:
+      yield record
+      record = resultSet.nextRecord ()
+
+
+  # ---------------------------------------------------------------------------
+  # Lesen aller Artikel
+  # ---------------------------------------------------------------------------
+
+  def __ArtikelListe (self):
+
+    source = GDataSource.DataSourceWrapper (self.__connections,
+              ['a.nummer', 'a.text', 'a.preis'],
+              {'name': 'dtsInhalt',
+               'connection': self.connection,
+               'table': "artikel a",
+               'primarykey': "a.nummer",
+               'order_by': "a.nummer"})
+
+    resultSet = source.createResultSet ()
+
+    record = resultSet.firstRecord ()
+    while record is not None:
+      yield record
+      record = resultSet.nextRecord ()
+
+  # ---------------------------------------------------------------------------
+  # Seite einrichten (Kopf-/Fusszeilen) usw
+  # ---------------------------------------------------------------------------
+
+  def __setupPage (self, canvas, ladenr, ladeBeze):
+
+    (pwidth, pheight) = A4
+
+    if ladenr is not None:
+      kopf = "Lade %s - %s" % (ladenr.encode ("cp1252"),
+                               ladeBeze.encode ("cp1252"))
+    else:
+      kopf = "Artikelliste"
+
+    canvas.setFont ('Helvetica', 20)
+    canvas.drawString (1 * cm, pheight - 2 * cm, kopf)
+
+    if os.path.exists ('share/logo.jpg'):
+      image = Image.open ("share/logo.jpg")
+      (l, t, rw, rh) = image.getbbox ()
+      bw  = bh = 2 * cm
+      pos = pwidth - bw - cm
+      res = canvas.drawImage ('share/logo.jpg', pos, pheight - 3 * cm, bw, bh)
+
+    today = datetime.datetime.now ()
+
+    canvas.setFont ('Helvetica', 10)
+    canvas.drawString (1 * cm, cm,
+        "%s" % today.strftime ('%c'))
+
+    canvas.setLineWidth (0.01 * cm)
+    canvas.drawRightString (pwidth - 1 * cm, cm,
+        "Seite: %d" % canvas.getPageNumber ())
+
+    self.__line = pheight - 4 * cm
+
+
+  # ---------------------------------------------------------------------------
+  # Einen Datensatz drucken
+  # ---------------------------------------------------------------------------
+
+  def __recordDrucken (self, canvas, ladenr, record):
+
+    if ladenr is not None:
+      artikel = record ['i.artikel']
+    else:
+      artikel = record ['a.nummer']
+      laden = self.__LadenProArtikel (artikel)
+      print "A:",artikel, "LADEN:", laden
+      lText = [', '.join (laden)]
+      lText = self.__makeBlock (canvas, lText, 2 * cm, 'Helvetica', 10)
+      lHeight = len (lText) * 0.4 * cm
+
+    if self.statusText:
+      self.statusText ('Ausgabe von Artikel %s' % artikel)
+
+    # Erst mal die Hoehe der Textbloecke bestimmen
+    if record ['a.text']:
+      aText = [a.encode ('cp1252') for a in record ['a.text'].splitlines ()]
+    else:
+      aText = []
+    aText = self.__makeBlock (canvas, aText, 5 * cm, 'Helvetica', 10)
+
+    if record ['a.preis']:
+      pText = [p.encode ('cp1252') for p in record ['a.preis'].splitlines ()]
+    else:
+      pText = []
+
+    pText = self.__makeBlock (canvas, pText, 3 * cm, 'Helvetica-Bold', 14)
+    aHeight = len (aText) * 0.4 * cm    # Hoehe Artikeltext
+    pHeight = len (pText) * 0.6 * cm    # Hoehe Preistext
+    # bHeight = 2*cm                      # Hoehe des Bildes (Minimum)
+
+
+    # Ermitteln des korrekten Seitenverhaeltnisses fuer das Bild bei maximaler
+    # Ausdehnung in der Breite
+    bildURL = str ("bilder/%s.JPG" % artikel)
+    if os.path.exists (bildURL):
+      image = Image.open (bildURL)
+      (l,t,rw, rh) = image.getbbox ()
+
+      bWidth  = 4 * cm
+      bHeight = bWidth * (float (rh) / float (rw))
+      # bWidth  = maxHoehe / (float (rh) / float (rw))
+    else:
+      bHeight = 0
+      image   = None
+
+    maxHoehe = max (aHeight, pHeight, bHeight)
+
+    if self.__line - maxHoehe < 1.5 * cm:
+      canvas.showPage ()
+      self.__setupPage (canvas, ladenr, self.ladeText)
+
+    (pw, ph)   = A4
+    randLinks  = 1 * cm
+    randRechts = pw - 1 * cm
+
+    # Horizontale Positionen
+    poLade =  1 * cm
+    poArnr =  3 * cm
+    poBeze =  7 * cm
+    poBild = 13 * cm
+    poPrei = pw - 1*cm
+
+    # Die cLine ist die vertikale Mitte des Datensatzes
+    top   = self.__line
+    cLine = top - (float (maxHoehe) / 2) - 2 * mm
+
+    canvas.line (randLinks, top, randRechts, top)
+    # Zur Kontrolle koennte dieser Strich gezeichnet werden
+    # canvas.line (randLinks, cLine, randRechts, cLine)
+
+    if image is not None:
+      bTop = top - bHeight - 2 * mm
+      res = canvas.drawImage (bildURL, poBild, bTop, bWidth, bHeight)
+    else:
+      txt = canvas.beginText ()
+      txt.setFont ('Helvetica', 10)
+      bTop = cLine + (aHeight / 2) - 3 * mm
+      txt.setTextOrigin (poBild, bTop)
+      txt.textLine ("'%s' fehlt" % bildURL)
+      canvas.drawText (txt)
+
+
+    if ladenr is not None:
+      bTop = cLine - 0.5 * mm
+      # Ladennummer is etwa 9 mm gross
+      ladeNr = canvas.beginText ()
+      ladeNr.setFont ('Helvetica-Bold', 18)
+      ladeNr.setTextOrigin (poLade, bTop)
+      ladeNr.setLeading (12)
+      ladeNr.textLine ("%s" % ladenr)
+      ladeNr.setFont ('Times-Roman', 10)
+      ladeNr.textLine ('Lade')
+      canvas.drawText (ladeNr)
+    else:
+      poArnr  = poLade
+      poBeze -=  2 * cm
+      poLaden = 11 * cm
+
+    # Die Artikelnummer ist 4 mm gross
+    bTop = cLine - 2 * mm
+    canvas.setFont ('Helvetica', 18)
+    canvas.drawString (poArnr, bTop, artikel)
+
+    # Die Bezeichnung ist aHeight Punkte hoch. Dabei muss die Position um die
+    # erste Baseline (4mm) noch verschoben werden.
+    bTop = cLine + (aHeight / 2) - 3 * mm
+    beze = canvas.beginText ()
+    beze.setTextOrigin (poBeze, bTop)
+    beze.setFont ('Helvetica', 10)
+    beze.textLines (aText)
+    canvas.drawText (beze)
+    
+    # Der Preistext ist pHeight Punkte hoch. Auch hier muss die Differenz zu
+    # maxHoehe ausgemittelt werden.
+    ctop  = cLine + (pHeight / 2) - 5 * mm
+    canvas.setFont ('Helvetica-Bold', 14)
+    for zeile in pText:
+      canvas.drawRightString (poPrei, ctop, zeile)
+      ctop -= 0.6 * cm
+
+    # Ist *keine* Lade definiert, kommen jetzt alle Laden des akt. Artikels
+    if ladenr is None:
+      ctop  = cLine + (lHeight / 2) - 3 * mm
+      canvas.setFont ('Helvetica', 10)
+      text = canvas.beginText ()
+      text.setTextOrigin (poLaden, bTop)
+      text.setFont ('Helvetica', 10)
+      text.textLines (lText)
+      canvas.drawText (text)
+
+    self.__line = self.__line - maxHoehe - 4 * mm
+
+
+  # ---------------------------------------------------------------------------
+  # Zeilenumbruch so durchfuehren, dass eine geg. Breite eingehalten wird
+  # ---------------------------------------------------------------------------
+
+  def __makeBlock (self, canvas, text, width, fontName, fontSize):
+
+    result = []
+
+    for line in text:
+      w = canvas.stringWidth (line, fontName, fontSize)
+      if w > width:
+        words = line.split ()
+
+        while words:
+          cw = words [:]
+          while canvas.stringWidth (' '.join (cw), fontName, fontSize) > width:
+            cw = cw [:-1]
+
+          result.append (' '.join (cw))
+          for item in cw: words.remove (item)
+
+      else:
+        result.append (line)
+
+    return result
+
+
+  # ---------------------------------------------------------------------------
+  # Liefert eine Liste aller Laden, die einen best. Artikel enthalten
+  # ---------------------------------------------------------------------------
+
+  def __LadenProArtikel (self, artikelNr):
+
+    source = GDataSource.DataSourceWrapper (self.__connections,
+              ['lade'],
+              {'name': 'dtsInhalt',
+               'connection': self.connection,
+               'table': "inhalt",
+               'order_by': "lade",
+               'distinct': True})
+
+    result    = []
+    resultSet = source.createResultSet ({'artikel': artikelNr})
+
+    record = resultSet.firstRecord ()
+    while record is not None:
+      lade = record ['lade']
+      if lade:
+        result.append (lade.encode ('cp1252'))
+
+      record = resultSet.nextRecord ()
+
+    return result
+
+# =============================================================================
+# Hauptprogramm (Selbsttest)
+# =============================================================================
+
+if __name__ == '__main__':
+  os.environ ['GNUE_CONNECTIONS'] = \
+      "/home/johannes/prj/gnue/bytewise/berno/etc/connections.conf"
+
+  rep = LadeBericht ('schmuck')
+  # rep.run (39, 'lade.pdf')
+  rep.run (None, 'foo-1.pdf')


Property changes on: schmuck/share/laderep.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: schmuck/share/schmuck.gfd
===================================================================
--- schmuck/share/schmuck.gfd   2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/share/schmuck.gfd   2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="iso8859-1"?>
+
+<!--
+    Copyright 2005 Bytewise Software GmbH
+ 
+    This program is free software; you can redistribute it
+    and/or modify it under the terms of the GNU General Public
+    License as published by the Free Software Foundation; either
+    version 2, or (at your option) any later version.
+ 
+    This program is distributed in the hope that it will be
+    useful, but WITHOUT ANY WARRANTY; without even the implied
+    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+    PURPOSE. See the GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public
+    License along with program; see the file COPYING. If not,
+    write to the Free Software Foundation, Inc., 59 Temple Place
+    - Suite 330, Boston, MA 02111-1307, USA.
+ 
+    $Id$
+-->
+
+<form title="Schmuckkatalog">
+  <options>
+    <author>BYTEWISE Software GmbH</author>
+    <version>1.0</version>
+    <description>Verwaltung des Schmuckkataloges f�r Firma Berno</description>
+  </options>
+
+  <datasource name="dtsArtikel" connection="schmuck" table="artikel"
+    prequery="Y">
+    <sortorder>
+      <sortfield name="nummer" />
+    </sortorder>
+  </datasource>
+
+  <datasource name="dtsLade" connection="schmuck" table="lade" prequery="Y">
+    <sortorder>
+      <sortfield name="nummer" />
+    </sortorder>
+  </datasource>
+
+  <datasource name="dtsInhalt" connection="schmuck" table="inhalt"
+    master="dtsLade" masterlink="nummer" detaillink="lade" requery="N">
+    <sortorder>
+      <sortfield name="nummer" />
+    </sortorder>
+  </datasource>
+
+  <datasource name="dtsArtikelD" connection="schmuck" table="artikel"
+    prequery="Y">
+    <sortorder>
+      <sortfield name="nummer" />
+    </sortorder>
+  </datasource>
+
+  <logic>
+    <block name="blkArtikel" datasource="dtsArtikel">
+      <trigger name="LoadRecord" type="ON-RECORDLOADED">
+        file = 'bilder/' + blkArtikel.fldNummer.get () + '.JPG'
+        blkArtikel.fldBild.set (file)
+      </trigger>
+      <field name="fldNummer" field="nummer" maxLength="13" >
+        <trigger name="Change" type="POST-CHANGE">
+          file = 'bilder/' + blkArtikel.fldNummer.get () + '.JPG'
+          blkArtikel.fldBild.set (file)
+        </trigger>
+      </field>
+      <field name="fldText"   field="text"   maxLength="256" />
+      <field name="fldPreis"  field="preis"  maxLength="256" />
+      <field name="fldBild"   />
+    </block>
+
+    <block name="blkLade" datasource="dtsLade">
+      <field name="fldNummer" field="nummer" maxLength="8"  />
+      <field name="fldText"   field="text"   maxLength="32" />
+    </block>
+
+    <block name="blkInhalt" datasource="dtsInhalt" rows="15"
+      autoCreate="Y" autoNextRecord="Y">
+      <trigger name="NeuePosition" type="ON-NEWRECORD">
+        rs = self.getResultSet ()
+        last = [0]
+        for rec in rs:
+          if rec ['nummer'] is not None:
+            last.append (int (rec ['nummer']))
+        n = max (last)
+        fldNummer.set (n + 10)
+      </trigger>
+      <field name="fldNummer"        field="nummer"  maxLength="3"
+        typecast="number" />
+      <field name="fldArtikelNummer" field="artikel" 
+        fk_source="dtsArtikelD" fk_key="nummer" fk_description="nummer" />
+      <field name="fldArtikelText"   field="artikel" 
+        fk_source="dtsArtikelD" fk_key="nummer" fk_description="text" />
+    </block>
+  </logic>
+
+  <layout xmlns:c="GNUe:Layout:Char" c:height="20" c:width="60" tabbed="top">
+    <page name="pgArtikel" caption="Artikel">
+      <label c:height="1" c:width="7"  c:x="1" c:y="1"  text="Nummer:" />
+      <label c:height="1" c:width="7"  c:x="1" c:y="2"  text="Text:"   />
+      <label c:height="1" c:width="7"  c:x="1" c:y="6"  text="Preis:"  />
+
+      <entry c:height="1" c:width="13"  c:x="9" c:y="1" block="blkArtikel"
+        field="fldNummer" />
+      <entry c:height="4" c:width="24" c:x="9" c:y="2" block="blkArtikel"
+        field="fldText" />
+      <entry c:height="4" c:width="32" c:x="9" c:y="6" block="blkArtikel"
+        field="fldPreis" />
+      <image c:height="9" c:width="32" c:x="9" c:y="10" block="blkArtikel"
+        field="fldBild" fit="width"/>
+
+      <button c:height="1" c:width="20" c:x="25" c:y="1" label="Liste 
erzeugen">
+        <trigger type="ON-ACTION">
+          import laderep
+          setStatusText ('Liste wird nach PDF exportiert ...')
+          fname = "./pdfs/Liste.pdf"
+          conn  = dtsLade._object._connection.name
+          rep   = laderep.LadeBericht (conn, dtsLade._object._connections,
+                                       statusText = setStatusText)
+          rep.run (None, fname)
+
+          showMessage ('Liste wurde exportiert in: "%s"' % fname)
+          setStatusText ('')
+        </trigger>
+      </button>
+    </page>
+
+    <page name="pgLaden" caption="Laden">
+      <!-- Sicherstellen, dass beim Register-Wechsel die Dropwdowns stimmen -->
+      <trigger name="updateDropdowns" type="PRE-FOCUSIN">
+        blkInhalt.fldArtikelNummer.resetForeignKey ()
+      </trigger>
+
+      <label c:height="1" c:width="7"  c:x="1"  c:y="1" text="Nummer:" />
+      <label c:height="1" c:width="7"  c:x="1"  c:y="2" text="Text:"   />
+
+      <entry c:height="1" c:width="8"  c:x="14" c:y="1" block="blkLade"
+        field="fldNummer" />
+      <entry c:height="1" c:width="32" c:x="14" c:y="2" block="blkLade"
+        field="fldText" />
+
+      <label c:height="1" c:width="3"  c:x="1"  c:y="4" text="lfd" />
+      <label c:height="1" c:width="9"  c:x="6"  c:y="4" text="Artikel" />
+      <label c:height="1" c:width="33" c:x="16" c:y="4" text="Text" />
+
+      <entry c:height="1" c:width="4"  c:x="1"  c:y="5" block="blkInhalt"
+        field="fldNummer" />
+      <entry c:height="1" c:width="14"  c:x="6"  c:y="5" block="blkInhalt"
+        field="fldArtikelNummer" style="dropdown" />
+      <entry c:height="1" c:width="33" c:x="21" c:y="5" block="blkInhalt"
+        field="fldArtikelText" style="label" />
+      <scrollbar name="scrInhalt" c:height="15" c:width="1" c:x="57" c:y="5"
+        block="blkInhalt" />
+      <button c:height="1" c:width="20" c:x="25" c:y="1" label="Drucken">
+        <trigger type="ON-ACTION">
+          import laderep
+          lade = blkLade.fldNummer.get ()
+          if lade:
+            setStatusText ('Ladebericht wird gedruckt ...')
+            fname = "./pdfs/Lade-%s.pdf" % lade
+
+            conn = dtsLade._object._connection.name
+            rep  = laderep.LadeBericht (conn, dtsLade._object._connections,
+                                              statusText = setStatusText)
+            rep.run (lade, fname)
+
+            showMessage ('Ladebericht erstellt in: "%s"' % fname)
+            setStatusText ('')
+            
+        </trigger>
+      </button>
+    </page>
+  </layout>
+</form>


Property changes on: schmuck/share/schmuck.gfd
___________________________________________________________________
Name: svn:keywords
   + Id

Added: schmuck/share/schmuck.gsd
===================================================================
--- schmuck/share/schmuck.gsd   2005-09-26 13:17:52 UTC (rev 225)
+++ schmuck/share/schmuck.gsd   2005-10-18 13:45:24 UTC (rev 226)
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+
+<!--
+    Copyright 2005 Bytewise Software GmbH
+ 
+    This program is free software; you can redistribute it
+    and/or modify it under the terms of the GNU General Public
+    License as published by the Free Software Foundation; either
+    version 2, or (at your option) any later version.
+ 
+    This program is distributed in the hope that it will be
+    useful, but WITHOUT ANY WARRANTY; without even the implied
+    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+    PURPOSE. See the GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public
+    License along with program; see the file COPYING. If not,
+    write to the Free Software Foundation, Inc., 59 Temple Place
+    - Suite 330, Boston, MA 02111-1307, USA.
+ 
+    $Id$
+-->
+
+<schema>
+  <tables>
+    <table name="artikel">
+      <fields>
+        <field name="nummer"   type="string" length="8"   nullable="False" />
+        <field name="text"     type="string" length="256" />
+        <field name="preis"    type="string" length="256" />
+      </fields>
+      <primarykey name="pk_artikel">
+        <pkfield name="nummer"/>
+      </primarykey>
+    </table>
+
+    <table name="lade">
+      <fields>
+        <field name="nummer" type="string" length="8"  nullable="False" />
+        <field name="text"   type="string" length="32" />
+      </fields>
+      <primarykey name="pk_lade">
+        <pkfield name="nummer"/>
+      </primarykey>
+    </table>
+
+    <table name="inhalt">
+      <fields>
+        <field name="lade"    type="string" length="8" nullable="False" />
+        <field name="nummer"  type="number" length="2" nullable="False" />
+        <field name="artikel" type="string" length="8" nullable="False" />
+      </fields>
+    </table>
+  </tables>
+</schema>


Property changes on: schmuck/share/schmuck.gsd
___________________________________________________________________
Name: svn:keywords
   + Id





reply via email to

[Prev in Thread] Current Thread [Next in Thread]