コード例 #1
0
ファイル: stockdecrease.py プロジェクト: stoq/stoq
    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
ファイル: stockdecrease.py プロジェクト: lucaslamounier/stoq
    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
ファイル: returnedsale.py プロジェクト: mimcomp/stoq
    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
ファイル: transfer.py プロジェクト: hackedbellini/stoq
    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)