Пример #1
0
    def onEditTicketlineButton(self):
        t = self.manager.ticket
        if t is None:
            self.warnTicketSelection()
            return

        tl = self.ticketTable.currentLine()
        if tl is None:
            self.warnTicketlineSelection()
            return

        data = {
            'description': '',
            'sell_price': 0,
            'amount': 1,
            'discount': 0,
            'product': None,
            'is_edited': False
        }
        tl.fillDict(data)
        _init_data = data.copy()
        dlg = EditDialog(data)
        dlg.exec_()
        if data != _init_data:
            self.manager.add_ticketline(data)
            self.populate()
Пример #2
0
 def onNewTicketlineButton(self):
     t = self.manager.ticket
     if t is None:
         self.warnTicketSelection()
         return
     
     data = {'description': '', 'amount': 1, 'sell_price': 0, 'discount': 0, 'ticket': t,
             'product': None, 'is_edited': False}
     _init_data = data.copy()
     dlg = EditDialog(data)
     dlg.exec_()
     if data != _init_data:
         self.manager.add_ticketline(data)
         self.populate()
Пример #3
0
 def onEditTicketlineButton(self):
     t = self.manager.ticket
     if t is None:
         self.warnTicketSelection()
         return
     
     tl = self.ticketTable.currentLine()
     if tl is None:
         self.warnTicketlineSelection()
         return
     
     data = {'description': '', 'sell_price': 0, 'amount': 1, 'discount': 0, 'product': None, 'is_edited': False}
     tl.fillDict(data)
     _init_data = data.copy()
     dlg = EditDialog(data)
     dlg.exec_()
     if data != _init_data:
         self.manager.add_ticketline(data)
         self.populate()
Пример #4
0
    def onNewTicketlineButton(self):
        t = self.manager.ticket
        if t is None:
            self.warnTicketSelection()
            return

        data = {
            'description': '',
            'amount': 1,
            'sell_price': 0,
            'discount': 0,
            'ticket': t,
            'product': None,
            'is_edited': False
        }
        _init_data = data.copy()
        dlg = EditDialog(data)
        dlg.exec_()
        if data != _init_data:
            self.manager.add_ticketline(data)
            self.populate()