예제 #1
0
    def process_click(self, event):
        selection = self.GetSelection()
        tree_data = self.GetItemData(selection)
        if not tree_data:
            event.Skip()
            return
        data = tree_data.GetData()

        if isinstance(data, data_types.SaleData):
            sale.Sale(self.parent, data=data, editable=False)
        elif isinstance(data, data_types.ProductData):
            inventory.ProductData(self.parent,
                                  data.description,
                                  data=data,
                                  editable=False)
        elif isinstance(data, str):
            inventory.ProductData(self.parent,
                                  core.format_id_user(data),
                                  product_id=int(data),
                                  editable=False)
        elif isinstance(data, data_types.ProductCategoryData):
            categories.ProductCategoryData(self.parent,
                                           data.category,
                                           data=data)
        elif isinstance(data, data_types.WasteData):
            waste.Waste(self.parent, data=data)
        elif isinstance(data, data_types.ExpenseData):
            expense.Expense(self.parent, data=data)
예제 #2
0
    def open_waste_edit(self, event):
        red = self.list_wastes.GetSelection()
        if self.list_wastes.GetRootItem() == red:
            return
        data = self.list_wastes.GetItemData(red).GetData()

        waste.Waste(self, key=data.ID)
예제 #3
0
    def process_click(self, event):
        selection = self.list_edited_data.GetSelection()
        tree_data = self.list_edited_data.GetItemData(selection)
        if not tree_data:
            event.Skip()
            return
        data = tree_data.GetData()

        if isinstance(data, data_types.SaleData):
            import sale
            sale.Sale(self, data=data, editable=False)
        elif isinstance(data, data_types.ProductData):
            import inventory
            inventory.ProductData(self,
                                  data.description,
                                  data=data,
                                  editable=False)
        elif isinstance(data, data_types.ProductCategoryData):
            import categories
            categories.ProductCategoryData(self, data=data)
        elif isinstance(data, data_types.WasteData):
            import waste
            waste.Waste(self, data=data)
        elif isinstance(data, data_types.ExpenseData):
            import expense
            expense.Expense(self, data=data)
        elif isinstance(data, data_types.TransactionData):
            import transaction
            transaction.Transaction(self,
                                    transaction_type=data.type,
                                    data=data)
        elif isinstance(data, data_types.ClientData):
            import clients
            clients.ClientData(self,
                               data.name,
                               data.ID,
                               data=data,
                               editable=False)
        elif isinstance(data, data_types.TransactionCategoryData):
            import categories
            categories.TransactionCategoryData(self,
                                               data.category,
                                               data.ID,
                                               data=data)
예제 #4
0
 def open_new_waste(self, event):
     waste.Waste(self.frame)
예제 #5
0
 def open_new_waste(self, event=None):
     waste.Waste(self)
예제 #6
0
 def open_waste_register(self, event):
     waste.Waste(self)