示例#1
0
    def confirm(self):
        """Confirms the stock decrease

        """
        assert self.can_confirm()
        assert self.branch

        store = self.store
        branch = self.branch
        for item in self.get_items():
            if item.sellable.product:
                ProductHistory.add_decreased_item(store, branch, item)
            item.decrease(branch)

        old_status = self.status
        self.status = StockDecrease.STATUS_CONFIRMED

        # Save the operation_nature and branch in Invoice Table
        self.invoice.operation_nature = self.operation_nature
        self.invoice.branch = branch

        if self.group:
            self.group.confirm()

        StockOperationConfirmedEvent.emit(self, old_status)
示例#2
0
    def confirm(self):
        """Confirms the stock decrease

        """
        assert self.can_confirm()
        assert self.branch

        store = self.store
        branch = self.branch
        for item in self.get_items():
            if item.sellable.product:
                ProductHistory.add_decreased_item(store, branch, item)
            item.decrease(branch)

        old_status = self.status
        self.status = StockDecrease.STATUS_CONFIRMED

        # Save the operation_nature and branch in Invoice Table
        self.invoice.operation_nature = self.operation_nature
        self.invoice.branch = branch

        if self.group:
            self.group.confirm()

        StockOperationConfirmedEvent.emit(self, old_status)
示例#3
0
文件: loan.py 项目: sarkis89/stoq
 def confirm(self):
     # Save the operation nature and branch in Invoice table.
     self.invoice.operation_nature = self.operation_nature
     self.invoice.branch = self.branch
     # Since there is no status change here and the event requires
     # the parameter, we use None
     old_status = None
     StockOperationConfirmedEvent.emit(self, old_status)
示例#4
0
 def confirm(self):
     # Save the operation nature and branch in Invoice table.
     self.invoice.operation_nature = self.operation_nature
     self.invoice.branch = self.branch
     # Since there is no status change here and the event requires
     # the parameter, we use None
     old_status = None
     StockOperationConfirmedEvent.emit(self, old_status)
示例#5
0
    def confirm(self, login_user):
        """Receive the returned_sale_items from a pending |returned_sale|

        :param user: the |login_user| that received the pending returned sale
        """
        assert self.status == self.STATUS_PENDING
        self._return_items()
        old_status = self.status
        self.status = self.STATUS_CONFIRMED
        self.confirm_responsible = login_user
        self.confirm_date = localnow()
        StockOperationConfirmedEvent.emit(self, old_status)
示例#6
0
    def confirm(self, login_user):
        """Receive the returned_sale_items from a pending |returned_sale|

        :param user: the |login_user| that received the pending returned sale
        """
        assert self.status == self.STATUS_PENDING
        self._return_items()
        old_status = self.status
        self.status = self.STATUS_CONFIRMED
        self.confirm_responsible = login_user
        self.confirm_date = localnow()
        StockOperationConfirmedEvent.emit(self, old_status)
示例#7
0
    def send(self):
        """Sends a transfer order to the destination branch.
        """
        assert self.can_send()

        for item in self.get_items():
            item.send()

        # Save the operation nature and branch in Invoice table.
        self.invoice.operation_nature = self.operation_nature
        self.invoice.branch = self.branch

        old_status = self.status
        self.status = self.STATUS_SENT
        StockOperationConfirmedEvent.emit(self, old_status)
示例#8
0
    def send(self):
        """Sends a transfer order to the destination branch.
        """
        assert self.can_send()

        for item in self.get_items():
            item.send()

        # Save the operation nature and branch in Invoice table.
        self.invoice.operation_nature = self.operation_nature
        self.invoice.branch = self.branch

        old_status = self.status
        self.status = self.STATUS_SENT
        StockOperationConfirmedEvent.emit(self, old_status)