/[gnue]/gnue-pos/src/hardware/receiptprinter/plain.py
ViewVC logotype

Diff of /gnue-pos/src/hardware/receiptprinter/plain.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jcater, Wed Jul 2 15:13:06 2003 UTC revision 1.5 by jcater, Mon Jul 7 05:29:13 2003 UTC
# Line 31  __all__ = ['Driver'] Line 31  __all__ = ['Driver']
31    
32  from gnue.common.events.EventAware import EventAware  from gnue.common.events.EventAware import EventAware
33    
34    LEFT_ALIGN=0
35    CENTER_ALIGN=0
36    RIGHT_ALIGN=2
37    
38  dollarFormat = '$%.02f'  dollarFormat = '$%.02f'
39    
40  class Driver(EventAware):  class Driver(EventAware):
# Line 52  class Driver(EventAware): Line 56  class Driver(EventAware):
56      self.instance = instance      self.instance = instance
57      self.__dict__.update(params)      self.__dict__.update(params)
58      self.output = None      self.output = None
59        self.width = hasattr(self,'width') and self.width or 40
60    
61      self.totalFields = (  ('subtotal',_('Subtotal')),      self.totalFields = (  ('subtotal',_('Subtotal')),
62                            ('mstax','MS Sales Tax (7%)'),                            ('mstax','MS Sales Tax (7%)'),
63                            ('total',_('Total')) )                            ('total',_('Total')) )
64    
65      self.receiptColumns = ( ('department',_('Dept'), '%s', 0),      self.receiptColumns = (
66                              ('sku',_('Code'), '%s', 0),                              ('sku',_('Code'), '%s', 0),
67                              ('quantity',_('Units'), '%s', 0),                              ('quantity',_('Units'), '%s', 0),
68                              ('description',_('Description'), '%s', 0),                              ('description',_('Description'), '%s', 0),
# Line 81  class Driver(EventAware): Line 86  class Driver(EventAware):
86      self.output = open(self.port,'w')      self.output = open(self.port,'w')
87      self.totals = {}      self.totals = {}
88      self.output.write("""      self.output.write("""
 ------------------------------  
         Company Header  
         123 N Main St  
       Yourtown, TN 38011  
         (662) 555-1234  
 ------------------------------  
89    
90  Receipt # %s         Old Towne Market
91         9120 Pigeon Roost Rd
92        Olive Branch, MS 38654
93            (662) 893-5669
94    
95    
96    Transaction # %s
97  %s %s %s  %s %s %s
98    
99  """ % (event.serial, '06/23/03','12:13pm','Jason'))  """ % (event.serial, '06/23/03','12:13pm','Jason'))
# Line 131  Receipt # %s Line 136  Receipt # %s
136    def _UpdateTotal(self, event):    def _UpdateTotal(self, event):
137      self.totals[event.field] = event.amount      self.totals[event.field] = event.amount
138    
139    
140      def write(self, text, double=0, color=0, alignment=0):
141        pass

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26