Example #1
0
 def addProductLine(self, p):
     sell_price = currency.convert(p.price, p.currency, self.ticket.currency)
     tl = TicketLine()
     tl.update(description=p.name, sell_price=sell_price, amount=1, discount=0,
               ticket=self.ticket, product=p, is_edited=False)
     self.updateList(self.ticket)
     index = self.findLine(tl)
     self.Select(index, True)
Example #2
0
 def OnNewTicketlineButton(self, event):
     event.Skip()
     t = self._doCheckCurrentTicket()
     if t:
         data = {'description': '', 'amount': 1, 'sell_price': 0, 'discount': 0, 'ticket': t,
                 'product': None, 'is_edited': True}
         dlg = EditDialog(None, data)
         ret = dlg.ShowModal()
         if ret == wx.ID_OK:
             tl = TicketLine()
             tl.update(data)
             self.ticketList.updateList(t)
             self.updateTicketInfo()
             index = self.ticketList.findLine(tl)
             self.ticketList.Select(index, True)
Example #3
0
 def OnNewTicketlineButton(self, event):
     event.Skip()
     t = self._doCheckCurrentTicket()
     if t:
         data = {
             'description': '',
             'amount': 1,
             'sell_price': 0,
             'discount': 0,
             'ticket': t,
             'product': None,
             'is_edited': True
         }
         dlg = EditDialog(None, data)
         ret = dlg.ShowModal()
         if ret == wx.ID_OK:
             tl = TicketLine()
             tl.update(data)
             self.ticketList.updateList(t)
             self.updateTicketInfo()
             index = self.ticketList.findLine(tl)
             self.ticketList.Select(index, True)