Exemplo n.º 1
0
    def void(self, user=None):
        """
        Voids invoice. This means the debt is no longer owed.
        """
        if not self.is_void:
            self.is_void = True
            self.void_date = datetime.now()
            self.voided_by = user
            # set balance to 0
            self.balance = 0
            self.save()

            # reverse accounting entries
            if self.subtotal > 0:
                make_acct_entries_initial_reversing(user, self, self.subtotal)
Exemplo n.º 2
0
    def void(self, user=None):
        """
        Voids invoice. This means the debt is no longer owed.
        """
        if not self.is_void:
            self.is_void = True
            self.void_date = datetime.now()
            self.voided_by = user
            # set balance to 0
            self.balance = 0
            self.save()

            # reverse accounting entries
            if self.subtotal > 0:
                make_acct_entries_initial_reversing(user, self, self.subtotal)